aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/wext.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/wext.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/wext.c')
-rw-r--r--net/mac80211/wext.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index 207971e9ad72..e8e4a6215e89 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -627,16 +627,14 @@ static int ieee80211_ioctl_siwrate(struct net_device *dev,
627 struct ieee80211_supported_band *sband; 627 struct ieee80211_supported_band *sband;
628 628
629 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 629 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
630 if (!sdata->bss)
631 return -ENODEV;
632 630
633 sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; 631 sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
634 632
635 /* target_rate = -1, rate->fixed = 0 means auto only, so use all rates 633 /* target_rate = -1, rate->fixed = 0 means auto only, so use all rates
636 * target_rate = X, rate->fixed = 1 means only rate X 634 * target_rate = X, rate->fixed = 1 means only rate X
637 * target_rate = X, rate->fixed = 0 means all rates <= X */ 635 * target_rate = X, rate->fixed = 0 means all rates <= X */
638 sdata->bss->max_ratectrl_rateidx = -1; 636 sdata->max_ratectrl_rateidx = -1;
639 sdata->bss->force_unicast_rateidx = -1; 637 sdata->force_unicast_rateidx = -1;
640 if (rate->value < 0) 638 if (rate->value < 0)
641 return 0; 639 return 0;
642 640
@@ -645,9 +643,9 @@ static int ieee80211_ioctl_siwrate(struct net_device *dev,
645 int this_rate = brate->bitrate; 643 int this_rate = brate->bitrate;
646 644
647 if (target_rate == this_rate) { 645 if (target_rate == this_rate) {
648 sdata->bss->max_ratectrl_rateidx = i; 646 sdata->max_ratectrl_rateidx = i;
649 if (rate->fixed) 647 if (rate->fixed)
650 sdata->bss->force_unicast_rateidx = i; 648 sdata->force_unicast_rateidx = i;
651 err = 0; 649 err = 0;
652 break; 650 break;
653 } 651 }