package/devel/binutils: Update to 2.27
[openwrt/staging/chunkeey.git] / package / kernel / mac80211 / patches / 316-ath9k-Remove-some-defined-constants-to-decrease-verb.patch
1 From: Benjamin Berg <benjamin.berg@open-mesh.com>
2 Date: Mon, 4 Jul 2016 14:37:24 +0200
3 Subject: [PATCH] ath9k: Remove some #defined constants to decrease
4 verbosity
5
6 The removed ATH9K_SLOT_TIME_X constants simply map the value in microseconds
7 to the same integer. These constants were not used consistently, so fix the
8 inconsistency issue by replacing all occurances with the integer equivalent.
9
10 Signed-off-by: Benjamin Berg <benjamin.berg@open-mesh.com>
11 ---
12
13 --- a/drivers/net/wireless/ath/ath9k/beacon.c
14 +++ b/drivers/net/wireless/ath/ath9k/beacon.c
15 @@ -50,7 +50,7 @@ static void ath9k_beaconq_config(struct
16 txq = sc->tx.txq_map[IEEE80211_AC_BE];
17 ath9k_hw_get_txq_props(ah, txq->axq_qnum, &qi_be);
18 qi.tqi_aifs = qi_be.tqi_aifs;
19 - if (ah->slottime == ATH9K_SLOT_TIME_20)
20 + if (ah->slottime == 20)
21 qi.tqi_cwmin = 2*qi_be.tqi_cwmin;
22 else
23 qi.tqi_cwmin = 4*qi_be.tqi_cwmin;
24 --- a/drivers/net/wireless/ath/ath9k/dynack.c
25 +++ b/drivers/net/wireless/ath/ath9k/dynack.c
26 @@ -280,7 +280,7 @@ EXPORT_SYMBOL(ath_dynack_sample_ack_ts);
27 void ath_dynack_node_init(struct ath_hw *ah, struct ath_node *an)
28 {
29 /* ackto = slottime + sifs + air delay */
30 - u32 ackto = ATH9K_SLOT_TIME_9 + 16 + 64;
31 + u32 ackto = 9 + 16 + 64;
32 struct ath_dynack *da = &ah->dynack;
33
34 an->ackto = ackto;
35 @@ -315,7 +315,7 @@ EXPORT_SYMBOL(ath_dynack_node_deinit);
36 void ath_dynack_reset(struct ath_hw *ah)
37 {
38 /* ackto = slottime + sifs + air delay */
39 - u32 ackto = ATH9K_SLOT_TIME_9 + 16 + 64;
40 + u32 ackto = 9 + 16 + 64;
41 struct ath_dynack *da = &ah->dynack;
42
43 da->lto = jiffies;
44 --- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
45 +++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
46 @@ -45,7 +45,7 @@ void ath9k_htc_beaconq_config(struct ath
47 * Long slot time : 2x cwmin
48 * Short slot time : 4x cwmin
49 */
50 - if (ah->slottime == ATH9K_SLOT_TIME_20)
51 + if (ah->slottime == 20)
52 qi.tqi_cwmin = 2*qi_be.tqi_cwmin;
53 else
54 qi.tqi_cwmin = 4*qi_be.tqi_cwmin;
55 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
56 +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
57 @@ -678,7 +678,7 @@ static int ath9k_init_priv(struct ath9k_
58
59 for (i = 0; i < ATH9K_HTC_MAX_BCN_VIF; i++)
60 priv->beacon.bslot[i] = NULL;
61 - priv->beacon.slottime = ATH9K_SLOT_TIME_9;
62 + priv->beacon.slottime = 9;
63
64 ath9k_cmn_init_channels_rates(common);
65 ath9k_cmn_init_crypto(ah);
66 --- a/drivers/net/wireless/ath/ath9k/hw.c
67 +++ b/drivers/net/wireless/ath/ath9k/hw.c
68 @@ -454,7 +454,7 @@ static void ath9k_hw_init_defaults(struc
69 if (AR_SREV_9100(ah))
70 ah->sta_id1_defaults |= AR_STA_ID1_AR9100_BA_FIX;
71
72 - ah->slottime = ATH9K_SLOT_TIME_9;
73 + ah->slottime = 9;
74 ah->globaltxtimeout = (u32) -1;
75 ah->power_mode = ATH9K_PM_UNDEFINED;
76 ah->htc_reset_init = true;
77 --- a/drivers/net/wireless/ath/ath9k/init.c
78 +++ b/drivers/net/wireless/ath/ath9k/init.c
79 @@ -372,7 +372,7 @@ static void ath9k_init_misc(struct ath_s
80
81 common->last_rssi = ATH_RSSI_DUMMY_MARKER;
82 memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN);
83 - sc->beacon.slottime = ATH9K_SLOT_TIME_9;
84 + sc->beacon.slottime = 9;
85
86 for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++)
87 sc->beacon.bslot[i] = NULL;
88 --- a/drivers/net/wireless/ath/ath9k/mac.h
89 +++ b/drivers/net/wireless/ath/ath9k/mac.h
90 @@ -65,10 +65,6 @@
91 #define INIT_SSH_RETRY 32
92 #define INIT_SLG_RETRY 32
93
94 -#define ATH9K_SLOT_TIME_6 6
95 -#define ATH9K_SLOT_TIME_9 9
96 -#define ATH9K_SLOT_TIME_20 20
97 -
98 #define ATH9K_TXERR_XRETRY 0x01
99 #define ATH9K_TXERR_FILT 0x02
100 #define ATH9K_TXERR_FIFO 0x04
101 --- a/drivers/net/wireless/ath/ath9k/main.c
102 +++ b/drivers/net/wireless/ath/ath9k/main.c
103 @@ -926,7 +926,7 @@ static void ath9k_vif_iter(struct ath9k_
104 }
105
106 if (!vif->bss_conf.use_short_slot)
107 - iter_data->slottime = ATH9K_SLOT_TIME_20;
108 + iter_data->slottime = 20;
109
110 switch (vif->type) {
111 case NL80211_IFTYPE_AP:
112 @@ -999,7 +999,7 @@ void ath9k_calculate_iter_data(struct at
113 */
114 memset(iter_data, 0, sizeof(*iter_data));
115 eth_broadcast_addr(iter_data->mask);
116 - iter_data->slottime = ATH9K_SLOT_TIME_9;
117 + iter_data->slottime = 9;
118
119 list_for_each_entry(avp, &ctx->vifs, list)
120 ath9k_vif_iter(iter_data, avp->vif->addr, avp->vif);
121 @@ -1061,7 +1061,7 @@ static void ath9k_set_offchannel_state(s
122 ah->opmode = vif->type;
123 ah->imask &= ~ATH9K_INT_SWBA;
124 ah->imask &= ~ATH9K_INT_TSFOOR;
125 - ah->slottime = ATH9K_SLOT_TIME_9;
126 + ah->slottime = 9;
127
128 ath_hw_setbssidmask(common);
129 ath9k_hw_setopmode(ah);
130 @@ -1788,6 +1788,7 @@ static void ath9k_bss_info_changed(struc
131 slottime = 9;
132 else
133 slottime = 20;
134 +
135 if (vif->type == NL80211_IFTYPE_AP) {
136 /*
137 * Defer update, so that connected stations can adjust