aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-03-06 15:46:08 -0500
committerDavid S. Miller <davem@davemloft.net>2015-03-06 15:46:08 -0500
commit28c0f02ffe8a614bc7e1aa57319a62e7ce700d04 (patch)
tree078ee8553662a5f6d82d31859c160ceab866c2d6 /drivers/net/wireless/mwifiex
parent89650ad0047f039b3c3bc0f6a5823bb9c9738152 (diff)
parent1ca2760fb2c13959fcba794695cd5b306cbfa6a4 (diff)
Merge tag 'wireless-drivers-next-for-davem-2015-03-06' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
Major changes: brcmfmac: * sdio improvements * add a debugfs file so users can provide us all the revinfo we could ask for iwlwifi: * add triggers for firmware dump collection * remove support for -9.ucode * new statitics API * rate control improvements ath9k: * add per-vif TX power capability * BT coexistance fixes ath10k: * qca6174: enable STA transmit beamforming (TxBF) support * disable multi-vif power save by default bcma: * enable support for PCIe Gen 2 host devices Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c14
-rw-r--r--drivers/net/wireless/mwifiex/decl.h1
-rw-r--r--drivers/net/wireless/mwifiex/init.c1
-rw-r--r--drivers/net/wireless/mwifiex/main.c16
-rw-r--r--drivers/net/wireless/mwifiex/main.h5
-rw-r--r--drivers/net/wireless/mwifiex/pcie.c10
-rw-r--r--drivers/net/wireless/mwifiex/pcie.h6
-rw-r--r--drivers/net/wireless/mwifiex/sdio.c13
-rw-r--r--drivers/net/wireless/mwifiex/sdio.h62
-rw-r--r--drivers/net/wireless/mwifiex/txrx.c8
-rw-r--r--drivers/net/wireless/mwifiex/util.c30
11 files changed, 100 insertions, 66 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 7c3ca2f50186..8e1f681f960b 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -2397,7 +2397,6 @@ mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap *ht_info,
2397 ht_info->mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED; 2397 ht_info->mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED;
2398} 2398}
2399 2399
2400#define MWIFIEX_MAX_WQ_LEN 30
2401/* 2400/*
2402 * create a new virtual interface with the given name 2401 * create a new virtual interface with the given name
2403 */ 2402 */
@@ -2411,7 +2410,6 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
2411 struct mwifiex_private *priv; 2410 struct mwifiex_private *priv;
2412 struct net_device *dev; 2411 struct net_device *dev;
2413 void *mdev_priv; 2412 void *mdev_priv;
2414 char dfs_cac_str[MWIFIEX_MAX_WQ_LEN], dfs_chsw_str[MWIFIEX_MAX_WQ_LEN];
2415 2413
2416 if (!adapter) 2414 if (!adapter)
2417 return ERR_PTR(-EFAULT); 2415 return ERR_PTR(-EFAULT);
@@ -2576,12 +2574,10 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
2576 return ERR_PTR(-EFAULT); 2574 return ERR_PTR(-EFAULT);
2577 } 2575 }
2578 2576
2579 strcpy(dfs_cac_str, "MWIFIEX_DFS_CAC"); 2577 priv->dfs_cac_workqueue = alloc_workqueue("MWIFIEX_DFS_CAC%s",
2580 strcat(dfs_cac_str, name);
2581 priv->dfs_cac_workqueue = alloc_workqueue(dfs_cac_str,
2582 WQ_HIGHPRI | 2578 WQ_HIGHPRI |
2583 WQ_MEM_RECLAIM | 2579 WQ_MEM_RECLAIM |
2584 WQ_UNBOUND, 1); 2580 WQ_UNBOUND, 1, name);
2585 if (!priv->dfs_cac_workqueue) { 2581 if (!priv->dfs_cac_workqueue) {
2586 wiphy_err(wiphy, "cannot register virtual network device\n"); 2582 wiphy_err(wiphy, "cannot register virtual network device\n");
2587 free_netdev(dev); 2583 free_netdev(dev);
@@ -2594,11 +2590,9 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
2594 2590
2595 INIT_DELAYED_WORK(&priv->dfs_cac_work, mwifiex_dfs_cac_work_queue); 2591 INIT_DELAYED_WORK(&priv->dfs_cac_work, mwifiex_dfs_cac_work_queue);
2596 2592
2597 strcpy(dfs_chsw_str, "MWIFIEX_DFS_CHSW"); 2593 priv->dfs_chan_sw_workqueue = alloc_workqueue("MWIFIEX_DFS_CHSW%s",
2598 strcat(dfs_chsw_str, name);
2599 priv->dfs_chan_sw_workqueue = alloc_workqueue(dfs_chsw_str,
2600 WQ_HIGHPRI | WQ_UNBOUND | 2594 WQ_HIGHPRI | WQ_UNBOUND |
2601 WQ_MEM_RECLAIM, 1); 2595 WQ_MEM_RECLAIM, 1, name);
2602 if (!priv->dfs_chan_sw_workqueue) { 2596 if (!priv->dfs_chan_sw_workqueue) {
2603 wiphy_err(wiphy, "cannot register virtual network device\n"); 2597 wiphy_err(wiphy, "cannot register virtual network device\n");
2604 free_netdev(dev); 2598 free_netdev(dev);
diff --git a/drivers/net/wireless/mwifiex/decl.h b/drivers/net/wireless/mwifiex/decl.h
index 88d0eade6bb1..cf2fa110e251 100644
--- a/drivers/net/wireless/mwifiex/decl.h
+++ b/drivers/net/wireless/mwifiex/decl.h
@@ -33,6 +33,7 @@
33#define MWIFIEX_MAX_BSS_NUM (3) 33#define MWIFIEX_MAX_BSS_NUM (3)
34 34
35#define MWIFIEX_DMA_ALIGN_SZ 64 35#define MWIFIEX_DMA_ALIGN_SZ 64
36#define MWIFIEX_RX_HEADROOM 64
36#define MAX_TXPD_SZ 32 37#define MAX_TXPD_SZ 32
37#define INTF_HDR_ALIGN 4 38#define INTF_HDR_ALIGN 4
38 39
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index 0978b1cc58b6..0153ce6d5879 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -296,7 +296,6 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
296 memset(&adapter->arp_filter, 0, sizeof(adapter->arp_filter)); 296 memset(&adapter->arp_filter, 0, sizeof(adapter->arp_filter));
297 adapter->arp_filter_size = 0; 297 adapter->arp_filter_size = 0;
298 adapter->max_mgmt_ie_index = MAX_MGMT_IE_INDEX; 298 adapter->max_mgmt_ie_index = MAX_MGMT_IE_INDEX;
299 adapter->ext_scan = false;
300 adapter->key_api_major_ver = 0; 299 adapter->key_api_major_ver = 0;
301 adapter->key_api_minor_ver = 0; 300 adapter->key_api_minor_ver = 0;
302 eth_broadcast_addr(adapter->perm_addr); 301 eth_broadcast_addr(adapter->perm_addr);
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 7e74b4fccddd..74488aba92bd 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -190,14 +190,16 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
190 190
191 /* Check if already processing */ 191 /* Check if already processing */
192 if (adapter->mwifiex_processing) { 192 if (adapter->mwifiex_processing) {
193 adapter->more_task_flag = true;
193 spin_unlock_irqrestore(&adapter->main_proc_lock, flags); 194 spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
194 goto exit_main_proc; 195 goto exit_main_proc;
195 } else { 196 } else {
196 adapter->mwifiex_processing = true; 197 adapter->mwifiex_processing = true;
197 spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
198 } 198 }
199process_start: 199process_start:
200 do { 200 do {
201 adapter->more_task_flag = false;
202 spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
201 if ((adapter->hw_status == MWIFIEX_HW_STATUS_CLOSING) || 203 if ((adapter->hw_status == MWIFIEX_HW_STATUS_CLOSING) ||
202 (adapter->hw_status == MWIFIEX_HW_STATUS_NOT_READY)) 204 (adapter->hw_status == MWIFIEX_HW_STATUS_NOT_READY))
203 break; 205 break;
@@ -238,6 +240,7 @@ process_start:
238 adapter->pm_wakeup_fw_try = true; 240 adapter->pm_wakeup_fw_try = true;
239 mod_timer(&adapter->wakeup_timer, jiffies + (HZ*3)); 241 mod_timer(&adapter->wakeup_timer, jiffies + (HZ*3));
240 adapter->if_ops.wakeup(adapter); 242 adapter->if_ops.wakeup(adapter);
243 spin_lock_irqsave(&adapter->main_proc_lock, flags);
241 continue; 244 continue;
242 } 245 }
243 246
@@ -295,8 +298,10 @@ process_start:
295 if ((adapter->ps_state == PS_STATE_SLEEP) || 298 if ((adapter->ps_state == PS_STATE_SLEEP) ||
296 (adapter->ps_state == PS_STATE_PRE_SLEEP) || 299 (adapter->ps_state == PS_STATE_PRE_SLEEP) ||
297 (adapter->ps_state == PS_STATE_SLEEP_CFM) || 300 (adapter->ps_state == PS_STATE_SLEEP_CFM) ||
298 adapter->tx_lock_flag) 301 adapter->tx_lock_flag){
302 spin_lock_irqsave(&adapter->main_proc_lock, flags);
299 continue; 303 continue;
304 }
300 305
301 if (!adapter->cmd_sent && !adapter->curr_cmd) { 306 if (!adapter->cmd_sent && !adapter->curr_cmd) {
302 if (mwifiex_exec_next_cmd(adapter) == -1) { 307 if (mwifiex_exec_next_cmd(adapter) == -1) {
@@ -330,15 +335,12 @@ process_start:
330 } 335 }
331 break; 336 break;
332 } 337 }
338 spin_lock_irqsave(&adapter->main_proc_lock, flags);
333 } while (true); 339 } while (true);
334 340
335 spin_lock_irqsave(&adapter->main_proc_lock, flags); 341 spin_lock_irqsave(&adapter->main_proc_lock, flags);
336 if (!adapter->delay_main_work && 342 if (adapter->more_task_flag)
337 (adapter->int_status || IS_CARD_RX_RCVD(adapter))) {
338 spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
339 goto process_start; 343 goto process_start;
340 }
341
342 adapter->mwifiex_processing = false; 344 adapter->mwifiex_processing = false;
343 spin_unlock_irqrestore(&adapter->main_proc_lock, flags); 345 spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
344 346
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index f0a6af179af0..16be45e9a66a 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -140,6 +140,9 @@ enum {
140 140
141#define MWIFIEX_DRV_INFO_SIZE_MAX 0x40000 141#define MWIFIEX_DRV_INFO_SIZE_MAX 0x40000
142 142
143/* Address alignment */
144#define MWIFIEX_ALIGN_ADDR(p, a) (((long)(p) + (a) - 1) & ~((a) - 1))
145
143struct mwifiex_dbg { 146struct mwifiex_dbg {
144 u32 num_cmd_host_to_card_failure; 147 u32 num_cmd_host_to_card_failure;
145 u32 num_cmd_sleep_cfm_host_to_card_failure; 148 u32 num_cmd_sleep_cfm_host_to_card_failure;
@@ -774,6 +777,7 @@ struct mwifiex_adapter {
774 /* spin lock for main process */ 777 /* spin lock for main process */
775 spinlock_t main_proc_lock; 778 spinlock_t main_proc_lock;
776 u32 mwifiex_processing; 779 u32 mwifiex_processing;
780 u8 more_task_flag;
777 u16 tx_buf_size; 781 u16 tx_buf_size;
778 u16 curr_tx_buf_size; 782 u16 curr_tx_buf_size;
779 u32 ioport; 783 u32 ioport;
@@ -1417,6 +1421,7 @@ u8 mwifiex_adjust_data_rate(struct mwifiex_private *priv,
1417 u8 rx_rate, u8 ht_info); 1421 u8 rx_rate, u8 ht_info);
1418 1422
1419void mwifiex_dump_drv_info(struct mwifiex_adapter *adapter); 1423void mwifiex_dump_drv_info(struct mwifiex_adapter *adapter);
1424void *mwifiex_alloc_rx_buf(int rx_len, gfp_t flags);
1420 1425
1421#ifdef CONFIG_DEBUG_FS 1426#ifdef CONFIG_DEBUG_FS
1422void mwifiex_debugfs_init(void); 1427void mwifiex_debugfs_init(void);
diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index a5828da59365..4b463c3b9906 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -203,7 +203,7 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev,
203 card->pcie.reg = data->reg; 203 card->pcie.reg = data->reg;
204 card->pcie.blksz_fw_dl = data->blksz_fw_dl; 204 card->pcie.blksz_fw_dl = data->blksz_fw_dl;
205 card->pcie.tx_buf_size = data->tx_buf_size; 205 card->pcie.tx_buf_size = data->tx_buf_size;
206 card->pcie.supports_fw_dump = data->supports_fw_dump; 206 card->pcie.can_dump_fw = data->can_dump_fw;
207 card->pcie.can_ext_scan = data->can_ext_scan; 207 card->pcie.can_ext_scan = data->can_ext_scan;
208 } 208 }
209 209
@@ -498,7 +498,8 @@ static int mwifiex_init_rxq_ring(struct mwifiex_adapter *adapter)
498 498
499 for (i = 0; i < MWIFIEX_MAX_TXRX_BD; i++) { 499 for (i = 0; i < MWIFIEX_MAX_TXRX_BD; i++) {
500 /* Allocate skb here so that firmware can DMA data from it */ 500 /* Allocate skb here so that firmware can DMA data from it */
501 skb = dev_alloc_skb(MWIFIEX_RX_DATA_BUF_SIZE); 501 skb = mwifiex_alloc_rx_buf(MWIFIEX_RX_DATA_BUF_SIZE,
502 GFP_KERNEL | GFP_DMA);
502 if (!skb) { 503 if (!skb) {
503 dev_err(adapter->dev, 504 dev_err(adapter->dev,
504 "Unable to allocate skb for RX ring.\n"); 505 "Unable to allocate skb for RX ring.\n");
@@ -1297,7 +1298,8 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter)
1297 } 1298 }
1298 } 1299 }
1299 1300
1300 skb_tmp = dev_alloc_skb(MWIFIEX_RX_DATA_BUF_SIZE); 1301 skb_tmp = mwifiex_alloc_rx_buf(MWIFIEX_RX_DATA_BUF_SIZE,
1302 GFP_KERNEL | GFP_DMA);
1301 if (!skb_tmp) { 1303 if (!skb_tmp) {
1302 dev_err(adapter->dev, 1304 dev_err(adapter->dev,
1303 "Unable to allocate skb.\n"); 1305 "Unable to allocate skb.\n");
@@ -2271,7 +2273,7 @@ static void mwifiex_pcie_fw_dump_work(struct mwifiex_adapter *adapter)
2271 int ret; 2273 int ret;
2272 static char *env[] = { "DRIVER=mwifiex_pcie", "EVENT=fw_dump", NULL }; 2274 static char *env[] = { "DRIVER=mwifiex_pcie", "EVENT=fw_dump", NULL };
2273 2275
2274 if (!card->pcie.supports_fw_dump) 2276 if (!card->pcie.can_dump_fw)
2275 return; 2277 return;
2276 2278
2277 for (idx = 0; idx < ARRAY_SIZE(mem_type_mapping_tbl); idx++) { 2279 for (idx = 0; idx < ARRAY_SIZE(mem_type_mapping_tbl); idx++) {
diff --git a/drivers/net/wireless/mwifiex/pcie.h b/drivers/net/wireless/mwifiex/pcie.h
index 666d40e9dbc3..0e7ee8b72358 100644
--- a/drivers/net/wireless/mwifiex/pcie.h
+++ b/drivers/net/wireless/mwifiex/pcie.h
@@ -205,7 +205,7 @@ struct mwifiex_pcie_device {
205 const struct mwifiex_pcie_card_reg *reg; 205 const struct mwifiex_pcie_card_reg *reg;
206 u16 blksz_fw_dl; 206 u16 blksz_fw_dl;
207 u16 tx_buf_size; 207 u16 tx_buf_size;
208 bool supports_fw_dump; 208 bool can_dump_fw;
209 bool can_ext_scan; 209 bool can_ext_scan;
210}; 210};
211 211
@@ -214,7 +214,7 @@ static const struct mwifiex_pcie_device mwifiex_pcie8766 = {
214 .reg = &mwifiex_reg_8766, 214 .reg = &mwifiex_reg_8766,
215 .blksz_fw_dl = MWIFIEX_PCIE_BLOCK_SIZE_FW_DNLD, 215 .blksz_fw_dl = MWIFIEX_PCIE_BLOCK_SIZE_FW_DNLD,
216 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K, 216 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K,
217 .supports_fw_dump = false, 217 .can_dump_fw = false,
218 .can_ext_scan = true, 218 .can_ext_scan = true,
219}; 219};
220 220
@@ -223,7 +223,7 @@ static const struct mwifiex_pcie_device mwifiex_pcie8897 = {
223 .reg = &mwifiex_reg_8897, 223 .reg = &mwifiex_reg_8897,
224 .blksz_fw_dl = MWIFIEX_PCIE_BLOCK_SIZE_FW_DNLD, 224 .blksz_fw_dl = MWIFIEX_PCIE_BLOCK_SIZE_FW_DNLD,
225 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K, 225 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K,
226 .supports_fw_dump = true, 226 .can_dump_fw = true,
227 .can_ext_scan = true, 227 .can_ext_scan = true,
228}; 228};
229 229
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index 91e36cda9543..57d85ab442bf 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -105,8 +105,8 @@ mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
105 card->tx_buf_size = data->tx_buf_size; 105 card->tx_buf_size = data->tx_buf_size;
106 card->mp_tx_agg_buf_size = data->mp_tx_agg_buf_size; 106 card->mp_tx_agg_buf_size = data->mp_tx_agg_buf_size;
107 card->mp_rx_agg_buf_size = data->mp_rx_agg_buf_size; 107 card->mp_rx_agg_buf_size = data->mp_rx_agg_buf_size;
108 card->supports_fw_dump = data->supports_fw_dump; 108 card->can_dump_fw = data->can_dump_fw;
109 card->auto_tdls = data->auto_tdls; 109 card->can_auto_tdls = data->can_auto_tdls;
110 card->can_ext_scan = data->can_ext_scan; 110 card->can_ext_scan = data->can_ext_scan;
111 } 111 }
112 112
@@ -1357,7 +1357,7 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
1357 return -1; 1357 return -1;
1358 rx_len = (u16) (rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE); 1358 rx_len = (u16) (rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE);
1359 1359
1360 skb = dev_alloc_skb(rx_len); 1360 skb = mwifiex_alloc_rx_buf(rx_len, GFP_KERNEL | GFP_DMA);
1361 if (!skb) 1361 if (!skb)
1362 return -1; 1362 return -1;
1363 1363
@@ -1454,7 +1454,8 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
1454 } 1454 }
1455 rx_len = (u16) (rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE); 1455 rx_len = (u16) (rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE);
1456 1456
1457 skb = dev_alloc_skb(rx_len); 1457 skb = mwifiex_alloc_rx_buf(rx_len,
1458 GFP_KERNEL | GFP_DMA);
1458 1459
1459 if (!skb) { 1460 if (!skb) {
1460 dev_err(adapter->dev, "%s: failed to alloc skb", 1461 dev_err(adapter->dev, "%s: failed to alloc skb",
@@ -1887,7 +1888,7 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter)
1887 return -1; 1888 return -1;
1888 } 1889 }
1889 1890
1890 adapter->auto_tdls = card->auto_tdls; 1891 adapter->auto_tdls = card->can_auto_tdls;
1891 adapter->ext_scan = card->can_ext_scan; 1892 adapter->ext_scan = card->can_ext_scan;
1892 return ret; 1893 return ret;
1893} 1894}
@@ -2032,7 +2033,7 @@ static void mwifiex_sdio_fw_dump_work(struct work_struct *work)
2032 2033
2033 mwifiex_dump_drv_info(adapter); 2034 mwifiex_dump_drv_info(adapter);
2034 2035
2035 if (!card->supports_fw_dump) 2036 if (!card->can_dump_fw)
2036 return; 2037 return;
2037 2038
2038 for (idx = 0; idx < ARRAY_SIZE(mem_type_mapping_tbl); idx++) { 2039 for (idx = 0; idx < ARRAY_SIZE(mem_type_mapping_tbl); idx++) {
diff --git a/drivers/net/wireless/mwifiex/sdio.h b/drivers/net/wireless/mwifiex/sdio.h
index 957cca246618..c636944c77bc 100644
--- a/drivers/net/wireless/mwifiex/sdio.h
+++ b/drivers/net/wireless/mwifiex/sdio.h
@@ -238,9 +238,6 @@ struct sdio_mmc_card {
238 const struct mwifiex_sdio_card_reg *reg; 238 const struct mwifiex_sdio_card_reg *reg;
239 u8 max_ports; 239 u8 max_ports;
240 u8 mp_agg_pkt_limit; 240 u8 mp_agg_pkt_limit;
241 bool supports_sdio_new_mode;
242 bool has_control_mask;
243 bool supports_fw_dump;
244 u16 tx_buf_size; 241 u16 tx_buf_size;
245 u32 mp_tx_agg_buf_size; 242 u32 mp_tx_agg_buf_size;
246 u32 mp_rx_agg_buf_size; 243 u32 mp_rx_agg_buf_size;
@@ -255,7 +252,10 @@ struct sdio_mmc_card {
255 u8 curr_wr_port; 252 u8 curr_wr_port;
256 253
257 u8 *mp_regs; 254 u8 *mp_regs;
258 u8 auto_tdls; 255 bool supports_sdio_new_mode;
256 bool has_control_mask;
257 bool can_dump_fw;
258 bool can_auto_tdls;
259 bool can_ext_scan; 259 bool can_ext_scan;
260 260
261 struct mwifiex_sdio_mpa_tx mpa_tx; 261 struct mwifiex_sdio_mpa_tx mpa_tx;
@@ -267,13 +267,13 @@ struct mwifiex_sdio_device {
267 const struct mwifiex_sdio_card_reg *reg; 267 const struct mwifiex_sdio_card_reg *reg;
268 u8 max_ports; 268 u8 max_ports;
269 u8 mp_agg_pkt_limit; 269 u8 mp_agg_pkt_limit;
270 bool supports_sdio_new_mode;
271 bool has_control_mask;
272 bool supports_fw_dump;
273 u16 tx_buf_size; 270 u16 tx_buf_size;
274 u32 mp_tx_agg_buf_size; 271 u32 mp_tx_agg_buf_size;
275 u32 mp_rx_agg_buf_size; 272 u32 mp_rx_agg_buf_size;
276 u8 auto_tdls; 273 bool supports_sdio_new_mode;
274 bool has_control_mask;
275 bool can_dump_fw;
276 bool can_auto_tdls;
277 bool can_ext_scan; 277 bool can_ext_scan;
278}; 278};
279 279
@@ -412,13 +412,13 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8786 = {
412 .reg = &mwifiex_reg_sd87xx, 412 .reg = &mwifiex_reg_sd87xx,
413 .max_ports = 16, 413 .max_ports = 16,
414 .mp_agg_pkt_limit = 8, 414 .mp_agg_pkt_limit = 8,
415 .supports_sdio_new_mode = false,
416 .has_control_mask = true,
417 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K, 415 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K,
418 .mp_tx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K, 416 .mp_tx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K,
419 .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K, 417 .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K,
420 .supports_fw_dump = false, 418 .supports_sdio_new_mode = false,
421 .auto_tdls = false, 419 .has_control_mask = true,
420 .can_dump_fw = false,
421 .can_auto_tdls = false,
422 .can_ext_scan = false, 422 .can_ext_scan = false,
423}; 423};
424 424
@@ -427,13 +427,13 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8787 = {
427 .reg = &mwifiex_reg_sd87xx, 427 .reg = &mwifiex_reg_sd87xx,
428 .max_ports = 16, 428 .max_ports = 16,
429 .mp_agg_pkt_limit = 8, 429 .mp_agg_pkt_limit = 8,
430 .supports_sdio_new_mode = false,
431 .has_control_mask = true,
432 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K, 430 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K,
433 .mp_tx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K, 431 .mp_tx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K,
434 .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K, 432 .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K,
435 .supports_fw_dump = false, 433 .supports_sdio_new_mode = false,
436 .auto_tdls = false, 434 .has_control_mask = true,
435 .can_dump_fw = false,
436 .can_auto_tdls = false,
437 .can_ext_scan = true, 437 .can_ext_scan = true,
438}; 438};
439 439
@@ -442,13 +442,13 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8797 = {
442 .reg = &mwifiex_reg_sd87xx, 442 .reg = &mwifiex_reg_sd87xx,
443 .max_ports = 16, 443 .max_ports = 16,
444 .mp_agg_pkt_limit = 8, 444 .mp_agg_pkt_limit = 8,
445 .supports_sdio_new_mode = false,
446 .has_control_mask = true,
447 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K, 445 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K,
448 .mp_tx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K, 446 .mp_tx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K,
449 .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K, 447 .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K,
450 .supports_fw_dump = false, 448 .supports_sdio_new_mode = false,
451 .auto_tdls = false, 449 .has_control_mask = true,
450 .can_dump_fw = false,
451 .can_auto_tdls = false,
452 .can_ext_scan = true, 452 .can_ext_scan = true,
453}; 453};
454 454
@@ -457,13 +457,13 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8897 = {
457 .reg = &mwifiex_reg_sd8897, 457 .reg = &mwifiex_reg_sd8897,
458 .max_ports = 32, 458 .max_ports = 32,
459 .mp_agg_pkt_limit = 16, 459 .mp_agg_pkt_limit = 16,
460 .supports_sdio_new_mode = true,
461 .has_control_mask = false,
462 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K, 460 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K,
463 .mp_tx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_32K, 461 .mp_tx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_32K,
464 .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_32K, 462 .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_32K,
465 .supports_fw_dump = true, 463 .supports_sdio_new_mode = true,
466 .auto_tdls = false, 464 .has_control_mask = false,
465 .can_dump_fw = true,
466 .can_auto_tdls = false,
467 .can_ext_scan = true, 467 .can_ext_scan = true,
468}; 468};
469 469
@@ -472,13 +472,13 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8887 = {
472 .reg = &mwifiex_reg_sd8887, 472 .reg = &mwifiex_reg_sd8887,
473 .max_ports = 32, 473 .max_ports = 32,
474 .mp_agg_pkt_limit = 16, 474 .mp_agg_pkt_limit = 16,
475 .supports_sdio_new_mode = true, 475 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K,
476 .has_control_mask = false,
477 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K,
478 .mp_tx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_32K, 476 .mp_tx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_32K,
479 .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_32K, 477 .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_32K,
480 .supports_fw_dump = false, 478 .supports_sdio_new_mode = true,
481 .auto_tdls = true, 479 .has_control_mask = false,
480 .can_dump_fw = false,
481 .can_auto_tdls = true,
482 .can_ext_scan = true, 482 .can_ext_scan = true,
483}; 483};
484 484
@@ -492,8 +492,8 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8801 = {
492 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K, 492 .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K,
493 .mp_tx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K, 493 .mp_tx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K,
494 .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K, 494 .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K,
495 .supports_fw_dump = false, 495 .can_dump_fw = false,
496 .auto_tdls = false, 496 .can_auto_tdls = false,
497 .can_ext_scan = true, 497 .can_ext_scan = true,
498}; 498};
499 499
diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c
index ac93557cbdc9..ea4549f0e0b9 100644
--- a/drivers/net/wireless/mwifiex/txrx.c
+++ b/drivers/net/wireless/mwifiex/txrx.c
@@ -80,11 +80,13 @@ EXPORT_SYMBOL_GPL(mwifiex_handle_rx_packet);
80int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb, 80int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
81 struct mwifiex_tx_param *tx_param) 81 struct mwifiex_tx_param *tx_param)
82{ 82{
83 int ret = -1; 83 int hroom, ret = -1;
84 struct mwifiex_adapter *adapter = priv->adapter; 84 struct mwifiex_adapter *adapter = priv->adapter;
85 u8 *head_ptr; 85 u8 *head_ptr;
86 struct txpd *local_tx_pd = NULL; 86 struct txpd *local_tx_pd = NULL;
87 87
88 hroom = (adapter->iface_type == MWIFIEX_USB) ? 0 : INTF_HEADER_LEN;
89
88 if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP) 90 if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP)
89 head_ptr = mwifiex_process_uap_txpd(priv, skb); 91 head_ptr = mwifiex_process_uap_txpd(priv, skb);
90 else 92 else
@@ -92,11 +94,9 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb,
92 94
93 if (head_ptr) { 95 if (head_ptr) {
94 if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) 96 if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA)
95 local_tx_pd = 97 local_tx_pd = (struct txpd *)(head_ptr + hroom);
96 (struct txpd *) (head_ptr + INTF_HEADER_LEN);
97 if (adapter->iface_type == MWIFIEX_USB) { 98 if (adapter->iface_type == MWIFIEX_USB) {
98 adapter->data_sent = true; 99 adapter->data_sent = true;
99 skb_pull(skb, INTF_HEADER_LEN);
100 ret = adapter->if_ops.host_to_card(adapter, 100 ret = adapter->if_ops.host_to_card(adapter,
101 MWIFIEX_USB_EP_DATA, 101 MWIFIEX_USB_EP_DATA,
102 skb, NULL); 102 skb, NULL);
diff --git a/drivers/net/wireless/mwifiex/util.c b/drivers/net/wireless/mwifiex/util.c
index 308550611f22..2148a573396b 100644
--- a/drivers/net/wireless/mwifiex/util.c
+++ b/drivers/net/wireless/mwifiex/util.c
@@ -367,6 +367,13 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
367 if (!skb) 367 if (!skb)
368 return -1; 368 return -1;
369 369
370 if (!priv->mgmt_frame_mask ||
371 priv->wdev.iftype == NL80211_IFTYPE_UNSPECIFIED) {
372 dev_dbg(priv->adapter->dev,
373 "do not receive mgmt frames on uninitialized intf");
374 return -1;
375 }
376
370 rx_pd = (struct rxpd *)skb->data; 377 rx_pd = (struct rxpd *)skb->data;
371 378
372 skb_pull(skb, le16_to_cpu(rx_pd->rx_pkt_offset)); 379 skb_pull(skb, le16_to_cpu(rx_pd->rx_pkt_offset));
@@ -624,3 +631,26 @@ void mwifiex_hist_data_reset(struct mwifiex_private *priv)
624 for (ix = 0; ix < MWIFIEX_MAX_SIG_STRENGTH; ix++) 631 for (ix = 0; ix < MWIFIEX_MAX_SIG_STRENGTH; ix++)
625 atomic_set(&phist_data->sig_str[ix], 0); 632 atomic_set(&phist_data->sig_str[ix], 0);
626} 633}
634
635void *mwifiex_alloc_rx_buf(int rx_len, gfp_t flags)
636{
637 struct sk_buff *skb;
638 int buf_len, pad;
639
640 buf_len = rx_len + MWIFIEX_RX_HEADROOM + MWIFIEX_DMA_ALIGN_SZ;
641
642 skb = __dev_alloc_skb(buf_len, flags);
643
644 if (!skb)
645 return NULL;
646
647 skb_reserve(skb, MWIFIEX_RX_HEADROOM);
648
649 pad = MWIFIEX_ALIGN_ADDR(skb->data, MWIFIEX_DMA_ALIGN_SZ) -
650 (long)skb->data;
651
652 skb_reserve(skb, pad);
653
654 return skb;
655}
656EXPORT_SYMBOL_GPL(mwifiex_alloc_rx_buf);