From 3d82de0fa584fbe73cf74a3bbc906c8710c523b8 Mon Sep 17 00:00:00 2001 From: Yogesh Ashok Powar Date: Wed, 5 Oct 2011 14:58:24 -0700 Subject: mwifiex: fix smatch errors drivers/net/wireless/mwifiex/main.c +828 mwifiex_remove_card(52) error: potential null derefence 'priv'. drivers/net/wireless/mwifiex/main.c +828 mwifiex_remove_card(52) error: we previously assumed 'priv' could be null (see line 820) drivers/net/wireless/mwifiex/txrx.c +90 mwifiex_process_tx(24) error: potential null derefence 'local_tx_pd'. drivers/net/wireless/mwifiex/sta_ioctl.c +766 mwifiex_rate_ioctl_set_rate_value(30) error: buffer overflow 'rate' 14 <= 14 Cc: Dan Carpenter Signed-off-by: Yogesh Ashok Powar Signed-off-by: Bing Zhao Signed-off-by: John W. Linville --- drivers/net/wireless/mwifiex/main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/net/wireless/mwifiex/main.c') diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index 8486451..277ea84 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c @@ -825,6 +825,10 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem) rtnl_unlock(); } + priv = adapter->priv[0]; + if (!priv) + goto exit_remove; + wiphy_unregister(priv->wdev->wiphy); wiphy_free(priv->wdev->wiphy); kfree(priv->wdev); -- cgit v1.1 From d930faee141bd0a6a4873791996c5354c9a85ca7 Mon Sep 17 00:00:00 2001 From: Amitkumar Karwar Date: Tue, 11 Oct 2011 17:41:21 -0700 Subject: mwifiex: add support for Marvell pcie8766 chipset This patch supports 88W8766P chipset with a PCIe interface. The corresponding firmware image file is located at: "mrvl/pcie8766_uapsta.bin" Signed-off-by: Amitkumar Karwar Signed-off-by: Ramesh Radhakrishnan Signed-off-by: Yogesh Ashok Powar Signed-off-by: Kiran Divekar Signed-off-by: Bing Zhao Signed-off-by: Frank Huang Signed-off-by: John W. Linville --- drivers/net/wireless/mwifiex/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/net/wireless/mwifiex/main.c') diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index 277ea84..849144d 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c @@ -661,7 +661,7 @@ mwifiex_terminate_workqueue(struct mwifiex_adapter *adapter) */ int mwifiex_add_card(void *card, struct semaphore *sem, - struct mwifiex_if_ops *if_ops) + struct mwifiex_if_ops *if_ops, u8 iface_type) { struct mwifiex_adapter *adapter; char fmt[64]; @@ -675,6 +675,8 @@ mwifiex_add_card(void *card, struct semaphore *sem, goto err_init_sw; } + adapter->iface_type = iface_type; + adapter->hw_status = MWIFIEX_HW_STATUS_INITIALIZING; adapter->surprise_removed = false; init_waitqueue_head(&adapter->init_wait_q); -- cgit v1.1 From efaaa8b8414e0ab4ba09aaaf79ab92a34b75797b Mon Sep 17 00:00:00 2001 From: Amitkumar Karwar Date: Wed, 12 Oct 2011 20:28:06 -0700 Subject: mwifiex: use separate wait condition for each command node Currently global wait condition (adapter->cmd_wait_q.condition) is used while sending synchronous commands to FW. When two threads enter in mwifiex_send_cmd_sync() routine at the same time, both the threads wait for their command responses. Since wait condition is same for both, they wake up simultaneously after getting response of 1st command. After this when a thread is waiting for command response of 3rd command, it wakes up after getting response of 2nd command and so on. Therefore we don't wait for the response of last command(0xaa) during unload. Hence while next time loading the driver command time out is seen for INIT command. This problem is resolved by having separate wait condition flag for each command(except scan command). Since scan command is treated differently (by maintaining scan pending q etc.), newly defined flag (scan_wait_q_woken) is used as a scan wait condition. Signed-off-by: Amitkumar Karwar Signed-off-by: Yogesh Ashok Powar Signed-off-by: Bing Zhao Signed-off-by: John W. Linville --- drivers/net/wireless/mwifiex/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/wireless/mwifiex/main.c') diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index 849144d..25ce86b 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c @@ -685,8 +685,8 @@ mwifiex_add_card(void *card, struct semaphore *sem, init_waitqueue_head(&adapter->hs_activate_wait_q); adapter->cmd_wait_q_required = false; init_waitqueue_head(&adapter->cmd_wait_q.wait); - adapter->cmd_wait_q.condition = false; adapter->cmd_wait_q.status = 0; + adapter->scan_wait_q_woken = false; adapter->workqueue = create_workqueue("MWIFIEX_WORK_QUEUE"); if (!adapter->workqueue) -- cgit v1.1