diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-06-17 11:43:56 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-24 15:05:30 -0400 |
commit | 3b8d81e020f77c9da8b85b0685c8cd2ca7c7b150 (patch) | |
tree | a19fcddbf28fecdbd13ad009fe07b8afc5e95c90 /net/mac80211/util.c | |
parent | c4029083e2acb82229c43b791c07afb089d972ff (diff) |
mac80211: remove master netdev
With the internal 'pending' queue system in place, we can simply
put packets there instead of pushing them off to the master dev,
getting rid of the master interface completely.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r-- | net/mac80211/util.c | 52 |
1 files changed, 13 insertions, 39 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index dbf66b52d38c..7fc55846d601 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -275,16 +275,12 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue, | |||
275 | 275 | ||
276 | __clear_bit(reason, &local->queue_stop_reasons[queue]); | 276 | __clear_bit(reason, &local->queue_stop_reasons[queue]); |
277 | 277 | ||
278 | if (!skb_queue_empty(&local->pending[queue]) && | ||
279 | local->queue_stop_reasons[queue] == | ||
280 | BIT(IEEE80211_QUEUE_STOP_REASON_PENDING)) | ||
281 | tasklet_schedule(&local->tx_pending_tasklet); | ||
282 | |||
283 | if (local->queue_stop_reasons[queue] != 0) | 278 | if (local->queue_stop_reasons[queue] != 0) |
284 | /* someone still has this queue stopped */ | 279 | /* someone still has this queue stopped */ |
285 | return; | 280 | return; |
286 | 281 | ||
287 | netif_wake_subqueue(local->mdev, queue); | 282 | if (!skb_queue_empty(&local->pending[queue])) |
283 | tasklet_schedule(&local->tx_pending_tasklet); | ||
288 | } | 284 | } |
289 | 285 | ||
290 | void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue, | 286 | void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue, |
@@ -313,14 +309,6 @@ static void __ieee80211_stop_queue(struct ieee80211_hw *hw, int queue, | |||
313 | if (WARN_ON(queue >= hw->queues)) | 309 | if (WARN_ON(queue >= hw->queues)) |
314 | return; | 310 | return; |
315 | 311 | ||
316 | /* | ||
317 | * Only stop if it was previously running, this is necessary | ||
318 | * for correct pending packets handling because there we may | ||
319 | * start (but not wake) the queue and rely on that. | ||
320 | */ | ||
321 | if (!local->queue_stop_reasons[queue]) | ||
322 | netif_stop_subqueue(local->mdev, queue); | ||
323 | |||
324 | __set_bit(reason, &local->queue_stop_reasons[queue]); | 312 | __set_bit(reason, &local->queue_stop_reasons[queue]); |
325 | } | 313 | } |
326 | 314 | ||
@@ -351,8 +339,7 @@ void ieee80211_add_pending_skb(struct ieee80211_local *local, | |||
351 | 339 | ||
352 | spin_lock_irqsave(&local->queue_stop_reason_lock, flags); | 340 | spin_lock_irqsave(&local->queue_stop_reason_lock, flags); |
353 | __ieee80211_stop_queue(hw, queue, IEEE80211_QUEUE_STOP_REASON_SKB_ADD); | 341 | __ieee80211_stop_queue(hw, queue, IEEE80211_QUEUE_STOP_REASON_SKB_ADD); |
354 | __ieee80211_stop_queue(hw, queue, IEEE80211_QUEUE_STOP_REASON_PENDING); | 342 | __skb_queue_tail(&local->pending[queue], skb); |
355 | skb_queue_tail(&local->pending[queue], skb); | ||
356 | __ieee80211_wake_queue(hw, queue, IEEE80211_QUEUE_STOP_REASON_SKB_ADD); | 343 | __ieee80211_wake_queue(hw, queue, IEEE80211_QUEUE_STOP_REASON_SKB_ADD); |
357 | spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); | 344 | spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); |
358 | } | 345 | } |
@@ -373,16 +360,12 @@ int ieee80211_add_pending_skbs(struct ieee80211_local *local, | |||
373 | while ((skb = skb_dequeue(skbs))) { | 360 | while ((skb = skb_dequeue(skbs))) { |
374 | ret++; | 361 | ret++; |
375 | queue = skb_get_queue_mapping(skb); | 362 | queue = skb_get_queue_mapping(skb); |
376 | skb_queue_tail(&local->pending[queue], skb); | 363 | __skb_queue_tail(&local->pending[queue], skb); |
377 | } | 364 | } |
378 | 365 | ||
379 | for (i = 0; i < hw->queues; i++) { | 366 | for (i = 0; i < hw->queues; i++) |
380 | if (ret) | ||
381 | __ieee80211_stop_queue(hw, i, | ||
382 | IEEE80211_QUEUE_STOP_REASON_PENDING); | ||
383 | __ieee80211_wake_queue(hw, i, | 367 | __ieee80211_wake_queue(hw, i, |
384 | IEEE80211_QUEUE_STOP_REASON_SKB_ADD); | 368 | IEEE80211_QUEUE_STOP_REASON_SKB_ADD); |
385 | } | ||
386 | spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); | 369 | spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); |
387 | 370 | ||
388 | return ret; | 371 | return ret; |
@@ -413,11 +396,16 @@ EXPORT_SYMBOL(ieee80211_stop_queues); | |||
413 | int ieee80211_queue_stopped(struct ieee80211_hw *hw, int queue) | 396 | int ieee80211_queue_stopped(struct ieee80211_hw *hw, int queue) |
414 | { | 397 | { |
415 | struct ieee80211_local *local = hw_to_local(hw); | 398 | struct ieee80211_local *local = hw_to_local(hw); |
399 | unsigned long flags; | ||
400 | int ret; | ||
416 | 401 | ||
417 | if (WARN_ON(queue >= hw->queues)) | 402 | if (WARN_ON(queue >= hw->queues)) |
418 | return true; | 403 | return true; |
419 | 404 | ||
420 | return __netif_subqueue_stopped(local->mdev, queue); | 405 | spin_lock_irqsave(&local->queue_stop_reason_lock, flags); |
406 | ret = !!local->queue_stop_reasons[queue]; | ||
407 | spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); | ||
408 | return ret; | ||
421 | } | 409 | } |
422 | EXPORT_SYMBOL(ieee80211_queue_stopped); | 410 | EXPORT_SYMBOL(ieee80211_queue_stopped); |
423 | 411 | ||
@@ -761,20 +749,6 @@ void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, | |||
761 | ieee80211_set_wmm_default(sdata); | 749 | ieee80211_set_wmm_default(sdata); |
762 | } | 750 | } |
763 | 751 | ||
764 | void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, | ||
765 | int encrypt) | ||
766 | { | ||
767 | skb->dev = sdata->local->mdev; | ||
768 | skb_set_mac_header(skb, 0); | ||
769 | skb_set_network_header(skb, 0); | ||
770 | skb_set_transport_header(skb, 0); | ||
771 | |||
772 | skb->iif = sdata->dev->ifindex; | ||
773 | skb->do_not_encrypt = !encrypt; | ||
774 | |||
775 | dev_queue_xmit(skb); | ||
776 | } | ||
777 | |||
778 | u32 ieee80211_mandatory_rates(struct ieee80211_local *local, | 752 | u32 ieee80211_mandatory_rates(struct ieee80211_local *local, |
779 | enum ieee80211_band band) | 753 | enum ieee80211_band band) |
780 | { | 754 | { |
@@ -1049,9 +1023,9 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
1049 | /* reconfigure hardware */ | 1023 | /* reconfigure hardware */ |
1050 | ieee80211_hw_config(local, ~0); | 1024 | ieee80211_hw_config(local, ~0); |
1051 | 1025 | ||
1052 | netif_addr_lock_bh(local->mdev); | 1026 | spin_lock_bh(&local->filter_lock); |
1053 | ieee80211_configure_filter(local); | 1027 | ieee80211_configure_filter(local); |
1054 | netif_addr_unlock_bh(local->mdev); | 1028 | spin_unlock_bh(&local->filter_lock); |
1055 | 1029 | ||
1056 | /* Finally also reconfigure all the BSS information */ | 1030 | /* Finally also reconfigure all the BSS information */ |
1057 | list_for_each_entry(sdata, &local->interfaces, list) { | 1031 | list_for_each_entry(sdata, &local->interfaces, list) { |