aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-06-22 16:45:32 -0700
committerJohn W. Linville <linville@tuxdriver.com>2008-06-27 09:09:18 -0400
commit4e3996fe899651e00d3085110cc6e92f6a78ee3e (patch)
treea175fe0768a66a386854664919eed0e8efabcf75 /net
parent182503abf450d39417c2cc6a2c49b4731117d21b (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>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/mlme.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 75c4e9743fb..7b4d4d46843 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,
struct ieee80211_rx_status *rx_status)
{
struct ieee80211_mgmt *mgmt;
- u16 fc;
+ __le16 fc;
if (skb->len < 2)
return RX_DROP_UNUSABLE;
mgmt = (struct ieee80211_mgmt *) skb->data;
- fc = le16_to_cpu(mgmt->frame_control);
+ fc = mgmt->frame_control;
- if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL)
+ if (ieee80211_is_ctl(fc))
return RX_CONTINUE;
if (skb->len < 24)
return RX_DROP_MONITOR;
- if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) {
- if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP) {
- ieee80211_rx_mgmt_probe_resp(dev, mgmt,
- skb->len, rx_status);
- dev_kfree_skb(skb);
- return RX_QUEUED;
- } else if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON) {
- ieee80211_rx_mgmt_beacon(dev, mgmt, skb->len,
- rx_status);
- dev_kfree_skb(skb);
- return RX_QUEUED;
- }
+ if (ieee80211_is_probe_resp(fc)) {
+ ieee80211_rx_mgmt_probe_resp(dev, mgmt, skb->len, rx_status);
+ dev_kfree_skb(skb);
+ return RX_QUEUED;
}
+
+ if (ieee80211_is_beacon(fc)) {
+ ieee80211_rx_mgmt_beacon(dev, mgmt, skb->len, rx_status);
+ dev_kfree_skb(skb);
+ return RX_QUEUED;
+ }
+
return RX_CONTINUE;
}
@@ -3875,7 +3874,7 @@ static void ieee80211_send_nullfunc(struct ieee80211_local *local,
{
struct sk_buff *skb;
struct ieee80211_hdr *nullfunc;
- u16 fc;
+ __le16 fc;
skb = dev_alloc_skb(local->hw.extra_tx_headroom + 24);
if (!skb) {
@@ -3887,11 +3886,11 @@ static void ieee80211_send_nullfunc(struct ieee80211_local *local,
nullfunc = (struct ieee80211_hdr *) skb_put(skb, 24);
memset(nullfunc, 0, 24);
- fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC |
- IEEE80211_FCTL_TODS;
+ fc = cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC |
+ IEEE80211_FCTL_TODS);
if (powersave)
- fc |= IEEE80211_FCTL_PM;
- nullfunc->frame_control = cpu_to_le16(fc);
+ fc |= cpu_to_le16(IEEE80211_FCTL_PM);
+ nullfunc->frame_control = fc;
memcpy(nullfunc->addr1, sdata->u.sta.bssid, ETH_ALEN);
memcpy(nullfunc->addr2, sdata->dev->dev_addr, ETH_ALEN);
memcpy(nullfunc->addr3, sdata->u.sta.bssid, ETH_ALEN);