Commit 4e3996fe authored by Harvey Harrison's avatar Harvey Harrison Committed by John W. Linville

mac80211: mlme.c use new frame control helpers

Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 182503ab
...@@ -3271,33 +3271,32 @@ ieee80211_sta_rx_scan(struct net_device *dev, struct sk_buff *skb, ...@@ -3271,33 +3271,32 @@ ieee80211_sta_rx_scan(struct net_device *dev, struct sk_buff *skb,
struct ieee80211_rx_status *rx_status) struct ieee80211_rx_status *rx_status)
{ {
struct ieee80211_mgmt *mgmt; struct ieee80211_mgmt *mgmt;
u16 fc; __le16 fc;
if (skb->len < 2) if (skb->len < 2)
return RX_DROP_UNUSABLE; return RX_DROP_UNUSABLE;
mgmt = (struct ieee80211_mgmt *) skb->data; 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; return RX_CONTINUE;
if (skb->len < 24) if (skb->len < 24)
return RX_DROP_MONITOR; return RX_DROP_MONITOR;
if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) { if (ieee80211_is_probe_resp(fc)) {
if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP) { ieee80211_rx_mgmt_probe_resp(dev, mgmt, skb->len, rx_status);
ieee80211_rx_mgmt_probe_resp(dev, mgmt, dev_kfree_skb(skb);
skb->len, rx_status); return RX_QUEUED;
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_beacon(fc)) {
ieee80211_rx_mgmt_beacon(dev, mgmt, skb->len, rx_status);
dev_kfree_skb(skb);
return RX_QUEUED;
}
return RX_CONTINUE; return RX_CONTINUE;
} }
...@@ -3875,7 +3874,7 @@ static void ieee80211_send_nullfunc(struct ieee80211_local *local, ...@@ -3875,7 +3874,7 @@ static void ieee80211_send_nullfunc(struct ieee80211_local *local,
{ {
struct sk_buff *skb; struct sk_buff *skb;
struct ieee80211_hdr *nullfunc; struct ieee80211_hdr *nullfunc;
u16 fc; __le16 fc;
skb = dev_alloc_skb(local->hw.extra_tx_headroom + 24); skb = dev_alloc_skb(local->hw.extra_tx_headroom + 24);
if (!skb) { if (!skb) {
...@@ -3887,11 +3886,11 @@ static void ieee80211_send_nullfunc(struct ieee80211_local *local, ...@@ -3887,11 +3886,11 @@ static void ieee80211_send_nullfunc(struct ieee80211_local *local,
nullfunc = (struct ieee80211_hdr *) skb_put(skb, 24); nullfunc = (struct ieee80211_hdr *) skb_put(skb, 24);
memset(nullfunc, 0, 24); memset(nullfunc, 0, 24);
fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC | fc = cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC |
IEEE80211_FCTL_TODS; IEEE80211_FCTL_TODS);
if (powersave) if (powersave)
fc |= IEEE80211_FCTL_PM; fc |= cpu_to_le16(IEEE80211_FCTL_PM);
nullfunc->frame_control = cpu_to_le16(fc); nullfunc->frame_control = fc;
memcpy(nullfunc->addr1, sdata->u.sta.bssid, ETH_ALEN); memcpy(nullfunc->addr1, sdata->u.sta.bssid, ETH_ALEN);
memcpy(nullfunc->addr2, sdata->dev->dev_addr, ETH_ALEN); memcpy(nullfunc->addr2, sdata->dev->dev_addr, ETH_ALEN);
memcpy(nullfunc->addr3, sdata->u.sta.bssid, ETH_ALEN); memcpy(nullfunc->addr3, sdata->u.sta.bssid, ETH_ALEN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment