Commit 03785387 authored by Avinash Patil's avatar Avinash Patil Committed by John W. Linville

mwifiex: handle station specific commands on STA interface only

Commands like IBSS coalescing status, power save, 11D should be
handled only when bss_type is STA.
Signed-off-by: default avatarAvinash Patil <patila@marvell.com>
Signed-off-by: default avatarYogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: default avatarKiran Divekar <dkiran@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 64b05e2f
...@@ -440,6 +440,11 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter) ...@@ -440,6 +440,11 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter)
do_gettimeofday(&tstamp); do_gettimeofday(&tstamp);
dev_dbg(adapter->dev, "event: %lu.%lu: cause: %#x\n", dev_dbg(adapter->dev, "event: %lu.%lu: cause: %#x\n",
tstamp.tv_sec, tstamp.tv_usec, eventcause); tstamp.tv_sec, tstamp.tv_usec, eventcause);
} else {
/* Handle PS_SLEEP/AWAKE events on STA */
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA);
if (!priv)
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
} }
ret = mwifiex_process_sta_event(priv); ret = mwifiex_process_sta_event(priv);
......
...@@ -1248,13 +1248,15 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta) ...@@ -1248,13 +1248,15 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta)
if (ret) if (ret)
return -1; return -1;
/* Enable IEEE PS by default */ if (priv->bss_type != MWIFIEX_BSS_TYPE_UAP) {
priv->adapter->ps_mode = MWIFIEX_802_11_POWER_MODE_PSP; /* Enable IEEE PS by default */
ret = mwifiex_send_cmd_async(priv, priv->adapter->ps_mode = MWIFIEX_802_11_POWER_MODE_PSP;
HostCmd_CMD_802_11_PS_MODE_ENH, ret = mwifiex_send_cmd_async(
EN_AUTO_PS, BITMAP_STA_PS, NULL); priv, HostCmd_CMD_802_11_PS_MODE_ENH,
if (ret) EN_AUTO_PS, BITMAP_STA_PS, NULL);
return -1; if (ret)
return -1;
}
} }
/* get tx rate */ /* get tx rate */
...@@ -1270,12 +1272,14 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta) ...@@ -1270,12 +1272,14 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta)
if (ret) if (ret)
return -1; return -1;
/* set ibss coalescing_status */ if (priv->bss_type == MWIFIEX_BSS_TYPE_STA) {
ret = mwifiex_send_cmd_async(priv, /* set ibss coalescing_status */
HostCmd_CMD_802_11_IBSS_COALESCING_STATUS, ret = mwifiex_send_cmd_async(
HostCmd_ACT_GEN_SET, 0, &enable); priv, HostCmd_CMD_802_11_IBSS_COALESCING_STATUS,
if (ret) HostCmd_ACT_GEN_SET, 0, &enable);
return -1; if (ret)
return -1;
}
memset(&amsdu_aggr_ctrl, 0, sizeof(amsdu_aggr_ctrl)); memset(&amsdu_aggr_ctrl, 0, sizeof(amsdu_aggr_ctrl));
amsdu_aggr_ctrl.enable = true; amsdu_aggr_ctrl.enable = true;
...@@ -1293,7 +1297,8 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta) ...@@ -1293,7 +1297,8 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta)
if (ret) if (ret)
return -1; return -1;
if (first_sta && (priv->adapter->iface_type != MWIFIEX_USB)) { if (first_sta && priv->adapter->iface_type != MWIFIEX_USB &&
priv->bss_type != MWIFIEX_BSS_TYPE_UAP) {
/* Enable auto deep sleep */ /* Enable auto deep sleep */
auto_ds.auto_ds = DEEP_SLEEP_ON; auto_ds.auto_ds = DEEP_SLEEP_ON;
auto_ds.idle_time = DEEP_SLEEP_IDLE_TIME; auto_ds.idle_time = DEEP_SLEEP_IDLE_TIME;
...@@ -1305,12 +1310,16 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta) ...@@ -1305,12 +1310,16 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta)
return -1; return -1;
} }
/* Send cmd to FW to enable/disable 11D function */ if (priv->bss_type != MWIFIEX_BSS_TYPE_UAP) {
state_11d = ENABLE_11D; /* Send cmd to FW to enable/disable 11D function */
ret = mwifiex_send_cmd_async(priv, HostCmd_CMD_802_11_SNMP_MIB, state_11d = ENABLE_11D;
HostCmd_ACT_GEN_SET, DOT11D_I, &state_11d); ret = mwifiex_send_cmd_async(priv, HostCmd_CMD_802_11_SNMP_MIB,
if (ret) HostCmd_ACT_GEN_SET, DOT11D_I,
dev_err(priv->adapter->dev, "11D: failed to enable 11D\n"); &state_11d);
if (ret)
dev_err(priv->adapter->dev,
"11D: failed to enable 11D\n");
}
/* Send cmd to FW to configure 11n specific configuration /* Send cmd to FW to configure 11n specific configuration
* (Short GI, Channel BW, Green field support etc.) for transmit * (Short GI, Channel BW, Green field support etc.) for transmit
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment