ath6kl: power down hardware when interface is down
The benefit from this is that user space can control hardware's power state
by putting interface up and down. This is handy if firmware gets to some
weird state.
The downside will be that putting interface up takes a bit longer,
I was measuring ~500 ms during interface up.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index 3b2a7e8..717ed22 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -673,10 +673,12 @@
set_bit(WMI_READY, &ar->flag);
wake_up(&ar->event_wq);
- ath6kl_info("hw %s fw %s%s\n",
- get_hw_id_string(ar->wiphy->hw_version),
- ar->wiphy->fw_version,
- test_bit(TESTMODE, &ar->flag) ? " testmode" : "");
+ if (test_and_clear_bit(FIRST_BOOT, &ar->flag)) {
+ ath6kl_info("hw %s fw %s%s\n",
+ get_hw_id_string(ar->wiphy->hw_version),
+ ar->wiphy->fw_version,
+ test_bit(TESTMODE, &ar->flag) ? " testmode" : "");
+ }
}
void ath6kl_scan_complete_evt(struct ath6kl_vif *vif, int status)
@@ -1112,6 +1114,12 @@
static int ath6kl_open(struct net_device *dev)
{
struct ath6kl_vif *vif = netdev_priv(dev);
+ int ret;
+
+ /* FIXME: how to handle multi vif support? */
+ ret = ath6kl_init_hw_start(vif->ar);
+ if (ret)
+ return ret;
set_bit(WLAN_ENABLED, &vif->flags);
@@ -1128,6 +1136,7 @@
{
struct ath6kl *ar = ath6kl_priv(dev);
struct ath6kl_vif *vif = netdev_priv(dev);
+ int ret;
netif_stop_queue(dev);
@@ -1143,6 +1152,11 @@
ath6kl_cfg80211_scan_complete_event(vif, -ECANCELED);
+ /* FIXME: how to handle multi vif support? */
+ ret = ath6kl_init_hw_stop(ar);
+ if (ret)
+ return ret;
+
return 0;
}