Commit d5b036c4 authored by Avinash Patil's avatar Avinash Patil Committed by Kalle Valo

mwifiex: support to set multichannel policy to FW

This patch adds support for setting multichannel policy as module parameter
to FW. Value of 1 indicates Multichannel support is enabled
and value of 0 disables it.
Signed-off-by: default avatarAvinash Patil <patila@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent ddd7ceb3
...@@ -201,6 +201,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { ...@@ -201,6 +201,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
#define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11)) #define ISSUPP_11NENABLED(FwCapInfo) (FwCapInfo & BIT(11))
#define ISSUPP_TDLS_ENABLED(FwCapInfo) (FwCapInfo & BIT(14)) #define ISSUPP_TDLS_ENABLED(FwCapInfo) (FwCapInfo & BIT(14))
#define ISSUPP_DRCS_ENABLED(FwCapInfo) (FwCapInfo & BIT(15))
#define ISSUPP_SDIO_SPA_ENABLED(FwCapInfo) (FwCapInfo & BIT(16)) #define ISSUPP_SDIO_SPA_ENABLED(FwCapInfo) (FwCapInfo & BIT(16))
#define MWIFIEX_DEF_HT_CAP (IEEE80211_HT_CAP_DSSSCCK40 | \ #define MWIFIEX_DEF_HT_CAP (IEEE80211_HT_CAP_DSSSCCK40 | \
...@@ -361,6 +362,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { ...@@ -361,6 +362,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
#define HostCmd_CMD_REMAIN_ON_CHAN 0x010d #define HostCmd_CMD_REMAIN_ON_CHAN 0x010d
#define HostCmd_CMD_11AC_CFG 0x0112 #define HostCmd_CMD_11AC_CFG 0x0112
#define HostCmd_CMD_TDLS_CONFIG 0x0100 #define HostCmd_CMD_TDLS_CONFIG 0x0100
#define HostCmd_CMD_MC_POLICY 0x0121
#define HostCmd_CMD_TDLS_OPER 0x0122 #define HostCmd_CMD_TDLS_OPER 0x0122
#define HostCmd_CMD_SDIO_SP_RX_AGGR_CFG 0x0223 #define HostCmd_CMD_SDIO_SP_RX_AGGR_CFG 0x0223
...@@ -2039,6 +2041,11 @@ struct host_cmd_ds_coalesce_cfg { ...@@ -2039,6 +2041,11 @@ struct host_cmd_ds_coalesce_cfg {
struct coalesce_receive_filt_rule rule[0]; struct coalesce_receive_filt_rule rule[0];
} __packed; } __packed;
struct host_cmd_ds_multi_chan_policy {
__le16 action;
__le16 policy;
} __packed;
struct host_cmd_ds_command { struct host_cmd_ds_command {
__le16 command; __le16 command;
__le16 size; __le16 size;
...@@ -2107,6 +2114,7 @@ struct host_cmd_ds_command { ...@@ -2107,6 +2114,7 @@ struct host_cmd_ds_command {
struct host_cmd_ds_tdls_oper tdls_oper; struct host_cmd_ds_tdls_oper tdls_oper;
struct host_cmd_ds_chan_rpt_req chan_rpt_req; struct host_cmd_ds_chan_rpt_req chan_rpt_req;
struct host_cmd_sdio_sp_rx_aggr_cfg sdio_rx_aggr_cfg; struct host_cmd_sdio_sp_rx_aggr_cfg sdio_rx_aggr_cfg;
struct host_cmd_ds_multi_chan_policy mc_policy;
} params; } params;
} __packed; } __packed;
......
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
#include "11n.h" #include "11n.h"
#include "11ac.h" #include "11ac.h"
static bool drcs;
module_param(drcs, bool, 0644);
MODULE_PARM_DESC(drcs, "multi-channel operation:1, single-channel operation:0");
static bool disable_auto_ds; static bool disable_auto_ds;
module_param(disable_auto_ds, bool, 0); module_param(disable_auto_ds, bool, 0);
MODULE_PARM_DESC(disable_auto_ds, MODULE_PARM_DESC(disable_auto_ds,
...@@ -1511,6 +1515,22 @@ static int mwifiex_cmd_cfg_data(struct mwifiex_private *priv, ...@@ -1511,6 +1515,22 @@ static int mwifiex_cmd_cfg_data(struct mwifiex_private *priv,
return 0; return 0;
} }
static int
mwifiex_cmd_set_mc_policy(struct mwifiex_private *priv,
struct host_cmd_ds_command *cmd,
u16 cmd_action, void *data_buf)
{
struct host_cmd_ds_multi_chan_policy *mc_pol = &cmd->params.mc_policy;
const u16 *drcs_info = data_buf;
mc_pol->action = cpu_to_le16(cmd_action);
mc_pol->policy = cpu_to_le16(*drcs_info);
cmd->command = cpu_to_le16(HostCmd_CMD_MC_POLICY);
cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_multi_chan_policy) +
S_DS_GEN);
return 0;
}
static int static int
mwifiex_cmd_coalesce_cfg(struct mwifiex_private *priv, mwifiex_cmd_coalesce_cfg(struct mwifiex_private *priv,
struct host_cmd_ds_command *cmd, struct host_cmd_ds_command *cmd,
...@@ -2014,6 +2034,10 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no, ...@@ -2014,6 +2034,10 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
ret = mwifiex_cmd_sdio_rx_aggr_cfg(cmd_ptr, cmd_action, ret = mwifiex_cmd_sdio_rx_aggr_cfg(cmd_ptr, cmd_action,
data_buf); data_buf);
break; break;
case HostCmd_CMD_MC_POLICY:
ret = mwifiex_cmd_set_mc_policy(priv, cmd_ptr, cmd_action,
data_buf);
break;
default: default:
mwifiex_dbg(priv->adapter, ERROR, mwifiex_dbg(priv->adapter, ERROR,
"PREP_CMD: unknown cmd- %#x\n", cmd_no); "PREP_CMD: unknown cmd- %#x\n", cmd_no);
...@@ -2130,6 +2154,13 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init) ...@@ -2130,6 +2154,13 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
if (ret) if (ret)
return -1; return -1;
} }
if (ISSUPP_DRCS_ENABLED(adapter->fw_cap_info))
ret = mwifiex_send_cmd(priv, HostCmd_CMD_MC_POLICY,
HostCmd_ACT_GEN_SET, 0, &drcs,
true);
if (ret)
return -1;
} }
/* get tx rate */ /* get tx rate */
......
...@@ -1193,6 +1193,7 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no, ...@@ -1193,6 +1193,7 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,
break; break;
case HostCmd_CMD_TDLS_OPER: case HostCmd_CMD_TDLS_OPER:
ret = mwifiex_ret_tdls_oper(priv, resp); ret = mwifiex_ret_tdls_oper(priv, resp);
case HostCmd_CMD_MC_POLICY:
break; break;
case HostCmd_CMD_CHAN_REPORT_REQUEST: case HostCmd_CMD_CHAN_REPORT_REQUEST:
break; break;
......
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