Commit 64b05e2f authored by Avinash Patil's avatar Avinash Patil Committed by John W. Linville

mwifiex: allocate space for one more mwifiex_private structure

Reserve space for one more priv structure.
This will be used by AP interface.
Signed-off-by: default avatarAvinash Patil <patila@marvell.com>
Signed-off-by: default avatarYogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: default avatarKiran Divekar <dkiran@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent dfcfb545
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <linux/ieee80211.h> #include <linux/ieee80211.h>
#define MWIFIEX_MAX_BSS_NUM (1) #define MWIFIEX_MAX_BSS_NUM (2)
#define MWIFIEX_MIN_DATA_HEADER_LEN 36 /* sizeof(mwifiex_txpd) #define MWIFIEX_MIN_DATA_HEADER_LEN 36 /* sizeof(mwifiex_txpd)
* + 4 byte alignment * + 4 byte alignment
......
...@@ -64,17 +64,17 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops, ...@@ -64,17 +64,17 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
adapter->priv_num = 0; adapter->priv_num = 0;
/* Allocate memory for private structure */ for (i = 0; i < MWIFIEX_MAX_BSS_NUM; i++) {
adapter->priv[0] = kzalloc(sizeof(struct mwifiex_private), GFP_KERNEL); /* Allocate memory for private structure */
if (!adapter->priv[0]) { adapter->priv[i] =
dev_err(adapter->dev, kzalloc(sizeof(struct mwifiex_private), GFP_KERNEL);
"%s: failed to alloc priv[0]\n", __func__); if (!adapter->priv[i])
goto error; goto error;
}
adapter->priv_num++;
adapter->priv[0]->adapter = adapter; adapter->priv[i]->adapter = adapter;
adapter->priv[i]->bss_priority = i;
adapter->priv_num++;
}
mwifiex_init_lock_list(adapter); mwifiex_init_lock_list(adapter);
init_timer(&adapter->cmd_timer); init_timer(&adapter->cmd_timer);
...@@ -836,13 +836,16 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem) ...@@ -836,13 +836,16 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
} }
priv = adapter->priv[0]; priv = adapter->priv[0];
if (!priv) if (!priv || !priv->wdev)
goto exit_remove; goto exit_remove;
if (priv->wdev) { wiphy_unregister(priv->wdev->wiphy);
wiphy_unregister(priv->wdev->wiphy); wiphy_free(priv->wdev->wiphy);
wiphy_free(priv->wdev->wiphy);
kfree(priv->wdev); for (i = 0; i < adapter->priv_num; i++) {
priv = adapter->priv[i];
if (priv)
kfree(priv->wdev);
} }
mwifiex_terminate_workqueue(adapter); mwifiex_terminate_workqueue(adapter);
......
...@@ -885,6 +885,10 @@ mwifiex_wmm_get_highest_priolist_ptr(struct mwifiex_adapter *adapter, ...@@ -885,6 +885,10 @@ mwifiex_wmm_get_highest_priolist_ptr(struct mwifiex_adapter *adapter,
tid_ptr = &(priv_tmp)->wmm. tid_ptr = &(priv_tmp)->wmm.
tid_tbl_ptr[tos_to_tid[i]]; tid_tbl_ptr[tos_to_tid[i]];
/* For non-STA ra_list_curr may be NULL */
if (!tid_ptr->ra_list_curr)
continue;
spin_lock_irqsave(&tid_ptr->tid_tbl_lock, spin_lock_irqsave(&tid_ptr->tid_tbl_lock,
flags); flags);
is_list_empty = is_list_empty =
......
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