]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/mac80211/main.c
mac80211: fix aggregation for hardware with ampdu queues
[karo-tx-linux.git] / net / mac80211 / main.c
index 5667f4e8067fdd4f885a507fa15a5085003f1dcd..e9181981adcd8b024bd005b39169140be8896dd0 100644 (file)
@@ -705,7 +705,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
                                        const struct ieee80211_ops *ops)
 {
        struct ieee80211_local *local;
-       int priv_size;
+       int priv_size, i;
        struct wiphy *wiphy;
 
        /* Ensure 32-byte alignment of our private data and hw private data.
@@ -779,6 +779,11 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
        setup_timer(&local->dynamic_ps_timer,
                    ieee80211_dynamic_ps_timer, (unsigned long) local);
 
+       for (i = 0; i < IEEE80211_MAX_AMPDU_QUEUES; i++)
+               local->ampdu_ac_queue[i] = -1;
+       /* using an s8 won't work with more than that */
+       BUILD_BUG_ON(IEEE80211_MAX_AMPDU_QUEUES > 127);
+
        sta_info_init(local);
 
        tasklet_init(&local->tx_pending_tasklet, ieee80211_tx_pending,
@@ -872,7 +877,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 
        mdev = alloc_netdev_mq(sizeof(struct ieee80211_master_priv),
                               "wmaster%d", ieee80211_master_setup,
-                              ieee80211_num_queues(hw));
+                              hw->queues);
        if (!mdev)
                goto fail_mdev_alloc;
 
@@ -916,6 +921,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 
        memcpy(local->mdev->dev_addr, local->hw.wiphy->perm_addr, ETH_ALEN);
        SET_NETDEV_DEV(local->mdev, wiphy_dev(local->hw.wiphy));
+       local->mdev->features |= NETIF_F_NETNS_LOCAL;
 
        result = register_netdevice(local->mdev);
        if (result < 0)