wl12xx: call wl12xx_cmd_set_peer_state() in AP mode
authorEliad Peller <eliad@wizery.com>
Sun, 14 Aug 2011 10:17:23 +0000 (13:17 +0300)
committerLuciano Coelho <coelho@ti.com>
Mon, 22 Aug 2011 09:35:28 +0000 (12:35 +0300)
After adding a station, call wl12xx_cmd_set_peer_state().
This is required for 11n support.

Change wl12xx_cmd_set_peer_state() prototype to get hlid
as param.

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

index 025fb14184d6be863a743768c24ac4d72d707419..d655e629677cf1e0c5f320cea02d569f1a6bbe2c 100644 (file)
@@ -1321,12 +1321,12 @@ out:
        return ret;
 }
 
-int wl12xx_cmd_set_peer_state(struct wl1271 *wl)
+int wl12xx_cmd_set_peer_state(struct wl1271 *wl, u8 hlid)
 {
        struct wl12xx_cmd_set_peer_state *cmd;
        int ret = 0;
 
-       wl1271_debug(DEBUG_CMD, "cmd set peer state (hlid=%d)", wl->sta_hlid);
+       wl1271_debug(DEBUG_CMD, "cmd set peer state (hlid=%d)", hlid);
 
        cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
        if (!cmd) {
@@ -1334,7 +1334,7 @@ int wl12xx_cmd_set_peer_state(struct wl1271 *wl)
                goto out;
        }
 
-       cmd->hlid = wl->sta_hlid;
+       cmd->hlid = hlid;
        cmd->state = WL1271_CMD_STA_STATE_CONNECTED;
 
        ret = wl1271_cmd_send(wl, CMD_SET_PEER_STATE, cmd, sizeof(*cmd), 0);
index 8b32a57e1cc61d964503340feaf652fbc83f150f..740d27edd02da05615ac528929db046fa9a126e6 100644 (file)
@@ -70,7 +70,7 @@ int wl1271_cmd_set_sta_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
 int wl1271_cmd_set_ap_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
                          u8 key_size, const u8 *key, u8 hlid, u32 tx_seq_32,
                          u16 tx_seq_16);
-int wl12xx_cmd_set_peer_state(struct wl1271 *wl);
+int wl12xx_cmd_set_peer_state(struct wl1271 *wl, u8 hlid);
 int wl12xx_roc(struct wl1271 *wl, u8 role_id);
 int wl12xx_croc(struct wl1271 *wl, u8 role_id);
 int wl12xx_cmd_add_peer(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid);
index 934f5731fd73c4cc18dba70a0a05054a589ec044..27333d1afd0d67ac0b9a3204554cd9887f7a24bc 100644 (file)
@@ -395,7 +395,7 @@ static int wl1271_check_operstate(struct wl1271 *wl, unsigned char operstate)
        if (test_and_set_bit(WL1271_FLAG_STA_STATE_SENT, &wl->flags))
                return 0;
 
-       ret = wl12xx_cmd_set_peer_state(wl);
+       ret = wl12xx_cmd_set_peer_state(wl, wl->sta_hlid);
        if (ret < 0)
                return ret;
 
@@ -3676,6 +3676,10 @@ static int wl1271_op_sta_add(struct ieee80211_hw *hw,
        if (ret < 0)
                goto out_sleep;
 
+       ret = wl12xx_cmd_set_peer_state(wl, hlid);
+       if (ret < 0)
+               goto out_sleep;
+
 out_sleep:
        wl1271_ps_elp_sleep(wl);