diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2014-03-17 09:34:21 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-03-17 13:44:18 -0400 |
commit | 9c3bde56b7e6403a9f86b63bb02c9a5cb74456fa (patch) | |
tree | 0e37ac3e088bf7216e2195d8aefc89db9d71669a /drivers/net/wireless | |
parent | 4cd9e8377f6f18ffabad2cf0967855432db3dbce (diff) |
wil6210: serialize fw_recovery and start_ap
These methods can change device state, serialize with others
similar ones like up/down
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/cfg80211.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/main.c | 2 |
2 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c index 597540a307d8..ed5a7e145027 100644 --- a/drivers/net/wireless/ath/wil6210/cfg80211.c +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c | |||
@@ -609,18 +609,20 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy, | |||
609 | if (wil_fix_bcon(wil, bcon)) | 609 | if (wil_fix_bcon(wil, bcon)) |
610 | wil_dbg_misc(wil, "Fixed bcon\n"); | 610 | wil_dbg_misc(wil, "Fixed bcon\n"); |
611 | 611 | ||
612 | mutex_lock(&wil->mutex); | ||
613 | |||
612 | rc = wil_reset(wil); | 614 | rc = wil_reset(wil); |
613 | if (rc) | 615 | if (rc) |
614 | return rc; | 616 | goto out; |
615 | 617 | ||
616 | /* Rx VRING. */ | 618 | /* Rx VRING. */ |
617 | rc = wil_rx_init(wil); | 619 | rc = wil_rx_init(wil); |
618 | if (rc) | 620 | if (rc) |
619 | return rc; | 621 | goto out; |
620 | 622 | ||
621 | rc = wmi_set_ssid(wil, info->ssid_len, info->ssid); | 623 | rc = wmi_set_ssid(wil, info->ssid_len, info->ssid); |
622 | if (rc) | 624 | if (rc) |
623 | return rc; | 625 | goto out; |
624 | 626 | ||
625 | /* MAC address - pre-requisite for other commands */ | 627 | /* MAC address - pre-requisite for other commands */ |
626 | wmi_set_mac_address(wil, ndev->dev_addr); | 628 | wmi_set_mac_address(wil, ndev->dev_addr); |
@@ -644,11 +646,13 @@ static int wil_cfg80211_start_ap(struct wiphy *wiphy, | |||
644 | rc = wmi_pcp_start(wil, info->beacon_interval, wmi_nettype, | 646 | rc = wmi_pcp_start(wil, info->beacon_interval, wmi_nettype, |
645 | channel->hw_value); | 647 | channel->hw_value); |
646 | if (rc) | 648 | if (rc) |
647 | return rc; | 649 | goto out; |
648 | 650 | ||
649 | 651 | ||
650 | netif_carrier_on(ndev); | 652 | netif_carrier_on(ndev); |
651 | 653 | ||
654 | out: | ||
655 | mutex_unlock(&wil->mutex); | ||
652 | return rc; | 656 | return rc; |
653 | } | 657 | } |
654 | 658 | ||
@@ -658,8 +662,11 @@ static int wil_cfg80211_stop_ap(struct wiphy *wiphy, | |||
658 | int rc = 0; | 662 | int rc = 0; |
659 | struct wil6210_priv *wil = wiphy_to_wil(wiphy); | 663 | struct wil6210_priv *wil = wiphy_to_wil(wiphy); |
660 | 664 | ||
665 | mutex_lock(&wil->mutex); | ||
666 | |||
661 | rc = wmi_pcp_stop(wil); | 667 | rc = wmi_pcp_stop(wil); |
662 | 668 | ||
669 | mutex_unlock(&wil->mutex); | ||
663 | return rc; | 670 | return rc; |
664 | } | 671 | } |
665 | 672 | ||
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index 32ac1b906abe..351925b5d2c8 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c | |||
@@ -159,6 +159,7 @@ static void wil_fw_error_worker(struct work_struct *work) | |||
159 | if (no_fw_recovery) | 159 | if (no_fw_recovery) |
160 | return; | 160 | return; |
161 | 161 | ||
162 | mutex_lock(&wil->mutex); | ||
162 | switch (wdev->iftype) { | 163 | switch (wdev->iftype) { |
163 | case NL80211_IFTYPE_STATION: | 164 | case NL80211_IFTYPE_STATION: |
164 | case NL80211_IFTYPE_P2P_CLIENT: | 165 | case NL80211_IFTYPE_P2P_CLIENT: |
@@ -176,6 +177,7 @@ static void wil_fw_error_worker(struct work_struct *work) | |||
176 | default: | 177 | default: |
177 | break; | 178 | break; |
178 | } | 179 | } |
180 | mutex_unlock(&wil->mutex); | ||
179 | } | 181 | } |
180 | 182 | ||
181 | static int wil_find_free_vring(struct wil6210_priv *wil) | 183 | static int wil_find_free_vring(struct wil6210_priv *wil) |