diff options
author | Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> | 2011-10-25 19:34:20 +0530 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2011-11-11 12:58:52 +0200 |
commit | 990bd9151927ad55c7e3da3b05cf13ecfe7a31bf (patch) | |
tree | 18c730d33aea2b373b1ddb8c638220f1bd32dd92 /drivers/net/wireless/ath/ath6kl/main.c | |
parent | 478ac0272154023abb813db7ae12dc380caeb68e (diff) | |
download | lwn-990bd9151927ad55c7e3da3b05cf13ecfe7a31bf.tar.gz lwn-990bd9151927ad55c7e3da3b05cf13ecfe7a31bf.zip |
ath6kl: Maintain virtual interface in a list
This patch removes all references to ar->vif and takes
vif from a list.
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/main.c')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/main.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c index ca86ed368da2..17cabdce62dc 100644 --- a/drivers/net/wireless/ath/ath6kl/main.c +++ b/drivers/net/wireless/ath/ath6kl/main.c @@ -861,8 +861,19 @@ void ath6kl_disconnect(struct ath6kl_vif *vif) void ath6kl_deep_sleep_enable(struct ath6kl *ar) { - /* TODO: Pass vif instead of taking it from ar */ - struct ath6kl_vif *vif = ar->vif; + struct ath6kl_vif *vif; + + /* FIXME: for multi vif */ + vif = ath6kl_vif_first(ar); + if (!vif) { + /* save the current power mode before enabling power save */ + ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode; + + if (ath6kl_wmi_powermode_cmd(ar->wmi, 0, REC_POWER) != 0) + ath6kl_warn("ath6kl_deep_sleep_enable: " + "wmi_powermode_cmd failed\n"); + return; + } switch (vif->sme_state) { case SME_CONNECTING: @@ -1363,6 +1374,23 @@ void ath6kl_disconnect_event(struct ath6kl_vif *vif, u8 reason, u8 *bssid, ath6kl_tx_data_cleanup(ar); } +struct ath6kl_vif *ath6kl_vif_first(struct ath6kl *ar) +{ + struct ath6kl_vif *vif; + + spin_lock(&ar->list_lock); + if (list_empty(&ar->vif_list)) { + spin_unlock(&ar->list_lock); + return NULL; + } + + vif = list_first_entry(&ar->vif_list, struct ath6kl_vif, list); + + spin_unlock(&ar->list_lock); + + return vif; +} + static int ath6kl_open(struct net_device *dev) { struct ath6kl_vif *vif = netdev_priv(dev); |