diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-07-09 08:40:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-07-14 14:30:06 -0400 |
commit | 3e122be089e6fb8d3f322416da4cdbb80ce12927 (patch) | |
tree | 087db56fcbe05e9a8e2caa874262c81267c27573 /net/mac80211/rx.c | |
parent | 500c11973233437cbfd298b9d41ba942550aec76 (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/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index fab443d717eb..244ee2d50a58 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -647,8 +647,7 @@ static void ap_sta_ps_start(struct net_device *dev, struct sta_info *sta) | |||
647 | 647 | ||
648 | sdata = sta->sdata; | 648 | sdata = sta->sdata; |
649 | 649 | ||
650 | if (sdata->bss) | 650 | atomic_inc(&sdata->bss->num_sta_ps); |
651 | atomic_inc(&sdata->bss->num_sta_ps); | ||
652 | set_and_clear_sta_flags(sta, WLAN_STA_PS, WLAN_STA_PSPOLL); | 651 | set_and_clear_sta_flags(sta, WLAN_STA_PS, WLAN_STA_PSPOLL); |
653 | #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG | 652 | #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG |
654 | printk(KERN_DEBUG "%s: STA %s aid %d enters power save mode\n", | 653 | printk(KERN_DEBUG "%s: STA %s aid %d enters power save mode\n", |
@@ -667,8 +666,7 @@ static int ap_sta_ps_end(struct net_device *dev, struct sta_info *sta) | |||
667 | 666 | ||
668 | sdata = sta->sdata; | 667 | sdata = sta->sdata; |
669 | 668 | ||
670 | if (sdata->bss) | 669 | atomic_dec(&sdata->bss->num_sta_ps); |
671 | atomic_dec(&sdata->bss->num_sta_ps); | ||
672 | 670 | ||
673 | clear_sta_flags(sta, WLAN_STA_PS | WLAN_STA_PSPOLL); | 671 | clear_sta_flags(sta, WLAN_STA_PS | WLAN_STA_PSPOLL); |
674 | 672 | ||
@@ -742,7 +740,9 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx) | |||
742 | sta->last_qual = rx->status->qual; | 740 | sta->last_qual = rx->status->qual; |
743 | sta->last_noise = rx->status->noise; | 741 | sta->last_noise = rx->status->noise; |
744 | 742 | ||
745 | if (!ieee80211_has_morefrags(hdr->frame_control)) { | 743 | if (!ieee80211_has_morefrags(hdr->frame_control) && |
744 | (rx->sdata->vif.type == IEEE80211_IF_TYPE_AP || | ||
745 | rx->sdata->vif.type == IEEE80211_IF_TYPE_VLAN)) { | ||
746 | /* Change STA power saving mode only in the end of a frame | 746 | /* Change STA power saving mode only in the end of a frame |
747 | * exchange sequence */ | 747 | * exchange sequence */ |
748 | if (test_sta_flags(sta, WLAN_STA_PS) && | 748 | if (test_sta_flags(sta, WLAN_STA_PS) && |
@@ -1772,11 +1772,6 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata, | |||
1772 | return 0; | 1772 | return 0; |
1773 | rx->flags &= ~IEEE80211_RX_RA_MATCH; | 1773 | rx->flags &= ~IEEE80211_RX_RA_MATCH; |
1774 | } | 1774 | } |
1775 | if (sdata->dev == sdata->local->mdev && | ||
1776 | !(rx->flags & IEEE80211_RX_IN_SCAN)) | ||
1777 | /* do not receive anything via | ||
1778 | * master device when not scanning */ | ||
1779 | return 0; | ||
1780 | break; | 1775 | break; |
1781 | case IEEE80211_IF_TYPE_WDS: | 1776 | case IEEE80211_IF_TYPE_WDS: |
1782 | if (bssid || !ieee80211_is_data(hdr->frame_control)) | 1777 | if (bssid || !ieee80211_is_data(hdr->frame_control)) |