mac80211: fix single queue drivers
authorJohannes Berg <johannes.berg@intel.com>
Mon, 7 May 2012 15:45:29 +0000 (17:45 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 16 May 2012 16:46:04 +0000 (12:46 -0400)
My queue management rework broke drivers that don't
have multiple AC queues and register a single queue
only, causing a warning:

WARNING: at net/mac80211/iface.c:162 ieee80211_check_queues

This was due to filling the queues wrongly and then
noticing the error when checking later.

Reported-and-Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/iface.c

index 3e05a8bfddf0dfcbe97731759e16c9761e256b9d..c550945dd703660fbd424c6361720a26145198e8 100644 (file)
@@ -206,8 +206,10 @@ static void ieee80211_set_default_queues(struct ieee80211_sub_if_data *sdata)
        for (i = 0; i < IEEE80211_NUM_ACS; i++) {
                if (local->hw.flags & IEEE80211_HW_QUEUE_CONTROL)
                        sdata->vif.hw_queue[i] = IEEE80211_INVAL_HW_QUEUE;
-               else
+               else if (local->hw.queues >= IEEE80211_NUM_ACS)
                        sdata->vif.hw_queue[i] = i;
+               else
+                       sdata->vif.hw_queue[i] = 0;
        }
        sdata->vif.cab_queue = IEEE80211_INVAL_HW_QUEUE;
 }