diff options
author | Kalle Valo <kvalo@qca.qualcomm.com> | 2011-11-01 02:44:04 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2011-11-11 05:58:59 -0500 |
commit | ec4b7f602d24839a85131dc5b498e69c84ee8373 (patch) | |
tree | 6524e700442aa50130d8a0c47a54abf69c23fa9c /drivers/net | |
parent | 1c17d313891c1477f5aad8d2e1da473bf8b9499d (diff) |
ath6kl: create ath6kl_cfg80211_stop()
Just take code from deep sleep for now, will be improved later. No
functional changes.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.c | 49 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/main.c | 46 |
3 files changed, 52 insertions, 45 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index e7203cf17542..db75642d16f2 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c | |||
@@ -2113,6 +2113,55 @@ static struct cfg80211_ops ath6kl_cfg80211_ops = { | |||
2113 | .mgmt_frame_register = ath6kl_mgmt_frame_register, | 2113 | .mgmt_frame_register = ath6kl_mgmt_frame_register, |
2114 | }; | 2114 | }; |
2115 | 2115 | ||
2116 | void ath6kl_cfg80211_stop(struct ath6kl *ar) | ||
2117 | { | ||
2118 | struct ath6kl_vif *vif; | ||
2119 | |||
2120 | /* FIXME: for multi vif */ | ||
2121 | vif = ath6kl_vif_first(ar); | ||
2122 | if (!vif) { | ||
2123 | /* save the current power mode before enabling power save */ | ||
2124 | ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode; | ||
2125 | |||
2126 | if (ath6kl_wmi_powermode_cmd(ar->wmi, 0, REC_POWER) != 0) | ||
2127 | ath6kl_warn("ath6kl_deep_sleep_enable: " | ||
2128 | "wmi_powermode_cmd failed\n"); | ||
2129 | return; | ||
2130 | } | ||
2131 | |||
2132 | switch (vif->sme_state) { | ||
2133 | case SME_CONNECTING: | ||
2134 | cfg80211_connect_result(vif->ndev, vif->bssid, NULL, 0, | ||
2135 | NULL, 0, | ||
2136 | WLAN_STATUS_UNSPECIFIED_FAILURE, | ||
2137 | GFP_KERNEL); | ||
2138 | break; | ||
2139 | case SME_CONNECTED: | ||
2140 | default: | ||
2141 | /* | ||
2142 | * FIXME: oddly enough smeState is in DISCONNECTED during | ||
2143 | * suspend, why? Need to send disconnected event in that | ||
2144 | * state. | ||
2145 | */ | ||
2146 | cfg80211_disconnected(vif->ndev, 0, NULL, 0, GFP_KERNEL); | ||
2147 | break; | ||
2148 | } | ||
2149 | |||
2150 | if (test_bit(CONNECTED, &vif->flags) || | ||
2151 | test_bit(CONNECT_PEND, &vif->flags)) | ||
2152 | ath6kl_wmi_disconnect_cmd(ar->wmi, vif->fw_vif_idx); | ||
2153 | |||
2154 | vif->sme_state = SME_DISCONNECTED; | ||
2155 | |||
2156 | /* disable scanning */ | ||
2157 | if (ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 0xFFFF, 0, 0, | ||
2158 | 0, 0, 0, 0, 0, 0, 0) != 0) | ||
2159 | printk(KERN_WARNING "ath6kl: failed to disable scan " | ||
2160 | "during suspend\n"); | ||
2161 | |||
2162 | ath6kl_cfg80211_scan_complete_event(vif, true); | ||
2163 | } | ||
2164 | |||
2116 | struct ath6kl *ath6kl_core_alloc(struct device *dev) | 2165 | struct ath6kl *ath6kl_core_alloc(struct device *dev) |
2117 | { | 2166 | { |
2118 | struct ath6kl *ar; | 2167 | struct ath6kl *ar; |
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h b/drivers/net/wireless/ath/ath6kl/cfg80211.h index f323a49fdde3..bb0ac22dfa5b 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.h +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h | |||
@@ -40,4 +40,6 @@ void ath6kl_cfg80211_disconnect_event(struct ath6kl_vif *vif, u8 reason, | |||
40 | void ath6kl_cfg80211_tkip_micerr_event(struct ath6kl_vif *vif, u8 keyid, | 40 | void ath6kl_cfg80211_tkip_micerr_event(struct ath6kl_vif *vif, u8 keyid, |
41 | bool ismcast); | 41 | bool ismcast); |
42 | 42 | ||
43 | void ath6kl_cfg80211_stop(struct ath6kl *ar); | ||
44 | |||
43 | #endif /* ATH6KL_CFG80211_H */ | 45 | #endif /* ATH6KL_CFG80211_H */ |
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c index d2822d0854eb..378dc8d0277d 100644 --- a/drivers/net/wireless/ath/ath6kl/main.c +++ b/drivers/net/wireless/ath/ath6kl/main.c | |||
@@ -580,51 +580,7 @@ void ath6kl_disconnect(struct ath6kl_vif *vif) | |||
580 | 580 | ||
581 | void ath6kl_deep_sleep_enable(struct ath6kl *ar) | 581 | void ath6kl_deep_sleep_enable(struct ath6kl *ar) |
582 | { | 582 | { |
583 | struct ath6kl_vif *vif; | 583 | ath6kl_cfg80211_stop(ar); |
584 | |||
585 | /* FIXME: for multi vif */ | ||
586 | vif = ath6kl_vif_first(ar); | ||
587 | if (!vif) { | ||
588 | /* save the current power mode before enabling power save */ | ||
589 | ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode; | ||
590 | |||
591 | if (ath6kl_wmi_powermode_cmd(ar->wmi, 0, REC_POWER) != 0) | ||
592 | ath6kl_warn("ath6kl_deep_sleep_enable: " | ||
593 | "wmi_powermode_cmd failed\n"); | ||
594 | return; | ||
595 | } | ||
596 | |||
597 | switch (vif->sme_state) { | ||
598 | case SME_CONNECTING: | ||
599 | cfg80211_connect_result(vif->ndev, vif->bssid, NULL, 0, | ||
600 | NULL, 0, | ||
601 | WLAN_STATUS_UNSPECIFIED_FAILURE, | ||
602 | GFP_KERNEL); | ||
603 | break; | ||
604 | case SME_CONNECTED: | ||
605 | default: | ||
606 | /* | ||
607 | * FIXME: oddly enough smeState is in DISCONNECTED during | ||
608 | * suspend, why? Need to send disconnected event in that | ||
609 | * state. | ||
610 | */ | ||
611 | cfg80211_disconnected(vif->ndev, 0, NULL, 0, GFP_KERNEL); | ||
612 | break; | ||
613 | } | ||
614 | |||
615 | if (test_bit(CONNECTED, &vif->flags) || | ||
616 | test_bit(CONNECT_PEND, &vif->flags)) | ||
617 | ath6kl_wmi_disconnect_cmd(ar->wmi, vif->fw_vif_idx); | ||
618 | |||
619 | vif->sme_state = SME_DISCONNECTED; | ||
620 | |||
621 | /* disable scanning */ | ||
622 | if (ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 0xFFFF, 0, 0, | ||
623 | 0, 0, 0, 0, 0, 0, 0) != 0) | ||
624 | printk(KERN_WARNING "ath6kl: failed to disable scan " | ||
625 | "during suspend\n"); | ||
626 | |||
627 | ath6kl_cfg80211_scan_complete_event(vif, true); | ||
628 | 584 | ||
629 | /* save the current power mode before enabling power save */ | 585 | /* save the current power mode before enabling power save */ |
630 | ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode; | 586 | ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode; |