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