diff options
author | Raja Mani <rmani@qca.qualcomm.com> | 2012-02-20 08:38:08 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2012-03-07 02:49:47 -0500 |
commit | ce0dc0cfeac9fde9964fa4b07aecd7cc604060e0 (patch) | |
tree | 5ee4c1ee9e079ec9524c10bdb5d4fe2e8316afe1 /drivers/net/wireless/ath/ath6kl/cfg80211.c | |
parent | 8f46fccd6cd0d7ba70ba1636e59e98ca17dd2239 (diff) |
ath6kl: Set optimal listen intvl,bmiss,scan params while going to wow suspend
* In order to save the target power in WOW suspend state,
configure the best optimal values for the below parameters,
- listen interval.
- beacon miss interval.
- scan parameters.
Default values for above attributes are reverted in
wow resume operation.
* The default listen interval is set before the host issue
connect request.
* New function is added to configure beacon miss count.
kvalo: minor changes to fix open parenthesis alignment
Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/cfg80211.c')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.c | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 8d6bb323bb74..baa3895b1643 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c | |||
@@ -423,6 +423,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, | |||
423 | struct ath6kl_vif *vif = netdev_priv(dev); | 423 | struct ath6kl_vif *vif = netdev_priv(dev); |
424 | int status; | 424 | int status; |
425 | u8 nw_subtype = (ar->p2p) ? SUBTYPE_P2PDEV : SUBTYPE_NONE; | 425 | u8 nw_subtype = (ar->p2p) ? SUBTYPE_P2PDEV : SUBTYPE_NONE; |
426 | u16 interval; | ||
426 | 427 | ||
427 | ath6kl_cfg80211_sscan_disable(vif); | 428 | ath6kl_cfg80211_sscan_disable(vif); |
428 | 429 | ||
@@ -577,6 +578,20 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, | |||
577 | vif->grp_crypto_len, vif->ch_hint); | 578 | vif->grp_crypto_len, vif->ch_hint); |
578 | 579 | ||
579 | vif->reconnect_flag = 0; | 580 | vif->reconnect_flag = 0; |
581 | |||
582 | if (vif->nw_type == INFRA_NETWORK) { | ||
583 | interval = max(vif->listen_intvl_t, | ||
584 | (u16) ATH6KL_MAX_WOW_LISTEN_INTL); | ||
585 | status = ath6kl_wmi_listeninterval_cmd(ar->wmi, vif->fw_vif_idx, | ||
586 | interval, | ||
587 | 0); | ||
588 | if (status) { | ||
589 | ath6kl_err("couldn't set listen intervel\n"); | ||
590 | up(&ar->sem); | ||
591 | return status; | ||
592 | } | ||
593 | } | ||
594 | |||
580 | status = ath6kl_wmi_connect_cmd(ar->wmi, vif->fw_vif_idx, vif->nw_type, | 595 | status = ath6kl_wmi_connect_cmd(ar->wmi, vif->fw_vif_idx, vif->nw_type, |
581 | vif->dot11_auth_mode, vif->auth_mode, | 596 | vif->dot11_auth_mode, vif->auth_mode, |
582 | vif->prwise_crypto, | 597 | vif->prwise_crypto, |
@@ -1911,7 +1926,7 @@ static int ath6kl_wow_suspend(struct ath6kl *ar, struct cfg80211_wowlan *wow) | |||
1911 | struct ath6kl_vif *vif; | 1926 | struct ath6kl_vif *vif; |
1912 | int ret, left; | 1927 | int ret, left; |
1913 | u32 filter = 0; | 1928 | u32 filter = 0; |
1914 | u16 i; | 1929 | u16 i, bmiss_time; |
1915 | u8 index = 0; | 1930 | u8 index = 0; |
1916 | __be32 ips[MAX_IP_ADDRS]; | 1931 | __be32 ips[MAX_IP_ADDRS]; |
1917 | 1932 | ||
@@ -1950,6 +1965,30 @@ static int ath6kl_wow_suspend(struct ath6kl *ar, struct cfg80211_wowlan *wow) | |||
1950 | 1965 | ||
1951 | netif_stop_queue(vif->ndev); | 1966 | netif_stop_queue(vif->ndev); |
1952 | 1967 | ||
1968 | if (vif->nw_type != AP_NETWORK) { | ||
1969 | ret = ath6kl_wmi_listeninterval_cmd(ar->wmi, vif->fw_vif_idx, | ||
1970 | ATH6KL_MAX_WOW_LISTEN_INTL, | ||
1971 | 0); | ||
1972 | if (ret) | ||
1973 | return ret; | ||
1974 | |||
1975 | /* Set listen interval x 15 times as bmiss time */ | ||
1976 | bmiss_time = ATH6KL_MAX_WOW_LISTEN_INTL * 15; | ||
1977 | if (bmiss_time > ATH6KL_MAX_BMISS_TIME) | ||
1978 | bmiss_time = ATH6KL_MAX_BMISS_TIME; | ||
1979 | |||
1980 | ret = ath6kl_wmi_bmisstime_cmd(ar->wmi, vif->fw_vif_idx, | ||
1981 | bmiss_time, 0); | ||
1982 | if (ret) | ||
1983 | return ret; | ||
1984 | |||
1985 | ret = ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, | ||
1986 | 0xFFFF, 0, 0xFFFF, 0, 0, 0, | ||
1987 | 0, 0, 0, 0); | ||
1988 | if (ret) | ||
1989 | return ret; | ||
1990 | } | ||
1991 | |||
1953 | ar->state = ATH6KL_STATE_SUSPENDING; | 1992 | ar->state = ATH6KL_STATE_SUSPENDING; |
1954 | 1993 | ||
1955 | /* Setup own IP addr for ARP agent. */ | 1994 | /* Setup own IP addr for ARP agent. */ |
@@ -2041,6 +2080,23 @@ static int ath6kl_wow_resume(struct ath6kl *ar) | |||
2041 | return ret; | 2080 | return ret; |
2042 | } | 2081 | } |
2043 | 2082 | ||
2083 | if (vif->nw_type != AP_NETWORK) { | ||
2084 | ret = ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, | ||
2085 | 0, 0, 0, 0, 0, 0, 3, 0, 0, 0); | ||
2086 | if (ret) | ||
2087 | return ret; | ||
2088 | |||
2089 | ret = ath6kl_wmi_listeninterval_cmd(ar->wmi, vif->fw_vif_idx, | ||
2090 | vif->listen_intvl_t, 0); | ||
2091 | if (ret) | ||
2092 | return ret; | ||
2093 | |||
2094 | ret = ath6kl_wmi_bmisstime_cmd(ar->wmi, vif->fw_vif_idx, | ||
2095 | vif->bmiss_time_t, 0); | ||
2096 | if (ret) | ||
2097 | return ret; | ||
2098 | } | ||
2099 | |||
2044 | ar->state = ATH6KL_STATE_ON; | 2100 | ar->state = ATH6KL_STATE_ON; |
2045 | 2101 | ||
2046 | netif_wake_queue(vif->ndev); | 2102 | netif_wake_queue(vif->ndev); |
@@ -3034,6 +3090,7 @@ struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name, | |||
3034 | vif->fw_vif_idx = fw_vif_idx; | 3090 | vif->fw_vif_idx = fw_vif_idx; |
3035 | vif->nw_type = vif->next_mode = nw_type; | 3091 | vif->nw_type = vif->next_mode = nw_type; |
3036 | vif->listen_intvl_t = ATH6KL_DEFAULT_LISTEN_INTVAL; | 3092 | vif->listen_intvl_t = ATH6KL_DEFAULT_LISTEN_INTVAL; |
3093 | vif->bmiss_time_t = ATH6KL_DEFAULT_BMISS_TIME; | ||
3037 | 3094 | ||
3038 | memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN); | 3095 | memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN); |
3039 | if (fw_vif_idx != 0) | 3096 | if (fw_vif_idx != 0) |