wl1271: Update beacon interval properly for ad-hoc
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>
Fri, 26 Mar 2010 10:53:25 +0000 (12:53 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 31 Mar 2010 18:39:15 +0000 (14:39 -0400)
Configure the hardware beacon interval to whatever requested by the
mac80211.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/wl12xx/wl1271.h
drivers/net/wireless/wl12xx/wl1271_cmd.c
drivers/net/wireless/wl12xx/wl1271_main.c

index 37ad5cd0b82f4fed1f199e3bd190a2bfd26c026a..c5559efcf5a7206d62e1f25028d6e1aa25a0c840 100644 (file)
@@ -452,6 +452,9 @@ struct wl1271 {
        /* The current band */
        enum ieee80211_band band;
 
+       /* Beaconing interval (needed for ad-hoc) */
+       u32 beacon_int;
+
        /* Default key (for WEP) */
        u32 default_key;
 
index 0aa2422982d3128d0ea588c389e8085c73f10c0a..0dcb3c2afe07f6f84c9b53f753fd9cef976f8069 100644 (file)
@@ -323,7 +323,7 @@ int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type)
                                                   CONF_HW_BIT_RATE_24MBPS);
        }
 
-       join->beacon_interval = cpu_to_le16(WL1271_DEFAULT_BEACON_INT);
+       join->beacon_interval = cpu_to_le16(wl->beacon_int);
        join->dtim_interval = WL1271_DEFAULT_DTIM_PERIOD;
 
        join->channel = wl->channel;
index 49f37b0183ac00e987de4ee9a990121386e47e5a..523e051d62ddf8edd008a339a24453123a0bcd03 100644 (file)
@@ -1575,6 +1575,15 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
        if (ret < 0)
                goto out;
 
+       if ((changed && BSS_CHANGED_BEACON_INT) &&
+           (wl->bss_type == BSS_TYPE_IBSS)) {
+               wl1271_debug(DEBUG_ADHOC, "ad-hoc beacon interval updated: %d",
+                       bss_conf->beacon_int);
+
+               wl->beacon_int = bss_conf->beacon_int;
+               do_join = true;
+       }
+
        if ((changed && BSS_CHANGED_BEACON) &&
            (wl->bss_type == BSS_TYPE_IBSS)) {
                struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
@@ -2193,6 +2202,7 @@ struct ieee80211_hw *wl1271_alloc_hw(void)
 
        INIT_DELAYED_WORK(&wl->elp_work, wl1271_elp_work);
        wl->channel = WL1271_DEFAULT_CHANNEL;
+       wl->beacon_int = WL1271_DEFAULT_BEACON_INT;
        wl->default_key = 0;
        wl->rx_counter = 0;
        wl->rx_config = WL1271_DEFAULT_RX_CONFIG;