aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2012-10-19 22:19:17 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-10-29 15:20:33 -0400
commitb0e70c2fb67bc376c3114a709ce0852e71d37ecb (patch)
tree1cf166a22c78fb8e5e8ab8430d655a328ef262da /drivers/net
parentf162cac83ba474eb71ea2aa7788bd77f1692f4d2 (diff)
mwifiex: minor cleanup and a fix in scan semaphore usage
mwifiex_request_scan() takes care of synchronous internal scan performed by driver during association. Currently the semaphore acquired for the scan is unnecessarily released at the end of different paths. Also, failure paths returning error code other than "-1" are not considered. We will release it at the end of routine to fix above issues. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c1
-rw-r--r--drivers/net/wireless/mwifiex/init.c5
-rw-r--r--drivers/net/wireless/mwifiex/main.h1
-rw-r--r--drivers/net/wireless/mwifiex/scan.c10
-rw-r--r--drivers/net/wireless/mwifiex/sta_cmdresp.c4
5 files changed, 1 insertions, 20 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 0a067bd0222..94405831a87 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -2119,7 +2119,6 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
2119 } 2119 }
2120 2120
2121 sema_init(&priv->async_sem, 1); 2121 sema_init(&priv->async_sem, 1);
2122 priv->scan_pending_on_block = false;
2123 2122
2124 dev_dbg(adapter->dev, "info: %s: Marvell 802.11 Adapter\n", dev->name); 2123 dev_dbg(adapter->dev, "info: %s: Marvell 802.11 Adapter\n", dev->name);
2125 2124
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index 37f2d957bbf..482faace790 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -97,11 +97,6 @@ static void scan_delay_timer_fn(unsigned long data)
97 kfree(priv->user_scan_cfg); 97 kfree(priv->user_scan_cfg);
98 priv->user_scan_cfg = NULL; 98 priv->user_scan_cfg = NULL;
99 } 99 }
100
101 if (priv->scan_pending_on_block) {
102 priv->scan_pending_on_block = false;
103 up(&priv->async_sem);
104 }
105 goto done; 100 goto done;
106 } 101 }
107 102
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 0b747ec84c4..4ed46b694ce 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -482,7 +482,6 @@ struct mwifiex_private {
482 u8 nick_name[16]; 482 u8 nick_name[16];
483 u16 current_key_index; 483 u16 current_key_index;
484 struct semaphore async_sem; 484 struct semaphore async_sem;
485 u8 scan_pending_on_block;
486 u8 report_scan_result; 485 u8 report_scan_result;
487 struct cfg80211_scan_request *scan_request; 486 struct cfg80211_scan_request *scan_request;
488 struct mwifiex_user_scan_cfg *user_scan_cfg; 487 struct mwifiex_user_scan_cfg *user_scan_cfg;
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 32b79ddd774..9c0ad0fe276 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1762,10 +1762,6 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
1762 } 1762 }
1763 if (priv->report_scan_result) 1763 if (priv->report_scan_result)
1764 priv->report_scan_result = false; 1764 priv->report_scan_result = false;
1765 if (priv->scan_pending_on_block) {
1766 priv->scan_pending_on_block = false;
1767 up(&priv->async_sem);
1768 }
1769 1765
1770 if (priv->user_scan_cfg) { 1766 if (priv->user_scan_cfg) {
1771 if (priv->scan_request) { 1767 if (priv->scan_request) {
@@ -1914,7 +1910,6 @@ int mwifiex_request_scan(struct mwifiex_private *priv,
1914 __func__); 1910 __func__);
1915 return -1; 1911 return -1;
1916 } 1912 }
1917 priv->scan_pending_on_block = true;
1918 1913
1919 priv->adapter->scan_wait_q_woken = false; 1914 priv->adapter->scan_wait_q_woken = false;
1920 1915
@@ -1928,10 +1923,7 @@ int mwifiex_request_scan(struct mwifiex_private *priv,
1928 if (!ret) 1923 if (!ret)
1929 ret = mwifiex_wait_queue_complete(priv->adapter); 1924 ret = mwifiex_wait_queue_complete(priv->adapter);
1930 1925
1931 if (ret == -1) { 1926 up(&priv->async_sem);
1932 priv->scan_pending_on_block = false;
1933 up(&priv->async_sem);
1934 }
1935 1927
1936 return ret; 1928 return ret;
1937} 1929}
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c
index 09e6a267f56..65c12eb3e5e 100644
--- a/drivers/net/wireless/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c
@@ -85,10 +85,6 @@ mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
85 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); 85 spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
86 if (priv->report_scan_result) 86 if (priv->report_scan_result)
87 priv->report_scan_result = false; 87 priv->report_scan_result = false;
88 if (priv->scan_pending_on_block) {
89 priv->scan_pending_on_block = false;
90 up(&priv->async_sem);
91 }
92 break; 88 break;
93 89
94 case HostCmd_CMD_MAC_CONTROL: 90 case HostCmd_CMD_MAC_CONTROL: