aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 798a91b100cc..1ed956c9cb8b 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -390,6 +390,30 @@ static int ieee80211_ifa_changed(struct notifier_block *nb,
390} 390}
391#endif 391#endif
392 392
393static int ieee80211_napi_poll(struct napi_struct *napi, int budget)
394{
395 struct ieee80211_local *local =
396 container_of(napi, struct ieee80211_local, napi);
397
398 return local->ops->napi_poll(&local->hw, budget);
399}
400
401void ieee80211_napi_schedule(struct ieee80211_hw *hw)
402{
403 struct ieee80211_local *local = hw_to_local(hw);
404
405 napi_schedule(&local->napi);
406}
407EXPORT_SYMBOL(ieee80211_napi_schedule);
408
409void ieee80211_napi_complete(struct ieee80211_hw *hw)
410{
411 struct ieee80211_local *local = hw_to_local(hw);
412
413 napi_complete(&local->napi);
414}
415EXPORT_SYMBOL(ieee80211_napi_complete);
416
393struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, 417struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
394 const struct ieee80211_ops *ops) 418 const struct ieee80211_ops *ops)
395{ 419{
@@ -494,6 +518,9 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
494 skb_queue_head_init(&local->skb_queue); 518 skb_queue_head_init(&local->skb_queue);
495 skb_queue_head_init(&local->skb_queue_unreliable); 519 skb_queue_head_init(&local->skb_queue_unreliable);
496 520
521 /* init dummy netdev for use w/ NAPI */
522 init_dummy_netdev(&local->napi_dev);
523
497 return local_to_hw(local); 524 return local_to_hw(local);
498} 525}
499EXPORT_SYMBOL(ieee80211_alloc_hw); 526EXPORT_SYMBOL(ieee80211_alloc_hw);
@@ -683,6 +710,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
683 goto fail_ifa; 710 goto fail_ifa;
684#endif 711#endif
685 712
713 netif_napi_add(&local->napi_dev, &local->napi, ieee80211_napi_poll,
714 local->hw.napi_weight);
715
686 return 0; 716 return 0;
687 717
688#ifdef CONFIG_INET 718#ifdef CONFIG_INET