aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-07-09 08:40:34 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-07-14 14:30:06 -0400
commit3e122be089e6fb8d3f322416da4cdbb80ce12927 (patch)
tree087db56fcbe05e9a8e2caa874262c81267c27573 /net/mac80211/tx.c
parent500c11973233437cbfd298b9d41ba942550aec76 (diff)
mac80211: make master netdev handling sane
Currently, almost every interface type has a 'bss' pointer pointing to BSS information. This BSS information, however, is for a _local_ BSS, not for the BSS we joined, so having it on a STA mode interface makes little sense, but now they have it pointing to the master device, which is an AP mode virtual interface. However, except for some bitrate control data, this pointer is only used in AP/VLAN modes (for power saving stations.) Overall, it is not necessary to even have the master netdev be a valid virtual interface, and it doesn't have to be on the list of interfaces either. This patch changes the master netdev to be special, it now - no longer is on the list of virtual interfaces, which lets me remove a lot of tests for that - no longer has sub_if_data attached, since that isn't used Additionally, this patch changes some vlan/ap mode handling that is related to these 'bss' pointers described above (but in the VLAN case they actually make sense because there they point to the AP they belong to); it also adds some debugging code to IEEE80211_DEV_TO_SUB_IF to validate it is not called on the master netdev any more. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 9bd9faac3c3c..a757dcc1208d 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -303,8 +303,7 @@ static void purge_old_ps_buffers(struct ieee80211_local *local)
303 303
304 list_for_each_entry_rcu(sdata, &local->interfaces, list) { 304 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
305 struct ieee80211_if_ap *ap; 305 struct ieee80211_if_ap *ap;
306 if (sdata->dev == local->mdev || 306 if (sdata->vif.type != IEEE80211_IF_TYPE_AP)
307 sdata->vif.type != IEEE80211_IF_TYPE_AP)
308 continue; 307 continue;
309 ap = &sdata->u.ap; 308 ap = &sdata->u.ap;
310 skb = skb_dequeue(&ap->ps_bc_buf); 309 skb = skb_dequeue(&ap->ps_bc_buf);
@@ -346,8 +345,12 @@ ieee80211_tx_h_multicast_ps_buf(struct ieee80211_tx_data *tx)
346 * This is done either by the hardware or us. 345 * This is done either by the hardware or us.
347 */ 346 */
348 347
349 /* not AP/IBSS or ordered frame */ 348 /* powersaving STAs only in AP/VLAN mode */
350 if (!tx->sdata->bss || (tx->fc & IEEE80211_FCTL_ORDER)) 349 if (!tx->sdata->bss)
350 return TX_CONTINUE;
351
352 /* no buffering for ordered frames */
353 if (tx->fc & IEEE80211_FCTL_ORDER)
351 return TX_CONTINUE; 354 return TX_CONTINUE;
352 355
353 /* no stations in PS mode */ 356 /* no stations in PS mode */