aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-06-10 04:21:37 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-14 15:39:27 -0400
commitc1475ca99edcc7216ddc45838ab2c3281c14ba22 (patch)
tree3f1a5fd9c2fce428382cf49e3140c281a49e006b /net
parent344eec67c7b8557234e149d254bca2ae9614d61e (diff)
mac80211: move aggregation callback processing
This moves the aggregation callback processing to the per-sdata skb queue and a work function rather than the tasklet. Unfortunately, this means that it extends the pkt_type hack to that skb queue. However, it will enable making ampdu_action API changes gradually, my current plan is to get rid of this again by forcing drivers to only return from ampdu_action() when everything is done, thus removing the callbacks completely. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/agg-tx.c14
-rw-r--r--net/mac80211/ieee80211_i.h11
-rw-r--r--net/mac80211/iface.c15
-rw-r--r--net/mac80211/main.c13
-rw-r--r--net/mac80211/rx.c5
5 files changed, 30 insertions, 28 deletions
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index 9b9f21be0ff7..c7b7ac40316a 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -502,11 +502,10 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif,
502 ra_tid = (struct ieee80211_ra_tid *) &skb->cb; 502 ra_tid = (struct ieee80211_ra_tid *) &skb->cb;
503 memcpy(&ra_tid->ra, ra, ETH_ALEN); 503 memcpy(&ra_tid->ra, ra, ETH_ALEN);
504 ra_tid->tid = tid; 504 ra_tid->tid = tid;
505 ra_tid->vif = vif;
506 505
507 skb->pkt_type = IEEE80211_ADDBA_MSG; 506 skb->pkt_type = IEEE80211_SDATA_QUEUE_AGG_START;
508 skb_queue_tail(&local->skb_queue, skb); 507 skb_queue_tail(&sdata->skb_queue, skb);
509 tasklet_schedule(&local->tasklet); 508 ieee80211_queue_work(&local->hw, &sdata->work);
510} 509}
511EXPORT_SYMBOL(ieee80211_start_tx_ba_cb_irqsafe); 510EXPORT_SYMBOL(ieee80211_start_tx_ba_cb_irqsafe);
512 511
@@ -637,11 +636,10 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif,
637 ra_tid = (struct ieee80211_ra_tid *) &skb->cb; 636 ra_tid = (struct ieee80211_ra_tid *) &skb->cb;
638 memcpy(&ra_tid->ra, ra, ETH_ALEN); 637 memcpy(&ra_tid->ra, ra, ETH_ALEN);
639 ra_tid->tid = tid; 638 ra_tid->tid = tid;
640 ra_tid->vif = vif;
641 639
642 skb->pkt_type = IEEE80211_DELBA_MSG; 640 skb->pkt_type = IEEE80211_SDATA_QUEUE_AGG_STOP;
643 skb_queue_tail(&local->skb_queue, skb); 641 skb_queue_tail(&sdata->skb_queue, skb);
644 tasklet_schedule(&local->tasklet); 642 ieee80211_queue_work(&local->hw, &sdata->work);
645} 643}
646EXPORT_SYMBOL(ieee80211_stop_tx_ba_cb_irqsafe); 644EXPORT_SYMBOL(ieee80211_stop_tx_ba_cb_irqsafe);
647 645
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index a3bcaa3239d9..bafe610dcf77 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -564,11 +564,15 @@ ieee80211_sdata_set_mesh_id(struct ieee80211_sub_if_data *sdata,
564#endif 564#endif
565} 565}
566 566
567enum sdata_queue_type {
568 IEEE80211_SDATA_QUEUE_TYPE_FRAME = 0,
569 IEEE80211_SDATA_QUEUE_AGG_START = 1,
570 IEEE80211_SDATA_QUEUE_AGG_STOP = 2,
571};
572
567enum { 573enum {
568 IEEE80211_RX_MSG = 1, 574 IEEE80211_RX_MSG = 1,
569 IEEE80211_TX_STATUS_MSG = 2, 575 IEEE80211_TX_STATUS_MSG = 2,
570 IEEE80211_DELBA_MSG = 3,
571 IEEE80211_ADDBA_MSG = 4,
572}; 576};
573 577
574enum queue_stop_reason { 578enum queue_stop_reason {
@@ -870,9 +874,8 @@ IEEE80211_DEV_TO_SUB_IF(struct net_device *dev)
870 return netdev_priv(dev); 874 return netdev_priv(dev);
871} 875}
872 876
873/* this struct represents 802.11n's RA/TID combination along with our vif */ 877/* this struct represents 802.11n's RA/TID combination */
874struct ieee80211_ra_tid { 878struct ieee80211_ra_tid {
875 struct ieee80211_vif *vif;
876 u8 ra[ETH_ALEN]; 879 u8 ra[ETH_ALEN];
877 u16 tid; 880 u16 tid;
878}; 881};
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 87fc012e4ab3..9f00d3f174e4 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -482,7 +482,7 @@ static int ieee80211_stop(struct net_device *dev)
482 } 482 }
483 /* fall through */ 483 /* fall through */
484 default: 484 default:
485 cancel_work_sync(&sdata->work); 485 flush_work(&sdata->work);
486 /* 486 /*
487 * When we get here, the interface is marked down. 487 * When we get here, the interface is marked down.
488 * Call synchronize_rcu() to wait for the RX path 488 * Call synchronize_rcu() to wait for the RX path
@@ -708,6 +708,7 @@ static void ieee80211_iface_work(struct work_struct *work)
708 struct ieee80211_local *local = sdata->local; 708 struct ieee80211_local *local = sdata->local;
709 struct sk_buff *skb; 709 struct sk_buff *skb;
710 struct sta_info *sta; 710 struct sta_info *sta;
711 struct ieee80211_ra_tid *ra_tid;
711 712
712 if (!ieee80211_sdata_running(sdata)) 713 if (!ieee80211_sdata_running(sdata))
713 return; 714 return;
@@ -727,8 +728,16 @@ static void ieee80211_iface_work(struct work_struct *work)
727 while ((skb = skb_dequeue(&sdata->skb_queue))) { 728 while ((skb = skb_dequeue(&sdata->skb_queue))) {
728 struct ieee80211_mgmt *mgmt = (void *)skb->data; 729 struct ieee80211_mgmt *mgmt = (void *)skb->data;
729 730
730 if (ieee80211_is_action(mgmt->frame_control) && 731 if (skb->pkt_type == IEEE80211_SDATA_QUEUE_AGG_START) {
731 mgmt->u.action.category == WLAN_CATEGORY_BACK) { 732 ra_tid = (void *)&skb->cb;
733 ieee80211_start_tx_ba_cb(&sdata->vif, ra_tid->ra,
734 ra_tid->tid);
735 } else if (skb->pkt_type == IEEE80211_SDATA_QUEUE_AGG_STOP) {
736 ra_tid = (void *)&skb->cb;
737 ieee80211_stop_tx_ba_cb(&sdata->vif, ra_tid->ra,
738 ra_tid->tid);
739 } else if (ieee80211_is_action(mgmt->frame_control) &&
740 mgmt->u.action.category == WLAN_CATEGORY_BACK) {
732 int len = skb->len; 741 int len = skb->len;
733 742
734 rcu_read_lock(); 743 rcu_read_lock();
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 88b671a16a41..a2d10d44641e 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -259,7 +259,6 @@ static void ieee80211_tasklet_handler(unsigned long data)
259{ 259{
260 struct ieee80211_local *local = (struct ieee80211_local *) data; 260 struct ieee80211_local *local = (struct ieee80211_local *) data;
261 struct sk_buff *skb; 261 struct sk_buff *skb;
262 struct ieee80211_ra_tid *ra_tid;
263 262
264 while ((skb = skb_dequeue(&local->skb_queue)) || 263 while ((skb = skb_dequeue(&local->skb_queue)) ||
265 (skb = skb_dequeue(&local->skb_queue_unreliable))) { 264 (skb = skb_dequeue(&local->skb_queue_unreliable))) {
@@ -274,18 +273,6 @@ static void ieee80211_tasklet_handler(unsigned long data)
274 skb->pkt_type = 0; 273 skb->pkt_type = 0;
275 ieee80211_tx_status(local_to_hw(local), skb); 274 ieee80211_tx_status(local_to_hw(local), skb);
276 break; 275 break;
277 case IEEE80211_DELBA_MSG:
278 ra_tid = (struct ieee80211_ra_tid *) &skb->cb;
279 ieee80211_stop_tx_ba_cb(ra_tid->vif, ra_tid->ra,
280 ra_tid->tid);
281 dev_kfree_skb(skb);
282 break;
283 case IEEE80211_ADDBA_MSG:
284 ra_tid = (struct ieee80211_ra_tid *) &skb->cb;
285 ieee80211_start_tx_ba_cb(ra_tid->vif, ra_tid->ra,
286 ra_tid->tid);
287 dev_kfree_skb(skb);
288 break ;
289 default: 276 default:
290 WARN(1, "mac80211: Packet is of unknown type %d\n", 277 WARN(1, "mac80211: Packet is of unknown type %d\n",
291 skb->pkt_type); 278 skb->pkt_type);
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index b716fa2370b3..84f11733b9fe 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -741,6 +741,7 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx,
741 sc = le16_to_cpu(hdr->seq_ctrl); 741 sc = le16_to_cpu(hdr->seq_ctrl);
742 if (sc & IEEE80211_SCTL_FRAG) { 742 if (sc & IEEE80211_SCTL_FRAG) {
743 spin_unlock(&sta->lock); 743 spin_unlock(&sta->lock);
744 skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
744 skb_queue_tail(&rx->sdata->skb_queue, skb); 745 skb_queue_tail(&rx->sdata->skb_queue, skb);
745 ieee80211_queue_work(&local->hw, &rx->sdata->work); 746 ieee80211_queue_work(&local->hw, &rx->sdata->work);
746 return; 747 return;
@@ -1969,6 +1970,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
1969 goto invalid; 1970 goto invalid;
1970 } 1971 }
1971 1972
1973 rx->skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
1972 skb_queue_tail(&sdata->skb_queue, rx->skb); 1974 skb_queue_tail(&sdata->skb_queue, rx->skb);
1973 ieee80211_queue_work(&local->hw, &sdata->work); 1975 ieee80211_queue_work(&local->hw, &sdata->work);
1974 return RX_QUEUED; 1976 return RX_QUEUED;
@@ -2001,6 +2003,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
2001 if (memcmp(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN)) 2003 if (memcmp(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN))
2002 break; 2004 break;
2003 2005
2006 rx->skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
2004 skb_queue_tail(&sdata->skb_queue, rx->skb); 2007 skb_queue_tail(&sdata->skb_queue, rx->skb);
2005 ieee80211_queue_work(&local->hw, &sdata->work); 2008 ieee80211_queue_work(&local->hw, &sdata->work);
2006 return RX_QUEUED; 2009 return RX_QUEUED;
@@ -2023,6 +2026,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
2023 case WLAN_CATEGORY_MESH_PATH_SEL: 2026 case WLAN_CATEGORY_MESH_PATH_SEL:
2024 if (!ieee80211_vif_is_mesh(&sdata->vif)) 2027 if (!ieee80211_vif_is_mesh(&sdata->vif))
2025 break; 2028 break;
2029 rx->skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
2026 skb_queue_tail(&sdata->skb_queue, rx->skb); 2030 skb_queue_tail(&sdata->skb_queue, rx->skb);
2027 ieee80211_queue_work(&local->hw, &sdata->work); 2031 ieee80211_queue_work(&local->hw, &sdata->work);
2028 return RX_QUEUED; 2032 return RX_QUEUED;
@@ -2128,6 +2132,7 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx)
2128 } 2132 }
2129 2133
2130 /* queue up frame and kick off work to process it */ 2134 /* queue up frame and kick off work to process it */
2135 rx->skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
2131 skb_queue_tail(&sdata->skb_queue, rx->skb); 2136 skb_queue_tail(&sdata->skb_queue, rx->skb);
2132 ieee80211_queue_work(&rx->local->hw, &sdata->work); 2137 ieee80211_queue_work(&rx->local->hw, &sdata->work);
2133 2138