提交 c1475ca9 编写于 作者: J Johannes Berg 提交者: John W. Linville

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: NJohannes Berg <johannes.berg@intel.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 344eec67
...@@ -502,11 +502,10 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, ...@@ -502,11 +502,10 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif,
ra_tid = (struct ieee80211_ra_tid *) &skb->cb; ra_tid = (struct ieee80211_ra_tid *) &skb->cb;
memcpy(&ra_tid->ra, ra, ETH_ALEN); memcpy(&ra_tid->ra, ra, ETH_ALEN);
ra_tid->tid = tid; ra_tid->tid = tid;
ra_tid->vif = vif;
skb->pkt_type = IEEE80211_ADDBA_MSG; skb->pkt_type = IEEE80211_SDATA_QUEUE_AGG_START;
skb_queue_tail(&local->skb_queue, skb); skb_queue_tail(&sdata->skb_queue, skb);
tasklet_schedule(&local->tasklet); ieee80211_queue_work(&local->hw, &sdata->work);
} }
EXPORT_SYMBOL(ieee80211_start_tx_ba_cb_irqsafe); EXPORT_SYMBOL(ieee80211_start_tx_ba_cb_irqsafe);
...@@ -637,11 +636,10 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, ...@@ -637,11 +636,10 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif,
ra_tid = (struct ieee80211_ra_tid *) &skb->cb; ra_tid = (struct ieee80211_ra_tid *) &skb->cb;
memcpy(&ra_tid->ra, ra, ETH_ALEN); memcpy(&ra_tid->ra, ra, ETH_ALEN);
ra_tid->tid = tid; ra_tid->tid = tid;
ra_tid->vif = vif;
skb->pkt_type = IEEE80211_DELBA_MSG; skb->pkt_type = IEEE80211_SDATA_QUEUE_AGG_STOP;
skb_queue_tail(&local->skb_queue, skb); skb_queue_tail(&sdata->skb_queue, skb);
tasklet_schedule(&local->tasklet); ieee80211_queue_work(&local->hw, &sdata->work);
} }
EXPORT_SYMBOL(ieee80211_stop_tx_ba_cb_irqsafe); EXPORT_SYMBOL(ieee80211_stop_tx_ba_cb_irqsafe);
......
...@@ -564,11 +564,15 @@ ieee80211_sdata_set_mesh_id(struct ieee80211_sub_if_data *sdata, ...@@ -564,11 +564,15 @@ ieee80211_sdata_set_mesh_id(struct ieee80211_sub_if_data *sdata,
#endif #endif
} }
enum sdata_queue_type {
IEEE80211_SDATA_QUEUE_TYPE_FRAME = 0,
IEEE80211_SDATA_QUEUE_AGG_START = 1,
IEEE80211_SDATA_QUEUE_AGG_STOP = 2,
};
enum { enum {
IEEE80211_RX_MSG = 1, IEEE80211_RX_MSG = 1,
IEEE80211_TX_STATUS_MSG = 2, IEEE80211_TX_STATUS_MSG = 2,
IEEE80211_DELBA_MSG = 3,
IEEE80211_ADDBA_MSG = 4,
}; };
enum queue_stop_reason { enum queue_stop_reason {
...@@ -870,9 +874,8 @@ IEEE80211_DEV_TO_SUB_IF(struct net_device *dev) ...@@ -870,9 +874,8 @@ IEEE80211_DEV_TO_SUB_IF(struct net_device *dev)
return netdev_priv(dev); return netdev_priv(dev);
} }
/* this struct represents 802.11n's RA/TID combination along with our vif */ /* this struct represents 802.11n's RA/TID combination */
struct ieee80211_ra_tid { struct ieee80211_ra_tid {
struct ieee80211_vif *vif;
u8 ra[ETH_ALEN]; u8 ra[ETH_ALEN];
u16 tid; u16 tid;
}; };
......
...@@ -482,7 +482,7 @@ static int ieee80211_stop(struct net_device *dev) ...@@ -482,7 +482,7 @@ static int ieee80211_stop(struct net_device *dev)
} }
/* fall through */ /* fall through */
default: default:
cancel_work_sync(&sdata->work); flush_work(&sdata->work);
/* /*
* When we get here, the interface is marked down. * When we get here, the interface is marked down.
* Call synchronize_rcu() to wait for the RX path * Call synchronize_rcu() to wait for the RX path
...@@ -708,6 +708,7 @@ static void ieee80211_iface_work(struct work_struct *work) ...@@ -708,6 +708,7 @@ static void ieee80211_iface_work(struct work_struct *work)
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
struct sk_buff *skb; struct sk_buff *skb;
struct sta_info *sta; struct sta_info *sta;
struct ieee80211_ra_tid *ra_tid;
if (!ieee80211_sdata_running(sdata)) if (!ieee80211_sdata_running(sdata))
return; return;
...@@ -727,8 +728,16 @@ static void ieee80211_iface_work(struct work_struct *work) ...@@ -727,8 +728,16 @@ static void ieee80211_iface_work(struct work_struct *work)
while ((skb = skb_dequeue(&sdata->skb_queue))) { while ((skb = skb_dequeue(&sdata->skb_queue))) {
struct ieee80211_mgmt *mgmt = (void *)skb->data; struct ieee80211_mgmt *mgmt = (void *)skb->data;
if (ieee80211_is_action(mgmt->frame_control) && if (skb->pkt_type == IEEE80211_SDATA_QUEUE_AGG_START) {
mgmt->u.action.category == WLAN_CATEGORY_BACK) { ra_tid = (void *)&skb->cb;
ieee80211_start_tx_ba_cb(&sdata->vif, ra_tid->ra,
ra_tid->tid);
} else if (skb->pkt_type == IEEE80211_SDATA_QUEUE_AGG_STOP) {
ra_tid = (void *)&skb->cb;
ieee80211_stop_tx_ba_cb(&sdata->vif, ra_tid->ra,
ra_tid->tid);
} else if (ieee80211_is_action(mgmt->frame_control) &&
mgmt->u.action.category == WLAN_CATEGORY_BACK) {
int len = skb->len; int len = skb->len;
rcu_read_lock(); rcu_read_lock();
......
...@@ -259,7 +259,6 @@ static void ieee80211_tasklet_handler(unsigned long data) ...@@ -259,7 +259,6 @@ static void ieee80211_tasklet_handler(unsigned long data)
{ {
struct ieee80211_local *local = (struct ieee80211_local *) data; struct ieee80211_local *local = (struct ieee80211_local *) data;
struct sk_buff *skb; struct sk_buff *skb;
struct ieee80211_ra_tid *ra_tid;
while ((skb = skb_dequeue(&local->skb_queue)) || while ((skb = skb_dequeue(&local->skb_queue)) ||
(skb = skb_dequeue(&local->skb_queue_unreliable))) { (skb = skb_dequeue(&local->skb_queue_unreliable))) {
...@@ -274,18 +273,6 @@ static void ieee80211_tasklet_handler(unsigned long data) ...@@ -274,18 +273,6 @@ static void ieee80211_tasklet_handler(unsigned long data)
skb->pkt_type = 0; skb->pkt_type = 0;
ieee80211_tx_status(local_to_hw(local), skb); ieee80211_tx_status(local_to_hw(local), skb);
break; break;
case IEEE80211_DELBA_MSG:
ra_tid = (struct ieee80211_ra_tid *) &skb->cb;
ieee80211_stop_tx_ba_cb(ra_tid->vif, ra_tid->ra,
ra_tid->tid);
dev_kfree_skb(skb);
break;
case IEEE80211_ADDBA_MSG:
ra_tid = (struct ieee80211_ra_tid *) &skb->cb;
ieee80211_start_tx_ba_cb(ra_tid->vif, ra_tid->ra,
ra_tid->tid);
dev_kfree_skb(skb);
break ;
default: default:
WARN(1, "mac80211: Packet is of unknown type %d\n", WARN(1, "mac80211: Packet is of unknown type %d\n",
skb->pkt_type); skb->pkt_type);
......
...@@ -741,6 +741,7 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx, ...@@ -741,6 +741,7 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx,
sc = le16_to_cpu(hdr->seq_ctrl); sc = le16_to_cpu(hdr->seq_ctrl);
if (sc & IEEE80211_SCTL_FRAG) { if (sc & IEEE80211_SCTL_FRAG) {
spin_unlock(&sta->lock); spin_unlock(&sta->lock);
skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
skb_queue_tail(&rx->sdata->skb_queue, skb); skb_queue_tail(&rx->sdata->skb_queue, skb);
ieee80211_queue_work(&local->hw, &rx->sdata->work); ieee80211_queue_work(&local->hw, &rx->sdata->work);
return; return;
...@@ -1969,6 +1970,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) ...@@ -1969,6 +1970,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
goto invalid; goto invalid;
} }
rx->skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
skb_queue_tail(&sdata->skb_queue, rx->skb); skb_queue_tail(&sdata->skb_queue, rx->skb);
ieee80211_queue_work(&local->hw, &sdata->work); ieee80211_queue_work(&local->hw, &sdata->work);
return RX_QUEUED; return RX_QUEUED;
...@@ -2001,6 +2003,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) ...@@ -2001,6 +2003,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
if (memcmp(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN)) if (memcmp(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN))
break; break;
rx->skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
skb_queue_tail(&sdata->skb_queue, rx->skb); skb_queue_tail(&sdata->skb_queue, rx->skb);
ieee80211_queue_work(&local->hw, &sdata->work); ieee80211_queue_work(&local->hw, &sdata->work);
return RX_QUEUED; return RX_QUEUED;
...@@ -2023,6 +2026,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) ...@@ -2023,6 +2026,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
case WLAN_CATEGORY_MESH_PATH_SEL: case WLAN_CATEGORY_MESH_PATH_SEL:
if (!ieee80211_vif_is_mesh(&sdata->vif)) if (!ieee80211_vif_is_mesh(&sdata->vif))
break; break;
rx->skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
skb_queue_tail(&sdata->skb_queue, rx->skb); skb_queue_tail(&sdata->skb_queue, rx->skb);
ieee80211_queue_work(&local->hw, &sdata->work); ieee80211_queue_work(&local->hw, &sdata->work);
return RX_QUEUED; return RX_QUEUED;
...@@ -2128,6 +2132,7 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx) ...@@ -2128,6 +2132,7 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx)
} }
/* queue up frame and kick off work to process it */ /* queue up frame and kick off work to process it */
rx->skb->pkt_type = IEEE80211_SDATA_QUEUE_TYPE_FRAME;
skb_queue_tail(&sdata->skb_queue, rx->skb); skb_queue_tail(&sdata->skb_queue, rx->skb);
ieee80211_queue_work(&rx->local->hw, &sdata->work); ieee80211_queue_work(&rx->local->hw, &sdata->work);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册