summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/sta_cmd.c
diff options
context:
space:
mode:
authorBing Zhao2013-12-14 03:33:00 +0100
committerJohn W. Linville2013-12-18 21:23:07 +0100
commitd39fbc88956ef56a67b8030d53c7e8fa645a4e00 (patch)
tree65f721e8d8adf46336d233fc9ae3639cedb8142d /drivers/net/wireless/mwifiex/sta_cmd.c
parentmwifiex: send regulatory domain info to firmware only if alpha2 changed (diff)
downloadkernel-qcow2-linux-d39fbc88956ef56a67b8030d53c7e8fa645a4e00.tar.gz
kernel-qcow2-linux-d39fbc88956ef56a67b8030d53c7e8fa645a4e00.tar.xz
kernel-qcow2-linux-d39fbc88956ef56a67b8030d53c7e8fa645a4e00.zip
mwifiex: remove cfg_data construction
The cfg_data buffer will include the cfg_data structure header (action, type, data_len). This makes it work for all data types without extra parsing. Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/sta_cmd.c')
-rw-r--r--drivers/net/wireless/mwifiex/sta_cmd.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
index 1efa43ec1c6e..2368c7f030bb 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -1158,28 +1158,20 @@ static u32 mwifiex_parse_cal_cfg(u8 *src, size_t len, u8 *dst)
/* This function prepares command of set_cfg_data. */
static int mwifiex_cmd_cfg_data(struct mwifiex_private *priv,
- struct host_cmd_ds_command *cmd,
- u16 cmd_action)
+ struct host_cmd_ds_command *cmd)
{
- struct host_cmd_ds_802_11_cfg_data *cfg_data = &cmd->params.cfg_data;
struct mwifiex_adapter *adapter = priv->adapter;
- u32 len, cal_data_offset;
- u8 *tmp_cmd = (u8 *)cmd;
+ u32 len;
+ u8 *data = (u8 *)cmd + S_DS_GEN;
- cal_data_offset = S_DS_GEN + sizeof(*cfg_data);
if ((adapter->cal_data->data) && (adapter->cal_data->size > 0))
len = mwifiex_parse_cal_cfg((u8 *)adapter->cal_data->data,
- adapter->cal_data->size,
- (u8 *)(tmp_cmd + cal_data_offset));
+ adapter->cal_data->size, data);
else
return -1;
- cfg_data->action = cpu_to_le16(cmd_action);
- cfg_data->type = cpu_to_le16(CFG_DATA_TYPE_CAL);
- cfg_data->data_len = cpu_to_le16(len);
-
cmd->command = cpu_to_le16(HostCmd_CMD_CFG_DATA);
- cmd->size = cpu_to_le16(S_DS_GEN + sizeof(*cfg_data) + len);
+ cmd->size = cpu_to_le16(S_DS_GEN + len);
return 0;
}
@@ -1267,7 +1259,7 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
ret = mwifiex_cmd_get_hw_spec(priv, cmd_ptr);
break;
case HostCmd_CMD_CFG_DATA:
- ret = mwifiex_cmd_cfg_data(priv, cmd_ptr, cmd_action);
+ ret = mwifiex_cmd_cfg_data(priv, cmd_ptr);
break;
case HostCmd_CMD_MAC_CONTROL:
ret = mwifiex_cmd_mac_control(priv, cmd_ptr, cmd_action,