aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/ieee80211.c13
-rw-r--r--net/mac80211/ieee80211_i.h12
-rw-r--r--net/mac80211/ieee80211_sta.c6
-rw-r--r--net/mac80211/rx.c4
-rw-r--r--net/mac80211/tx.c23
-rw-r--r--net/mac80211/wme.c4
6 files changed, 36 insertions, 26 deletions
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 8f472379b128..289b33ce45cf 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -876,10 +876,15 @@ static void ieee80211_remove_tx_extra(struct ieee80211_local *local,
876 876
877 pkt_data = (struct ieee80211_tx_packet_data *)skb->cb; 877 pkt_data = (struct ieee80211_tx_packet_data *)skb->cb;
878 pkt_data->ifindex = control->ifindex; 878 pkt_data->ifindex = control->ifindex;
879 pkt_data->mgmt_iface = (control->type == IEEE80211_IF_TYPE_MGMT); 879 pkt_data->flags = 0;
880 pkt_data->req_tx_status = !!(control->flags & IEEE80211_TXCTL_REQ_TX_STATUS); 880 if (control->flags & IEEE80211_TXCTL_REQ_TX_STATUS)
881 pkt_data->do_not_encrypt = !!(control->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT); 881 pkt_data->flags |= IEEE80211_TXPD_REQ_TX_STATUS;
882 pkt_data->requeue = !!(control->flags & IEEE80211_TXCTL_REQUEUE); 882 if (control->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT)
883 pkt_data->flags |= IEEE80211_TXPD_DO_NOT_ENCRYPT;
884 if (control->flags & IEEE80211_TXCTL_REQUEUE)
885 pkt_data->flags |= IEEE80211_TXPD_REQUEUE;
886 if (control->type == IEEE80211_IF_TYPE_MGMT)
887 pkt_data->flags |= IEEE80211_TXPD_MGMT_IFACE;
883 pkt_data->queue = control->queue; 888 pkt_data->queue = control->queue;
884 889
885 hdrlen = ieee80211_get_hdrlen_from_skb(skb); 890 hdrlen = ieee80211_get_hdrlen_from_skb(skb);
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 9c5fd861eb72..a2b018bae180 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -155,15 +155,17 @@ struct ieee80211_txrx_data {
155 } u; 155 } u;
156}; 156};
157 157
158/* flags used in struct ieee80211_tx_packet_data.flags */
159#define IEEE80211_TXPD_REQ_TX_STATUS BIT(0)
160#define IEEE80211_TXPD_DO_NOT_ENCRYPT BIT(1)
161#define IEEE80211_TXPD_REQUEUE BIT(2)
162#define IEEE80211_TXPD_MGMT_IFACE BIT(3)
158/* Stored in sk_buff->cb */ 163/* Stored in sk_buff->cb */
159struct ieee80211_tx_packet_data { 164struct ieee80211_tx_packet_data {
160 int ifindex; 165 int ifindex;
161 unsigned long jiffies; 166 unsigned long jiffies;
162 unsigned int req_tx_status:1; 167 unsigned int flags;
163 unsigned int do_not_encrypt:1; 168 u8 queue;
164 unsigned int requeue:1;
165 unsigned int mgmt_iface:1;
166 unsigned int queue:4;
167}; 169};
168 170
169struct ieee80211_tx_stored_packet { 171struct ieee80211_tx_stored_packet {
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 1b3304454356..3757298c5a60 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -465,8 +465,10 @@ static void ieee80211_sta_tx(struct net_device *dev, struct sk_buff *skb,
465 pkt_data = (struct ieee80211_tx_packet_data *) skb->cb; 465 pkt_data = (struct ieee80211_tx_packet_data *) skb->cb;
466 memset(pkt_data, 0, sizeof(struct ieee80211_tx_packet_data)); 466 memset(pkt_data, 0, sizeof(struct ieee80211_tx_packet_data));
467 pkt_data->ifindex = sdata->dev->ifindex; 467 pkt_data->ifindex = sdata->dev->ifindex;
468 pkt_data->mgmt_iface = (sdata->type == IEEE80211_IF_TYPE_MGMT); 468 if (sdata->type == IEEE80211_IF_TYPE_MGMT)
469 pkt_data->do_not_encrypt = !encrypt; 469 pkt_data->flags |= IEEE80211_TXPD_MGMT_IFACE;
470 if (!encrypt)
471 pkt_data->flags |= IEEE80211_TXPD_DO_NOT_ENCRYPT;
470 472
471 dev_queue_xmit(skb); 473 dev_queue_xmit(skb);
472} 474}
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 5a66269d9435..441383ced931 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -434,7 +434,7 @@ static int ap_sta_ps_end(struct net_device *dev, struct sta_info *sta)
434 while ((skb = skb_dequeue(&sta->tx_filtered)) != NULL) { 434 while ((skb = skb_dequeue(&sta->tx_filtered)) != NULL) {
435 pkt_data = (struct ieee80211_tx_packet_data *) skb->cb; 435 pkt_data = (struct ieee80211_tx_packet_data *) skb->cb;
436 sent++; 436 sent++;
437 pkt_data->requeue = 1; 437 pkt_data->flags |= IEEE80211_TXPD_REQUEUE;
438 dev_queue_xmit(skb); 438 dev_queue_xmit(skb);
439 } 439 }
440 while ((skb = skb_dequeue(&sta->ps_tx_buf)) != NULL) { 440 while ((skb = skb_dequeue(&sta->ps_tx_buf)) != NULL) {
@@ -446,7 +446,7 @@ static int ap_sta_ps_end(struct net_device *dev, struct sta_info *sta)
446 "since STA not sleeping anymore\n", dev->name, 446 "since STA not sleeping anymore\n", dev->name,
447 MAC_ARG(sta->addr), sta->aid); 447 MAC_ARG(sta->addr), sta->aid);
448#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 448#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
449 pkt_data->requeue = 1; 449 pkt_data->flags |= IEEE80211_TXPD_REQUEUE;
450 dev_queue_xmit(skb); 450 dev_queue_xmit(skb);
451 } 451 }
452 452
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 53efcf6f769c..eb4d9eab0f3f 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1245,11 +1245,11 @@ int ieee80211_master_start_xmit(struct sk_buff *skb,
1245 1245
1246 control.ifindex = odev->ifindex; 1246 control.ifindex = odev->ifindex;
1247 control.type = osdata->type; 1247 control.type = osdata->type;
1248 if (pkt_data->req_tx_status) 1248 if (pkt_data->flags & IEEE80211_TXPD_REQ_TX_STATUS)
1249 control.flags |= IEEE80211_TXCTL_REQ_TX_STATUS; 1249 control.flags |= IEEE80211_TXCTL_REQ_TX_STATUS;
1250 if (pkt_data->do_not_encrypt) 1250 if (pkt_data->flags & IEEE80211_TXPD_DO_NOT_ENCRYPT)
1251 control.flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT; 1251 control.flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT;
1252 if (pkt_data->requeue) 1252 if (pkt_data->flags & IEEE80211_TXPD_REQUEUE)
1253 control.flags |= IEEE80211_TXCTL_REQUEUE; 1253 control.flags |= IEEE80211_TXCTL_REQUEUE;
1254 control.queue = pkt_data->queue; 1254 control.queue = pkt_data->queue;
1255 1255
@@ -1291,8 +1291,7 @@ int ieee80211_monitor_start_xmit(struct sk_buff *skb,
1291 /* needed because we set skb device to master */ 1291 /* needed because we set skb device to master */
1292 pkt_data->ifindex = dev->ifindex; 1292 pkt_data->ifindex = dev->ifindex;
1293 1293
1294 pkt_data->mgmt_iface = 0; 1294 pkt_data->flags |= IEEE80211_TXPD_DO_NOT_ENCRYPT;
1295 pkt_data->do_not_encrypt = 1;
1296 1295
1297 /* 1296 /*
1298 * fix up the pointers accounting for the radiotap 1297 * fix up the pointers accounting for the radiotap
@@ -1343,7 +1342,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
1343 struct ieee80211_hdr hdr; 1342 struct ieee80211_hdr hdr;
1344 const u8 *encaps_data; 1343 const u8 *encaps_data;
1345 int encaps_len, skip_header_bytes; 1344 int encaps_len, skip_header_bytes;
1346 int nh_pos, h_pos, no_encrypt = 0; 1345 int nh_pos, h_pos;
1347 struct sta_info *sta; 1346 struct sta_info *sta;
1348 1347
1349 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1348 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
@@ -1487,8 +1486,8 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
1487 pkt_data = (struct ieee80211_tx_packet_data *)skb->cb; 1486 pkt_data = (struct ieee80211_tx_packet_data *)skb->cb;
1488 memset(pkt_data, 0, sizeof(struct ieee80211_tx_packet_data)); 1487 memset(pkt_data, 0, sizeof(struct ieee80211_tx_packet_data));
1489 pkt_data->ifindex = dev->ifindex; 1488 pkt_data->ifindex = dev->ifindex;
1490 pkt_data->mgmt_iface = (sdata->type == IEEE80211_IF_TYPE_MGMT); 1489 if (sdata->type == IEEE80211_IF_TYPE_MGMT)
1491 pkt_data->do_not_encrypt = no_encrypt; 1490 pkt_data->flags |= IEEE80211_TXPD_MGMT_IFACE;
1492 1491
1493 skb->dev = local->mdev; 1492 skb->dev = local->mdev;
1494 sdata->stats.tx_packets++; 1493 sdata->stats.tx_packets++;
@@ -1546,7 +1545,8 @@ int ieee80211_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev)
1546 pkt_data = (struct ieee80211_tx_packet_data *) skb->cb; 1545 pkt_data = (struct ieee80211_tx_packet_data *) skb->cb;
1547 memset(pkt_data, 0, sizeof(struct ieee80211_tx_packet_data)); 1546 memset(pkt_data, 0, sizeof(struct ieee80211_tx_packet_data));
1548 pkt_data->ifindex = sdata->dev->ifindex; 1547 pkt_data->ifindex = sdata->dev->ifindex;
1549 pkt_data->mgmt_iface = (sdata->type == IEEE80211_IF_TYPE_MGMT); 1548 if (sdata->type == IEEE80211_IF_TYPE_MGMT)
1549 pkt_data->flags |= IEEE80211_TXPD_MGMT_IFACE;
1550 1550
1551 skb->priority = 20; /* use hardcoded priority for mgmt TX queue */ 1551 skb->priority = 20; /* use hardcoded priority for mgmt TX queue */
1552 skb->dev = sdata->local->mdev; 1552 skb->dev = sdata->local->mdev;
@@ -1556,12 +1556,13 @@ int ieee80211_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev)
1556 * to request TX callback for hostapd. BIT(1) is checked. 1556 * to request TX callback for hostapd. BIT(1) is checked.
1557 */ 1557 */
1558 if ((fc & BIT(1)) == BIT(1)) { 1558 if ((fc & BIT(1)) == BIT(1)) {
1559 pkt_data->req_tx_status = 1; 1559 pkt_data->flags |= IEEE80211_TXPD_REQ_TX_STATUS;
1560 fc &= ~BIT(1); 1560 fc &= ~BIT(1);
1561 hdr->frame_control = cpu_to_le16(fc); 1561 hdr->frame_control = cpu_to_le16(fc);
1562 } 1562 }
1563 1563
1564 pkt_data->do_not_encrypt = !(fc & IEEE80211_FCTL_PROTECTED); 1564 if (!(fc & IEEE80211_FCTL_PROTECTED))
1565 pkt_data->flags |= IEEE80211_TXPD_DO_NOT_ENCRYPT;
1565 1566
1566 sdata->stats.tx_packets++; 1567 sdata->stats.tx_packets++;
1567 sdata->stats.tx_bytes += skb->len; 1568 sdata->stats.tx_bytes += skb->len;
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index 0f11ccd30a36..d303229249e7 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -108,7 +108,7 @@ static inline int classify80211(struct sk_buff *skb, struct Qdisc *qd)
108 return IEEE80211_TX_QUEUE_DATA0; 108 return IEEE80211_TX_QUEUE_DATA0;
109 } 109 }
110 110
111 if (unlikely(pkt_data->mgmt_iface)) { 111 if (unlikely(pkt_data->flags & IEEE80211_TXPD_MGMT_IFACE)) {
112 /* Data frames from hostapd (mainly, EAPOL) use AC_VO 112 /* Data frames from hostapd (mainly, EAPOL) use AC_VO
113 * and they will include QoS control fields if 113 * and they will include QoS control fields if
114 * the target STA is using WME. */ 114 * the target STA is using WME. */
@@ -153,7 +153,7 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
153 struct Qdisc *qdisc; 153 struct Qdisc *qdisc;
154 int err, queue; 154 int err, queue;
155 155
156 if (pkt_data->requeue) { 156 if (pkt_data->flags & IEEE80211_TXPD_REQUEUE) {
157 skb_queue_tail(&q->requeued[pkt_data->queue], skb); 157 skb_queue_tail(&q->requeued[pkt_data->queue], skb);
158 qd->q.qlen++; 158 qd->q.qlen++;
159 return 0; 159 return 0;