]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
wl12xx: configure rates when working in ibss mode
authorEliad Peller <eliad@wizery.com>
Thu, 7 Apr 2011 12:52:05 +0000 (15:52 +0300)
committerLuciano Coelho <coelho@ti.com>
Mon, 2 May 2011 07:26:02 +0000 (10:26 +0300)
When working in ibss mode, we don't configure rate policy per station
(as we use the same link for multiple stations), so currently the
1mb/s rate is being used.

Instead, configure the firmware to use the whole 11b rates by default.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/conf.h
drivers/net/wireless/wl12xx/main.c

index d16094f2604f583c2119e560b58c1bfcacc20d2a..5551d9d4016b9ffcded41d3a702d1d9937455cb8 100644 (file)
@@ -516,6 +516,13 @@ struct conf_rx_settings {
 #define CONF_TX_AP_DEFAULT_MGMT_RATES  (CONF_HW_BIT_RATE_1MBPS | \
        CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS)
 
+/*
+ * Default rates for working as IBSS. use 11b rates
+ */
+#define CONF_TX_IBSS_DEFAULT_RATES  (CONF_HW_BIT_RATE_1MBPS |       \
+               CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS | \
+               CONF_HW_BIT_RATE_11MBPS);
+
 struct conf_tx_rate_class {
 
        /*
index 1dd735cc38b1c427ccc863943dc26a42d210231c..53a8e2357ccf0a0029386ff9ecb5c194cafa00db 100644 (file)
@@ -2509,6 +2509,24 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl,
                }
        }
 
+       if (changed & BSS_CHANGED_IBSS) {
+               wl1271_debug(DEBUG_ADHOC, "ibss_joined: %d",
+                            bss_conf->ibss_joined);
+
+               if (bss_conf->ibss_joined) {
+                       u32 rates = bss_conf->basic_rates;
+                       wl->basic_rate_set = wl1271_tx_enabled_rates_get(wl,
+                                                                        rates);
+                       wl->basic_rate = wl1271_tx_min_rate_get(wl);
+
+                       /* by default, use 11b rates */
+                       wl->rate_set = CONF_TX_IBSS_DEFAULT_RATES;
+                       ret = wl1271_acx_sta_rate_policies(wl);
+                       if (ret < 0)
+                               goto out;
+               }
+       }
+
        ret = wl1271_bss_erp_info_changed(wl, bss_conf, changed);
        if (ret < 0)
                goto out;