Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+85 −90
Original line number Diff line number Diff line
@@ -174,8 +174,8 @@ static int mwifiex_cmd_tx_rate_cfg(struct mwifiex_private *priv,
	rate_scope = (struct mwifiex_rate_scope *) ((u8 *) rate_cfg +
		      sizeof(struct host_cmd_ds_tx_rate_cfg));
	rate_scope->type = cpu_to_le16(TLV_TYPE_RATE_SCOPE);
	rate_scope->length = cpu_to_le16(sizeof(struct mwifiex_rate_scope) -
			sizeof(struct mwifiex_ie_types_header));
	rate_scope->length = cpu_to_le16
		(sizeof(*rate_scope) - sizeof(struct mwifiex_ie_types_header));
	if (pbitmap_rates != NULL) {
		rate_scope->hr_dsss_rate_bitmap = cpu_to_le16(pbitmap_rates[0]);
		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,
	cmd->command = cpu_to_le16(HostCmd_CMD_802_11_HS_CFG_ENH);

	if (!hs_activate &&
	    (hscfg_param->conditions
	    != cpu_to_le32(HOST_SLEEP_CFG_CANCEL))
	    && ((adapter->arp_filter_size > 0)
		&& (adapter->arp_filter_size <= ARP_FILTER_MAX_BUF_SIZE))) {
	    (hscfg_param->conditions != cpu_to_le32(HOST_SLEEP_CFG_CANCEL)) &&
	    ((adapter->arp_filter_size > 0) &&
	     (adapter->arp_filter_size <= ARP_FILTER_MAX_BUF_SIZE))) {
		dev_dbg(adapter->dev,
			"cmd: Attach %d bytes ArpFilter to HSCfg cmd\n",
			adapter->arp_filter_size);
		memcpy(((u8 *) hs_cfg) +
		       sizeof(struct host_cmd_ds_802_11_hs_cfg_enh),
		       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)
				+ S_DS_GEN);
	} else {
@@ -565,8 +565,8 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv,

		key_param_len = (WAPI_KEY_LEN + KEYPARAMSET_FIXED_LEN) +
				 sizeof(struct mwifiex_ie_types_header);
		cmd->size = cpu_to_le16(key_param_len +
				sizeof(key_material->action) + S_DS_GEN);
		cmd->size = cpu_to_le16(sizeof(key_material->action)
					+ S_DS_GEN +  key_param_len);
		return ret;
	}
	if (enc_key->key_len == WLAN_KEY_LEN_CCMP) {
@@ -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)
				+ sizeof(struct mwifiex_ie_types_header);

		cmd->size = cpu_to_le16(key_param_len +
				    sizeof(key_material->action) + S_DS_GEN);
		cmd->size = cpu_to_le16(sizeof(key_material->action) + S_DS_GEN
					+ key_param_len);
	}

	return ret;
@@ -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,
	       sizeof(domain->country_code));

	domain->header.len = cpu_to_le16((no_of_triplet *
				sizeof(struct ieee80211_country_ie_triplet)) +
				sizeof(domain->country_code));
	domain->header.len =
		cpu_to_le16((no_of_triplet *
			     sizeof(struct ieee80211_country_ie_triplet))
			    + sizeof(domain->country_code));

	if (no_of_triplet) {
		memcpy(domain->triplet, adapter->domain_reg.triplet,
				no_of_triplet *
				sizeof(struct ieee80211_country_ie_triplet));
		       no_of_triplet * sizeof(struct
					      ieee80211_country_ie_triplet));

		cmd->size = cpu_to_le16(sizeof(domain_info->action) +
					le16_to_cpu(domain->header.len) +
@@ -698,8 +699,8 @@ static int mwifiex_cmd_802_11_rf_channel(struct mwifiex_private *priv,
				+ S_DS_GEN);

	if (cmd_action == HostCmd_ACT_GEN_SET) {
		if ((priv->adapter->adhoc_start_band & BAND_A)
		    || (priv->adapter->adhoc_start_band & BAND_AN))
		if ((priv->adapter->adhoc_start_band & BAND_A) ||
		    (priv->adapter->adhoc_start_band & BAND_AN))
			rf_chan->rf_type =
				cpu_to_le16(HostCmd_SCAN_RADIO_TYPE_A);

@@ -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;

		cmd->size = cpu_to_le16(sizeof(*bbp_reg) + S_DS_GEN);
		bbp_reg = (struct host_cmd_ds_bbp_reg_access *) &cmd->
			params.bbp_reg;
		bbp_reg = (struct host_cmd_ds_bbp_reg_access *)
							&cmd->params.bbp_reg;
		bbp_reg->action = cpu_to_le16(cmd_action);
		bbp_reg->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,
		struct host_cmd_ds_rf_reg_access *rf_reg;

		cmd->size = cpu_to_le16(sizeof(*rf_reg) + S_DS_GEN);
		rf_reg = (struct host_cmd_ds_rf_reg_access *) &cmd->
			params.rf_reg;
		rf_reg = (struct host_cmd_ds_rf_reg_access *)
							&cmd->params.rf_reg;
		rf_reg->action = cpu_to_le16(cmd_action);
		rf_reg->offset =
			cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
		rf_reg->offset = cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
		rf_reg->value = (u8) le32_to_cpu(reg_rw->value);
		break;
	}
@@ -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;

		cmd->size = cpu_to_le16(sizeof(*cau_reg) + S_DS_GEN);
		cau_reg = (struct host_cmd_ds_rf_reg_access *) &cmd->
				params.rf_reg;
		cau_reg = (struct host_cmd_ds_rf_reg_access *)
							&cmd->params.rf_reg;
		cau_reg->action = cpu_to_le16(cmd_action);
		cau_reg->offset =
				cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
@@ -882,29 +882,25 @@ mwifiex_cmd_pcie_host_spec(struct mwifiex_private *priv,

	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 */
	host_spec->txbd_addr_lo = (u32)(card->txbd_ring_pbase);
		host_spec->txbd_addr_hi =
				(u32)(((u64)card->txbd_ring_pbase)>>32);
	host_spec->txbd_addr_hi = (u32)(((u64)card->txbd_ring_pbase)>>32);
	host_spec->txbd_count = MWIFIEX_MAX_TXRX_BD;
	host_spec->rxbd_addr_lo = (u32)(card->rxbd_ring_pbase);
		host_spec->rxbd_addr_hi =
				(u32)(((u64)card->rxbd_ring_pbase)>>32);
	host_spec->rxbd_addr_hi = (u32)(((u64)card->rxbd_ring_pbase)>>32);
	host_spec->rxbd_count = MWIFIEX_MAX_TXRX_BD;
		host_spec->evtbd_addr_lo =
				(u32)(card->evtbd_ring_pbase);
		host_spec->evtbd_addr_hi =
				(u32)(((u64)card->evtbd_ring_pbase)>>32);
	host_spec->evtbd_addr_lo = (u32)(card->evtbd_ring_pbase);
	host_spec->evtbd_addr_hi = (u32)(((u64)card->evtbd_ring_pbase)>>32);
	host_spec->evtbd_count = MWIFIEX_MAX_EVT_BD;
	if (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_hi =
						(u32) (((u64)*buf_pa) >> 32);
			dev_dbg(priv->adapter->dev, "sleep_cook_lo phy addr: "
				 "0x%x\n", host_spec->sleep_cookie_addr_lo);
		}
		host_spec->sleep_cookie_addr_hi = (u32) (((u64)*buf_pa) >> 32);
		dev_dbg(priv->adapter->dev, "sleep_cook_lo phy addr: 0x%x\n",
			host_spec->sleep_cookie_addr_lo);
	}

	return 0;
@@ -1052,8 +1048,7 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
						  data_buf);
		break;
	case HostCmd_CMD_11N_CFG:
		ret = mwifiex_cmd_11n_cfg(cmd_ptr, cmd_action,
					  data_buf);
		ret = mwifiex_cmd_11n_cfg(cmd_ptr, cmd_action, data_buf);
		break;
	case HostCmd_CMD_WMM_GET_STATUS:
		dev_dbg(priv->adapter->dev,
+29 −31
Original line number Diff line number Diff line
@@ -57,8 +57,8 @@ mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
	switch (le16_to_cpu(resp->command)) {
	case HostCmd_CMD_802_11_PS_MODE_ENH:
		pm = &resp->params.psmode_enh;
		dev_err(adapter->dev, "PS_MODE_ENH cmd failed: "
					"result=0x%x action=0x%X\n",
		dev_err(adapter->dev,
			"PS_MODE_ENH cmd failed: result=0x%x action=0x%X\n",
			resp->result, le16_to_cpu(pm->action));
		/* We do not re-try enter-ps command in ad-hoc mode. */
		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,
	u16 action = le16_to_cpu(domain_info->action);
	u8 no_of_triplet;

	no_of_triplet = (u8) ((le16_to_cpu(domain->header.len) -
					IEEE80211_COUNTRY_STRING_LEN) /
				sizeof(struct ieee80211_country_ie_triplet));
	no_of_triplet = (u8) ((le16_to_cpu(domain->header.len)
				- IEEE80211_COUNTRY_STRING_LEN)
			      / sizeof(struct ieee80211_country_ie_triplet));

	dev_dbg(priv->adapter->dev, "info: 11D Domain Info Resp:"
			" no_of_triplet=%d\n", no_of_triplet);
	dev_dbg(priv->adapter->dev,
		"info: 11D Domain Info Resp: no_of_triplet=%d\n",
		no_of_triplet);

	if (no_of_triplet > MWIFIEX_MAX_TRIPLET_802_11D) {
		dev_warn(priv->adapter->dev,
			"11D: invalid number of triplets %d "
			"returned!!\n", no_of_triplet);
			 "11D: invalid number of triplets %d returned\n",
			 no_of_triplet);
		return -1;
	}

@@ -887,9 +888,9 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,
	case HostCmd_CMD_RECONFIGURE_TX_BUFF:
		adapter->tx_buf_size = (u16) le16_to_cpu(resp->params.
							     tx_buf.buff_size);
		adapter->tx_buf_size = (adapter->tx_buf_size /
						MWIFIEX_SDIO_BLOCK_SIZE) *
						MWIFIEX_SDIO_BLOCK_SIZE;
		adapter->tx_buf_size = (adapter->tx_buf_size
					/ MWIFIEX_SDIO_BLOCK_SIZE)
				       * MWIFIEX_SDIO_BLOCK_SIZE;
		adapter->curr_tx_buf_size = adapter->tx_buf_size;
		dev_dbg(adapter->dev,
			"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,

		if (adapter->if_ops.update_mp_end_port)
			adapter->if_ops.update_mp_end_port(adapter,
					le16_to_cpu(resp->
						params.
						tx_buf.
						mp_end_port));
				le16_to_cpu(resp->params.tx_buf.mp_end_port));
		break;
	case HostCmd_CMD_AMSDU_AGGR_CTRL:
		ret = mwifiex_ret_amsdu_aggr_ctrl(resp, data_buf);