wl1271: Implement CMD_SET_STA_STATE to indicate connection completion to FW
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>
Thu, 27 May 2010 09:53:01 +0000 (12:53 +0300)
committerLuciano Coelho <luciano.coelho@nokia.com>
Tue, 28 Sep 2010 09:15:03 +0000 (12:15 +0300)
Implement the command function to send CMD_SET_STA_STATE to the firmware. This
is used to indicate that association (and the related EAP negotiation) are
complete.

This is used to tune WLAN-BT coexistense priority towards BT, improving BT
A2DP and SCO performance.

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>
drivers/net/wireless/wl12xx/wl1271_cmd.c
drivers/net/wireless/wl12xx/wl1271_cmd.h

index ce503ddd5a41e8504d894cd5516973d078af8769..a338b1c93a29b9a743b01bbba63f04c805693d6d 100644 (file)
@@ -746,3 +746,31 @@ out_free:
 out:
        return ret;
 }
+
+int wl1271_cmd_set_sta_state(struct wl1271 *wl)
+{
+       struct wl1271_cmd_set_sta_state *cmd;
+       int ret = 0;
+
+       wl1271_debug(DEBUG_CMD, "cmd set sta state");
+
+       cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
+       if (!cmd) {
+               ret = -ENOMEM;
+               goto out;
+       }
+
+       cmd->state = WL1271_CMD_STA_STATE_CONNECTED;
+
+       ret = wl1271_cmd_send(wl, CMD_SET_STA_STATE, cmd, sizeof(*cmd), 0);
+       if (ret < 0) {
+               wl1271_error("failed to send set STA state command");
+               goto out_free;
+       }
+
+out_free:
+       kfree(cmd);
+
+out:
+       return ret;
+}
index af577ee8eb0257c4585c86518f776b98d380e387..ce0476ceb84acf46c0f1ac02916ba40f0b9923c9 100644 (file)
@@ -55,6 +55,7 @@ int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
                       u8 key_size, const u8 *key, const u8 *addr,
                       u32 tx_seq_32, u16 tx_seq_16);
 int wl1271_cmd_disconnect(struct wl1271 *wl);
+int wl1271_cmd_set_sta_state(struct wl1271 *wl);
 
 enum wl1271_commands {
        CMD_INTERROGATE     = 1,    /*use this to read information elements*/
@@ -469,4 +470,13 @@ struct wl1271_cmd_disconnect {
        u8  padding;
 } __packed;
 
+#define WL1271_CMD_STA_STATE_CONNECTED  1
+
+struct wl1271_cmd_set_sta_state {
+       struct wl1271_cmd_header header;
+
+       u8 state;
+       u8 padding[3];
+} __attribute__ ((packed));
+
 #endif /* __WL1271_CMD_H__ */