Commit 35f20c14 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: use common skb queue

IBSS, managed and mesh modes all have an
skb queue, and in the future we want to
also use it in other modes, so make them
all use a common skb queue already.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2a419056
...@@ -779,7 +779,7 @@ static void ieee80211_ibss_work(struct work_struct *work) ...@@ -779,7 +779,7 @@ static void ieee80211_ibss_work(struct work_struct *work)
return; return;
ifibss = &sdata->u.ibss; ifibss = &sdata->u.ibss;
while ((skb = skb_dequeue(&ifibss->skb_queue))) while ((skb = skb_dequeue(&sdata->skb_queue)))
ieee80211_ibss_rx_queued_mgmt(sdata, skb); ieee80211_ibss_rx_queued_mgmt(sdata, skb);
if (!test_and_clear_bit(IEEE80211_IBSS_REQ_RUN, &ifibss->request)) if (!test_and_clear_bit(IEEE80211_IBSS_REQ_RUN, &ifibss->request))
...@@ -850,7 +850,6 @@ void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata) ...@@ -850,7 +850,6 @@ void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata)
INIT_WORK(&ifibss->work, ieee80211_ibss_work); INIT_WORK(&ifibss->work, ieee80211_ibss_work);
setup_timer(&ifibss->timer, ieee80211_ibss_timer, setup_timer(&ifibss->timer, ieee80211_ibss_timer,
(unsigned long) sdata); (unsigned long) sdata);
skb_queue_head_init(&ifibss->skb_queue);
} }
/* scan finished notification */ /* scan finished notification */
...@@ -890,7 +889,7 @@ ieee80211_ibss_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) ...@@ -890,7 +889,7 @@ ieee80211_ibss_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
case IEEE80211_STYPE_BEACON: case IEEE80211_STYPE_BEACON:
case IEEE80211_STYPE_PROBE_REQ: case IEEE80211_STYPE_PROBE_REQ:
case IEEE80211_STYPE_AUTH: case IEEE80211_STYPE_AUTH:
skb_queue_tail(&sdata->u.ibss.skb_queue, skb); skb_queue_tail(&sdata->skb_queue, skb);
ieee80211_queue_work(&local->hw, &sdata->u.ibss.work); ieee80211_queue_work(&local->hw, &sdata->u.ibss.work);
return RX_QUEUED; return RX_QUEUED;
} }
...@@ -983,7 +982,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata) ...@@ -983,7 +982,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
synchronize_rcu(); synchronize_rcu();
kfree_skb(skb); kfree_skb(skb);
skb_queue_purge(&sdata->u.ibss.skb_queue); skb_queue_purge(&sdata->skb_queue);
memset(sdata->u.ibss.bssid, 0, ETH_ALEN); memset(sdata->u.ibss.bssid, 0, ETH_ALEN);
sdata->u.ibss.ssid_len = 0; sdata->u.ibss.ssid_len = 0;
......
...@@ -340,8 +340,6 @@ struct ieee80211_if_managed { ...@@ -340,8 +340,6 @@ struct ieee80211_if_managed {
u16 aid; u16 aid;
struct sk_buff_head skb_queue;
unsigned long timers_running; /* used for quiesce/restart */ unsigned long timers_running; /* used for quiesce/restart */
bool powersave; /* powersave requested for this iface */ bool powersave; /* powersave requested for this iface */
enum ieee80211_smps_mode req_smps, /* requested smps mode */ enum ieee80211_smps_mode req_smps, /* requested smps mode */
...@@ -388,8 +386,6 @@ struct ieee80211_if_ibss { ...@@ -388,8 +386,6 @@ struct ieee80211_if_ibss {
struct timer_list timer; struct timer_list timer;
struct work_struct work; struct work_struct work;
struct sk_buff_head skb_queue;
unsigned long request; unsigned long request;
unsigned long last_scan_completed; unsigned long last_scan_completed;
...@@ -420,7 +416,6 @@ struct ieee80211_if_mesh { ...@@ -420,7 +416,6 @@ struct ieee80211_if_mesh {
struct timer_list housekeeping_timer; struct timer_list housekeeping_timer;
struct timer_list mesh_path_timer; struct timer_list mesh_path_timer;
struct timer_list mesh_path_root_timer; struct timer_list mesh_path_root_timer;
struct sk_buff_head skb_queue;
unsigned long timers_running; unsigned long timers_running;
...@@ -517,6 +512,8 @@ struct ieee80211_sub_if_data { ...@@ -517,6 +512,8 @@ struct ieee80211_sub_if_data {
u16 sequence_number; u16 sequence_number;
struct sk_buff_head skb_queue;
/* /*
* AP this belongs to: self in AP mode and * AP this belongs to: self in AP mode and
* corresponding AP in VLAN mode, NULL for * corresponding AP in VLAN mode, NULL for
......
...@@ -465,21 +465,11 @@ static int ieee80211_stop(struct net_device *dev) ...@@ -465,21 +465,11 @@ static int ieee80211_stop(struct net_device *dev)
cancel_work_sync(&sdata->u.mgd.monitor_work); cancel_work_sync(&sdata->u.mgd.monitor_work);
cancel_work_sync(&sdata->u.mgd.beacon_connection_loss_work); cancel_work_sync(&sdata->u.mgd.beacon_connection_loss_work);
/*
* When we get here, the interface is marked down.
* Call synchronize_rcu() to wait for the RX path
* should it be using the interface and enqueuing
* frames at this very time on another CPU.
*/
synchronize_rcu();
skb_queue_purge(&sdata->u.mgd.skb_queue);
/* fall through */ /* fall through */
case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_ADHOC:
if (sdata->vif.type == NL80211_IFTYPE_ADHOC) { if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
del_timer_sync(&sdata->u.ibss.timer); del_timer_sync(&sdata->u.ibss.timer);
cancel_work_sync(&sdata->u.ibss.work); cancel_work_sync(&sdata->u.ibss.work);
synchronize_rcu();
skb_queue_purge(&sdata->u.ibss.skb_queue);
} }
/* fall through */ /* fall through */
case NL80211_IFTYPE_MESH_POINT: case NL80211_IFTYPE_MESH_POINT:
...@@ -495,6 +485,15 @@ static int ieee80211_stop(struct net_device *dev) ...@@ -495,6 +485,15 @@ static int ieee80211_stop(struct net_device *dev)
} }
/* fall through */ /* fall through */
default: default:
/*
* When we get here, the interface is marked down.
* Call synchronize_rcu() to wait for the RX path
* should it be using the interface and enqueuing
* frames at this very time on another CPU.
*/
synchronize_rcu();
skb_queue_purge(&sdata->skb_queue);
if (local->scan_sdata == sdata) if (local->scan_sdata == sdata)
ieee80211_scan_cancel(local); ieee80211_scan_cancel(local);
...@@ -721,6 +720,8 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, ...@@ -721,6 +720,8 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
/* only monitor differs */ /* only monitor differs */
sdata->dev->type = ARPHRD_ETHER; sdata->dev->type = ARPHRD_ETHER;
skb_queue_head_init(&sdata->skb_queue);
switch (type) { switch (type) {
case NL80211_IFTYPE_AP: case NL80211_IFTYPE_AP:
skb_queue_head_init(&sdata->u.ap.ps_bc_buf); skb_queue_head_init(&sdata->u.ap.ps_bc_buf);
......
...@@ -537,15 +537,6 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata) ...@@ -537,15 +537,6 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
* it no longer is. * it no longer is.
*/ */
cancel_work_sync(&sdata->u.mesh.work); cancel_work_sync(&sdata->u.mesh.work);
/*
* When we get here, the interface is marked down.
* Call synchronize_rcu() to wait for the RX path
* should it be using the interface and enqueuing
* frames at this very time on another CPU.
*/
rcu_barrier(); /* Wait for RX path and call_rcu()'s */
skb_queue_purge(&sdata->u.mesh.skb_queue);
} }
static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
...@@ -650,7 +641,7 @@ static void ieee80211_mesh_work(struct work_struct *work) ...@@ -650,7 +641,7 @@ static void ieee80211_mesh_work(struct work_struct *work)
if (local->scanning) if (local->scanning)
return; return;
while ((skb = skb_dequeue(&ifmsh->skb_queue))) while ((skb = skb_dequeue(&sdata->skb_queue)))
ieee80211_mesh_rx_queued_mgmt(sdata, skb); ieee80211_mesh_rx_queued_mgmt(sdata, skb);
if (ifmsh->preq_queue_len && if (ifmsh->preq_queue_len &&
...@@ -690,7 +681,6 @@ void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata) ...@@ -690,7 +681,6 @@ void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
setup_timer(&ifmsh->housekeeping_timer, setup_timer(&ifmsh->housekeeping_timer,
ieee80211_mesh_housekeeping_timer, ieee80211_mesh_housekeeping_timer,
(unsigned long) sdata); (unsigned long) sdata);
skb_queue_head_init(&sdata->u.mesh.skb_queue);
ifmsh->mshcfg.dot11MeshRetryTimeout = MESH_RET_T; ifmsh->mshcfg.dot11MeshRetryTimeout = MESH_RET_T;
ifmsh->mshcfg.dot11MeshConfirmTimeout = MESH_CONF_T; ifmsh->mshcfg.dot11MeshConfirmTimeout = MESH_CONF_T;
...@@ -750,7 +740,7 @@ ieee80211_mesh_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) ...@@ -750,7 +740,7 @@ ieee80211_mesh_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
case IEEE80211_STYPE_ACTION: case IEEE80211_STYPE_ACTION:
case IEEE80211_STYPE_PROBE_RESP: case IEEE80211_STYPE_PROBE_RESP:
case IEEE80211_STYPE_BEACON: case IEEE80211_STYPE_BEACON:
skb_queue_tail(&ifmsh->skb_queue, skb); skb_queue_tail(&sdata->skb_queue, skb);
ieee80211_queue_work(&local->hw, &ifmsh->work); ieee80211_queue_work(&local->hw, &ifmsh->work);
return RX_QUEUED; return RX_QUEUED;
} }
......
...@@ -1652,7 +1652,7 @@ ieee80211_rx_result ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata, ...@@ -1652,7 +1652,7 @@ ieee80211_rx_result ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata,
case IEEE80211_STYPE_DEAUTH: case IEEE80211_STYPE_DEAUTH:
case IEEE80211_STYPE_DISASSOC: case IEEE80211_STYPE_DISASSOC:
case IEEE80211_STYPE_ACTION: case IEEE80211_STYPE_ACTION:
skb_queue_tail(&sdata->u.mgd.skb_queue, skb); skb_queue_tail(&sdata->skb_queue, skb);
ieee80211_queue_work(&local->hw, &sdata->u.mgd.work); ieee80211_queue_work(&local->hw, &sdata->u.mgd.work);
return RX_QUEUED; return RX_QUEUED;
} }
...@@ -1810,7 +1810,7 @@ static void ieee80211_sta_work(struct work_struct *work) ...@@ -1810,7 +1810,7 @@ static void ieee80211_sta_work(struct work_struct *work)
ifmgd = &sdata->u.mgd; ifmgd = &sdata->u.mgd;
/* first process frames to avoid timing out while a frame is pending */ /* first process frames to avoid timing out while a frame is pending */
while ((skb = skb_dequeue(&ifmgd->skb_queue))) while ((skb = skb_dequeue(&sdata->skb_queue)))
ieee80211_sta_rx_queued_mgmt(sdata, skb); ieee80211_sta_rx_queued_mgmt(sdata, skb);
/* then process the rest of the work */ /* then process the rest of the work */
...@@ -1967,7 +1967,6 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata) ...@@ -1967,7 +1967,6 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
(unsigned long) sdata); (unsigned long) sdata);
setup_timer(&ifmgd->chswitch_timer, ieee80211_chswitch_timer, setup_timer(&ifmgd->chswitch_timer, ieee80211_chswitch_timer,
(unsigned long) sdata); (unsigned long) sdata);
skb_queue_head_init(&ifmgd->skb_queue);
ifmgd->flags = 0; ifmgd->flags = 0;
......
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