aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-07-06 21:45:17 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 15:02:30 -0400
commit77fdaa12cea26c204cc12c312fe40bc0f3dcdfd8 (patch)
treec28fdd28f2ca2783783adb4b5e13b7ba57a223a3 /net/mac80211/rx.c
parenta7c1cfc9616ee76213a6d4fd4c17f13fdc92ddce (diff)
mac80211: rework MLME for multiple authentications
Sit tight. This shakes up the world as you know it. Let go of your spaghetti tongs, they will no longer be required, the horrible statemachine in net/mac80211/mlme.c is no more... With the cfg80211 SME mac80211 now has much less to keep track of, but, on the other hand, for FT it needs to be able to keep track of at least one authentication being in progress while associated. So convert from a single state machine to having small ones for all the different things we need to do. For real FT it will still need work wrt. PS, but this should be a good step. 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.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index ec5acc6dc021..fe6b99059531 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1641,12 +1641,7 @@ static void ieee80211_process_sa_query_req(struct ieee80211_sub_if_data *sdata,
1641 1641
1642 if (compare_ether_addr(mgmt->sa, sdata->u.mgd.bssid) != 0 || 1642 if (compare_ether_addr(mgmt->sa, sdata->u.mgd.bssid) != 0 ||
1643 compare_ether_addr(mgmt->bssid, sdata->u.mgd.bssid) != 0) { 1643 compare_ether_addr(mgmt->bssid, sdata->u.mgd.bssid) != 0) {
1644 /* Not from the current AP. */ 1644 /* Not from the current AP or not associated yet. */
1645 return;
1646 }
1647
1648 if (sdata->u.mgd.state == IEEE80211_STA_MLME_ASSOCIATE) {
1649 /* Association in progress; ignore SA Query */
1650 return; 1645 return;
1651 } 1646 }
1652 1647
@@ -1683,7 +1678,6 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
1683 struct ieee80211_local *local = rx->local; 1678 struct ieee80211_local *local = rx->local;
1684 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); 1679 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev);
1685 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; 1680 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data;
1686 struct ieee80211_bss *bss;
1687 int len = rx->skb->len; 1681 int len = rx->skb->len;
1688 1682
1689 if (!ieee80211_is_action(mgmt->frame_control)) 1683 if (!ieee80211_is_action(mgmt->frame_control))
@@ -1761,17 +1755,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
1761 if (memcmp(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN)) 1755 if (memcmp(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN))
1762 return RX_DROP_MONITOR; 1756 return RX_DROP_MONITOR;
1763 1757
1764 bss = ieee80211_rx_bss_get(local, sdata->u.mgd.bssid, 1758 return ieee80211_sta_rx_mgmt(sdata, rx->skb);
1765 local->hw.conf.channel->center_freq,
1766 sdata->u.mgd.ssid,
1767 sdata->u.mgd.ssid_len);
1768 if (!bss)
1769 return RX_DROP_MONITOR;
1770
1771 ieee80211_sta_process_chanswitch(sdata,
1772 &mgmt->u.action.u.chan_switch.sw_elem, bss);
1773 ieee80211_rx_bss_put(local, bss);
1774 break;
1775 } 1759 }
1776 break; 1760 break;
1777 case WLAN_CATEGORY_SA_QUERY: 1761 case WLAN_CATEGORY_SA_QUERY:
@@ -2026,13 +2010,8 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata,
2026 case NL80211_IFTYPE_STATION: 2010 case NL80211_IFTYPE_STATION:
2027 if (!bssid) 2011 if (!bssid)
2028 return 0; 2012 return 0;
2029 if (!ieee80211_bssid_match(bssid, sdata->u.mgd.bssid)) { 2013 if (!multicast &&
2030 if (!(rx->flags & IEEE80211_RX_IN_SCAN)) 2014 compare_ether_addr(sdata->dev->dev_addr, hdr->addr1) != 0) {
2031 return 0;
2032 rx->flags &= ~IEEE80211_RX_RA_MATCH;
2033 } else if (!multicast &&
2034 compare_ether_addr(sdata->dev->dev_addr,
2035 hdr->addr1) != 0) {
2036 if (!(sdata->dev->flags & IFF_PROMISC)) 2015 if (!(sdata->dev->flags & IFF_PROMISC))
2037 return 0; 2016 return 0;
2038 rx->flags &= ~IEEE80211_RX_RA_MATCH; 2017 rx->flags &= ~IEEE80211_RX_RA_MATCH;