]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
wl1271: Fix warning about unsupported RX rate
authorTeemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Thu, 14 Oct 2010 09:00:04 +0000 (11:00 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 15 Nov 2010 18:25:13 +0000 (13:25 -0500)
While scanning, it is possible that beacon and probe response frames are
received on other band than configured to the driver. In rx status
handling this has caused "Unsupported RX rate from HW" warnings. This
patch changes the wl1271_rate_to_index function to take the band of the
received frame as a parameter instead of using value configuret to
wl->band.

Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
drivers/net/wireless/wl12xx/wl1271_main.c
drivers/net/wireless/wl12xx/wl1271_rx.c
drivers/net/wireless/wl12xx/wl1271_rx.h
drivers/net/wireless/wl12xx/wl1271_tx.c
drivers/net/wireless/wl12xx/wl1271_tx.h

index 532ccd01cf6f0af918a02a825e692a499d48c936..63036b53f9e471d8ccb16b265a18f21638e16eef 100644 (file)
@@ -2367,18 +2367,18 @@ static const struct ieee80211_ops wl1271_ops = {
 };
 
 
-u8 wl1271_rate_to_idx(struct wl1271 *wl, int rate)
+u8 wl1271_rate_to_idx(int rate, enum ieee80211_band band)
 {
        u8 idx;
 
-       BUG_ON(wl->band >= sizeof(wl1271_band_rate_to_idx)/sizeof(u8 *));
+       BUG_ON(band >= sizeof(wl1271_band_rate_to_idx)/sizeof(u8 *));
 
        if (unlikely(rate >= CONF_HW_RXTX_RATE_MAX)) {
                wl1271_error("Illegal RX rate from HW: %d", rate);
                return 0;
        }
 
-       idx = wl1271_band_rate_to_idx[wl->band][rate];
+       idx = wl1271_band_rate_to_idx[band][rate];
        if (unlikely(idx == CONF_HW_RXTX_RATE_UNSUPPORTED)) {
                wl1271_error("Unsupported RX rate from HW: %d", rate);
                return 0;
index ac13f7d252198f2ee9542ac866260257ee83885a..35448e7c0dd59950303d7d24dd2247c8809da74a 100644 (file)
@@ -48,10 +48,18 @@ static void wl1271_rx_status(struct wl1271 *wl,
                             struct ieee80211_rx_status *status,
                             u8 beacon)
 {
+       enum ieee80211_band desc_band;
+
        memset(status, 0, sizeof(struct ieee80211_rx_status));
 
        status->band = wl->band;
-       status->rate_idx = wl1271_rate_to_idx(wl, desc->rate);
+
+       if ((desc->flags & WL1271_RX_DESC_BAND_MASK) == WL1271_RX_DESC_BAND_BG)
+               desc_band = IEEE80211_BAND_2GHZ;
+       else
+               desc_band = IEEE80211_BAND_5GHZ;
+
+       status->rate_idx = wl1271_rate_to_idx(desc->rate, desc_band);
 
 #ifdef CONFIG_WL1271_HT
        /* 11n support */
index 13a232333b13fd5cb6e5fbbd260b7e5d9195d6c4..6d41981ce53fcb7f16d16e9543d847bb3a76920f 100644 (file)
@@ -116,6 +116,6 @@ struct wl1271_rx_descriptor {
 } __packed;
 
 void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_status *status);
-u8 wl1271_rate_to_idx(struct wl1271 *wl, int rate);
+u8 wl1271_rate_to_idx(int rate, enum ieee80211_band band);
 
 #endif
index 87a5aed00c8c18f11efcf3fba68861f24db36f53..46fafe08f81a5b4217315d5ab9d486a94ad09a76 100644 (file)
@@ -350,7 +350,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
        if (result->status == TX_SUCCESS) {
                if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
                        info->flags |= IEEE80211_TX_STAT_ACK;
-               rate = wl1271_rate_to_idx(wl, result->rate_class_index);
+               rate = wl1271_rate_to_idx(result->rate_class_index, wl->band);
                retries = result->ack_failures;
        } else if (result->status == TX_RETRY_EXCEEDED) {
                wl->stats.excessive_retries++;
index f1c906519b7df2a37c7e614901fdc9c3c1b49815..9dc6f228c0de9b7696a1eb6883a0f593cec972be 100644 (file)
@@ -144,7 +144,7 @@ void wl1271_tx_work_locked(struct wl1271 *wl);
 void wl1271_tx_complete(struct wl1271 *wl);
 void wl1271_tx_reset(struct wl1271 *wl);
 void wl1271_tx_flush(struct wl1271 *wl);
-u8 wl1271_rate_to_idx(struct wl1271 *wl, int rate);
+u8 wl1271_rate_to_idx(int rate, enum ieee80211_band band);
 u32 wl1271_tx_enabled_rates_get(struct wl1271 *wl, u32 rate_set);
 
 #endif