Commit 8f46fccd authored by Raja Mani's avatar Raja Mani Committed by Kalle Valo

ath6kl: Maintain the listen interval per VIF specific

Firmware has the option to support the listen interval
per vif specific. Fix this.

Listen interval can be set by the TUs or by the number
of beacons. Current code enables the user to configure
the listen interval in the unit of 'number of beacons'
using debugfs entry "listen_interval". Going forward,
we need to alter the listen interval in the unit of TUs
to get good power numbers while going to WOW suspend/resume.

Allowing the user to change the listen interval in
the unit of "number of beacons"  in debugfs and changing
listen interval in wow suspend/resume in the unit of
time (TUs) would lead us to confuse.

This patch make sures the listen interval is changed only
in the unit of time (TUs).
Signed-off-by: default avatarRaja Mani <rmani@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 390a8c8f
...@@ -3033,6 +3033,7 @@ struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name, ...@@ -3033,6 +3033,7 @@ struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name,
vif->wdev.iftype = type; vif->wdev.iftype = type;
vif->fw_vif_idx = fw_vif_idx; vif->fw_vif_idx = fw_vif_idx;
vif->nw_type = vif->next_mode = nw_type; vif->nw_type = vif->next_mode = nw_type;
vif->listen_intvl_t = ATH6KL_DEFAULT_LISTEN_INTVAL;
memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN); memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN);
if (fw_vif_idx != 0) if (fw_vif_idx != 0)
......
...@@ -228,9 +228,7 @@ struct ath6kl *ath6kl_core_create(struct device *dev) ...@@ -228,9 +228,7 @@ struct ath6kl *ath6kl_core_create(struct device *dev)
clear_bit(SKIP_SCAN, &ar->flag); clear_bit(SKIP_SCAN, &ar->flag);
clear_bit(DESTROY_IN_PROGRESS, &ar->flag); clear_bit(DESTROY_IN_PROGRESS, &ar->flag);
ar->listen_intvl_b = A_DEFAULT_LISTEN_INTERVAL;
ar->tx_pwr = 0; ar->tx_pwr = 0;
ar->intra_bss = 1; ar->intra_bss = 1;
ar->lrssi_roam_threshold = DEF_LRSSI_ROAM_THRESHOLD; ar->lrssi_roam_threshold = DEF_LRSSI_ROAM_THRESHOLD;
......
...@@ -60,8 +60,6 @@ ...@@ -60,8 +60,6 @@
#define MAX_DEFAULT_SEND_QUEUE_DEPTH (MAX_DEF_COOKIE_NUM / WMM_NUM_AC) #define MAX_DEFAULT_SEND_QUEUE_DEPTH (MAX_DEF_COOKIE_NUM / WMM_NUM_AC)
#define DISCON_TIMER_INTVAL 10000 /* in msec */ #define DISCON_TIMER_INTVAL 10000 /* in msec */
#define A_DEFAULT_LISTEN_INTERVAL 1 /* beacon intervals */
#define A_MAX_WOW_LISTEN_INTERVAL 1000
/* Channel dwell time in fg scan */ /* Channel dwell time in fg scan */
#define ATH6KL_FG_SCAN_INTERVAL 50 /* in ms */ #define ATH6KL_FG_SCAN_INTERVAL 50 /* in ms */
...@@ -187,6 +185,8 @@ struct ath6kl_fw_ie { ...@@ -187,6 +185,8 @@ struct ath6kl_fw_ie {
#define MBOX_YIELD_LIMIT 99 #define MBOX_YIELD_LIMIT 99
#define ATH6KL_DEFAULT_LISTEN_INTVAL 100 /* in TUs */
/* configuration lags */ /* configuration lags */
/* /*
* ATH6KL_CONF_IGNORE_ERP_BARKER: Ignore the barker premable in * ATH6KL_CONF_IGNORE_ERP_BARKER: Ignore the barker premable in
...@@ -510,6 +510,7 @@ struct ath6kl_vif { ...@@ -510,6 +510,7 @@ struct ath6kl_vif {
bool probe_req_report; bool probe_req_report;
u16 next_chan; u16 next_chan;
u16 assoc_bss_beacon_int; u16 assoc_bss_beacon_int;
u16 listen_intvl_t;
u8 assoc_bss_dtim_period; u8 assoc_bss_dtim_period;
struct net_device_stats net_stats; struct net_device_stats net_stats;
struct target_stats target_stats; struct target_stats target_stats;
...@@ -569,7 +570,6 @@ struct ath6kl { ...@@ -569,7 +570,6 @@ struct ath6kl {
u8 avail_idx_map; u8 avail_idx_map;
spinlock_t lock; spinlock_t lock;
struct semaphore sem; struct semaphore sem;
u16 listen_intvl_b;
u8 lrssi_roam_threshold; u8 lrssi_roam_threshold;
struct ath6kl_version version; struct ath6kl_version version;
u32 target_type; u32 target_type;
......
...@@ -1631,12 +1631,12 @@ static ssize_t ath6kl_listen_int_write(struct file *file, ...@@ -1631,12 +1631,12 @@ static ssize_t ath6kl_listen_int_write(struct file *file,
if (kstrtou16(buf, 0, &listen_interval)) if (kstrtou16(buf, 0, &listen_interval))
return -EINVAL; return -EINVAL;
if ((listen_interval < 1) || (listen_interval > 50)) if ((listen_interval < 15) || (listen_interval > 3000))
return -EINVAL; return -EINVAL;
ar->listen_intvl_b = listen_interval; vif->listen_intvl_t = listen_interval;
ath6kl_wmi_listeninterval_cmd(ar->wmi, vif->fw_vif_idx, 0, ath6kl_wmi_listeninterval_cmd(ar->wmi, vif->fw_vif_idx,
ar->listen_intvl_b); vif->listen_intvl_t, 0);
return count; return count;
} }
...@@ -1646,10 +1646,15 @@ static ssize_t ath6kl_listen_int_read(struct file *file, ...@@ -1646,10 +1646,15 @@ static ssize_t ath6kl_listen_int_read(struct file *file,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct ath6kl *ar = file->private_data; struct ath6kl *ar = file->private_data;
struct ath6kl_vif *vif;
char buf[32]; char buf[32];
int len; int len;
len = scnprintf(buf, sizeof(buf), "%u\n", ar->listen_intvl_b); vif = ath6kl_vif_first(ar);
if (!vif)
return -EIO;
len = scnprintf(buf, sizeof(buf), "%u\n", vif->listen_intvl_t);
return simple_read_from_buffer(user_buf, count, ppos, buf, len); return simple_read_from_buffer(user_buf, count, ppos, buf, len);
} }
......
...@@ -599,11 +599,9 @@ void ath6kl_connect_event(struct ath6kl_vif *vif, u16 channel, u8 *bssid, ...@@ -599,11 +599,9 @@ void ath6kl_connect_event(struct ath6kl_vif *vif, u16 channel, u8 *bssid,
memcpy(vif->bssid, bssid, sizeof(vif->bssid)); memcpy(vif->bssid, bssid, sizeof(vif->bssid));
vif->bss_ch = channel; vif->bss_ch = channel;
if ((vif->nw_type == INFRA_NETWORK)) { if ((vif->nw_type == INFRA_NETWORK))
ar->listen_intvl_b = listen_int;
ath6kl_wmi_listeninterval_cmd(ar->wmi, vif->fw_vif_idx, ath6kl_wmi_listeninterval_cmd(ar->wmi, vif->fw_vif_idx,
0, ar->listen_intvl_b); vif->listen_intvl_t, 0);
}
netif_wake_queue(vif->ndev); netif_wake_queue(vif->ndev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment