aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-05-16 18:57:14 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:48:14 -0400
commite2530083609148a7835b54c431f6b8956407c1f6 (patch)
tree8ed43347541444c7a72d2c79f550f69a93cad591 /net/mac80211/main.c
parenteefce91a384a64c7bbf913eb08c4adfb911c3639 (diff)
mac80211: use multi-queue master netdevice
This patch updates mac80211 and drivers to be multi-queue aware and use that instead of the internal queue mapping. Also does a number of cleanups in various pieces of the code that fall out and reduces internal mac80211 state size. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 8f1ff7ef1667..97d4a537ca2f 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1634,12 +1634,32 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1634 if (result < 0) 1634 if (result < 0)
1635 return result; 1635 return result;
1636 1636
1637 /*
1638 * We use the number of queues for feature tests (QoS, HT) internally
1639 * so restrict them appropriately.
1640 */
1641#ifdef CONFIG_MAC80211_QOS
1642 if (hw->queues > IEEE80211_MAX_QUEUES)
1643 hw->queues = IEEE80211_MAX_QUEUES;
1644 if (hw->ampdu_queues > IEEE80211_MAX_AMPDU_QUEUES)
1645 hw->ampdu_queues = IEEE80211_MAX_AMPDU_QUEUES;
1646 if (hw->queues < 4)
1647 hw->ampdu_queues = 0;
1648#else
1649 hw->queues = 1;
1650 hw->ampdu_queues = 0;
1651#endif
1652
1637 /* for now, mdev needs sub_if_data :/ */ 1653 /* for now, mdev needs sub_if_data :/ */
1638 mdev = alloc_netdev(sizeof(struct ieee80211_sub_if_data), 1654 mdev = alloc_netdev_mq(sizeof(struct ieee80211_sub_if_data),
1639 "wmaster%d", ether_setup); 1655 "wmaster%d", ether_setup,
1656 ieee80211_num_queues(hw));
1640 if (!mdev) 1657 if (!mdev)
1641 goto fail_mdev_alloc; 1658 goto fail_mdev_alloc;
1642 1659
1660 if (ieee80211_num_queues(hw) > 1)
1661 mdev->features |= NETIF_F_MULTI_QUEUE;
1662
1643 sdata = IEEE80211_DEV_TO_SUB_IF(mdev); 1663 sdata = IEEE80211_DEV_TO_SUB_IF(mdev);
1644 mdev->ieee80211_ptr = &sdata->wdev; 1664 mdev->ieee80211_ptr = &sdata->wdev;
1645 sdata->wdev.wiphy = local->hw.wiphy; 1665 sdata->wdev.wiphy = local->hw.wiphy;
@@ -1728,11 +1748,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1728 goto fail_wep; 1748 goto fail_wep;
1729 } 1749 }
1730 1750
1731 if (hw->queues > IEEE80211_MAX_QUEUES)
1732 hw->queues = IEEE80211_MAX_QUEUES;
1733 if (hw->ampdu_queues > IEEE80211_MAX_AMPDU_QUEUES)
1734 hw->ampdu_queues = IEEE80211_MAX_AMPDU_QUEUES;
1735
1736 ieee80211_install_qdisc(local->mdev); 1751 ieee80211_install_qdisc(local->mdev);
1737 1752
1738 /* add one default STA interface */ 1753 /* add one default STA interface */