aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r--drivers/net/wireless/mwifiex/11n.c14
-rw-r--r--drivers/net/wireless/mwifiex/11n.h3
-rw-r--r--drivers/net/wireless/mwifiex/11n_rxreorder.c18
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c2
-rw-r--r--drivers/net/wireless/mwifiex/join.c20
-rw-r--r--drivers/net/wireless/mwifiex/scan.c24
-rw-r--r--drivers/net/wireless/mwifiex/sta_cmd.c16
-rw-r--r--drivers/net/wireless/mwifiex/sta_cmdresp.c24
-rw-r--r--drivers/net/wireless/mwifiex/sta_event.c2
9 files changed, 44 insertions, 79 deletions
diff --git a/drivers/net/wireless/mwifiex/11n.c b/drivers/net/wireless/mwifiex/11n.c
index fe8ebfebcc0e..e535c937628b 100644
--- a/drivers/net/wireless/mwifiex/11n.c
+++ b/drivers/net/wireless/mwifiex/11n.c
@@ -101,8 +101,7 @@ int mwifiex_ret_11n_delba(struct mwifiex_private *priv,
101{ 101{
102 int tid; 102 int tid;
103 struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl; 103 struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl;
104 struct host_cmd_ds_11n_delba *del_ba = 104 struct host_cmd_ds_11n_delba *del_ba = &resp->params.del_ba;
105 (struct host_cmd_ds_11n_delba *) &resp->params.del_ba;
106 uint16_t del_ba_param_set = le16_to_cpu(del_ba->del_ba_param_set); 105 uint16_t del_ba_param_set = le16_to_cpu(del_ba->del_ba_param_set);
107 106
108 tid = del_ba_param_set >> DELBA_TID_POS; 107 tid = del_ba_param_set >> DELBA_TID_POS;
@@ -147,8 +146,7 @@ int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv,
147 struct host_cmd_ds_command *resp) 146 struct host_cmd_ds_command *resp)
148{ 147{
149 int tid; 148 int tid;
150 struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = 149 struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = &resp->params.add_ba_rsp;
151 (struct host_cmd_ds_11n_addba_rsp *) &resp->params.add_ba_rsp;
152 struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl; 150 struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl;
153 151
154 add_ba_rsp->ssn = cpu_to_le16((le16_to_cpu(add_ba_rsp->ssn)) 152 add_ba_rsp->ssn = cpu_to_le16((le16_to_cpu(add_ba_rsp->ssn))
@@ -412,7 +410,7 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
412 410
413 memcpy((u8 *) bss_co_2040 + 411 memcpy((u8 *) bss_co_2040 +
414 sizeof(struct mwifiex_ie_types_header), 412 sizeof(struct mwifiex_ie_types_header),
415 (u8 *) bss_desc->bcn_bss_co_2040 + 413 bss_desc->bcn_bss_co_2040 +
416 sizeof(struct ieee_types_header), 414 sizeof(struct ieee_types_header),
417 le16_to_cpu(bss_co_2040->header.len)); 415 le16_to_cpu(bss_co_2040->header.len));
418 416
@@ -426,10 +424,8 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
426 ext_cap->header.type = cpu_to_le16(WLAN_EID_EXT_CAPABILITY); 424 ext_cap->header.type = cpu_to_le16(WLAN_EID_EXT_CAPABILITY);
427 ext_cap->header.len = cpu_to_le16(sizeof(ext_cap->ext_cap)); 425 ext_cap->header.len = cpu_to_le16(sizeof(ext_cap->ext_cap));
428 426
429 memcpy((u8 *) ext_cap + 427 memcpy((u8 *)ext_cap + sizeof(struct mwifiex_ie_types_header),
430 sizeof(struct mwifiex_ie_types_header), 428 bss_desc->bcn_ext_cap + sizeof(struct ieee_types_header),
431 (u8 *) bss_desc->bcn_ext_cap +
432 sizeof(struct ieee_types_header),
433 le16_to_cpu(ext_cap->header.len)); 429 le16_to_cpu(ext_cap->header.len));
434 430
435 *buffer += sizeof(struct mwifiex_ie_types_extcap); 431 *buffer += sizeof(struct mwifiex_ie_types_extcap);
diff --git a/drivers/net/wireless/mwifiex/11n.h b/drivers/net/wireless/mwifiex/11n.h
index 77646d777dce..28366e9211fb 100644
--- a/drivers/net/wireless/mwifiex/11n.h
+++ b/drivers/net/wireless/mwifiex/11n.h
@@ -105,8 +105,7 @@ static inline u8 mwifiex_space_avail_for_new_ba_stream(
105 priv = adapter->priv[i]; 105 priv = adapter->priv[i];
106 if (priv) 106 if (priv)
107 ba_stream_num += mwifiex_wmm_list_len( 107 ba_stream_num += mwifiex_wmm_list_len(
108 (struct list_head *) 108 &priv->tx_ba_stream_tbl_ptr);
109 &priv->tx_ba_stream_tbl_ptr);
110 } 109 }
111 110
112 return ((ba_stream_num < 111 return ((ba_stream_num <
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.c b/drivers/net/wireless/mwifiex/11n_rxreorder.c
index 9c44088054dd..89f7c570cd2e 100644
--- a/drivers/net/wireless/mwifiex/11n_rxreorder.c
+++ b/drivers/net/wireless/mwifiex/11n_rxreorder.c
@@ -296,9 +296,7 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
296 */ 296 */
297int mwifiex_cmd_11n_addba_req(struct host_cmd_ds_command *cmd, void *data_buf) 297int mwifiex_cmd_11n_addba_req(struct host_cmd_ds_command *cmd, void *data_buf)
298{ 298{
299 struct host_cmd_ds_11n_addba_req *add_ba_req = 299 struct host_cmd_ds_11n_addba_req *add_ba_req = &cmd->params.add_ba_req;
300 (struct host_cmd_ds_11n_addba_req *)
301 &cmd->params.add_ba_req;
302 300
303 cmd->command = cpu_to_le16(HostCmd_CMD_11N_ADDBA_REQ); 301 cmd->command = cpu_to_le16(HostCmd_CMD_11N_ADDBA_REQ);
304 cmd->size = cpu_to_le16(sizeof(*add_ba_req) + S_DS_GEN); 302 cmd->size = cpu_to_le16(sizeof(*add_ba_req) + S_DS_GEN);
@@ -320,9 +318,7 @@ int mwifiex_cmd_11n_addba_rsp_gen(struct mwifiex_private *priv,
320 struct host_cmd_ds_11n_addba_req 318 struct host_cmd_ds_11n_addba_req
321 *cmd_addba_req) 319 *cmd_addba_req)
322{ 320{
323 struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = 321 struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = &cmd->params.add_ba_rsp;
324 (struct host_cmd_ds_11n_addba_rsp *)
325 &cmd->params.add_ba_rsp;
326 u8 tid; 322 u8 tid;
327 int win_size; 323 int win_size;
328 uint16_t block_ack_param_set; 324 uint16_t block_ack_param_set;
@@ -367,8 +363,7 @@ int mwifiex_cmd_11n_addba_rsp_gen(struct mwifiex_private *priv,
367 */ 363 */
368int mwifiex_cmd_11n_delba(struct host_cmd_ds_command *cmd, void *data_buf) 364int mwifiex_cmd_11n_delba(struct host_cmd_ds_command *cmd, void *data_buf)
369{ 365{
370 struct host_cmd_ds_11n_delba *del_ba = (struct host_cmd_ds_11n_delba *) 366 struct host_cmd_ds_11n_delba *del_ba = &cmd->params.del_ba;
371 &cmd->params.del_ba;
372 367
373 cmd->command = cpu_to_le16(HostCmd_CMD_11N_DELBA); 368 cmd->command = cpu_to_le16(HostCmd_CMD_11N_DELBA);
374 cmd->size = cpu_to_le16(sizeof(*del_ba) + S_DS_GEN); 369 cmd->size = cpu_to_le16(sizeof(*del_ba) + S_DS_GEN);
@@ -398,8 +393,7 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv,
398 int start_win, end_win, win_size; 393 int start_win, end_win, win_size;
399 u16 pkt_index; 394 u16 pkt_index;
400 395
401 tbl = mwifiex_11n_get_rx_reorder_tbl((struct mwifiex_private *) priv, 396 tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid, ta);
402 tid, ta);
403 if (!tbl) { 397 if (!tbl) {
404 if (pkt_type != PKT_TYPE_BAR) 398 if (pkt_type != PKT_TYPE_BAR)
405 mwifiex_process_rx_packet(priv->adapter, payload); 399 mwifiex_process_rx_packet(priv->adapter, payload);
@@ -520,9 +514,7 @@ mwifiex_del_ba_tbl(struct mwifiex_private *priv, int tid, u8 *peer_mac,
520int mwifiex_ret_11n_addba_resp(struct mwifiex_private *priv, 514int mwifiex_ret_11n_addba_resp(struct mwifiex_private *priv,
521 struct host_cmd_ds_command *resp) 515 struct host_cmd_ds_command *resp)
522{ 516{
523 struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = 517 struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = &resp->params.add_ba_rsp;
524 (struct host_cmd_ds_11n_addba_rsp *)
525 &resp->params.add_ba_rsp;
526 int tid, win_size; 518 int tid, win_size;
527 struct mwifiex_rx_reorder_tbl *tbl; 519 struct mwifiex_rx_reorder_tbl *tbl;
528 uint16_t block_ack_param_set; 520 uint16_t block_ack_param_set;
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 87671446e24b..42c1af943111 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1703,7 +1703,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
1703 wdev_priv = wiphy_priv(wiphy); 1703 wdev_priv = wiphy_priv(wiphy);
1704 *(unsigned long *)wdev_priv = (unsigned long)adapter; 1704 *(unsigned long *)wdev_priv = (unsigned long)adapter;
1705 1705
1706 set_wiphy_dev(wiphy, (struct device *)priv->adapter->dev); 1706 set_wiphy_dev(wiphy, priv->adapter->dev);
1707 1707
1708 ret = wiphy_register(wiphy); 1708 ret = wiphy_register(wiphy);
1709 if (ret < 0) { 1709 if (ret < 0) {
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index d6b4fb04011f..82e63cee1e97 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -1349,22 +1349,16 @@ static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac)
1349{ 1349{
1350 u8 mac_address[ETH_ALEN]; 1350 u8 mac_address[ETH_ALEN];
1351 int ret; 1351 int ret;
1352 u8 zero_mac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 };
1353 1352
1354 if (mac) { 1353 if (!mac || is_zero_ether_addr(mac))
1355 if (!memcmp(mac, zero_mac, sizeof(zero_mac))) 1354 memcpy(mac_address,
1356 memcpy((u8 *) &mac_address, 1355 priv->curr_bss_params.bss_descriptor.mac_address,
1357 (u8 *) &priv->curr_bss_params.bss_descriptor. 1356 ETH_ALEN);
1358 mac_address, ETH_ALEN); 1357 else
1359 else 1358 memcpy(mac_address, mac, ETH_ALEN);
1360 memcpy((u8 *) &mac_address, (u8 *) mac, ETH_ALEN);
1361 } else {
1362 memcpy((u8 *) &mac_address, (u8 *) &priv->curr_bss_params.
1363 bss_descriptor.mac_address, ETH_ALEN);
1364 }
1365 1359
1366 ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_DEAUTHENTICATE, 1360 ret = mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_DEAUTHENTICATE,
1367 HostCmd_ACT_GEN_SET, 0, &mac_address); 1361 HostCmd_ACT_GEN_SET, 0, mac_address);
1368 1362
1369 return ret; 1363 return ret;
1370} 1364}
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 74f045715723..8fa763fa629a 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1014,14 +1014,12 @@ mwifiex_ret_802_11_scan_get_tlv_ptrs(struct mwifiex_adapter *adapter,
1014 case TLV_TYPE_TSFTIMESTAMP: 1014 case TLV_TYPE_TSFTIMESTAMP:
1015 dev_dbg(adapter->dev, "info: SCAN_RESP: TSF " 1015 dev_dbg(adapter->dev, "info: SCAN_RESP: TSF "
1016 "timestamp TLV, len = %d\n", tlv_len); 1016 "timestamp TLV, len = %d\n", tlv_len);
1017 *tlv_data = (struct mwifiex_ie_types_data *) 1017 *tlv_data = current_tlv;
1018 current_tlv;
1019 break; 1018 break;
1020 case TLV_TYPE_CHANNELBANDLIST: 1019 case TLV_TYPE_CHANNELBANDLIST:
1021 dev_dbg(adapter->dev, "info: SCAN_RESP: channel" 1020 dev_dbg(adapter->dev, "info: SCAN_RESP: channel"
1022 " band list TLV, len = %d\n", tlv_len); 1021 " band list TLV, len = %d\n", tlv_len);
1023 *tlv_data = (struct mwifiex_ie_types_data *) 1022 *tlv_data = current_tlv;
1024 current_tlv;
1025 break; 1023 break;
1026 default: 1024 default:
1027 dev_err(adapter->dev, 1025 dev_err(adapter->dev,
@@ -1226,15 +1224,15 @@ int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
1226 bss_entry->beacon_buf); 1224 bss_entry->beacon_buf);
1227 break; 1225 break;
1228 case WLAN_EID_BSS_COEX_2040: 1226 case WLAN_EID_BSS_COEX_2040:
1229 bss_entry->bcn_bss_co_2040 = (u8 *) (current_ptr + 1227 bss_entry->bcn_bss_co_2040 = current_ptr +
1230 sizeof(struct ieee_types_header)); 1228 sizeof(struct ieee_types_header);
1231 bss_entry->bss_co_2040_offset = (u16) (current_ptr + 1229 bss_entry->bss_co_2040_offset = (u16) (current_ptr +
1232 sizeof(struct ieee_types_header) - 1230 sizeof(struct ieee_types_header) -
1233 bss_entry->beacon_buf); 1231 bss_entry->beacon_buf);
1234 break; 1232 break;
1235 case WLAN_EID_EXT_CAPABILITY: 1233 case WLAN_EID_EXT_CAPABILITY:
1236 bss_entry->bcn_ext_cap = (u8 *) (current_ptr + 1234 bss_entry->bcn_ext_cap = current_ptr +
1237 sizeof(struct ieee_types_header)); 1235 sizeof(struct ieee_types_header);
1238 bss_entry->ext_cap_offset = (u16) (current_ptr + 1236 bss_entry->ext_cap_offset = (u16) (current_ptr +
1239 sizeof(struct ieee_types_header) - 1237 sizeof(struct ieee_types_header) -
1240 bss_entry->beacon_buf); 1238 bss_entry->beacon_buf);
@@ -1683,8 +1681,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
1683 goto done; 1681 goto done;
1684 } 1682 }
1685 if (element_id == WLAN_EID_DS_PARAMS) { 1683 if (element_id == WLAN_EID_DS_PARAMS) {
1686 channel = *(u8 *) (current_ptr + 1684 channel = *(current_ptr + sizeof(struct ieee_types_header));
1687 sizeof(struct ieee_types_header));
1688 break; 1685 break;
1689 } 1686 }
1690 1687
@@ -2010,12 +2007,11 @@ mwifiex_save_curr_bcn(struct mwifiex_private *priv)
2010 2007
2011 if (curr_bss->bcn_bss_co_2040) 2008 if (curr_bss->bcn_bss_co_2040)
2012 curr_bss->bcn_bss_co_2040 = 2009 curr_bss->bcn_bss_co_2040 =
2013 (u8 *) (curr_bss->beacon_buf + 2010 (curr_bss->beacon_buf + curr_bss->bss_co_2040_offset);
2014 curr_bss->bss_co_2040_offset);
2015 2011
2016 if (curr_bss->bcn_ext_cap) 2012 if (curr_bss->bcn_ext_cap)
2017 curr_bss->bcn_ext_cap = (u8 *) (curr_bss->beacon_buf + 2013 curr_bss->bcn_ext_cap = curr_bss->beacon_buf +
2018 curr_bss->ext_cap_offset); 2014 curr_bss->ext_cap_offset;
2019} 2015}
2020 2016
2021/* 2017/*
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
index 40e025da6bc2..1ff1362d8cdf 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -793,8 +793,7 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
793 struct host_cmd_ds_mac_reg_access *mac_reg; 793 struct host_cmd_ds_mac_reg_access *mac_reg;
794 794
795 cmd->size = cpu_to_le16(sizeof(*mac_reg) + S_DS_GEN); 795 cmd->size = cpu_to_le16(sizeof(*mac_reg) + S_DS_GEN);
796 mac_reg = (struct host_cmd_ds_mac_reg_access *) &cmd-> 796 mac_reg = &cmd->params.mac_reg;
797 params.mac_reg;
798 mac_reg->action = cpu_to_le16(cmd_action); 797 mac_reg->action = cpu_to_le16(cmd_action);
799 mac_reg->offset = 798 mac_reg->offset =
800 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 799 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
@@ -806,8 +805,7 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
806 struct host_cmd_ds_bbp_reg_access *bbp_reg; 805 struct host_cmd_ds_bbp_reg_access *bbp_reg;
807 806
808 cmd->size = cpu_to_le16(sizeof(*bbp_reg) + S_DS_GEN); 807 cmd->size = cpu_to_le16(sizeof(*bbp_reg) + S_DS_GEN);
809 bbp_reg = (struct host_cmd_ds_bbp_reg_access *) 808 bbp_reg = &cmd->params.bbp_reg;
810 &cmd->params.bbp_reg;
811 bbp_reg->action = cpu_to_le16(cmd_action); 809 bbp_reg->action = cpu_to_le16(cmd_action);
812 bbp_reg->offset = 810 bbp_reg->offset =
813 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 811 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
@@ -819,8 +817,7 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
819 struct host_cmd_ds_rf_reg_access *rf_reg; 817 struct host_cmd_ds_rf_reg_access *rf_reg;
820 818
821 cmd->size = cpu_to_le16(sizeof(*rf_reg) + S_DS_GEN); 819 cmd->size = cpu_to_le16(sizeof(*rf_reg) + S_DS_GEN);
822 rf_reg = (struct host_cmd_ds_rf_reg_access *) 820 rf_reg = &cmd->params.rf_reg;
823 &cmd->params.rf_reg;
824 rf_reg->action = cpu_to_le16(cmd_action); 821 rf_reg->action = cpu_to_le16(cmd_action);
825 rf_reg->offset = cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 822 rf_reg->offset = cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
826 rf_reg->value = (u8) le32_to_cpu(reg_rw->value); 823 rf_reg->value = (u8) le32_to_cpu(reg_rw->value);
@@ -831,8 +828,7 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
831 struct host_cmd_ds_pmic_reg_access *pmic_reg; 828 struct host_cmd_ds_pmic_reg_access *pmic_reg;
832 829
833 cmd->size = cpu_to_le16(sizeof(*pmic_reg) + S_DS_GEN); 830 cmd->size = cpu_to_le16(sizeof(*pmic_reg) + S_DS_GEN);
834 pmic_reg = (struct host_cmd_ds_pmic_reg_access *) &cmd-> 831 pmic_reg = &cmd->params.pmic_reg;
835 params.pmic_reg;
836 pmic_reg->action = cpu_to_le16(cmd_action); 832 pmic_reg->action = cpu_to_le16(cmd_action);
837 pmic_reg->offset = 833 pmic_reg->offset =
838 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 834 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
@@ -844,8 +840,7 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
844 struct host_cmd_ds_rf_reg_access *cau_reg; 840 struct host_cmd_ds_rf_reg_access *cau_reg;
845 841
846 cmd->size = cpu_to_le16(sizeof(*cau_reg) + S_DS_GEN); 842 cmd->size = cpu_to_le16(sizeof(*cau_reg) + S_DS_GEN);
847 cau_reg = (struct host_cmd_ds_rf_reg_access *) 843 cau_reg = &cmd->params.rf_reg;
848 &cmd->params.rf_reg;
849 cau_reg->action = cpu_to_le16(cmd_action); 844 cau_reg->action = cpu_to_le16(cmd_action);
850 cau_reg->offset = 845 cau_reg->offset =
851 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 846 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
@@ -856,7 +851,6 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
856 { 851 {
857 struct mwifiex_ds_read_eeprom *rd_eeprom = data_buf; 852 struct mwifiex_ds_read_eeprom *rd_eeprom = data_buf;
858 struct host_cmd_ds_802_11_eeprom_access *cmd_eeprom = 853 struct host_cmd_ds_802_11_eeprom_access *cmd_eeprom =
859 (struct host_cmd_ds_802_11_eeprom_access *)
860 &cmd->params.eeprom; 854 &cmd->params.eeprom;
861 855
862 cmd->size = cpu_to_le16(sizeof(*cmd_eeprom) + S_DS_GEN); 856 cmd->size = cpu_to_le16(sizeof(*cmd_eeprom) + S_DS_GEN);
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c
index a79ed9bd9695..bd40541ebd5a 100644
--- a/drivers/net/wireless/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c
@@ -227,7 +227,7 @@ static int mwifiex_ret_get_log(struct mwifiex_private *priv,
227 struct mwifiex_ds_get_stats *stats) 227 struct mwifiex_ds_get_stats *stats)
228{ 228{
229 struct host_cmd_ds_802_11_get_log *get_log = 229 struct host_cmd_ds_802_11_get_log *get_log =
230 (struct host_cmd_ds_802_11_get_log *) &resp->params.get_log; 230 &resp->params.get_log;
231 231
232 if (stats) { 232 if (stats) {
233 stats->mcast_tx_frame = le32_to_cpu(get_log->mcast_tx_frame); 233 stats->mcast_tx_frame = le32_to_cpu(get_log->mcast_tx_frame);
@@ -282,7 +282,7 @@ static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv,
282 u32 i; 282 u32 i;
283 int ret = 0; 283 int ret = 0;
284 284
285 tlv_buf = (u8 *) ((u8 *) rate_cfg) + 285 tlv_buf = ((u8 *)rate_cfg) +
286 sizeof(struct host_cmd_ds_tx_rate_cfg); 286 sizeof(struct host_cmd_ds_tx_rate_cfg);
287 tlv_buf_len = *(u16 *) (tlv_buf + sizeof(u16)); 287 tlv_buf_len = *(u16 *) (tlv_buf + sizeof(u16));
288 288
@@ -679,39 +679,33 @@ static int mwifiex_ret_reg_access(u16 type, struct host_cmd_ds_command *resp,
679 eeprom = data_buf; 679 eeprom = data_buf;
680 switch (type) { 680 switch (type) {
681 case HostCmd_CMD_MAC_REG_ACCESS: 681 case HostCmd_CMD_MAC_REG_ACCESS:
682 r.mac = (struct host_cmd_ds_mac_reg_access *) 682 r.mac = &resp->params.mac_reg;
683 &resp->params.mac_reg;
684 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.mac->offset)); 683 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.mac->offset));
685 reg_rw->value = r.mac->value; 684 reg_rw->value = r.mac->value;
686 break; 685 break;
687 case HostCmd_CMD_BBP_REG_ACCESS: 686 case HostCmd_CMD_BBP_REG_ACCESS:
688 r.bbp = (struct host_cmd_ds_bbp_reg_access *) 687 r.bbp = &resp->params.bbp_reg;
689 &resp->params.bbp_reg;
690 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.bbp->offset)); 688 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.bbp->offset));
691 reg_rw->value = cpu_to_le32((u32) r.bbp->value); 689 reg_rw->value = cpu_to_le32((u32) r.bbp->value);
692 break; 690 break;
693 691
694 case HostCmd_CMD_RF_REG_ACCESS: 692 case HostCmd_CMD_RF_REG_ACCESS:
695 r.rf = (struct host_cmd_ds_rf_reg_access *) 693 r.rf = &resp->params.rf_reg;
696 &resp->params.rf_reg;
697 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset)); 694 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset));
698 reg_rw->value = cpu_to_le32((u32) r.bbp->value); 695 reg_rw->value = cpu_to_le32((u32) r.bbp->value);
699 break; 696 break;
700 case HostCmd_CMD_PMIC_REG_ACCESS: 697 case HostCmd_CMD_PMIC_REG_ACCESS:
701 r.pmic = (struct host_cmd_ds_pmic_reg_access *) 698 r.pmic = &resp->params.pmic_reg;
702 &resp->params.pmic_reg;
703 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.pmic->offset)); 699 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.pmic->offset));
704 reg_rw->value = cpu_to_le32((u32) r.pmic->value); 700 reg_rw->value = cpu_to_le32((u32) r.pmic->value);
705 break; 701 break;
706 case HostCmd_CMD_CAU_REG_ACCESS: 702 case HostCmd_CMD_CAU_REG_ACCESS:
707 r.rf = (struct host_cmd_ds_rf_reg_access *) 703 r.rf = &resp->params.rf_reg;
708 &resp->params.rf_reg;
709 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset)); 704 reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset));
710 reg_rw->value = cpu_to_le32((u32) r.rf->value); 705 reg_rw->value = cpu_to_le32((u32) r.rf->value);
711 break; 706 break;
712 case HostCmd_CMD_802_11_EEPROM_ACCESS: 707 case HostCmd_CMD_802_11_EEPROM_ACCESS:
713 r.eeprom = (struct host_cmd_ds_802_11_eeprom_access *) 708 r.eeprom = &resp->params.eeprom;
714 &resp->params.eeprom;
715 pr_debug("info: EEPROM read len=%x\n", r.eeprom->byte_count); 709 pr_debug("info: EEPROM read len=%x\n", r.eeprom->byte_count);
716 if (le16_to_cpu(eeprom->byte_count) < 710 if (le16_to_cpu(eeprom->byte_count) <
717 le16_to_cpu(r.eeprom->byte_count)) { 711 le16_to_cpu(r.eeprom->byte_count)) {
@@ -787,7 +781,7 @@ static int mwifiex_ret_subsc_evt(struct mwifiex_private *priv,
787 struct mwifiex_ds_misc_subsc_evt *sub_event) 781 struct mwifiex_ds_misc_subsc_evt *sub_event)
788{ 782{
789 struct host_cmd_ds_802_11_subsc_evt *cmd_sub_event = 783 struct host_cmd_ds_802_11_subsc_evt *cmd_sub_event =
790 (struct host_cmd_ds_802_11_subsc_evt *)&resp->params.subsc_evt; 784 &resp->params.subsc_evt;
791 785
792 /* For every subscribe event command (Get/Set/Clear), FW reports the 786 /* For every subscribe event command (Get/Set/Clear), FW reports the
793 * current set of subscribed events*/ 787 * current set of subscribed events*/
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c
index 4ace5a3dcd23..e8b27c305367 100644
--- a/drivers/net/wireless/mwifiex/sta_event.c
+++ b/drivers/net/wireless/mwifiex/sta_event.c
@@ -422,7 +422,7 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
422 422
423 if (len != -1) { 423 if (len != -1) {
424 sinfo.filled = STATION_INFO_ASSOC_REQ_IES; 424 sinfo.filled = STATION_INFO_ASSOC_REQ_IES;
425 sinfo.assoc_req_ies = (u8 *)&event->data[len]; 425 sinfo.assoc_req_ies = &event->data[len];
426 len = (u8 *)sinfo.assoc_req_ies - 426 len = (u8 *)sinfo.assoc_req_ies -
427 (u8 *)&event->frame_control; 427 (u8 *)&event->frame_control;
428 sinfo.assoc_req_ies_len = 428 sinfo.assoc_req_ies_len =