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

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

For files fw.h, init.c and join.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 aea0701e
...@@ -117,8 +117,8 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { ...@@ -117,8 +117,8 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
#define BA_STREAM_NOT_ALLOWED 0xff #define BA_STREAM_NOT_ALLOWED 0xff
#define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \ #define IS_11N_ENABLED(priv) ((priv->adapter->config_bands & BAND_GN || \
priv->adapter->config_bands & BAND_AN) \ priv->adapter->config_bands & BAND_AN) && \
&& priv->curr_bss_params.bss_descriptor.bcn_ht_cap) priv->curr_bss_params.bss_descriptor.bcn_ht_cap)
#define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\ #define INITIATOR_BIT(DelBAParamSet) (((DelBAParamSet) &\
BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS) BIT(DELBA_INITIATOR_POS)) >> DELBA_INITIATOR_POS)
......
...@@ -35,6 +35,7 @@ static int mwifiex_add_bss_prio_tbl(struct mwifiex_private *priv) ...@@ -35,6 +35,7 @@ static int mwifiex_add_bss_prio_tbl(struct mwifiex_private *priv)
{ {
struct mwifiex_adapter *adapter = priv->adapter; struct mwifiex_adapter *adapter = priv->adapter;
struct mwifiex_bss_prio_node *bss_prio; struct mwifiex_bss_prio_node *bss_prio;
struct mwifiex_bss_prio_tbl *tbl = adapter->bss_prio_tbl;
unsigned long flags; unsigned long flags;
bss_prio = kzalloc(sizeof(struct mwifiex_bss_prio_node), GFP_KERNEL); bss_prio = kzalloc(sizeof(struct mwifiex_bss_prio_node), GFP_KERNEL);
...@@ -46,17 +47,12 @@ static int mwifiex_add_bss_prio_tbl(struct mwifiex_private *priv) ...@@ -46,17 +47,12 @@ static int mwifiex_add_bss_prio_tbl(struct mwifiex_private *priv)
bss_prio->priv = priv; bss_prio->priv = priv;
INIT_LIST_HEAD(&bss_prio->list); INIT_LIST_HEAD(&bss_prio->list);
if (!adapter->bss_prio_tbl[priv->bss_priority].bss_prio_cur) if (!tbl[priv->bss_priority].bss_prio_cur)
adapter->bss_prio_tbl[priv->bss_priority].bss_prio_cur = tbl[priv->bss_priority].bss_prio_cur = bss_prio;
bss_prio;
spin_lock_irqsave(&tbl[priv->bss_priority].bss_prio_lock, flags);
spin_lock_irqsave(&adapter->bss_prio_tbl[priv->bss_priority] list_add_tail(&bss_prio->list, &tbl[priv->bss_priority].bss_prio_head);
.bss_prio_lock, flags); spin_unlock_irqrestore(&tbl[priv->bss_priority].bss_prio_lock, flags);
list_add_tail(&bss_prio->list,
&adapter->bss_prio_tbl[priv->bss_priority]
.bss_prio_head);
spin_unlock_irqrestore(&adapter->bss_prio_tbl[priv->bss_priority]
.bss_prio_lock, flags);
return 0; return 0;
} }
...@@ -520,7 +516,7 @@ static void mwifiex_delete_bss_prio_tbl(struct mwifiex_private *priv) ...@@ -520,7 +516,7 @@ static void mwifiex_delete_bss_prio_tbl(struct mwifiex_private *priv)
struct mwifiex_adapter *adapter = priv->adapter; struct mwifiex_adapter *adapter = priv->adapter;
struct mwifiex_bss_prio_node *bssprio_node, *tmp_node, **cur; struct mwifiex_bss_prio_node *bssprio_node, *tmp_node, **cur;
struct list_head *head; struct list_head *head;
spinlock_t *lock; spinlock_t *lock; /* bss priority lock */
unsigned long flags; unsigned long flags;
for (i = 0; i < adapter->priv_num; ++i) { for (i = 0; i < adapter->priv_num; ++i) {
...@@ -646,8 +642,7 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter, ...@@ -646,8 +642,7 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter,
/* Check if we are the winner for downloading FW */ /* Check if we are the winner for downloading FW */
if (!adapter->winner) { if (!adapter->winner) {
dev_notice(adapter->dev, dev_notice(adapter->dev,
"Other interface already running!" "Other intf already running! Skip FW download\n");
" Skip FW download\n");
poll_num = MAX_MULTI_INTERFACE_POLL_TRIES; poll_num = MAX_MULTI_INTERFACE_POLL_TRIES;
goto poll_fw; goto poll_fw;
} }
......
...@@ -52,7 +52,8 @@ mwifiex_cmd_append_generic_ie(struct mwifiex_private *priv, u8 **buffer) ...@@ -52,7 +52,8 @@ mwifiex_cmd_append_generic_ie(struct mwifiex_private *priv, u8 **buffer)
* parameter buffer pointer. * parameter buffer pointer.
*/ */
if (priv->gen_ie_buf_len) { if (priv->gen_ie_buf_len) {
dev_dbg(priv->adapter->dev, "info: %s: append generic %d to %p\n", dev_dbg(priv->adapter->dev,
"info: %s: append generic ie len %d to %p\n",
__func__, priv->gen_ie_buf_len, *buffer); __func__, priv->gen_ie_buf_len, *buffer);
/* Wrap the generic IE buffer with a pass through TLV type */ /* Wrap the generic IE buffer with a pass through TLV type */
...@@ -123,8 +124,9 @@ mwifiex_cmd_append_tsf_tlv(struct mwifiex_private *priv, u8 **buffer, ...@@ -123,8 +124,9 @@ mwifiex_cmd_append_tsf_tlv(struct mwifiex_private *priv, u8 **buffer,
memcpy(&tsf_val, bss_desc->time_stamp, sizeof(tsf_val)); memcpy(&tsf_val, bss_desc->time_stamp, sizeof(tsf_val));
dev_dbg(priv->adapter->dev, "info: %s: TSF offset calc: %016llx - " dev_dbg(priv->adapter->dev,
"%016llx\n", __func__, tsf_val, bss_desc->network_tsf); "info: %s: TSF offset calc: %016llx - %016llx\n",
__func__, tsf_val, bss_desc->network_tsf);
memcpy(*buffer, &tsf_val, sizeof(tsf_val)); memcpy(*buffer, &tsf_val, sizeof(tsf_val));
*buffer += sizeof(tsf_val); *buffer += sizeof(tsf_val);
...@@ -425,12 +427,12 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv, ...@@ -425,12 +427,12 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
pos += sizeof(auth_tlv->header) + le16_to_cpu(auth_tlv->header.len); pos += sizeof(auth_tlv->header) + le16_to_cpu(auth_tlv->header.len);
if (IS_SUPPORT_MULTI_BANDS(priv->adapter) if (IS_SUPPORT_MULTI_BANDS(priv->adapter) &&
&& !(ISSUPP_11NENABLED(priv->adapter->fw_cap_info) !(ISSUPP_11NENABLED(priv->adapter->fw_cap_info) &&
&& (!bss_desc->disable_11n) (!bss_desc->disable_11n) &&
&& (priv->adapter->config_bands & BAND_GN (priv->adapter->config_bands & BAND_GN ||
|| priv->adapter->config_bands & BAND_AN) priv->adapter->config_bands & BAND_AN) &&
&& (bss_desc->bcn_ht_cap) (bss_desc->bcn_ht_cap)
) )
) { ) {
/* Append a channel TLV for the channel the attempted AP was /* Append a channel TLV for the channel the attempted AP was
...@@ -464,10 +466,10 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv, ...@@ -464,10 +466,10 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
return -1; return -1;
} }
if (ISSUPP_11NENABLED(priv->adapter->fw_cap_info) if (ISSUPP_11NENABLED(priv->adapter->fw_cap_info) &&
&& (!bss_desc->disable_11n) (!bss_desc->disable_11n) &&
&& (priv->adapter->config_bands & BAND_GN (priv->adapter->config_bands & BAND_GN ||
|| priv->adapter->config_bands & BAND_AN)) priv->adapter->config_bands & BAND_AN))
mwifiex_cmd_append_11n_tlv(priv, bss_desc, &pos); mwifiex_cmd_append_11n_tlv(priv, bss_desc, &pos);
/* Append vendor specific IE TLV */ /* Append vendor specific IE TLV */
...@@ -579,8 +581,8 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv, ...@@ -579,8 +581,8 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
if (le16_to_cpu(assoc_rsp->status_code)) { if (le16_to_cpu(assoc_rsp->status_code)) {
priv->adapter->dbg.num_cmd_assoc_failure++; priv->adapter->dbg.num_cmd_assoc_failure++;
dev_err(priv->adapter->dev, "ASSOC_RESP: association failed, " dev_err(priv->adapter->dev,
"status code = %d, error = 0x%x, a_id = 0x%x\n", "ASSOC_RESP: failed, status code=%d err=%#x a_id=%#x\n",
le16_to_cpu(assoc_rsp->status_code), le16_to_cpu(assoc_rsp->status_code),
le16_to_cpu(assoc_rsp->cap_info_bitmap), le16_to_cpu(assoc_rsp->cap_info_bitmap),
le16_to_cpu(assoc_rsp->a_id)); le16_to_cpu(assoc_rsp->a_id));
...@@ -617,8 +619,8 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv, ...@@ -617,8 +619,8 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
else else
priv->curr_bss_params.wmm_enabled = false; priv->curr_bss_params.wmm_enabled = false;
if ((priv->wmm_required || bss_desc->bcn_ht_cap) if ((priv->wmm_required || bss_desc->bcn_ht_cap) &&
&& priv->curr_bss_params.wmm_enabled) priv->curr_bss_params.wmm_enabled)
priv->wmm_enabled = true; priv->wmm_enabled = true;
else else
priv->wmm_enabled = false; priv->wmm_enabled = false;
...@@ -882,8 +884,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv, ...@@ -882,8 +884,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
chan_tlv->chan_scan_param[0].radio_type chan_tlv->chan_scan_param[0].radio_type
= mwifiex_band_to_radio_type(priv->curr_bss_params.band); = mwifiex_band_to_radio_type(priv->curr_bss_params.band);
if (adapter->adhoc_start_band & BAND_GN if (adapter->adhoc_start_band & BAND_GN ||
|| adapter->adhoc_start_band & BAND_AN) { adapter->adhoc_start_band & BAND_AN) {
if (adapter->sec_chan_offset == if (adapter->sec_chan_offset ==
IEEE80211_HT_PARAM_CHA_SEC_ABOVE) IEEE80211_HT_PARAM_CHA_SEC_ABOVE)
chan_tlv->chan_scan_param[0].radio_type |= chan_tlv->chan_scan_param[0].radio_type |=
...@@ -925,8 +927,7 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv, ...@@ -925,8 +927,7 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
mwifiex_fill_cap_info(priv, radio_type, ht_cap); mwifiex_fill_cap_info(priv, radio_type, ht_cap);
pos += sizeof(struct mwifiex_ie_types_htcap); pos += sizeof(struct mwifiex_ie_types_htcap);
cmd_append_size += cmd_append_size += sizeof(struct mwifiex_ie_types_htcap);
sizeof(struct mwifiex_ie_types_htcap);
/* Fill HT INFORMATION */ /* Fill HT INFORMATION */
ht_info = (struct mwifiex_ie_types_htinfo *) pos; ht_info = (struct mwifiex_ie_types_htinfo *) pos;
...@@ -950,8 +951,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv, ...@@ -950,8 +951,8 @@ mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv,
sizeof(struct mwifiex_ie_types_htinfo); sizeof(struct mwifiex_ie_types_htinfo);
} }
cmd->size = cpu_to_le16((u16) cmd->size =
(sizeof(struct host_cmd_ds_802_11_ad_hoc_start) cpu_to_le16((u16)(sizeof(struct host_cmd_ds_802_11_ad_hoc_start)
+ S_DS_GEN + cmd_append_size)); + S_DS_GEN + cmd_append_size));
if (adapter->adhoc_start_band == BAND_B) if (adapter->adhoc_start_band == BAND_B)
...@@ -1039,11 +1040,12 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv, ...@@ -1039,11 +1040,12 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
tmp_cap &= CAPINFO_MASK; tmp_cap &= CAPINFO_MASK;
dev_dbg(priv->adapter->dev, "info: ADHOC_J_CMD: tmp_cap=%4X" dev_dbg(priv->adapter->dev,
" CAPINFO_MASK=%4lX\n", tmp_cap, CAPINFO_MASK); "info: ADHOC_J_CMD: tmp_cap=%4X CAPINFO_MASK=%4lX\n",
tmp_cap, CAPINFO_MASK);
/* Information on BSSID descriptor passed to FW */ /* Information on BSSID descriptor passed to FW */
dev_dbg(priv->adapter->dev, "info: ADHOC_J_CMD: BSSID = %pM, SSID = %s\n", dev_dbg(priv->adapter->dev, "info: ADHOC_J_CMD: BSSID=%pM, SSID='%s'\n",
adhoc_join->bss_descriptor.bssid, adhoc_join->bss_descriptor.bssid,
adhoc_join->bss_descriptor.ssid); adhoc_join->bss_descriptor.ssid);
...@@ -1082,13 +1084,13 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv, ...@@ -1082,13 +1084,13 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
sizeof(struct mwifiex_chan_scan_param_set)); sizeof(struct mwifiex_chan_scan_param_set));
chan_tlv->chan_scan_param[0].chan_number = chan_tlv->chan_scan_param[0].chan_number =
(bss_desc->phy_param_set.ds_param_set.current_chan); (bss_desc->phy_param_set.ds_param_set.current_chan);
dev_dbg(priv->adapter->dev, "info: ADHOC_J_CMD: TLV Chan = %d\n", dev_dbg(priv->adapter->dev, "info: ADHOC_J_CMD: TLV Chan=%d\n",
chan_tlv->chan_scan_param[0].chan_number); chan_tlv->chan_scan_param[0].chan_number);
chan_tlv->chan_scan_param[0].radio_type = chan_tlv->chan_scan_param[0].radio_type =
mwifiex_band_to_radio_type((u8) bss_desc->bss_band); mwifiex_band_to_radio_type((u8) bss_desc->bss_band);
dev_dbg(priv->adapter->dev, "info: ADHOC_J_CMD: TLV Band = %d\n", dev_dbg(priv->adapter->dev, "info: ADHOC_J_CMD: TLV Band=%d\n",
chan_tlv->chan_scan_param[0].radio_type); chan_tlv->chan_scan_param[0].radio_type);
pos += sizeof(chan_tlv->header) + pos += sizeof(chan_tlv->header) +
sizeof(struct mwifiex_chan_scan_param_set); sizeof(struct mwifiex_chan_scan_param_set);
...@@ -1110,8 +1112,8 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv, ...@@ -1110,8 +1112,8 @@ mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv,
cmd_append_size += mwifiex_cmd_append_vsie_tlv(priv, cmd_append_size += mwifiex_cmd_append_vsie_tlv(priv,
MWIFIEX_VSIE_MASK_ADHOC, &pos); MWIFIEX_VSIE_MASK_ADHOC, &pos);
cmd->size = cpu_to_le16((u16) cmd->size = cpu_to_le16
(sizeof(struct host_cmd_ds_802_11_ad_hoc_join) ((u16) (sizeof(struct host_cmd_ds_802_11_ad_hoc_join)
+ S_DS_GEN + cmd_append_size)); + S_DS_GEN + cmd_append_size));
adhoc_join->bss_descriptor.cap_info_bitmap = cpu_to_le16(tmp_cap); adhoc_join->bss_descriptor.cap_info_bitmap = cpu_to_le16(tmp_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