aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex
diff options
context:
space:
mode:
authorAvinash Patil <patila@marvell.com>2015-01-28 05:12:02 -0500
committerKalle Valo <kvalo@codeaurora.org>2015-01-29 03:20:14 -0500
commit1247cc1f43905441821faa56d9a815e852afe235 (patch)
tree0d812b509f116d9ada7e8ce0401b899fad49b346 /drivers/net/wireless/mwifiex
parent8d05eb222074169c22c9d2707f607cf762f8d027 (diff)
mwifiex: add init parameter to init command routine
FW initialization routine can also be called while changing virtual interface types. This patch adds bool parameter "init" to init command routine so as to differentiate between initialization during driver load and change virtual interface handler. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r--drivers/net/wireless/mwifiex/init.c3
-rw-r--r--drivers/net/wireless/mwifiex/main.h2
-rw-r--r--drivers/net/wireless/mwifiex/sta_cmd.c13
-rw-r--r--drivers/net/wireless/mwifiex/sta_ioctl.c2
4 files changed, 12 insertions, 8 deletions
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index 44babc329fda..2975b5154c39 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -552,7 +552,8 @@ int mwifiex_init_fw(struct mwifiex_adapter *adapter)
552 552
553 for (i = 0; i < adapter->priv_num; i++) { 553 for (i = 0; i < adapter->priv_num; i++) {
554 if (adapter->priv[i]) { 554 if (adapter->priv[i]) {
555 ret = mwifiex_sta_init_cmd(adapter->priv[i], first_sta); 555 ret = mwifiex_sta_init_cmd(adapter->priv[i], first_sta,
556 true);
556 if (ret == -1) 557 if (ret == -1)
557 return -1; 558 return -1;
558 559
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 45b40af9797b..9686bd8603c8 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -989,7 +989,7 @@ void mwifiex_wmm_del_peer_ra_list(struct mwifiex_private *priv,
989 const u8 *ra_addr); 989 const u8 *ra_addr);
990void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb); 990void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb);
991void *mwifiex_process_uap_txpd(struct mwifiex_private *, struct sk_buff *skb); 991void *mwifiex_process_uap_txpd(struct mwifiex_private *, struct sk_buff *skb);
992int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta); 992int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta, bool init);
993int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd, 993int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd,
994 struct mwifiex_scan_cmd_config *scan_cfg); 994 struct mwifiex_scan_cmd_config *scan_cfg);
995void mwifiex_queue_scan_cmd(struct mwifiex_private *priv, 995void mwifiex_queue_scan_cmd(struct mwifiex_private *priv,
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
index f7b920d7a95a..92a66e8b6636 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -1911,6 +1911,8 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
1911 * 1911 *
1912 * This is called after firmware download to bring the card to 1912 * This is called after firmware download to bring the card to
1913 * working state. 1913 * working state.
1914 * Function is also called during reinitialization of virtual
1915 * interfaces.
1914 * 1916 *
1915 * The following commands are issued sequentially - 1917 * The following commands are issued sequentially -
1916 * - Set PCI-Express host buffer configuration (PCIE only) 1918 * - Set PCI-Express host buffer configuration (PCIE only)
@@ -1925,7 +1927,7 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
1925 * - Set 11d control 1927 * - Set 11d control
1926 * - Set MAC control (this must be the last command to initialize firmware) 1928 * - Set MAC control (this must be the last command to initialize firmware)
1927 */ 1929 */
1928int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta) 1930int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
1929{ 1931{
1930 struct mwifiex_adapter *adapter = priv->adapter; 1932 struct mwifiex_adapter *adapter = priv->adapter;
1931 int ret; 1933 int ret;
@@ -2059,9 +2061,6 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta)
2059 "11D: failed to enable 11D\n"); 2061 "11D: failed to enable 11D\n");
2060 } 2062 }
2061 2063
2062 /* set last_init_cmd before sending the command */
2063 priv->adapter->last_init_cmd = HostCmd_CMD_11N_CFG;
2064
2065 /* Send cmd to FW to configure 11n specific configuration 2064 /* Send cmd to FW to configure 11n specific configuration
2066 * (Short GI, Channel BW, Green field support etc.) for transmit 2065 * (Short GI, Channel BW, Green field support etc.) for transmit
2067 */ 2066 */
@@ -2069,7 +2068,11 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta)
2069 ret = mwifiex_send_cmd(priv, HostCmd_CMD_11N_CFG, 2068 ret = mwifiex_send_cmd(priv, HostCmd_CMD_11N_CFG,
2070 HostCmd_ACT_GEN_SET, 0, &tx_cfg, true); 2069 HostCmd_ACT_GEN_SET, 0, &tx_cfg, true);
2071 2070
2072 ret = -EINPROGRESS; 2071 if (init) {
2072 /* set last_init_cmd before sending the command */
2073 priv->adapter->last_init_cmd = HostCmd_CMD_11N_CFG;
2074 ret = -EINPROGRESS;
2075 }
2073 2076
2074 return ret; 2077 return ret;
2075} 2078}
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 329cd515316c..2faa5174fe73 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -1162,7 +1162,7 @@ mwifiex_set_bss_role(struct mwifiex_private *priv, u8 bss_role)
1162 mwifiex_send_cmd(priv, HostCmd_CMD_SET_BSS_MODE, 1162 mwifiex_send_cmd(priv, HostCmd_CMD_SET_BSS_MODE,
1163 HostCmd_ACT_GEN_SET, 0, NULL, true); 1163 HostCmd_ACT_GEN_SET, 0, NULL, true);
1164 1164
1165 return mwifiex_sta_init_cmd(priv, false); 1165 return mwifiex_sta_init_cmd(priv, false, false);
1166} 1166}
1167 1167
1168/* 1168/*