diff options
author | John W. Linville <linville@tuxdriver.com> | 2014-05-16 14:15:28 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-05-16 14:15:28 -0400 |
commit | 75e58071c0c64f331ccc4c0037990a1e50099f7f (patch) | |
tree | 3074ad8e4be3762cae1e1f5d11d103ce8c216329 | |
parent | 5f407acbb7d6a92841c455b37a6ad4833757740e (diff) | |
parent | d9bc4b9b693d52dc14dc1de5dfec760634067d8c (diff) |
Merge branch 'for-linville' of git://github.com/kvalo/ath
-rw-r--r-- | drivers/net/wireless/ath/ath10k/core.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/mac.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/pci.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.c | 2 |
4 files changed, 39 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 6abde37fb339..75b3dfbd6509 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c | |||
@@ -680,8 +680,8 @@ static void ath10k_core_restart(struct work_struct *work) | |||
680 | 680 | ||
681 | switch (ar->state) { | 681 | switch (ar->state) { |
682 | case ATH10K_STATE_ON: | 682 | case ATH10K_STATE_ON: |
683 | ath10k_halt(ar); | ||
684 | ar->state = ATH10K_STATE_RESTARTING; | 683 | ar->state = ATH10K_STATE_RESTARTING; |
684 | ath10k_halt(ar); | ||
685 | ieee80211_restart_hw(ar->hw); | 685 | ieee80211_restart_hw(ar->hw); |
686 | break; | 686 | break; |
687 | case ATH10K_STATE_OFF: | 687 | case ATH10K_STATE_OFF: |
@@ -908,7 +908,9 @@ void ath10k_core_stop(struct ath10k *ar) | |||
908 | lockdep_assert_held(&ar->conf_mutex); | 908 | lockdep_assert_held(&ar->conf_mutex); |
909 | 909 | ||
910 | /* try to suspend target */ | 910 | /* try to suspend target */ |
911 | ath10k_wait_for_suspend(ar, WMI_PDEV_SUSPEND_AND_DISABLE_INTR); | 911 | if (ar->state != ATH10K_STATE_RESTARTING) |
912 | ath10k_wait_for_suspend(ar, WMI_PDEV_SUSPEND_AND_DISABLE_INTR); | ||
913 | |||
912 | ath10k_debug_stop(ar); | 914 | ath10k_debug_stop(ar); |
913 | ath10k_htc_stop(&ar->htc); | 915 | ath10k_htc_stop(&ar->htc); |
914 | ath10k_htt_detach(&ar->htt); | 916 | ath10k_htt_detach(&ar->htt); |
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 0ac5437492fd..7026f021ccbb 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c | |||
@@ -2291,6 +2291,8 @@ static void ath10k_tx(struct ieee80211_hw *hw, | |||
2291 | */ | 2291 | */ |
2292 | void ath10k_halt(struct ath10k *ar) | 2292 | void ath10k_halt(struct ath10k *ar) |
2293 | { | 2293 | { |
2294 | struct ath10k_vif *arvif; | ||
2295 | |||
2294 | lockdep_assert_held(&ar->conf_mutex); | 2296 | lockdep_assert_held(&ar->conf_mutex); |
2295 | 2297 | ||
2296 | if (ath10k_monitor_is_enabled(ar)) { | 2298 | if (ath10k_monitor_is_enabled(ar)) { |
@@ -2313,6 +2315,17 @@ void ath10k_halt(struct ath10k *ar) | |||
2313 | ar->scan.in_progress = false; | 2315 | ar->scan.in_progress = false; |
2314 | ieee80211_scan_completed(ar->hw, true); | 2316 | ieee80211_scan_completed(ar->hw, true); |
2315 | } | 2317 | } |
2318 | |||
2319 | list_for_each_entry(arvif, &ar->arvifs, list) { | ||
2320 | if (!arvif->beacon) | ||
2321 | continue; | ||
2322 | |||
2323 | dma_unmap_single(arvif->ar->dev, | ||
2324 | ATH10K_SKB_CB(arvif->beacon)->paddr, | ||
2325 | arvif->beacon->len, DMA_TO_DEVICE); | ||
2326 | dev_kfree_skb_any(arvif->beacon); | ||
2327 | arvif->beacon = NULL; | ||
2328 | } | ||
2316 | spin_unlock_bh(&ar->data_lock); | 2329 | spin_unlock_bh(&ar->data_lock); |
2317 | } | 2330 | } |
2318 | 2331 | ||
@@ -2771,6 +2784,9 @@ static void ath10k_remove_interface(struct ieee80211_hw *hw, | |||
2771 | 2784 | ||
2772 | spin_lock_bh(&ar->data_lock); | 2785 | spin_lock_bh(&ar->data_lock); |
2773 | if (arvif->beacon) { | 2786 | if (arvif->beacon) { |
2787 | dma_unmap_single(arvif->ar->dev, | ||
2788 | ATH10K_SKB_CB(arvif->beacon)->paddr, | ||
2789 | arvif->beacon->len, DMA_TO_DEVICE); | ||
2774 | dev_kfree_skb_any(arvif->beacon); | 2790 | dev_kfree_skb_any(arvif->beacon); |
2775 | arvif->beacon = NULL; | 2791 | arvif->beacon = NULL; |
2776 | } | 2792 | } |
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index bf1083d52e61..66b1f3017f2b 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c | |||
@@ -2452,6 +2452,10 @@ static int ath10k_pci_wait_for_target_init(struct ath10k *ar) | |||
2452 | if (val == 0xffffffff) | 2452 | if (val == 0xffffffff) |
2453 | continue; | 2453 | continue; |
2454 | 2454 | ||
2455 | /* the device has crashed so don't bother trying anymore */ | ||
2456 | if (val & FW_IND_EVENT_PENDING) | ||
2457 | break; | ||
2458 | |||
2455 | if (val & FW_IND_INITIALIZED) | 2459 | if (val & FW_IND_INITIALIZED) |
2456 | break; | 2460 | break; |
2457 | 2461 | ||
@@ -2464,7 +2468,19 @@ static int ath10k_pci_wait_for_target_init(struct ath10k *ar) | |||
2464 | mdelay(10); | 2468 | mdelay(10); |
2465 | } while (time_before(jiffies, timeout)); | 2469 | } while (time_before(jiffies, timeout)); |
2466 | 2470 | ||
2467 | if (val == 0xffffffff || !(val & FW_IND_INITIALIZED)) { | 2471 | if (val == 0xffffffff) { |
2472 | ath10k_err("failed to read device register, device is gone\n"); | ||
2473 | ret = -EIO; | ||
2474 | goto out; | ||
2475 | } | ||
2476 | |||
2477 | if (val & FW_IND_EVENT_PENDING) { | ||
2478 | ath10k_warn("device has crashed during init\n"); | ||
2479 | ret = -ECOMM; | ||
2480 | goto out; | ||
2481 | } | ||
2482 | |||
2483 | if (!(val & FW_IND_INITIALIZED)) { | ||
2468 | ath10k_err("failed to receive initialized event from target: %08x\n", | 2484 | ath10k_err("failed to receive initialized event from target: %08x\n", |
2469 | val); | 2485 | val); |
2470 | ret = -ETIMEDOUT; | 2486 | ret = -ETIMEDOUT; |
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index fe4d5f1c672f..72cc4f20d102 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c | |||
@@ -1431,6 +1431,7 @@ static void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb) | |||
1431 | ATH10K_SKB_CB(arvif->beacon)->paddr, | 1431 | ATH10K_SKB_CB(arvif->beacon)->paddr, |
1432 | arvif->beacon->len, DMA_TO_DEVICE); | 1432 | arvif->beacon->len, DMA_TO_DEVICE); |
1433 | dev_kfree_skb_any(arvif->beacon); | 1433 | dev_kfree_skb_any(arvif->beacon); |
1434 | arvif->beacon = NULL; | ||
1434 | } | 1435 | } |
1435 | 1436 | ||
1436 | ATH10K_SKB_CB(bcn)->paddr = dma_map_single(arvif->ar->dev, | 1437 | ATH10K_SKB_CB(bcn)->paddr = dma_map_single(arvif->ar->dev, |
@@ -1440,6 +1441,7 @@ static void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb) | |||
1440 | ATH10K_SKB_CB(bcn)->paddr); | 1441 | ATH10K_SKB_CB(bcn)->paddr); |
1441 | if (ret) { | 1442 | if (ret) { |
1442 | ath10k_warn("failed to map beacon: %d\n", ret); | 1443 | ath10k_warn("failed to map beacon: %d\n", ret); |
1444 | dev_kfree_skb_any(bcn); | ||
1443 | goto skip; | 1445 | goto skip; |
1444 | } | 1446 | } |
1445 | 1447 | ||