aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/mesh_hwmp.c8
-rw-r--r--net/mac80211/mesh_plink.c4
-rw-r--r--net/mac80211/mlme.c46
-rw-r--r--net/mac80211/tx.c4
5 files changed, 31 insertions, 33 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index ec59345af65b..a2870bc245d9 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -38,8 +38,6 @@
38 38
39#define WLAN_FC_DATA_PRESENT(fc) (((fc) & 0x4c) == 0x08) 39#define WLAN_FC_DATA_PRESENT(fc) (((fc) & 0x4c) == 0x08)
40 40
41#define IEEE80211_FC(type, subtype) cpu_to_le16(type | subtype)
42
43struct ieee80211_local; 41struct ieee80211_local;
44 42
45/* Maximum number of broadcast/multicast frames to buffer when some of the 43/* Maximum number of broadcast/multicast frames to buffer when some of the
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 08aca446ca01..2cdbd522631b 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -99,8 +99,8 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
99 mgmt = (struct ieee80211_mgmt *) 99 mgmt = (struct ieee80211_mgmt *)
100 skb_put(skb, 25 + sizeof(mgmt->u.action.u.mesh_action)); 100 skb_put(skb, 25 + sizeof(mgmt->u.action.u.mesh_action));
101 memset(mgmt, 0, 25 + sizeof(mgmt->u.action.u.mesh_action)); 101 memset(mgmt, 0, 25 + sizeof(mgmt->u.action.u.mesh_action));
102 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 102 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
103 IEEE80211_STYPE_ACTION); 103 IEEE80211_STYPE_ACTION);
104 104
105 memcpy(mgmt->da, da, ETH_ALEN); 105 memcpy(mgmt->da, da, ETH_ALEN);
106 memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN); 106 memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN);
@@ -178,8 +178,8 @@ int mesh_path_error_tx(u8 *dst, __le32 dst_dsn, u8 *ra,
178 mgmt = (struct ieee80211_mgmt *) 178 mgmt = (struct ieee80211_mgmt *)
179 skb_put(skb, 25 + sizeof(mgmt->u.action.u.mesh_action)); 179 skb_put(skb, 25 + sizeof(mgmt->u.action.u.mesh_action));
180 memset(mgmt, 0, 25 + sizeof(mgmt->u.action.u.mesh_action)); 180 memset(mgmt, 0, 25 + sizeof(mgmt->u.action.u.mesh_action));
181 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 181 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
182 IEEE80211_STYPE_ACTION); 182 IEEE80211_STYPE_ACTION);
183 183
184 memcpy(mgmt->da, ra, ETH_ALEN); 184 memcpy(mgmt->da, ra, ETH_ALEN);
185 memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN); 185 memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN);
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 9efeb1f07025..4a7e6d094ff9 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -163,8 +163,8 @@ static int mesh_plink_frame_tx(struct net_device *dev,
163 mgmt = (struct ieee80211_mgmt *) 163 mgmt = (struct ieee80211_mgmt *)
164 skb_put(skb, 25 + sizeof(mgmt->u.action.u.plink_action)); 164 skb_put(skb, 25 + sizeof(mgmt->u.action.u.plink_action));
165 memset(mgmt, 0, 25 + sizeof(mgmt->u.action.u.plink_action)); 165 memset(mgmt, 0, 25 + sizeof(mgmt->u.action.u.plink_action));
166 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 166 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
167 IEEE80211_STYPE_ACTION); 167 IEEE80211_STYPE_ACTION);
168 memcpy(mgmt->da, da, ETH_ALEN); 168 memcpy(mgmt->da, da, ETH_ALEN);
169 memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN); 169 memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN);
170 /* BSSID is left zeroed, wildcard value */ 170 /* BSSID is left zeroed, wildcard value */
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 1e97fb9fb34b..ac776c9d48fa 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -641,8 +641,8 @@ static void ieee80211_send_auth(struct net_device *dev,
641 641
642 mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24 + 6); 642 mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24 + 6);
643 memset(mgmt, 0, 24 + 6); 643 memset(mgmt, 0, 24 + 6);
644 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 644 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
645 IEEE80211_STYPE_AUTH); 645 IEEE80211_STYPE_AUTH);
646 if (encrypt) 646 if (encrypt)
647 mgmt->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED); 647 mgmt->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
648 memcpy(mgmt->da, ifsta->bssid, ETH_ALEN); 648 memcpy(mgmt->da, ifsta->bssid, ETH_ALEN);
@@ -771,8 +771,8 @@ static void ieee80211_send_assoc(struct net_device *dev,
771 771
772 if (ifsta->flags & IEEE80211_STA_PREV_BSSID_SET) { 772 if (ifsta->flags & IEEE80211_STA_PREV_BSSID_SET) {
773 skb_put(skb, 10); 773 skb_put(skb, 10);
774 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 774 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
775 IEEE80211_STYPE_REASSOC_REQ); 775 IEEE80211_STYPE_REASSOC_REQ);
776 mgmt->u.reassoc_req.capab_info = cpu_to_le16(capab); 776 mgmt->u.reassoc_req.capab_info = cpu_to_le16(capab);
777 mgmt->u.reassoc_req.listen_interval = 777 mgmt->u.reassoc_req.listen_interval =
778 cpu_to_le16(local->hw.conf.listen_interval); 778 cpu_to_le16(local->hw.conf.listen_interval);
@@ -780,8 +780,8 @@ static void ieee80211_send_assoc(struct net_device *dev,
780 ETH_ALEN); 780 ETH_ALEN);
781 } else { 781 } else {
782 skb_put(skb, 4); 782 skb_put(skb, 4);
783 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 783 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
784 IEEE80211_STYPE_ASSOC_REQ); 784 IEEE80211_STYPE_ASSOC_REQ);
785 mgmt->u.assoc_req.capab_info = cpu_to_le16(capab); 785 mgmt->u.assoc_req.capab_info = cpu_to_le16(capab);
786 mgmt->u.reassoc_req.listen_interval = 786 mgmt->u.reassoc_req.listen_interval =
787 cpu_to_le16(local->hw.conf.listen_interval); 787 cpu_to_le16(local->hw.conf.listen_interval);
@@ -931,8 +931,8 @@ static void ieee80211_send_deauth(struct net_device *dev,
931 memcpy(mgmt->da, ifsta->bssid, ETH_ALEN); 931 memcpy(mgmt->da, ifsta->bssid, ETH_ALEN);
932 memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN); 932 memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN);
933 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN); 933 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN);
934 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 934 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
935 IEEE80211_STYPE_DEAUTH); 935 IEEE80211_STYPE_DEAUTH);
936 skb_put(skb, 2); 936 skb_put(skb, 2);
937 mgmt->u.deauth.reason_code = cpu_to_le16(reason); 937 mgmt->u.deauth.reason_code = cpu_to_le16(reason);
938 938
@@ -960,8 +960,8 @@ static void ieee80211_send_disassoc(struct net_device *dev,
960 memcpy(mgmt->da, ifsta->bssid, ETH_ALEN); 960 memcpy(mgmt->da, ifsta->bssid, ETH_ALEN);
961 memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN); 961 memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN);
962 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN); 962 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN);
963 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 963 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
964 IEEE80211_STYPE_DISASSOC); 964 IEEE80211_STYPE_DISASSOC);
965 skb_put(skb, 2); 965 skb_put(skb, 2);
966 mgmt->u.disassoc.reason_code = cpu_to_le16(reason); 966 mgmt->u.disassoc.reason_code = cpu_to_le16(reason);
967 967
@@ -1115,8 +1115,8 @@ static void ieee80211_send_probe_req(struct net_device *dev, u8 *dst,
1115 1115
1116 mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24); 1116 mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
1117 memset(mgmt, 0, 24); 1117 memset(mgmt, 0, 24);
1118 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 1118 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
1119 IEEE80211_STYPE_PROBE_REQ); 1119 IEEE80211_STYPE_PROBE_REQ);
1120 memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN); 1120 memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN);
1121 if (dst) { 1121 if (dst) {
1122 memcpy(mgmt->da, dst, ETH_ALEN); 1122 memcpy(mgmt->da, dst, ETH_ALEN);
@@ -1219,8 +1219,8 @@ static void ieee80211_send_addba_resp(struct net_device *dev, u8 *da, u16 tid,
1219 memcpy(mgmt->bssid, dev->dev_addr, ETH_ALEN); 1219 memcpy(mgmt->bssid, dev->dev_addr, ETH_ALEN);
1220 else 1220 else
1221 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN); 1221 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN);
1222 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 1222 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
1223 IEEE80211_STYPE_ACTION); 1223 IEEE80211_STYPE_ACTION);
1224 1224
1225 skb_put(skb, 1 + sizeof(mgmt->u.action.u.addba_resp)); 1225 skb_put(skb, 1 + sizeof(mgmt->u.action.u.addba_resp));
1226 mgmt->u.action.category = WLAN_CATEGORY_BACK; 1226 mgmt->u.action.category = WLAN_CATEGORY_BACK;
@@ -1268,8 +1268,8 @@ void ieee80211_send_addba_request(struct net_device *dev, const u8 *da,
1268 else 1268 else
1269 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN); 1269 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN);
1270 1270
1271 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 1271 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
1272 IEEE80211_STYPE_ACTION); 1272 IEEE80211_STYPE_ACTION);
1273 1273
1274 skb_put(skb, 1 + sizeof(mgmt->u.action.u.addba_req)); 1274 skb_put(skb, 1 + sizeof(mgmt->u.action.u.addba_req));
1275 1275
@@ -1524,8 +1524,8 @@ void ieee80211_send_delba(struct net_device *dev, const u8 *da, u16 tid,
1524 memcpy(mgmt->bssid, dev->dev_addr, ETH_ALEN); 1524 memcpy(mgmt->bssid, dev->dev_addr, ETH_ALEN);
1525 else 1525 else
1526 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN); 1526 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN);
1527 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 1527 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
1528 IEEE80211_STYPE_ACTION); 1528 IEEE80211_STYPE_ACTION);
1529 1529
1530 skb_put(skb, 1 + sizeof(mgmt->u.action.u.delba)); 1530 skb_put(skb, 1 + sizeof(mgmt->u.action.u.delba));
1531 1531
@@ -1556,8 +1556,8 @@ void ieee80211_send_bar(struct net_device *dev, u8 *ra, u16 tid, u16 ssn)
1556 skb_reserve(skb, local->hw.extra_tx_headroom); 1556 skb_reserve(skb, local->hw.extra_tx_headroom);
1557 bar = (struct ieee80211_bar *)skb_put(skb, sizeof(*bar)); 1557 bar = (struct ieee80211_bar *)skb_put(skb, sizeof(*bar));
1558 memset(bar, 0, sizeof(*bar)); 1558 memset(bar, 0, sizeof(*bar));
1559 bar->frame_control = IEEE80211_FC(IEEE80211_FTYPE_CTL, 1559 bar->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL |
1560 IEEE80211_STYPE_BACK_REQ); 1560 IEEE80211_STYPE_BACK_REQ);
1561 memcpy(bar->ra, ra, ETH_ALEN); 1561 memcpy(bar->ra, ra, ETH_ALEN);
1562 memcpy(bar->ta, dev->dev_addr, ETH_ALEN); 1562 memcpy(bar->ta, dev->dev_addr, ETH_ALEN);
1563 bar_control |= (u16)IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL; 1563 bar_control |= (u16)IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL;
@@ -1801,7 +1801,7 @@ static void ieee80211_send_refuse_measurement_request(struct net_device *dev,
1801 memcpy(msr_report->da, da, ETH_ALEN); 1801 memcpy(msr_report->da, da, ETH_ALEN);
1802 memcpy(msr_report->sa, dev->dev_addr, ETH_ALEN); 1802 memcpy(msr_report->sa, dev->dev_addr, ETH_ALEN);
1803 memcpy(msr_report->bssid, bssid, ETH_ALEN); 1803 memcpy(msr_report->bssid, bssid, ETH_ALEN);
1804 msr_report->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 1804 msr_report->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
1805 IEEE80211_STYPE_ACTION); 1805 IEEE80211_STYPE_ACTION);
1806 1806
1807 skb_put(skb, 1 + sizeof(msr_report->u.action.u.measurement)); 1807 skb_put(skb, 1 + sizeof(msr_report->u.action.u.measurement));
@@ -2446,8 +2446,8 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
2446 mgmt = (struct ieee80211_mgmt *) 2446 mgmt = (struct ieee80211_mgmt *)
2447 skb_put(skb, 24 + sizeof(mgmt->u.beacon)); 2447 skb_put(skb, 24 + sizeof(mgmt->u.beacon));
2448 memset(mgmt, 0, 24 + sizeof(mgmt->u.beacon)); 2448 memset(mgmt, 0, 24 + sizeof(mgmt->u.beacon));
2449 mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 2449 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
2450 IEEE80211_STYPE_PROBE_RESP); 2450 IEEE80211_STYPE_PROBE_RESP);
2451 memset(mgmt->da, 0xff, ETH_ALEN); 2451 memset(mgmt->da, 0xff, ETH_ALEN);
2452 memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN); 2452 memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN);
2453 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN); 2453 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN);
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 24146f3387a7..9c60dedc3687 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1889,8 +1889,8 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1889 goto out; 1889 goto out;
1890 1890
1891 hdr = (struct ieee80211_hdr *) skb->data; 1891 hdr = (struct ieee80211_hdr *) skb->data;
1892 hdr->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, 1892 hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
1893 IEEE80211_STYPE_BEACON); 1893 IEEE80211_STYPE_BEACON);
1894 1894
1895 num_beacons = &ifsta->num_beacons; 1895 num_beacons = &ifsta->num_beacons;
1896 } else if (ieee80211_vif_is_mesh(&sdata->vif)) { 1896 } else if (ieee80211_vif_is_mesh(&sdata->vif)) {