1 Subject: mac80211: move bss_conf into vif
3 Move bss_conf into the vif struct so that drivers can
4 access it during ->tx without having to store it in
5 the private data or similar. No driver updates because
6 this is only for when they want to start using it.
8 Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
10 include/net/mac80211.h | 3 +++
11 net/mac80211/cfg.c | 6 +++---
12 net/mac80211/debugfs_netdev.c | 2 +-
13 net/mac80211/ieee80211_i.h | 3 ---
14 net/mac80211/iface.c | 2 +-
15 net/mac80211/main.c | 8 ++++----
16 net/mac80211/mlme.c | 30 +++++++++++++++---------------
17 net/mac80211/tx.c | 16 ++++++++--------
18 net/mac80211/util.c | 6 +++---
19 9 files changed, 38 insertions(+), 38 deletions(-)
21 --- everything.orig/include/net/mac80211.h 2008-10-10 17:09:04.000000000 +0200
22 +++ everything/include/net/mac80211.h 2008-10-10 17:09:41.000000000 +0200
23 @@ -519,11 +519,14 @@ struct ieee80211_conf {
24 * use during the life of a virtual interface.
26 * @type: type of this virtual interface
27 + * @bss_conf: BSS configuration for this interface, either our own
28 + * or the BSS we're associated to
29 * @drv_priv: data area for driver use, will always be aligned to
32 struct ieee80211_vif {
33 enum nl80211_iftype type;
34 + struct ieee80211_bss_conf bss_conf;
36 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
38 --- everything.orig/net/mac80211/ieee80211_i.h 2008-10-10 17:10:40.000000000 +0200
39 +++ everything/net/mac80211/ieee80211_i.h 2008-10-10 17:10:45.000000000 +0200
40 @@ -440,9 +440,6 @@ struct ieee80211_sub_if_data {
44 - /* BSS configuration for this interface. */
45 - struct ieee80211_bss_conf bss_conf;
48 * AP this belongs to: self in AP mode and
49 * corresponding AP in VLAN mode, NULL for
50 --- everything.orig/net/mac80211/main.c 2008-10-10 17:10:55.000000000 +0200
51 +++ everything/net/mac80211/main.c 2008-10-10 17:11:10.000000000 +0200
52 @@ -249,15 +249,15 @@ void ieee80211_bss_info_change_notify(st
53 if (local->ops->bss_info_changed)
54 local->ops->bss_info_changed(local_to_hw(local),
57 + &sdata->vif.bss_conf,
61 u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata)
63 - sdata->bss_conf.use_cts_prot = false;
64 - sdata->bss_conf.use_short_preamble = false;
65 - sdata->bss_conf.use_short_slot = false;
66 + sdata->vif.bss_conf.use_cts_prot = false;
67 + sdata->vif.bss_conf.use_short_preamble = false;
68 + sdata->vif.bss_conf.use_short_slot = false;
69 return BSS_CHANGED_ERP_CTS_PROT |
70 BSS_CHANGED_ERP_PREAMBLE |
72 --- everything.orig/net/mac80211/iface.c 2008-10-10 17:12:11.000000000 +0200
73 +++ everything/net/mac80211/iface.c 2008-10-10 17:12:13.000000000 +0200
74 @@ -695,7 +695,7 @@ int ieee80211_if_change_type(struct ieee
75 ieee80211_setup_sdata(sdata, type);
77 /* reset some values that shouldn't be kept across type changes */
78 - sdata->bss_conf.basic_rates =
79 + sdata->vif.bss_conf.basic_rates =
80 ieee80211_mandatory_rates(sdata->local,
81 sdata->local->hw.conf.channel->band);
82 sdata->drop_unencrypted = 0;
83 --- everything.orig/net/mac80211/mlme.c 2008-10-10 17:11:49.000000000 +0200
84 +++ everything/net/mac80211/mlme.c 2008-10-10 17:11:58.000000000 +0200
85 @@ -572,7 +572,7 @@ static void ieee80211_sta_wmm_params(str
86 static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata,
87 u16 capab, bool erp_valid, u8 erp)
89 - struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf;
90 + struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf;
91 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
92 struct ieee80211_if_sta *ifsta = &sdata->u.sta;
94 @@ -720,9 +720,9 @@ static void ieee80211_set_associated(str
95 ifsta->ssid, ifsta->ssid_len);
97 /* set timing information */
98 - sdata->bss_conf.beacon_int = bss->beacon_int;
99 - sdata->bss_conf.timestamp = bss->timestamp;
100 - sdata->bss_conf.dtim_period = bss->dtim_period;
101 + sdata->vif.bss_conf.beacon_int = bss->beacon_int;
102 + sdata->vif.bss_conf.timestamp = bss->timestamp;
103 + sdata->vif.bss_conf.dtim_period = bss->dtim_period;
105 changed |= ieee80211_handle_bss_capability(sdata,
106 bss->capability, bss->has_erp_value, bss->erp_value);
107 @@ -732,9 +732,9 @@ static void ieee80211_set_associated(str
109 if (conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) {
110 changed |= BSS_CHANGED_HT;
111 - sdata->bss_conf.assoc_ht = 1;
112 - sdata->bss_conf.ht_cap = &conf->ht_cap;
113 - sdata->bss_conf.ht_bss_conf = &conf->ht_bss_conf;
114 + sdata->vif.bss_conf.assoc_ht = 1;
115 + sdata->vif.bss_conf.ht_cap = &conf->ht_cap;
116 + sdata->vif.bss_conf.ht_bss_conf = &conf->ht_bss_conf;
119 ifsta->flags |= IEEE80211_STA_PREV_BSSID_SET;
120 @@ -744,7 +744,7 @@ static void ieee80211_set_associated(str
121 ifsta->last_probe = jiffies;
122 ieee80211_led_assoc(local, 1);
124 - sdata->bss_conf.assoc = 1;
125 + sdata->vif.bss_conf.assoc = 1;
127 * For now just always ask the driver to update the basic rateset
128 * when we have associated, we aren't checking whether it actually
129 @@ -853,15 +853,15 @@ static void ieee80211_set_disassoc(struc
130 ifsta->flags &= ~IEEE80211_STA_ASSOCIATED;
131 changed |= ieee80211_reset_erp_info(sdata);
133 - if (sdata->bss_conf.assoc_ht)
134 + if (sdata->vif.bss_conf.assoc_ht)
135 changed |= BSS_CHANGED_HT;
137 - sdata->bss_conf.assoc_ht = 0;
138 - sdata->bss_conf.ht_cap = NULL;
139 - sdata->bss_conf.ht_bss_conf = NULL;
140 + sdata->vif.bss_conf.assoc_ht = 0;
141 + sdata->vif.bss_conf.ht_cap = NULL;
142 + sdata->vif.bss_conf.ht_bss_conf = NULL;
144 ieee80211_led_assoc(local, 0);
145 - sdata->bss_conf.assoc = 0;
146 + sdata->vif.bss_conf.assoc = 0;
148 ieee80211_sta_send_apinfo(sdata, ifsta);
150 @@ -1194,7 +1194,7 @@ static void ieee80211_rx_mgmt_assoc_resp
151 u64 rates, basic_rates;
152 u16 capab_info, status_code, aid;
153 struct ieee802_11_elems elems;
154 - struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf;
155 + struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf;
158 DECLARE_MAC_BUF(mac);
159 @@ -1337,7 +1337,7 @@ static void ieee80211_rx_mgmt_assoc_resp
162 sta->sta.supp_rates[local->hw.conf.channel->band] = rates;
163 - sdata->bss_conf.basic_rates = basic_rates;
164 + sdata->vif.bss_conf.basic_rates = basic_rates;
166 /* cf. IEEE 802.11 9.2.12 */
167 if (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ &&
168 --- everything.orig/net/mac80211/cfg.c 2008-10-10 17:12:29.000000000 +0200
169 +++ everything/net/mac80211/cfg.c 2008-10-10 17:12:31.000000000 +0200
170 @@ -966,16 +966,16 @@ static int ieee80211_change_bss(struct w
173 if (params->use_cts_prot >= 0) {
174 - sdata->bss_conf.use_cts_prot = params->use_cts_prot;
175 + sdata->vif.bss_conf.use_cts_prot = params->use_cts_prot;
176 changed |= BSS_CHANGED_ERP_CTS_PROT;
178 if (params->use_short_preamble >= 0) {
179 - sdata->bss_conf.use_short_preamble =
180 + sdata->vif.bss_conf.use_short_preamble =
181 params->use_short_preamble;
182 changed |= BSS_CHANGED_ERP_PREAMBLE;
184 if (params->use_short_slot_time >= 0) {
185 - sdata->bss_conf.use_short_slot =
186 + sdata->vif.bss_conf.use_short_slot =
187 params->use_short_slot_time;
188 changed |= BSS_CHANGED_ERP_SLOT;
190 --- everything.orig/net/mac80211/debugfs_netdev.c 2008-10-10 17:13:26.000000000 +0200
191 +++ everything/net/mac80211/debugfs_netdev.c 2008-10-10 17:13:28.000000000 +0200
192 @@ -120,7 +120,7 @@ static ssize_t ieee80211_if_fmt_flags(
193 sdata->u.sta.flags & IEEE80211_STA_AUTHENTICATED ? "AUTH\n" : "",
194 sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED ? "ASSOC\n" : "",
195 sdata->u.sta.flags & IEEE80211_STA_PROBEREQ_POLL ? "PROBEREQ POLL\n" : "",
196 - sdata->bss_conf.use_cts_prot ? "CTS prot\n" : "");
197 + sdata->vif.bss_conf.use_cts_prot ? "CTS prot\n" : "");
199 __IEEE80211_IF_FILE(flags);
201 --- everything.orig/net/mac80211/tx.c 2008-10-10 17:12:46.000000000 +0200
202 +++ everything/net/mac80211/tx.c 2008-10-10 17:12:49.000000000 +0200
203 @@ -116,7 +116,7 @@ static __le16 ieee80211_duration(struct
204 if (r->bitrate > txrate->bitrate)
207 - if (tx->sdata->bss_conf.basic_rates & BIT(i))
208 + if (tx->sdata->vif.bss_conf.basic_rates & BIT(i))
211 switch (sband->band) {
212 @@ -150,7 +150,7 @@ static __le16 ieee80211_duration(struct
213 * to closest integer */
215 dur = ieee80211_frame_duration(local, 10, rate, erp,
216 - tx->sdata->bss_conf.use_short_preamble);
217 + tx->sdata->vif.bss_conf.use_short_preamble);
220 /* Frame is fragmented: duration increases with time needed to
221 @@ -159,7 +159,7 @@ static __le16 ieee80211_duration(struct
223 dur += ieee80211_frame_duration(local, next_frag_len,
224 txrate->bitrate, erp,
225 - tx->sdata->bss_conf.use_short_preamble);
226 + tx->sdata->vif.bss_conf.use_short_preamble);
229 return cpu_to_le16(dur);
230 @@ -465,7 +465,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021
232 info->control.retries[0].rate_idx = -1;
234 - if (tx->sdata->bss_conf.use_cts_prot &&
235 + if (tx->sdata->vif.bss_conf.use_cts_prot &&
236 (tx->flags & IEEE80211_TX_FRAGMENTED) && (rsel.nonerp_idx >= 0)) {
237 tx->last_frag_rate_idx = tx->rate_idx;
238 if (rsel.probe_idx >= 0)
239 @@ -531,7 +531,7 @@ ieee80211_tx_h_misc(struct ieee80211_tx_
240 if ((tx->sdata->flags & IEEE80211_SDATA_OPERATING_GMODE) &&
241 (sband->bitrates[tx->rate_idx].flags & IEEE80211_RATE_ERP_G) &&
242 (tx->flags & IEEE80211_TX_UNICAST) &&
243 - tx->sdata->bss_conf.use_cts_prot &&
244 + tx->sdata->vif.bss_conf.use_cts_prot &&
245 !(info->flags & IEEE80211_TX_CTL_USE_RTS_CTS))
246 info->flags |= IEEE80211_TX_CTL_USE_CTS_PROTECT;
248 @@ -540,7 +540,7 @@ ieee80211_tx_h_misc(struct ieee80211_tx_
249 * available on the network at the current point in time. */
250 if (ieee80211_is_data(hdr->frame_control) &&
251 (sband->bitrates[tx->rate_idx].flags & IEEE80211_RATE_SHORT_PREAMBLE) &&
252 - tx->sdata->bss_conf.use_short_preamble &&
253 + tx->sdata->vif.bss_conf.use_short_preamble &&
254 (!tx->sta || test_sta_flags(tx->sta, WLAN_STA_SHORT_PREAMBLE))) {
255 info->flags |= IEEE80211_TX_CTL_SHORT_PREAMBLE;
257 @@ -560,7 +560,7 @@ ieee80211_tx_h_misc(struct ieee80211_tx_
258 for (idx = 0; idx < sband->n_bitrates; idx++) {
259 if (sband->bitrates[idx].bitrate > rate->bitrate)
261 - if (tx->sdata->bss_conf.basic_rates & BIT(idx) &&
262 + if (tx->sdata->vif.bss_conf.basic_rates & BIT(idx) &&
264 (sband->bitrates[baserate].bitrate
265 < sband->bitrates[idx].bitrate)))
266 @@ -1981,7 +1981,7 @@ struct sk_buff *ieee80211_beacon_get(str
267 info->flags |= IEEE80211_TX_CTL_NO_ACK;
268 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
269 info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ;
270 - if (sdata->bss_conf.use_short_preamble &&
271 + if (sdata->vif.bss_conf.use_short_preamble &&
272 sband->bitrates[rsel.rate_idx].flags & IEEE80211_RATE_SHORT_PREAMBLE)
273 info->flags |= IEEE80211_TX_CTL_SHORT_PREAMBLE;
275 --- everything.orig/net/mac80211/util.c 2008-10-10 17:13:03.000000000 +0200
276 +++ everything/net/mac80211/util.c 2008-10-10 17:13:06.000000000 +0200
277 @@ -239,7 +239,7 @@ __le16 ieee80211_generic_frame_duration(
280 sdata = vif_to_sdata(vif);
281 - short_preamble = sdata->bss_conf.use_short_preamble;
282 + short_preamble = sdata->vif.bss_conf.use_short_preamble;
283 if (sdata->flags & IEEE80211_SDATA_OPERATING_GMODE)
284 erp = rate->flags & IEEE80211_RATE_ERP_G;
286 @@ -272,7 +272,7 @@ __le16 ieee80211_rts_duration(struct iee
289 sdata = vif_to_sdata(vif);
290 - short_preamble = sdata->bss_conf.use_short_preamble;
291 + short_preamble = sdata->vif.bss_conf.use_short_preamble;
292 if (sdata->flags & IEEE80211_SDATA_OPERATING_GMODE)
293 erp = rate->flags & IEEE80211_RATE_ERP_G;
295 @@ -312,7 +312,7 @@ __le16 ieee80211_ctstoself_duration(stru
298 sdata = vif_to_sdata(vif);
299 - short_preamble = sdata->bss_conf.use_short_preamble;
300 + short_preamble = sdata->vif.bss_conf.use_short_preamble;
301 if (sdata->flags & IEEE80211_SDATA_OPERATING_GMODE)
302 erp = rate->flags & IEEE80211_RATE_ERP_G;