diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2020-05-02 12:20:13 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-05 12:28:00 +0200 |
commit | d95c8695e0d91d60867d971009862299c53b5fb6 (patch) | |
tree | 30e9f6479043a358813af95b84081f135a5b805b /drivers/staging/vt6656/main_usb.c | |
parent | 986da7debb04225221d8876b405c4088614ae5f4 (diff) |
staging: vt6656: refactor power save operation
At present the power save wake uses the listening interval and
the slow path to wake up.
The following using a beacon interval of 100 and
listen interval of 5.
The TBTT set at 100 wake-up sequence;
100 TBTT wake-up set to listen interval.
200 TBTT
300 TBTT
400 TBTT --> call vnt_next_tbtt_wakeup on slow path
Beacon heard and passed through at the approx 500 interval.
500 TBTT
600 TBTT wake-up set to listen interval
The TBTT set at 500 wake-up sequence and always listen flagged on;
100 No TBTT
200 No TBTT
300 No TBTT
400 No TBTT
500 TBTT - beacon heard and passed through
600 No TBTT
A further enhancement because the TBTT is more precise
the dtim_period can be used instead.
When Power save is off the TBTT continues to run at the listen
interval but all the other beacons are passed.
The code in vnt_int_process_data is no longer required.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/5a188bd8-7049-8063-f24d-96768ce9a6ed@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656/main_usb.c')
-rw-r--r-- | drivers/staging/vt6656/main_usb.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index 7db1e044ad26..b5790d4d7152 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -824,10 +824,17 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw, if (changed & (BSS_CHANGED_ASSOC | BSS_CHANGED_BEACON_INFO) && priv->op_mode != NL80211_IFTYPE_AP) { if (conf->assoc && conf->beacon_rate) { + u16 ps_beacon_int = conf->beacon_int; + + if (conf->dtim_period) + ps_beacon_int *= conf->dtim_period; + else if (hw->conf.listen_interval) + ps_beacon_int *= hw->conf.listen_interval; + vnt_mac_reg_bits_on(priv, MAC_REG_TFTCTL, TFTCTL_TSFCNTREN); - vnt_mac_set_beacon_interval(priv, conf->beacon_int); + vnt_mac_set_beacon_interval(priv, ps_beacon_int); vnt_reset_next_tbtt(priv, conf->beacon_int); @@ -835,7 +842,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw, conf->sync_tsf, priv->current_tsf); vnt_update_next_tbtt(priv, - conf->sync_tsf, conf->beacon_int); + conf->sync_tsf, ps_beacon_int); } else { vnt_clear_current_tsf(priv); |