mwifiex: support AP reset after bss_stop
authorAvinash Patil <patila@marvell.com>
Wed, 3 Jun 2015 11:29:33 +0000 (16:59 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 8 Jun 2015 08:41:46 +0000 (11:41 +0300)
This would enable clearing of FW bss data structures when AP
operations are stopped.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mwifiex/cfg80211.c
drivers/net/wireless/mwifiex/cmdevt.c
drivers/net/wireless/mwifiex/fw.h
drivers/net/wireless/mwifiex/sta_cmdresp.c
drivers/net/wireless/mwifiex/uap_cmd.c

index 3a14d3a0a10ea925d4537c81aa14ca0867048577..d47799ae0d471ef3217db796f7f25f383c087509 100644 (file)
@@ -1725,6 +1725,13 @@ static int mwifiex_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
                return -1;
        }
 
+       if (mwifiex_send_cmd(priv, HOST_CMD_APCMD_SYS_RESET,
+                            HostCmd_ACT_GEN_SET, 0, NULL, true)) {
+               mwifiex_dbg(priv->adapter, ERROR,
+                           "Failed to reset BSS\n");
+               return -1;
+       }
+
        return 0;
 }
 
index a1de83fd1dbe4a0c2f535844ef6978fd256d5cea..b5033d1bbc746c47777ae9b08c4ab0b1294d3662 100644 (file)
@@ -574,6 +574,7 @@ int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no,
                case HostCmd_CMD_UAP_BSS_START:
                case HostCmd_CMD_UAP_BSS_STOP:
                case HostCmd_CMD_UAP_STA_DEAUTH:
+               case HOST_CMD_APCMD_SYS_RESET:
                        ret = mwifiex_uap_prepare_cmd(priv, cmd_no, cmd_action,
                                                      cmd_oid, data_buf,
                                                      cmd_ptr);
index cf386bc2757205c9946d6e3253082b46fa0f5cbc..45822a83e57e843d7a846d264cb343326f83320b 100644 (file)
@@ -330,6 +330,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
 #define HostCmd_CMD_RSSI_INFO                         0x00a4
 #define HostCmd_CMD_FUNC_INIT                         0x00a9
 #define HostCmd_CMD_FUNC_SHUTDOWN                     0x00aa
+#define HOST_CMD_APCMD_SYS_RESET                      0x00af
 #define HostCmd_CMD_UAP_SYS_CONFIG                    0x00b0
 #define HostCmd_CMD_UAP_BSS_START                     0x00b1
 #define HostCmd_CMD_UAP_BSS_STOP                      0x00b2
index aa5b9a310340df972dd5142ede815366d25a0d5b..f20a09e0c774b1d7c2964d7f1016bb87bc61ad82 100644 (file)
@@ -1159,6 +1159,8 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,
                break;
        case HostCmd_CMD_UAP_STA_DEAUTH:
                break;
+       case HOST_CMD_APCMD_SYS_RESET:
+               break;
        case HostCmd_CMD_MEF_CFG:
                break;
        case HostCmd_CMD_COALESCE_CFG:
index a4ae28353b6d8bb2fd80c977aad8a7c06d78d6a3..0a3297e268f661f2d0d1aba8bfad9bb3856a03ce 100644 (file)
@@ -754,6 +754,7 @@ int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, u16 cmd_no,
                break;
        case HostCmd_CMD_UAP_BSS_START:
        case HostCmd_CMD_UAP_BSS_STOP:
+       case HOST_CMD_APCMD_SYS_RESET:
                cmd->command = cpu_to_le16(cmd_no);
                cmd->size = cpu_to_le16(S_DS_GEN);
                break;
@@ -811,8 +812,13 @@ int mwifiex_config_start_uap(struct mwifiex_private *priv,
 
        if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_BSS_STOP,
                             HostCmd_ACT_GEN_SET, 0, NULL, true)) {
-               mwifiex_dbg(priv->adapter, ERROR,
-                           "Failed to stop the BSS\n");
+               mwifiex_dbg(priv->adapter, ERROR, "Failed to stop the BSS\n");
+               return -1;
+       }
+
+       if (mwifiex_send_cmd(priv, HOST_CMD_APCMD_SYS_RESET,
+                            HostCmd_ACT_GEN_SET, 0, NULL, true)) {
+               mwifiex_dbg(priv->adapter, ERROR, "Failed to reset BSS\n");
                return -1;
        }