diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-06-22 19:45:32 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-06-27 09:09:18 -0400 |
commit | 4e3996fe899651e00d3085110cc6e92f6a78ee3e (patch) | |
tree | a175fe0768a66a386854664919eed0e8efabcf75 | |
parent | 182503abf450d39417c2cc6a2c49b4731117d21b (diff) |
mac80211: mlme.c use new frame control helpers
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/mac80211/mlme.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 75c4e9743fb4..7b4d4d46843b 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -3271,33 +3271,32 @@ ieee80211_sta_rx_scan(struct net_device *dev, struct sk_buff *skb, | |||
3271 | struct ieee80211_rx_status *rx_status) | 3271 | struct ieee80211_rx_status *rx_status) |
3272 | { | 3272 | { |
3273 | struct ieee80211_mgmt *mgmt; | 3273 | struct ieee80211_mgmt *mgmt; |
3274 | u16 fc; | 3274 | __le16 fc; |
3275 | 3275 | ||
3276 | if (skb->len < 2) | 3276 | if (skb->len < 2) |
3277 | return RX_DROP_UNUSABLE; | 3277 | return RX_DROP_UNUSABLE; |
3278 | 3278 | ||
3279 | mgmt = (struct ieee80211_mgmt *) skb->data; | 3279 | mgmt = (struct ieee80211_mgmt *) skb->data; |
3280 | fc = le16_to_cpu(mgmt->frame_control); | 3280 | fc = mgmt->frame_control; |
3281 | 3281 | ||
3282 | if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) | 3282 | if (ieee80211_is_ctl(fc)) |
3283 | return RX_CONTINUE; | 3283 | return RX_CONTINUE; |
3284 | 3284 | ||
3285 | if (skb->len < 24) | 3285 | if (skb->len < 24) |
3286 | return RX_DROP_MONITOR; | 3286 | return RX_DROP_MONITOR; |
3287 | 3287 | ||
3288 | if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) { | 3288 | if (ieee80211_is_probe_resp(fc)) { |
3289 | if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP) { | 3289 | ieee80211_rx_mgmt_probe_resp(dev, mgmt, skb->len, rx_status); |
3290 | ieee80211_rx_mgmt_probe_resp(dev, mgmt, | 3290 | dev_kfree_skb(skb); |
3291 | skb->len, rx_status); | 3291 | return RX_QUEUED; |
3292 | dev_kfree_skb(skb); | ||
3293 | return RX_QUEUED; | ||
3294 | } else if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON) { | ||
3295 | ieee80211_rx_mgmt_beacon(dev, mgmt, skb->len, | ||
3296 | rx_status); | ||
3297 | dev_kfree_skb(skb); | ||
3298 | return RX_QUEUED; | ||
3299 | } | ||
3300 | } | 3292 | } |
3293 | |||
3294 | if (ieee80211_is_beacon(fc)) { | ||
3295 | ieee80211_rx_mgmt_beacon(dev, mgmt, skb->len, rx_status); | ||
3296 | dev_kfree_skb(skb); | ||
3297 | return RX_QUEUED; | ||
3298 | } | ||
3299 | |||
3301 | return RX_CONTINUE; | 3300 | return RX_CONTINUE; |
3302 | } | 3301 | } |
3303 | 3302 | ||
@@ -3875,7 +3874,7 @@ static void ieee80211_send_nullfunc(struct ieee80211_local *local, | |||
3875 | { | 3874 | { |
3876 | struct sk_buff *skb; | 3875 | struct sk_buff *skb; |
3877 | struct ieee80211_hdr *nullfunc; | 3876 | struct ieee80211_hdr *nullfunc; |
3878 | u16 fc; | 3877 | __le16 fc; |
3879 | 3878 | ||
3880 | skb = dev_alloc_skb(local->hw.extra_tx_headroom + 24); | 3879 | skb = dev_alloc_skb(local->hw.extra_tx_headroom + 24); |
3881 | if (!skb) { | 3880 | if (!skb) { |
@@ -3887,11 +3886,11 @@ static void ieee80211_send_nullfunc(struct ieee80211_local *local, | |||
3887 | 3886 | ||
3888 | nullfunc = (struct ieee80211_hdr *) skb_put(skb, 24); | 3887 | nullfunc = (struct ieee80211_hdr *) skb_put(skb, 24); |
3889 | memset(nullfunc, 0, 24); | 3888 | memset(nullfunc, 0, 24); |
3890 | fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC | | 3889 | fc = cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC | |
3891 | IEEE80211_FCTL_TODS; | 3890 | IEEE80211_FCTL_TODS); |
3892 | if (powersave) | 3891 | if (powersave) |
3893 | fc |= IEEE80211_FCTL_PM; | 3892 | fc |= cpu_to_le16(IEEE80211_FCTL_PM); |
3894 | nullfunc->frame_control = cpu_to_le16(fc); | 3893 | nullfunc->frame_control = fc; |
3895 | memcpy(nullfunc->addr1, sdata->u.sta.bssid, ETH_ALEN); | 3894 | memcpy(nullfunc->addr1, sdata->u.sta.bssid, ETH_ALEN); |
3896 | memcpy(nullfunc->addr2, sdata->dev->dev_addr, ETH_ALEN); | 3895 | memcpy(nullfunc->addr2, sdata->dev->dev_addr, ETH_ALEN); |
3897 | memcpy(nullfunc->addr3, sdata->u.sta.bssid, ETH_ALEN); | 3896 | memcpy(nullfunc->addr3, sdata->u.sta.bssid, ETH_ALEN); |