aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c59
-rw-r--r--drivers/net/wireless/ath/ath6kl/core.h4
-rw-r--r--drivers/net/wireless/ath/ath6kl/wmi.c20
-rw-r--r--drivers/net/wireless/ath/ath6kl/wmi.h8
4 files changed, 90 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)
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index 727267eb8313..01763cd243b4 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -186,6 +186,9 @@ struct ath6kl_fw_ie {
186#define MBOX_YIELD_LIMIT 99 186#define MBOX_YIELD_LIMIT 99
187 187
188#define ATH6KL_DEFAULT_LISTEN_INTVAL 100 /* in TUs */ 188#define ATH6KL_DEFAULT_LISTEN_INTVAL 100 /* in TUs */
189#define ATH6KL_DEFAULT_BMISS_TIME 1500
190#define ATH6KL_MAX_WOW_LISTEN_INTL 300 /* in TUs */
191#define ATH6KL_MAX_BMISS_TIME 5000
189 192
190/* configuration lags */ 193/* configuration lags */
191/* 194/*
@@ -511,6 +514,7 @@ struct ath6kl_vif {
511 u16 next_chan; 514 u16 next_chan;
512 u16 assoc_bss_beacon_int; 515 u16 assoc_bss_beacon_int;
513 u16 listen_intvl_t; 516 u16 listen_intvl_t;
517 u16 bmiss_time_t;
514 u8 assoc_bss_dtim_period; 518 u8 assoc_bss_dtim_period;
515 struct net_device_stats net_stats; 519 struct net_device_stats net_stats;
516 struct target_stats target_stats; 520 struct target_stats target_stats;
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 0a57dcc6041a..573cb26077a9 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -2027,6 +2027,26 @@ int ath6kl_wmi_listeninterval_cmd(struct wmi *wmi, u8 if_idx,
2027 return ret; 2027 return ret;
2028} 2028}
2029 2029
2030int ath6kl_wmi_bmisstime_cmd(struct wmi *wmi, u8 if_idx,
2031 u16 bmiss_time, u16 num_beacons)
2032{
2033 struct sk_buff *skb;
2034 struct wmi_bmiss_time_cmd *cmd;
2035 int ret;
2036
2037 skb = ath6kl_wmi_get_new_buf(sizeof(*cmd));
2038 if (!skb)
2039 return -ENOMEM;
2040
2041 cmd = (struct wmi_bmiss_time_cmd *) skb->data;
2042 cmd->bmiss_time = cpu_to_le16(bmiss_time);
2043 cmd->num_beacons = cpu_to_le16(num_beacons);
2044
2045 ret = ath6kl_wmi_cmd_send(wmi, if_idx, skb, WMI_SET_BMISS_TIME_CMDID,
2046 NO_SYNC_WMIFLAG);
2047 return ret;
2048}
2049
2030int ath6kl_wmi_powermode_cmd(struct wmi *wmi, u8 if_idx, u8 pwr_mode) 2050int ath6kl_wmi_powermode_cmd(struct wmi *wmi, u8 if_idx, u8 pwr_mode)
2031{ 2051{
2032 struct sk_buff *skb; 2052 struct sk_buff *skb;
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h
index cea7429a8a0b..892a7a0a1378 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.h
+++ b/drivers/net/wireless/ath/ath6kl/wmi.h
@@ -998,6 +998,12 @@ struct wmi_listen_int_cmd {
998 __le16 num_beacons; 998 __le16 num_beacons;
999} __packed; 999} __packed;
1000 1000
1001/* WMI_SET_BMISS_TIME_CMDID */
1002struct wmi_bmiss_time_cmd {
1003 __le16 bmiss_time;
1004 __le16 num_beacons;
1005};
1006
1001/* WMI_SET_POWER_MODE_CMDID */ 1007/* WMI_SET_POWER_MODE_CMDID */
1002enum wmi_power_mode { 1008enum wmi_power_mode {
1003 REC_POWER = 0x01, 1009 REC_POWER = 0x01,
@@ -2418,6 +2424,8 @@ int ath6kl_wmi_probedssid_cmd(struct wmi *wmi, u8 if_idx, u8 index, u8 flag,
2418int ath6kl_wmi_listeninterval_cmd(struct wmi *wmi, u8 if_idx, 2424int ath6kl_wmi_listeninterval_cmd(struct wmi *wmi, u8 if_idx,
2419 u16 listen_interval, 2425 u16 listen_interval,
2420 u16 listen_beacons); 2426 u16 listen_beacons);
2427int ath6kl_wmi_bmisstime_cmd(struct wmi *wmi, u8 if_idx,
2428 u16 bmiss_time, u16 num_beacons);
2421int ath6kl_wmi_powermode_cmd(struct wmi *wmi, u8 if_idx, u8 pwr_mode); 2429int ath6kl_wmi_powermode_cmd(struct wmi *wmi, u8 if_idx, u8 pwr_mode);
2422int ath6kl_wmi_pmparams_cmd(struct wmi *wmi, u8 if_idx, u16 idle_period, 2430int ath6kl_wmi_pmparams_cmd(struct wmi *wmi, u8 if_idx, u16 idle_period,
2423 u16 ps_poll_num, u16 dtim_policy, 2431 u16 ps_poll_num, u16 dtim_policy,