fix wpa_cli compile
[openwrt/openwrt.git] / package / madwifi / patches-r3776 / 312-ack_cts_rate.patch
1 Index: madwifi-trunk-r3776/ath/if_ath.c
2 ===================================================================
3 --- madwifi-trunk-r3776.orig/ath/if_ath.c 2008-07-17 02:37:41.000000000 +0200
4 +++ madwifi-trunk-r3776/ath/if_ath.c 2008-07-17 03:04:02.000000000 +0200
5 @@ -10889,8 +10889,13 @@
6 break;
7 #endif
8 case ATH_ACKRATE:
9 - sc->sc_ackrate = val;
10 - ath_set_ack_bitrate(sc, sc->sc_ackrate);
11 + if (val == -1)
12 + sc->sc_ackrate_override = 0;
13 + else {
14 + sc->sc_ackrate_override = 1;
15 + sc->sc_ackrate = val;
16 + ath_set_ack_bitrate(sc, sc->sc_ackrate);
17 + }
18 break;
19 case ATH_RP:
20 ath_rp_record(sc,
21 Index: madwifi-trunk-r3776/ath/if_athvar.h
22 ===================================================================
23 --- madwifi-trunk-r3776.orig/ath/if_athvar.h 2008-07-17 02:37:41.000000000 +0200
24 +++ madwifi-trunk-r3776/ath/if_athvar.h 2008-07-17 03:04:02.000000000 +0200
25 @@ -698,6 +698,7 @@
26 unsigned int sc_hasclrkey:1; /* CLR key supported */
27 unsigned int sc_stagbeacons:1; /* use staggered beacons */
28 unsigned int sc_dfswait:1; /* waiting on channel for radar detect */
29 + unsigned int sc_ackrate_override:1; /* override ack rate */
30 unsigned int sc_ackrate:1; /* send acks at high bitrate */
31 unsigned int sc_dfs_cac:1; /* waiting on channel for radar detect */
32 unsigned int sc_hasintmit:1; /* Interference mitigation */
33 Index: madwifi-trunk-r3776/ath/if_ath_hal_extensions.c
34 ===================================================================
35 --- madwifi-trunk-r3776.orig/ath/if_ath_hal_extensions.c 2008-07-17 00:21:39.000000000 +0200
36 +++ madwifi-trunk-r3776/ath/if_ath_hal_extensions.c 2008-07-17 03:04:48.000000000 +0200
37 @@ -129,6 +129,9 @@
38 int
39 ath_set_ack_bitrate(struct ath_softc *sc, int high)
40 {
41 + if (!sc->sc_ackrate_override)
42 + return 0;
43 +
44 if (ar_device(sc->devid) == 5212 || ar_device(sc->devid) == 5213) {
45 /* set ack to be sent at low bit-rate */
46 u_int32_t v = AR5K_STA_ID1_BASE_RATE_11B | AR5K_STA_ID1_ACKCTS_6MB;