Commit 43c93d9b authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: implement power saving code.

The device should ready to listen to next beacon so on count down of
wake_up_count == 1.

schedule command WLAN_CMD_TBTT_WAKEUP which calls vnt_next_tbtt_wakeup which
wakes the device.

This restores this back to vendors code with a slight difference the
count down is in the interrupt handler.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c1515879
...@@ -389,6 +389,8 @@ struct vnt_private { ...@@ -389,6 +389,8 @@ struct vnt_private {
u8 bb_pre_ed_rssi; u8 bb_pre_ed_rssi;
u8 bb_pre_ed_index; u8 bb_pre_ed_index;
u16 wake_up_count;
/* command timer */ /* command timer */
struct delayed_work run_command_work; struct delayed_work run_command_work;
......
...@@ -149,8 +149,16 @@ void vnt_int_process_data(struct vnt_private *priv) ...@@ -149,8 +149,16 @@ void vnt_int_process_data(struct vnt_private *priv)
priv->op_mode == NL80211_IFTYPE_AP) priv->op_mode == NL80211_IFTYPE_AP)
vnt_schedule_command(priv, WLAN_CMD_BECON_SEND); vnt_schedule_command(priv, WLAN_CMD_BECON_SEND);
if (int_data->isr0 & ISR_TBTT) { if (int_data->isr0 & ISR_TBTT &&
if (priv->hw->conf.flags & IEEE80211_CONF_PS) priv->hw->conf.flags & IEEE80211_CONF_PS) {
if (!priv->wake_up_count)
priv->wake_up_count =
priv->hw->conf.listen_interval;
--priv->wake_up_count;
/* Turn on wake up to listen next beacon */
if (priv->wake_up_count == 1)
vnt_schedule_command(priv, vnt_schedule_command(priv,
WLAN_CMD_TBTT_WAKEUP); WLAN_CMD_TBTT_WAKEUP);
} }
......
...@@ -134,7 +134,7 @@ int vnt_next_tbtt_wakeup(struct vnt_private *priv) ...@@ -134,7 +134,7 @@ int vnt_next_tbtt_wakeup(struct vnt_private *priv)
struct ieee80211_conf *conf = &hw->conf; struct ieee80211_conf *conf = &hw->conf;
int wake_up = false; int wake_up = false;
if (conf->listen_interval == 1) { if (conf->listen_interval > 1) {
/* Turn on wake up to listen next beacon */ /* Turn on wake up to listen next beacon */
vnt_mac_reg_bits_on(priv, MAC_REG_PSCTL, PSCTL_LNBCN); vnt_mac_reg_bits_on(priv, MAC_REG_PSCTL, PSCTL_LNBCN);
wake_up = true; wake_up = true;
......
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