diff options
author | Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> | 2012-11-16 07:53:36 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2012-11-27 14:44:28 -0500 |
commit | 355b3a982095c8647cce13dd43ebc4bc4299f31a (patch) | |
tree | 58c135ddfb1f17e9534ad5629233358b95f78a8d /drivers | |
parent | eb922e4b41fd315f4ef95fef0ca1051b61cd5538 (diff) |
ath6kl: Move and rename ath6kl_cleanup_vif function
Rename ath6kl_cleanup_vif function as 'ath6kl_cfg80211_vif_stop'
which is the more appropriate name considering the functionality
of the module and vif specific cleanup is actually done by
ath6kl_cfg80211_vif_cleanup. Also move it to cfg80211.c.
Also make ath6kl_cfg80211_sta_bmiss_enhance as static function.
This addresses a FIXME/TODO.
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.c | 81 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/core.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/init.c | 34 |
4 files changed, 58 insertions, 61 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index f253d6684d8f..e9783166e8db 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c | |||
@@ -427,6 +427,30 @@ static bool ath6kl_is_tx_pending(struct ath6kl *ar) | |||
427 | return ar->tx_pending[ath6kl_wmi_get_control_ep(ar->wmi)] == 0; | 427 | return ar->tx_pending[ath6kl_wmi_get_control_ep(ar->wmi)] == 0; |
428 | } | 428 | } |
429 | 429 | ||
430 | static void ath6kl_cfg80211_sta_bmiss_enhance(struct ath6kl_vif *vif, | ||
431 | bool enable) | ||
432 | { | ||
433 | int err; | ||
434 | |||
435 | if (WARN_ON(!test_bit(WMI_READY, &vif->ar->flag))) | ||
436 | return; | ||
437 | |||
438 | if (vif->nw_type != INFRA_NETWORK) | ||
439 | return; | ||
440 | |||
441 | if (!test_bit(ATH6KL_FW_CAPABILITY_BMISS_ENHANCE, | ||
442 | vif->ar->fw_capabilities)) | ||
443 | return; | ||
444 | |||
445 | ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s fw bmiss enhance\n", | ||
446 | enable ? "enable" : "disable"); | ||
447 | |||
448 | err = ath6kl_wmi_sta_bmiss_enhance_cmd(vif->ar->wmi, | ||
449 | vif->fw_vif_idx, enable); | ||
450 | if (err) | ||
451 | ath6kl_err("failed to %s enhanced bmiss detection: %d\n", | ||
452 | enable ? "enable" : "disable", err); | ||
453 | } | ||
430 | 454 | ||
431 | static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, | 455 | static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, |
432 | struct cfg80211_connect_params *sme) | 456 | struct cfg80211_connect_params *sme) |
@@ -1507,7 +1531,7 @@ static int ath6kl_cfg80211_del_iface(struct wiphy *wiphy, | |||
1507 | list_del(&vif->list); | 1531 | list_del(&vif->list); |
1508 | spin_unlock_bh(&ar->list_lock); | 1532 | spin_unlock_bh(&ar->list_lock); |
1509 | 1533 | ||
1510 | ath6kl_cleanup_vif(vif, test_bit(WMI_READY, &ar->flag)); | 1534 | ath6kl_cfg80211_vif_stop(vif, test_bit(WMI_READY, &ar->flag)); |
1511 | 1535 | ||
1512 | ath6kl_cfg80211_vif_cleanup(vif); | 1536 | ath6kl_cfg80211_vif_cleanup(vif); |
1513 | 1537 | ||
@@ -2667,30 +2691,6 @@ static int ath6kl_set_ies(struct ath6kl_vif *vif, | |||
2667 | return 0; | 2691 | return 0; |
2668 | } | 2692 | } |
2669 | 2693 | ||
2670 | void ath6kl_cfg80211_sta_bmiss_enhance(struct ath6kl_vif *vif, bool enable) | ||
2671 | { | ||
2672 | int err; | ||
2673 | |||
2674 | if (WARN_ON(!test_bit(WMI_READY, &vif->ar->flag))) | ||
2675 | return; | ||
2676 | |||
2677 | if (vif->nw_type != INFRA_NETWORK) | ||
2678 | return; | ||
2679 | |||
2680 | if (!test_bit(ATH6KL_FW_CAPABILITY_BMISS_ENHANCE, | ||
2681 | vif->ar->fw_capabilities)) | ||
2682 | return; | ||
2683 | |||
2684 | ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s fw bmiss enhance\n", | ||
2685 | enable ? "enable" : "disable"); | ||
2686 | |||
2687 | err = ath6kl_wmi_sta_bmiss_enhance_cmd(vif->ar->wmi, | ||
2688 | vif->fw_vif_idx, enable); | ||
2689 | if (err) | ||
2690 | ath6kl_err("failed to %s enhanced bmiss detection: %d\n", | ||
2691 | enable ? "enable" : "disable", err); | ||
2692 | } | ||
2693 | |||
2694 | static int ath6kl_get_rsn_capab(struct cfg80211_beacon_data *beacon, | 2694 | static int ath6kl_get_rsn_capab(struct cfg80211_beacon_data *beacon, |
2695 | u8 *rsn_capab) | 2695 | u8 *rsn_capab) |
2696 | { | 2696 | { |
@@ -3561,6 +3561,37 @@ static int ath6kl_cfg80211_vif_init(struct ath6kl_vif *vif) | |||
3561 | return 0; | 3561 | return 0; |
3562 | } | 3562 | } |
3563 | 3563 | ||
3564 | void ath6kl_cfg80211_vif_stop(struct ath6kl_vif *vif, bool wmi_ready) | ||
3565 | { | ||
3566 | static u8 bcast_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; | ||
3567 | bool discon_issued; | ||
3568 | |||
3569 | netif_stop_queue(vif->ndev); | ||
3570 | |||
3571 | clear_bit(WLAN_ENABLED, &vif->flags); | ||
3572 | |||
3573 | if (wmi_ready) { | ||
3574 | discon_issued = test_bit(CONNECTED, &vif->flags) || | ||
3575 | test_bit(CONNECT_PEND, &vif->flags); | ||
3576 | ath6kl_disconnect(vif); | ||
3577 | del_timer(&vif->disconnect_timer); | ||
3578 | |||
3579 | if (discon_issued) | ||
3580 | ath6kl_disconnect_event(vif, DISCONNECT_CMD, | ||
3581 | (vif->nw_type & AP_NETWORK) ? | ||
3582 | bcast_mac : vif->bssid, | ||
3583 | 0, NULL, 0); | ||
3584 | } | ||
3585 | |||
3586 | if (vif->scan_req) { | ||
3587 | cfg80211_scan_done(vif->scan_req, true); | ||
3588 | vif->scan_req = NULL; | ||
3589 | } | ||
3590 | |||
3591 | /* need to clean up enhanced bmiss detection fw state */ | ||
3592 | ath6kl_cfg80211_sta_bmiss_enhance(vif, false); | ||
3593 | } | ||
3594 | |||
3564 | void ath6kl_cfg80211_vif_cleanup(struct ath6kl_vif *vif) | 3595 | void ath6kl_cfg80211_vif_cleanup(struct ath6kl_vif *vif) |
3565 | { | 3596 | { |
3566 | struct ath6kl *ar = vif->ar; | 3597 | struct ath6kl *ar = vif->ar; |
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h b/drivers/net/wireless/ath/ath6kl/cfg80211.h index e5e70f3a8ca8..b59becd91aea 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.h +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h | |||
@@ -61,7 +61,5 @@ void ath6kl_cfg80211_cleanup(struct ath6kl *ar); | |||
61 | 61 | ||
62 | struct ath6kl *ath6kl_cfg80211_create(void); | 62 | struct ath6kl *ath6kl_cfg80211_create(void); |
63 | void ath6kl_cfg80211_destroy(struct ath6kl *ar); | 63 | void ath6kl_cfg80211_destroy(struct ath6kl *ar); |
64 | /* TODO: remove this once ath6kl_vif_cleanup() is moved to cfg80211.c */ | ||
65 | void ath6kl_cfg80211_sta_bmiss_enhance(struct ath6kl_vif *vif, bool enable); | ||
66 | 64 | ||
67 | #endif /* ATH6KL_CFG80211_H */ | 65 | #endif /* ATH6KL_CFG80211_H */ |
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h index 189d8faf8c87..61b2f98b4e77 100644 --- a/drivers/net/wireless/ath/ath6kl/core.h +++ b/drivers/net/wireless/ath/ath6kl/core.h | |||
@@ -940,7 +940,7 @@ void ath6kl_reset_device(struct ath6kl *ar, u32 target_type, | |||
940 | bool wait_fot_compltn, bool cold_reset); | 940 | bool wait_fot_compltn, bool cold_reset); |
941 | void ath6kl_init_control_info(struct ath6kl_vif *vif); | 941 | void ath6kl_init_control_info(struct ath6kl_vif *vif); |
942 | struct ath6kl_vif *ath6kl_vif_first(struct ath6kl *ar); | 942 | struct ath6kl_vif *ath6kl_vif_first(struct ath6kl *ar); |
943 | void ath6kl_cleanup_vif(struct ath6kl_vif *vif, bool wmi_ready); | 943 | void ath6kl_cfg80211_vif_stop(struct ath6kl_vif *vif, bool wmi_ready); |
944 | int ath6kl_init_hw_start(struct ath6kl *ar); | 944 | int ath6kl_init_hw_start(struct ath6kl *ar); |
945 | int ath6kl_init_hw_stop(struct ath6kl *ar); | 945 | int ath6kl_init_hw_stop(struct ath6kl *ar); |
946 | int ath6kl_init_fetch_firmwares(struct ath6kl *ar); | 946 | int ath6kl_init_fetch_firmwares(struct ath6kl *ar); |
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index 828cfbf7f72c..5d434cf88f35 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c | |||
@@ -1715,38 +1715,6 @@ void ath6kl_init_hw_restart(struct ath6kl *ar) | |||
1715 | } | 1715 | } |
1716 | } | 1716 | } |
1717 | 1717 | ||
1718 | /* FIXME: move this to cfg80211.c and rename to ath6kl_cfg80211_vif_stop() */ | ||
1719 | void ath6kl_cleanup_vif(struct ath6kl_vif *vif, bool wmi_ready) | ||
1720 | { | ||
1721 | static u8 bcast_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; | ||
1722 | bool discon_issued; | ||
1723 | |||
1724 | netif_stop_queue(vif->ndev); | ||
1725 | |||
1726 | clear_bit(WLAN_ENABLED, &vif->flags); | ||
1727 | |||
1728 | if (wmi_ready) { | ||
1729 | discon_issued = test_bit(CONNECTED, &vif->flags) || | ||
1730 | test_bit(CONNECT_PEND, &vif->flags); | ||
1731 | ath6kl_disconnect(vif); | ||
1732 | del_timer(&vif->disconnect_timer); | ||
1733 | |||
1734 | if (discon_issued) | ||
1735 | ath6kl_disconnect_event(vif, DISCONNECT_CMD, | ||
1736 | (vif->nw_type & AP_NETWORK) ? | ||
1737 | bcast_mac : vif->bssid, | ||
1738 | 0, NULL, 0); | ||
1739 | } | ||
1740 | |||
1741 | if (vif->scan_req) { | ||
1742 | cfg80211_scan_done(vif->scan_req, true); | ||
1743 | vif->scan_req = NULL; | ||
1744 | } | ||
1745 | |||
1746 | /* need to clean up enhanced bmiss detection fw state */ | ||
1747 | ath6kl_cfg80211_sta_bmiss_enhance(vif, false); | ||
1748 | } | ||
1749 | |||
1750 | void ath6kl_stop_txrx(struct ath6kl *ar) | 1718 | void ath6kl_stop_txrx(struct ath6kl *ar) |
1751 | { | 1719 | { |
1752 | struct ath6kl_vif *vif, *tmp_vif; | 1720 | struct ath6kl_vif *vif, *tmp_vif; |
@@ -1766,7 +1734,7 @@ void ath6kl_stop_txrx(struct ath6kl *ar) | |||
1766 | list_for_each_entry_safe(vif, tmp_vif, &ar->vif_list, list) { | 1734 | list_for_each_entry_safe(vif, tmp_vif, &ar->vif_list, list) { |
1767 | list_del(&vif->list); | 1735 | list_del(&vif->list); |
1768 | spin_unlock_bh(&ar->list_lock); | 1736 | spin_unlock_bh(&ar->list_lock); |
1769 | ath6kl_cleanup_vif(vif, test_bit(WMI_READY, &ar->flag)); | 1737 | ath6kl_cfg80211_vif_stop(vif, test_bit(WMI_READY, &ar->flag)); |
1770 | rtnl_lock(); | 1738 | rtnl_lock(); |
1771 | ath6kl_cfg80211_vif_cleanup(vif); | 1739 | ath6kl_cfg80211_vif_cleanup(vif); |
1772 | rtnl_unlock(); | 1740 | rtnl_unlock(); |