]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - drivers/net/wireless/wl12xx/wl1271_cmd.c
wl1271: hack to disable filters
[linux-2.6.git] / drivers / net / wireless / wl12xx / wl1271_cmd.c
index 2a4351ff54dcb83cf25c193c27d36da9ff430676..ac93efd53f2a469c819031b11e2254bbd324f859 100644 (file)
@@ -175,11 +175,9 @@ int wl1271_cmd_cal(struct wl1271 *wl)
        return ret;
 }
 
-int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type, u8 dtim_interval,
-                   u16 beacon_interval, u8 wait)
+int wl1271_cmd_join(struct wl1271 *wl)
 {
        static bool do_cal = true;
-       unsigned long timeout;
        struct wl1271_cmd_join *join;
        int ret, i;
        u8 *bssid;
@@ -210,12 +208,21 @@ int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type, u8 dtim_interval,
        join->rx_config_options = wl->rx_config;
        join->rx_filter_options = wl->rx_filter;
 
+       /*
+        * FIXME: disable temporarily all filters because after commit
+        * 9cef8737 "mac80211: fix managed mode BSSID handling" broke
+        * association. The filter logic needs to be implemented properly
+        * and once that is done, this hack can be removed.
+        */
+       join->rx_config_options = 0;
+       join->rx_filter_options = WL1271_DEFAULT_RX_FILTER;
+
        join->basic_rate_set = RATE_MASK_1MBPS | RATE_MASK_2MBPS |
                RATE_MASK_5_5MBPS | RATE_MASK_11MBPS;
 
-       join->beacon_interval = beacon_interval;
-       join->dtim_interval = dtim_interval;
-       join->bss_type = bss_type;
+       join->beacon_interval = wl->beacon_int;
+       join->dtim_interval = wl->dtim_period;
+       join->bss_type = wl->bss_type;
        join->channel = wl->channel;
        join->ssid_len = wl->ssid_len;
        memcpy(join->ssid, wl->ssid, wl->ssid_len);
@@ -228,6 +235,10 @@ int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type, u8 dtim_interval,
 
        join->ctrl |= wl->session_counter << WL1271_JOIN_CMD_TX_SESSION_OFFSET;
 
+       /* reset TX security counters */
+       wl->tx_security_last_seq = 0;
+       wl->tx_security_seq_16 = 0;
+       wl->tx_security_seq_32 = 0;
 
        ret = wl1271_cmd_send(wl, CMD_START_JOIN, join, sizeof(*join));
        if (ret < 0) {
@@ -235,14 +246,11 @@ int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type, u8 dtim_interval,
                goto out_free;
        }
 
-       timeout = msecs_to_jiffies(JOIN_TIMEOUT);
-
        /*
         * ugly hack: we should wait for JOIN_EVENT_COMPLETE_ID but to
         * simplify locking we just sleep instead, for now
         */
-       if (wait)
-               msleep(10);
+       msleep(10);
 
 out_free:
        kfree(join);
@@ -678,7 +686,10 @@ int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid)
 
        memcpy(template.bssid, wl->bssid, ETH_ALEN);
        memcpy(template.ta, wl->mac_addr, ETH_ALEN);
-       template.aid = aid;
+
+       /* aid in PS-Poll has its two MSBs each set to 1 */
+       template.aid = cpu_to_le16(1 << 15 | 1 << 14 | aid);
+
        template.fc = cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL);
 
        return wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, &template,
@@ -759,7 +770,8 @@ out:
 }
 
 int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
-                      u8 key_size, const u8 *key, const u8 *addr)
+                      u8 key_size, const u8 *key, const u8 *addr,
+                      u32 tx_seq_32, u16 tx_seq_16)
 {
        struct wl1271_cmd_set_keys *cmd;
        int ret = 0;
@@ -777,12 +789,14 @@ int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
        cmd->key_size = key_size;
        cmd->key_type = key_type;
 
+       cmd->ac_seq_num16[0] = tx_seq_16;
+       cmd->ac_seq_num32[0] = tx_seq_32;
+
        /* we have only one SSID profile */
        cmd->ssid_profile = 0;
 
        cmd->id = id;
 
-       /* FIXME: this is from wl1251, needs to be checked */
        if (key_type == KEY_TKIP) {
                /*
                 * We get the key in the following form: