Commit 9c05fd72 authored by Yogesh Ashok Powar's avatar Yogesh Ashok Powar Committed by John W. Linville

mwifiex: fix checkpatch --strict warnings/errors Part 7

For sta_cmd.c and sta_cmdresp.c
Signed-off-by: default avatarYogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5dbd326c
...@@ -174,8 +174,8 @@ static int mwifiex_cmd_tx_rate_cfg(struct mwifiex_private *priv, ...@@ -174,8 +174,8 @@ static int mwifiex_cmd_tx_rate_cfg(struct mwifiex_private *priv,
rate_scope = (struct mwifiex_rate_scope *) ((u8 *) rate_cfg + rate_scope = (struct mwifiex_rate_scope *) ((u8 *) rate_cfg +
sizeof(struct host_cmd_ds_tx_rate_cfg)); sizeof(struct host_cmd_ds_tx_rate_cfg));
rate_scope->type = cpu_to_le16(TLV_TYPE_RATE_SCOPE); rate_scope->type = cpu_to_le16(TLV_TYPE_RATE_SCOPE);
rate_scope->length = cpu_to_le16(sizeof(struct mwifiex_rate_scope) - rate_scope->length = cpu_to_le16
sizeof(struct mwifiex_ie_types_header)); (sizeof(*rate_scope) - sizeof(struct mwifiex_ie_types_header));
if (pbitmap_rates != NULL) { if (pbitmap_rates != NULL) {
rate_scope->hr_dsss_rate_bitmap = cpu_to_le16(pbitmap_rates[0]); rate_scope->hr_dsss_rate_bitmap = cpu_to_le16(pbitmap_rates[0]);
rate_scope->ofdm_rate_bitmap = cpu_to_le16(pbitmap_rates[1]); rate_scope->ofdm_rate_bitmap = cpu_to_le16(pbitmap_rates[1]);
...@@ -284,17 +284,17 @@ mwifiex_cmd_802_11_hs_cfg(struct mwifiex_private *priv, ...@@ -284,17 +284,17 @@ mwifiex_cmd_802_11_hs_cfg(struct mwifiex_private *priv,
cmd->command = cpu_to_le16(HostCmd_CMD_802_11_HS_CFG_ENH); cmd->command = cpu_to_le16(HostCmd_CMD_802_11_HS_CFG_ENH);
if (!hs_activate && if (!hs_activate &&
(hscfg_param->conditions (hscfg_param->conditions != cpu_to_le32(HOST_SLEEP_CFG_CANCEL)) &&
!= cpu_to_le32(HOST_SLEEP_CFG_CANCEL)) ((adapter->arp_filter_size > 0) &&
&& ((adapter->arp_filter_size > 0) (adapter->arp_filter_size <= ARP_FILTER_MAX_BUF_SIZE))) {
&& (adapter->arp_filter_size <= ARP_FILTER_MAX_BUF_SIZE))) {
dev_dbg(adapter->dev, dev_dbg(adapter->dev,
"cmd: Attach %d bytes ArpFilter to HSCfg cmd\n", "cmd: Attach %d bytes ArpFilter to HSCfg cmd\n",
adapter->arp_filter_size); adapter->arp_filter_size);
memcpy(((u8 *) hs_cfg) + memcpy(((u8 *) hs_cfg) +
sizeof(struct host_cmd_ds_802_11_hs_cfg_enh), sizeof(struct host_cmd_ds_802_11_hs_cfg_enh),
adapter->arp_filter, adapter->arp_filter_size); adapter->arp_filter, adapter->arp_filter_size);
cmd->size = cpu_to_le16(adapter->arp_filter_size + cmd->size = cpu_to_le16
(adapter->arp_filter_size +
sizeof(struct host_cmd_ds_802_11_hs_cfg_enh) sizeof(struct host_cmd_ds_802_11_hs_cfg_enh)
+ S_DS_GEN); + S_DS_GEN);
} else { } else {
...@@ -565,8 +565,8 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv, ...@@ -565,8 +565,8 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv,
key_param_len = (WAPI_KEY_LEN + KEYPARAMSET_FIXED_LEN) + key_param_len = (WAPI_KEY_LEN + KEYPARAMSET_FIXED_LEN) +
sizeof(struct mwifiex_ie_types_header); sizeof(struct mwifiex_ie_types_header);
cmd->size = cpu_to_le16(key_param_len + cmd->size = cpu_to_le16(sizeof(key_material->action)
sizeof(key_material->action) + S_DS_GEN); + S_DS_GEN + key_param_len);
return ret; return ret;
} }
if (enc_key->key_len == WLAN_KEY_LEN_CCMP) { if (enc_key->key_len == WLAN_KEY_LEN_CCMP) {
...@@ -617,8 +617,8 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv, ...@@ -617,8 +617,8 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv,
key_param_len = (u16) (enc_key->key_len + KEYPARAMSET_FIXED_LEN) key_param_len = (u16) (enc_key->key_len + KEYPARAMSET_FIXED_LEN)
+ sizeof(struct mwifiex_ie_types_header); + sizeof(struct mwifiex_ie_types_header);
cmd->size = cpu_to_le16(key_param_len + cmd->size = cpu_to_le16(sizeof(key_material->action) + S_DS_GEN
sizeof(key_material->action) + S_DS_GEN); + key_param_len);
} }
return ret; return ret;
...@@ -657,14 +657,15 @@ static int mwifiex_cmd_802_11d_domain_info(struct mwifiex_private *priv, ...@@ -657,14 +657,15 @@ static int mwifiex_cmd_802_11d_domain_info(struct mwifiex_private *priv,
memcpy(domain->country_code, adapter->domain_reg.country_code, memcpy(domain->country_code, adapter->domain_reg.country_code,
sizeof(domain->country_code)); sizeof(domain->country_code));
domain->header.len = cpu_to_le16((no_of_triplet * domain->header.len =
sizeof(struct ieee80211_country_ie_triplet)) + cpu_to_le16((no_of_triplet *
sizeof(domain->country_code)); sizeof(struct ieee80211_country_ie_triplet))
+ sizeof(domain->country_code));
if (no_of_triplet) { if (no_of_triplet) {
memcpy(domain->triplet, adapter->domain_reg.triplet, memcpy(domain->triplet, adapter->domain_reg.triplet,
no_of_triplet * no_of_triplet * sizeof(struct
sizeof(struct ieee80211_country_ie_triplet)); ieee80211_country_ie_triplet));
cmd->size = cpu_to_le16(sizeof(domain_info->action) + cmd->size = cpu_to_le16(sizeof(domain_info->action) +
le16_to_cpu(domain->header.len) + le16_to_cpu(domain->header.len) +
...@@ -698,8 +699,8 @@ static int mwifiex_cmd_802_11_rf_channel(struct mwifiex_private *priv, ...@@ -698,8 +699,8 @@ static int mwifiex_cmd_802_11_rf_channel(struct mwifiex_private *priv,
+ S_DS_GEN); + S_DS_GEN);
if (cmd_action == HostCmd_ACT_GEN_SET) { if (cmd_action == HostCmd_ACT_GEN_SET) {
if ((priv->adapter->adhoc_start_band & BAND_A) if ((priv->adapter->adhoc_start_band & BAND_A) ||
|| (priv->adapter->adhoc_start_band & BAND_AN)) (priv->adapter->adhoc_start_band & BAND_AN))
rf_chan->rf_type = rf_chan->rf_type =
cpu_to_le16(HostCmd_SCAN_RADIO_TYPE_A); cpu_to_le16(HostCmd_SCAN_RADIO_TYPE_A);
...@@ -789,8 +790,8 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd, ...@@ -789,8 +790,8 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
struct host_cmd_ds_bbp_reg_access *bbp_reg; struct host_cmd_ds_bbp_reg_access *bbp_reg;
cmd->size = cpu_to_le16(sizeof(*bbp_reg) + S_DS_GEN); cmd->size = cpu_to_le16(sizeof(*bbp_reg) + S_DS_GEN);
bbp_reg = (struct host_cmd_ds_bbp_reg_access *) &cmd-> bbp_reg = (struct host_cmd_ds_bbp_reg_access *)
params.bbp_reg; &cmd->params.bbp_reg;
bbp_reg->action = cpu_to_le16(cmd_action); bbp_reg->action = cpu_to_le16(cmd_action);
bbp_reg->offset = bbp_reg->offset =
cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
...@@ -802,11 +803,10 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd, ...@@ -802,11 +803,10 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
struct host_cmd_ds_rf_reg_access *rf_reg; struct host_cmd_ds_rf_reg_access *rf_reg;
cmd->size = cpu_to_le16(sizeof(*rf_reg) + S_DS_GEN); cmd->size = cpu_to_le16(sizeof(*rf_reg) + S_DS_GEN);
rf_reg = (struct host_cmd_ds_rf_reg_access *) &cmd-> rf_reg = (struct host_cmd_ds_rf_reg_access *)
params.rf_reg; &cmd->params.rf_reg;
rf_reg->action = cpu_to_le16(cmd_action); rf_reg->action = cpu_to_le16(cmd_action);
rf_reg->offset = rf_reg->offset = cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
rf_reg->value = (u8) le32_to_cpu(reg_rw->value); rf_reg->value = (u8) le32_to_cpu(reg_rw->value);
break; break;
} }
...@@ -828,8 +828,8 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd, ...@@ -828,8 +828,8 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
struct host_cmd_ds_rf_reg_access *cau_reg; struct host_cmd_ds_rf_reg_access *cau_reg;
cmd->size = cpu_to_le16(sizeof(*cau_reg) + S_DS_GEN); cmd->size = cpu_to_le16(sizeof(*cau_reg) + S_DS_GEN);
cau_reg = (struct host_cmd_ds_rf_reg_access *) &cmd-> cau_reg = (struct host_cmd_ds_rf_reg_access *)
params.rf_reg; &cmd->params.rf_reg;
cau_reg->action = cpu_to_le16(cmd_action); cau_reg->action = cpu_to_le16(cmd_action);
cau_reg->offset = cau_reg->offset =
cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
...@@ -882,29 +882,25 @@ mwifiex_cmd_pcie_host_spec(struct mwifiex_private *priv, ...@@ -882,29 +882,25 @@ mwifiex_cmd_pcie_host_spec(struct mwifiex_private *priv,
memset(host_spec, 0, sizeof(struct host_cmd_ds_pcie_details)); memset(host_spec, 0, sizeof(struct host_cmd_ds_pcie_details));
if (action == HostCmd_ACT_GEN_SET) { if (action != HostCmd_ACT_GEN_SET)
return 0;
/* Send the ring base addresses and count to firmware */ /* Send the ring base addresses and count to firmware */
host_spec->txbd_addr_lo = (u32)(card->txbd_ring_pbase); host_spec->txbd_addr_lo = (u32)(card->txbd_ring_pbase);
host_spec->txbd_addr_hi = host_spec->txbd_addr_hi = (u32)(((u64)card->txbd_ring_pbase)>>32);
(u32)(((u64)card->txbd_ring_pbase)>>32);
host_spec->txbd_count = MWIFIEX_MAX_TXRX_BD; host_spec->txbd_count = MWIFIEX_MAX_TXRX_BD;
host_spec->rxbd_addr_lo = (u32)(card->rxbd_ring_pbase); host_spec->rxbd_addr_lo = (u32)(card->rxbd_ring_pbase);
host_spec->rxbd_addr_hi = host_spec->rxbd_addr_hi = (u32)(((u64)card->rxbd_ring_pbase)>>32);
(u32)(((u64)card->rxbd_ring_pbase)>>32);
host_spec->rxbd_count = MWIFIEX_MAX_TXRX_BD; host_spec->rxbd_count = MWIFIEX_MAX_TXRX_BD;
host_spec->evtbd_addr_lo = host_spec->evtbd_addr_lo = (u32)(card->evtbd_ring_pbase);
(u32)(card->evtbd_ring_pbase); host_spec->evtbd_addr_hi = (u32)(((u64)card->evtbd_ring_pbase)>>32);
host_spec->evtbd_addr_hi =
(u32)(((u64)card->evtbd_ring_pbase)>>32);
host_spec->evtbd_count = MWIFIEX_MAX_EVT_BD; host_spec->evtbd_count = MWIFIEX_MAX_EVT_BD;
if (card->sleep_cookie) { if (card->sleep_cookie) {
buf_pa = MWIFIEX_SKB_PACB(card->sleep_cookie); buf_pa = MWIFIEX_SKB_PACB(card->sleep_cookie);
host_spec->sleep_cookie_addr_lo = (u32) *buf_pa; host_spec->sleep_cookie_addr_lo = (u32) *buf_pa;
host_spec->sleep_cookie_addr_hi = host_spec->sleep_cookie_addr_hi = (u32) (((u64)*buf_pa) >> 32);
(u32) (((u64)*buf_pa) >> 32); dev_dbg(priv->adapter->dev, "sleep_cook_lo phy addr: 0x%x\n",
dev_dbg(priv->adapter->dev, "sleep_cook_lo phy addr: " host_spec->sleep_cookie_addr_lo);
"0x%x\n", host_spec->sleep_cookie_addr_lo);
}
} }
return 0; return 0;
...@@ -1052,8 +1048,7 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no, ...@@ -1052,8 +1048,7 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
data_buf); data_buf);
break; break;
case HostCmd_CMD_11N_CFG: case HostCmd_CMD_11N_CFG:
ret = mwifiex_cmd_11n_cfg(cmd_ptr, cmd_action, ret = mwifiex_cmd_11n_cfg(cmd_ptr, cmd_action, data_buf);
data_buf);
break; break;
case HostCmd_CMD_WMM_GET_STATUS: case HostCmd_CMD_WMM_GET_STATUS:
dev_dbg(priv->adapter->dev, dev_dbg(priv->adapter->dev,
......
...@@ -57,8 +57,8 @@ mwifiex_process_cmdresp_error(struct mwifiex_private *priv, ...@@ -57,8 +57,8 @@ mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
switch (le16_to_cpu(resp->command)) { switch (le16_to_cpu(resp->command)) {
case HostCmd_CMD_802_11_PS_MODE_ENH: case HostCmd_CMD_802_11_PS_MODE_ENH:
pm = &resp->params.psmode_enh; pm = &resp->params.psmode_enh;
dev_err(adapter->dev, "PS_MODE_ENH cmd failed: " dev_err(adapter->dev,
"result=0x%x action=0x%X\n", "PS_MODE_ENH cmd failed: result=0x%x action=0x%X\n",
resp->result, le16_to_cpu(pm->action)); resp->result, le16_to_cpu(pm->action));
/* We do not re-try enter-ps command in ad-hoc mode. */ /* We do not re-try enter-ps command in ad-hoc mode. */
if (le16_to_cpu(pm->action) == EN_AUTO_PS && if (le16_to_cpu(pm->action) == EN_AUTO_PS &&
...@@ -580,17 +580,18 @@ static int mwifiex_ret_802_11d_domain_info(struct mwifiex_private *priv, ...@@ -580,17 +580,18 @@ static int mwifiex_ret_802_11d_domain_info(struct mwifiex_private *priv,
u16 action = le16_to_cpu(domain_info->action); u16 action = le16_to_cpu(domain_info->action);
u8 no_of_triplet; u8 no_of_triplet;
no_of_triplet = (u8) ((le16_to_cpu(domain->header.len) - no_of_triplet = (u8) ((le16_to_cpu(domain->header.len)
IEEE80211_COUNTRY_STRING_LEN) / - IEEE80211_COUNTRY_STRING_LEN)
sizeof(struct ieee80211_country_ie_triplet)); / sizeof(struct ieee80211_country_ie_triplet));
dev_dbg(priv->adapter->dev, "info: 11D Domain Info Resp:" dev_dbg(priv->adapter->dev,
" no_of_triplet=%d\n", no_of_triplet); "info: 11D Domain Info Resp: no_of_triplet=%d\n",
no_of_triplet);
if (no_of_triplet > MWIFIEX_MAX_TRIPLET_802_11D) { if (no_of_triplet > MWIFIEX_MAX_TRIPLET_802_11D) {
dev_warn(priv->adapter->dev, dev_warn(priv->adapter->dev,
"11D: invalid number of triplets %d " "11D: invalid number of triplets %d returned\n",
"returned!!\n", no_of_triplet); no_of_triplet);
return -1; return -1;
} }
...@@ -887,9 +888,9 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no, ...@@ -887,9 +888,9 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,
case HostCmd_CMD_RECONFIGURE_TX_BUFF: case HostCmd_CMD_RECONFIGURE_TX_BUFF:
adapter->tx_buf_size = (u16) le16_to_cpu(resp->params. adapter->tx_buf_size = (u16) le16_to_cpu(resp->params.
tx_buf.buff_size); tx_buf.buff_size);
adapter->tx_buf_size = (adapter->tx_buf_size / adapter->tx_buf_size = (adapter->tx_buf_size
MWIFIEX_SDIO_BLOCK_SIZE) * / MWIFIEX_SDIO_BLOCK_SIZE)
MWIFIEX_SDIO_BLOCK_SIZE; * MWIFIEX_SDIO_BLOCK_SIZE;
adapter->curr_tx_buf_size = adapter->tx_buf_size; adapter->curr_tx_buf_size = adapter->tx_buf_size;
dev_dbg(adapter->dev, dev_dbg(adapter->dev,
"cmd: max_tx_buf_size=%d, tx_buf_size=%d\n", "cmd: max_tx_buf_size=%d, tx_buf_size=%d\n",
...@@ -897,10 +898,7 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no, ...@@ -897,10 +898,7 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,
if (adapter->if_ops.update_mp_end_port) if (adapter->if_ops.update_mp_end_port)
adapter->if_ops.update_mp_end_port(adapter, adapter->if_ops.update_mp_end_port(adapter,
le16_to_cpu(resp-> le16_to_cpu(resp->params.tx_buf.mp_end_port));
params.
tx_buf.
mp_end_port));
break; break;
case HostCmd_CMD_AMSDU_AGGR_CTRL: case HostCmd_CMD_AMSDU_AGGR_CTRL:
ret = mwifiex_ret_amsdu_aggr_ctrl(resp, data_buf); ret = mwifiex_ret_amsdu_aggr_ctrl(resp, data_buf);
......
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