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

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

For files cfg80211.c, cfp.c, and cmdevt.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 84266841
...@@ -127,8 +127,7 @@ mwifiex_cfg80211_set_power_mgmt(struct wiphy *wiphy, ...@@ -127,8 +127,7 @@ mwifiex_cfg80211_set_power_mgmt(struct wiphy *wiphy,
if (timeout) if (timeout)
wiphy_dbg(wiphy, wiphy_dbg(wiphy,
"info: ignoring the timeout value" "info: ignore timeout value for IEEE Power Save\n");
" for IEEE power save\n");
ps_mode = enabled; ps_mode = enabled;
...@@ -350,9 +349,8 @@ mwifiex_set_rf_channel(struct mwifiex_private *priv, ...@@ -350,9 +349,8 @@ mwifiex_set_rf_channel(struct mwifiex_private *priv,
mwifiex_send_domain_info_cmd_fw(wiphy); mwifiex_send_domain_info_cmd_fw(wiphy);
} }
wiphy_dbg(wiphy, "info: setting band %d, channel offset %d and " wiphy_dbg(wiphy, "info: setting band %d, chan offset %d, mode %d\n",
"mode %d\n", config_bands, adapter->sec_chan_offset, config_bands, adapter->sec_chan_offset, priv->bss_mode);
priv->bss_mode);
if (!chan) if (!chan)
return 0; return 0;
...@@ -403,8 +401,8 @@ mwifiex_set_frag(struct mwifiex_private *priv, u32 frag_thr) ...@@ -403,8 +401,8 @@ mwifiex_set_frag(struct mwifiex_private *priv, u32 frag_thr)
{ {
int ret; int ret;
if (frag_thr < MWIFIEX_FRAG_MIN_VALUE if (frag_thr < MWIFIEX_FRAG_MIN_VALUE ||
|| frag_thr > MWIFIEX_FRAG_MAX_VALUE) frag_thr > MWIFIEX_FRAG_MAX_VALUE)
return -EINVAL; return -EINVAL;
/* Send request to firmware */ /* Send request to firmware */
...@@ -746,8 +744,7 @@ static int mwifiex_cfg80211_set_bitrate_mask(struct wiphy *wiphy, ...@@ -746,8 +744,7 @@ static int mwifiex_cfg80211_set_bitrate_mask(struct wiphy *wiphy,
adapter->channel_type = NL80211_CHAN_NO_HT; adapter->channel_type = NL80211_CHAN_NO_HT;
wiphy_debug(wiphy, "info: device configured in 802.11%s%s mode\n", wiphy_debug(wiphy, "info: device configured in 802.11%s%s mode\n",
(mode & BAND_B) ? "b" : "", (mode & BAND_B) ? "b" : "", (mode & BAND_G) ? "g" : "");
(mode & BAND_G) ? "g" : "");
return 0; return 0;
} }
...@@ -802,8 +799,7 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv) ...@@ -802,8 +799,7 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct mwifiex_private *priv)
ie_buf[1] = bss_info.ssid.ssid_len; ie_buf[1] = bss_info.ssid.ssid_len;
memcpy(&ie_buf[sizeof(struct ieee_types_header)], memcpy(&ie_buf[sizeof(struct ieee_types_header)],
&bss_info.ssid.ssid, &bss_info.ssid.ssid, bss_info.ssid.ssid_len);
bss_info.ssid.ssid_len);
ie_len = ie_buf[1] + sizeof(struct ieee_types_header); ie_len = ie_buf[1] + sizeof(struct ieee_types_header);
band = mwifiex_band_to_radio_type(priv->curr_bss_params.band); band = mwifiex_band_to_radio_type(priv->curr_bss_params.band);
...@@ -952,13 +948,14 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, ...@@ -952,13 +948,14 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
if (!bss) { if (!bss) {
if (is_scanning_required) { if (is_scanning_required) {
dev_warn(priv->adapter->dev, "assoc: requested " dev_warn(priv->adapter->dev,
"bss not found in scan results\n"); "assoc: requested bss not found in scan results\n");
break; break;
} }
is_scanning_required = 1; is_scanning_required = 1;
} else { } else {
dev_dbg(priv->adapter->dev, "info: trying to associate to %s and bssid %pM\n", dev_dbg(priv->adapter->dev,
"info: trying to associate to '%s' bssid %pM\n",
(char *) req_ssid.ssid, bss->bssid); (char *) req_ssid.ssid, bss->bssid);
memcpy(&priv->cfg_bssid, bss->bssid, ETH_ALEN); memcpy(&priv->cfg_bssid, bss->bssid, ETH_ALEN);
break; break;
...@@ -1367,6 +1364,7 @@ int mwifiex_register_cfg80211(struct mwifiex_private *priv) ...@@ -1367,6 +1364,7 @@ int mwifiex_register_cfg80211(struct mwifiex_private *priv)
int ret; int ret;
void *wdev_priv; void *wdev_priv;
struct wireless_dev *wdev; struct wireless_dev *wdev;
struct ieee80211_sta_ht_cap *ht_info;
wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
if (!wdev) { if (!wdev) {
...@@ -1383,17 +1381,17 @@ int mwifiex_register_cfg80211(struct mwifiex_private *priv) ...@@ -1383,17 +1381,17 @@ int mwifiex_register_cfg80211(struct mwifiex_private *priv)
} }
wdev->iftype = NL80211_IFTYPE_STATION; wdev->iftype = NL80211_IFTYPE_STATION;
wdev->wiphy->max_scan_ssids = 10; wdev->wiphy->max_scan_ssids = 10;
wdev->wiphy->interface_modes = wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC); BIT(NL80211_IFTYPE_ADHOC);
wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &mwifiex_band_2ghz; wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &mwifiex_band_2ghz;
mwifiex_setup_ht_caps( ht_info = &wdev->wiphy->bands[IEEE80211_BAND_2GHZ]->ht_cap;
&wdev->wiphy->bands[IEEE80211_BAND_2GHZ]->ht_cap, priv); mwifiex_setup_ht_caps(ht_info, priv);
if (priv->adapter->config_bands & BAND_A) { if (priv->adapter->config_bands & BAND_A) {
wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &mwifiex_band_5ghz; wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &mwifiex_band_5ghz;
mwifiex_setup_ht_caps( ht_info = &wdev->wiphy->bands[IEEE80211_BAND_5GHZ]->ht_cap;
&wdev->wiphy->bands[IEEE80211_BAND_5GHZ]->ht_cap, priv); mwifiex_setup_ht_caps(ht_info, priv);
} else { } else {
wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL; wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
} }
......
...@@ -158,7 +158,8 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv, ...@@ -158,7 +158,8 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
/* Set command sequence number */ /* Set command sequence number */
adapter->seq_num++; adapter->seq_num++;
host_cmd->seq_num = cpu_to_le16(HostCmd_SET_SEQ_NO_BSS_INFO host_cmd->seq_num = cpu_to_le16(HostCmd_SET_SEQ_NO_BSS_INFO
(adapter->seq_num, cmd_node->priv->bss_num, (adapter->seq_num,
cmd_node->priv->bss_num,
cmd_node->priv->bss_type)); cmd_node->priv->bss_type));
spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
...@@ -258,12 +259,12 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter) ...@@ -258,12 +259,12 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
else else
adapter->ps_state = PS_STATE_SLEEP_CFM; adapter->ps_state = PS_STATE_SLEEP_CFM;
if (!sleep_cfm_buf->resp_ctrl if (!sleep_cfm_buf->resp_ctrl &&
&& (adapter->is_hs_configured (adapter->is_hs_configured &&
&& !adapter->sleep_period.period)) { !adapter->sleep_period.period)) {
adapter->pm_wakeup_card_req = true; adapter->pm_wakeup_card_req = true;
mwifiex_hs_activated_event(mwifiex_get_priv(adapter, mwifiex_hs_activated_event(mwifiex_get_priv
MWIFIEX_BSS_ROLE_STA), true); (adapter, MWIFIEX_BSS_ROLE_STA), true);
} }
} }
...@@ -578,8 +579,8 @@ mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter, ...@@ -578,8 +579,8 @@ mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter,
if (command == HostCmd_CMD_802_11_PS_MODE_ENH) { if (command == HostCmd_CMD_802_11_PS_MODE_ENH) {
struct host_cmd_ds_802_11_ps_mode_enh *pm = struct host_cmd_ds_802_11_ps_mode_enh *pm =
&host_cmd->params.psmode_enh; &host_cmd->params.psmode_enh;
if ((le16_to_cpu(pm->action) == DIS_PS) if ((le16_to_cpu(pm->action) == DIS_PS) ||
|| (le16_to_cpu(pm->action) == DIS_AUTO_PS)) { (le16_to_cpu(pm->action) == DIS_AUTO_PS)) {
if (adapter->ps_state != PS_STATE_AWAKE) if (adapter->ps_state != PS_STATE_AWAKE)
add_tail = false; add_tail = false;
} }
...@@ -761,8 +762,8 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter) ...@@ -761,8 +762,8 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
if (adapter->curr_cmd->cmd_flag & CMD_F_HOSTCMD) { if (adapter->curr_cmd->cmd_flag & CMD_F_HOSTCMD) {
adapter->curr_cmd->cmd_flag &= ~CMD_F_HOSTCMD; adapter->curr_cmd->cmd_flag &= ~CMD_F_HOSTCMD;
if ((cmdresp_result == HostCmd_RESULT_OK) if ((cmdresp_result == HostCmd_RESULT_OK) &&
&& (cmdresp_no == HostCmd_CMD_802_11_HS_CFG_ENH)) (cmdresp_no == HostCmd_CMD_802_11_HS_CFG_ENH))
ret = mwifiex_ret_802_11_hs_cfg(priv, resp); ret = mwifiex_ret_802_11_hs_cfg(priv, resp);
} else { } else {
/* handle response */ /* handle response */
...@@ -824,9 +825,9 @@ mwifiex_cmd_timeout_func(unsigned long function_context) ...@@ -824,9 +825,9 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
adapter->dbg.timeout_cmd_act = adapter->dbg.timeout_cmd_act =
adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index]; adapter->dbg.last_cmd_act[adapter->dbg.last_cmd_index];
do_gettimeofday(&tstamp); do_gettimeofday(&tstamp);
dev_err(adapter->dev, "%s: Timeout cmd id (%lu.%lu) = %#x," dev_err(adapter->dev,
" act = %#x\n", __func__, "%s: Timeout cmd id (%lu.%lu) = %#x, act = %#x\n",
tstamp.tv_sec, tstamp.tv_usec, __func__, tstamp.tv_sec, tstamp.tv_usec,
adapter->dbg.timeout_cmd_id, adapter->dbg.timeout_cmd_id,
adapter->dbg.timeout_cmd_act); adapter->dbg.timeout_cmd_act);
...@@ -850,7 +851,8 @@ mwifiex_cmd_timeout_func(unsigned long function_context) ...@@ -850,7 +851,8 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
dev_err(adapter->dev, "last_cmd_resp_index = %d\n", dev_err(adapter->dev, "last_cmd_resp_index = %d\n",
adapter->dbg.last_cmd_resp_index); adapter->dbg.last_cmd_resp_index);
print_hex_dump_bytes("last_cmd_resp_id: ", DUMP_PREFIX_OFFSET, print_hex_dump_bytes("last_cmd_resp_id: ", DUMP_PREFIX_OFFSET,
adapter->dbg.last_cmd_resp_id, DBG_CMD_NUM); adapter->dbg.last_cmd_resp_id,
DBG_CMD_NUM);
dev_err(adapter->dev, "last_event_index = %d\n", dev_err(adapter->dev, "last_event_index = %d\n",
adapter->dbg.last_event_index); adapter->dbg.last_event_index);
...@@ -1078,7 +1080,8 @@ mwifiex_process_hs_config(struct mwifiex_adapter *adapter) ...@@ -1078,7 +1080,8 @@ mwifiex_process_hs_config(struct mwifiex_adapter *adapter)
adapter->hs_activated = false; adapter->hs_activated = false;
adapter->is_hs_configured = false; adapter->is_hs_configured = false;
mwifiex_hs_activated_event(mwifiex_get_priv(adapter, mwifiex_hs_activated_event(mwifiex_get_priv(adapter,
MWIFIEX_BSS_ROLE_ANY), false); MWIFIEX_BSS_ROLE_ANY),
false);
} }
/* /*
...@@ -1114,8 +1117,9 @@ mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *adapter, ...@@ -1114,8 +1117,9 @@ mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *adapter,
command &= HostCmd_CMD_ID_MASK; command &= HostCmd_CMD_ID_MASK;
if (command != HostCmd_CMD_802_11_PS_MODE_ENH) { if (command != HostCmd_CMD_802_11_PS_MODE_ENH) {
dev_err(adapter->dev, "%s: received unexpected response for" dev_err(adapter->dev,
" cmd %x, result = %x\n", __func__, command, result); "%s: rcvd unexpected resp for cmd %#x, result = %x\n",
__func__, command, result);
return; return;
} }
...@@ -1128,8 +1132,9 @@ mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *adapter, ...@@ -1128,8 +1132,9 @@ mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *adapter,
} }
adapter->pm_wakeup_card_req = true; adapter->pm_wakeup_card_req = true;
if (adapter->is_hs_configured) if (adapter->is_hs_configured)
mwifiex_hs_activated_event(mwifiex_get_priv(adapter, mwifiex_hs_activated_event(mwifiex_get_priv
MWIFIEX_BSS_ROLE_ANY), true); (adapter, MWIFIEX_BSS_ROLE_ANY),
true);
adapter->ps_state = PS_STATE_SLEEP; adapter->ps_state = PS_STATE_SLEEP;
cmd->command = cpu_to_le16(command); cmd->command = cpu_to_le16(command);
cmd->seq_num = cpu_to_le16(seq_num); cmd->seq_num = cpu_to_le16(seq_num);
...@@ -1198,8 +1203,7 @@ int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv, ...@@ -1198,8 +1203,7 @@ int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
cpu_to_le16(adapter->adhoc_awake_period); cpu_to_le16(adapter->adhoc_awake_period);
ps_mode->delay_to_ps = ps_mode->delay_to_ps =
cpu_to_le16(adapter->delay_to_ps); cpu_to_le16(adapter->delay_to_ps);
ps_mode->mode = ps_mode->mode = cpu_to_le16(adapter->enhanced_ps_mode);
cpu_to_le16(adapter->enhanced_ps_mode);
} }
if (ps_bitmap & BITMAP_AUTO_DS) { if (ps_bitmap & BITMAP_AUTO_DS) {
...@@ -1244,7 +1248,8 @@ int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv, ...@@ -1244,7 +1248,8 @@ int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv,
uint16_t auto_ps_bitmap = uint16_t auto_ps_bitmap =
le16_to_cpu(ps_mode->params.ps_bitmap); le16_to_cpu(ps_mode->params.ps_bitmap);
dev_dbg(adapter->dev, "info: %s: PS_MODE cmd reply result=%#x action=%#X\n", dev_dbg(adapter->dev,
"info: %s: PS_MODE cmd reply result=%#x action=%#X\n",
__func__, resp->result, action); __func__, resp->result, action);
if (action == EN_AUTO_PS) { if (action == EN_AUTO_PS) {
if (auto_ps_bitmap & BITMAP_AUTO_DS) { if (auto_ps_bitmap & BITMAP_AUTO_DS) {
...@@ -1254,7 +1259,8 @@ int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv, ...@@ -1254,7 +1259,8 @@ int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv,
if (auto_ps_bitmap & BITMAP_STA_PS) { if (auto_ps_bitmap & BITMAP_STA_PS) {
dev_dbg(adapter->dev, "cmd: Enabled STA power save\n"); dev_dbg(adapter->dev, "cmd: Enabled STA power save\n");
if (adapter->sleep_period.period) if (adapter->sleep_period.period)
dev_dbg(adapter->dev, "cmd: set to uapsd/pps mode\n"); dev_dbg(adapter->dev,
"cmd: set to uapsd/pps mode\n");
} }
} else if (action == DIS_AUTO_PS) { } else if (action == DIS_AUTO_PS) {
if (ps_bitmap & BITMAP_AUTO_DS) { if (ps_bitmap & BITMAP_AUTO_DS) {
...@@ -1376,7 +1382,8 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv, ...@@ -1376,7 +1382,8 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
adapter->fw_release_number); adapter->fw_release_number);
dev_dbg(adapter->dev, "info: GET_HW_SPEC: permanent addr: %pM\n", dev_dbg(adapter->dev, "info: GET_HW_SPEC: permanent addr: %pM\n",
hw_spec->permanent_addr); hw_spec->permanent_addr);
dev_dbg(adapter->dev, "info: GET_HW_SPEC: hw_if_version=%#x version=%#x\n", dev_dbg(adapter->dev,
"info: GET_HW_SPEC: hw_if_version=%#x version=%#x\n",
le16_to_cpu(hw_spec->hw_if_version), le16_to_cpu(hw_spec->hw_if_version),
le16_to_cpu(hw_spec->version)); le16_to_cpu(hw_spec->version));
...@@ -1393,7 +1400,8 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv, ...@@ -1393,7 +1400,8 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
/* If it's unidentified region code, use the default (USA) */ /* If it's unidentified region code, use the default (USA) */
if (i >= MWIFIEX_MAX_REGION_CODE) { if (i >= MWIFIEX_MAX_REGION_CODE) {
adapter->region_code = 0x10; adapter->region_code = 0x10;
dev_dbg(adapter->dev, "cmd: unknown region code, use default (USA)\n"); dev_dbg(adapter->dev,
"cmd: unknown region code, use default (USA)\n");
} }
adapter->hw_dot_11n_dev_cap = le32_to_cpu(hw_spec->dot_11n_dev_cap); adapter->hw_dot_11n_dev_cap = le32_to_cpu(hw_spec->dot_11n_dev_cap);
......
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