wlcore: use proper values for supported local rates
authorLuciano Coelho <coelho@ti.com>
Thu, 10 May 2012 09:14:14 +0000 (12:14 +0300)
committerLuciano Coelho <coelho@ti.com>
Tue, 5 Jun 2012 12:58:36 +0000 (15:58 +0300)
We were setting all the rates bits when starting the AP role.  Instead
of doing this, we should set only the rates we really support
(eg. MIMO rates or wide-channel rates).  This commit changes that so
that we always use the default rates (basic rates + MCS0-7) and add
the values returned by the ap_get_mimo_wide_rate_mask operation.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
drivers/net/wireless/ti/wlcore/cmd.c

index 5c4756047098234f3afa567071a866ca437ef20f..5b14446ece4ab92b86b29143c72c3d715d12e964 100644 (file)
@@ -36,6 +36,7 @@
 #include "cmd.h"
 #include "event.h"
 #include "tx.h"
+#include "hw_ops.h"
 
 #define WL1271_CMD_FAST_POLL_COUNT       50
 
@@ -500,6 +501,7 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif)
        struct wl12xx_cmd_role_start *cmd;
        struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
        struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
+       u32 supported_rates;
        int ret;
 
        wl1271_debug(DEBUG_CMD, "cmd role start ap %d", wlvif->role_id);
@@ -550,7 +552,13 @@ int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif)
                memcpy(cmd->ap.ssid, bss_conf->ssid, bss_conf->ssid_len);
        }
 
-       cmd->ap.local_rates = cpu_to_le32(0xffffffff);
+       supported_rates = CONF_TX_AP_ENABLED_RATES | CONF_TX_MCS_RATES |
+               wlcore_hw_ap_get_mimo_wide_rate_mask(wl, wlvif);
+
+       wl1271_debug(DEBUG_CMD, "cmd role start ap with supported_rates 0x%08x",
+                    supported_rates);
+
+       cmd->ap.local_rates = cpu_to_le32(supported_rates);
 
        switch (wlvif->band) {
        case IEEE80211_BAND_2GHZ: