2015-06-21 10:06:19

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 1/3] staging: vt6655: Fix missing power saving support

Add IEEE80211_HW_SUPPORTS_PS to ieee80211_hw flags
enabling this feature.

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/device_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 0bfc939..b1357af 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1819,7 +1819,8 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
priv->hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
IEEE80211_HW_REPORTS_TX_ACK_STATUS |
IEEE80211_HW_SIGNAL_DBM |
- IEEE80211_HW_TIMING_BEACON_ONLY;
+ IEEE80211_HW_TIMING_BEACON_ONLY |
+ IEEE80211_HW_SUPPORTS_PS;

priv->hw->max_signal = 100;

--
2.1.4


2015-06-21 10:06:21

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 2/3] staging: vt6655: vnt_tx_packet don't wakeup from power saving.

mac80211 changes the wake state before attempting to tx data

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/device_main.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index b1357af..c421f78 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1211,9 +1211,6 @@ static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)

vnt_generate_fifo_header(priv, dma_idx, head_td, skb);

- if (MACbIsRegBitsOn(priv->PortOffset, MAC_REG_PSCTL, PSCTL_PS))
- MACbPSWakeup(priv->PortOffset);
-
spin_lock_irqsave(&priv->lock, flags);

priv->bPWBitOn = false;
--
2.1.4

2015-06-21 10:06:23

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH 3/3] staging: vt6655: Correct listen interval TBTT wake up

PSbIsNextTBTTWakeUp is called at beacon intervals.

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

This restores this back to vendors code but modified for mac80211.

Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6655/device.h | 1 +
drivers/staging/vt6655/power.c | 16 ++++++++++++----
2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 5cf1b33..6aebb49 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -403,6 +403,7 @@ struct vnt_private {
unsigned char abyEEPROM[EEP_MAX_CONTEXT_SIZE]; /* unsigned long alignment */

unsigned short wBeaconInterval;
+ u16 wake_up_count;

struct work_struct interrupt_work;

diff --git a/drivers/staging/vt6655/power.c b/drivers/staging/vt6655/power.c
index be3c4e9..06e6b9d 100644
--- a/drivers/staging/vt6655/power.c
+++ b/drivers/staging/vt6655/power.c
@@ -157,10 +157,18 @@ PSbIsNextTBTTWakeUp(
struct ieee80211_conf *conf = &hw->conf;
bool bWakeUp = false;

- if (conf->listen_interval == 1) {
- /* Turn on wake up to listen next beacon */
- MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_LNBCN);
- bWakeUp = true;
+ if (conf->listen_interval > 1) {
+ if (!pDevice->wake_up_count)
+ pDevice->wake_up_count = conf->listen_interval;
+
+ --pDevice->wake_up_count;
+
+ if (pDevice->wake_up_count == 1) {
+ /* Turn on wake up to listen next beacon */
+ MACvRegBitsOn(pDevice->PortOffset,
+ MAC_REG_PSCTL, PSCTL_LNBCN);
+ bWakeUp = true;
+ }
}

return bWakeUp;
--
2.1.4

2015-07-15 02:26:17

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 1/3] staging: vt6655: Fix missing power saving support

On Sun, Jun 21, 2015 at 11:05:53AM +0100, Malcolm Priestley wrote:
> Add IEEE80211_HW_SUPPORTS_PS to ieee80211_hw flags
> enabling this feature.
>
> Signed-off-by: Malcolm Priestley <[email protected]>
> ---
> drivers/staging/vt6655/device_main.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
> index 0bfc939..b1357af 100644
> --- a/drivers/staging/vt6655/device_main.c
> +++ b/drivers/staging/vt6655/device_main.c
> @@ -1819,7 +1819,8 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
> priv->hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
> IEEE80211_HW_REPORTS_TX_ACK_STATUS |
> IEEE80211_HW_SIGNAL_DBM |
> - IEEE80211_HW_TIMING_BEACON_ONLY;
> + IEEE80211_HW_TIMING_BEACON_ONLY |
> + IEEE80211_HW_SUPPORTS_PS;
>
> priv->hw->max_signal = 100;

The api changed here, and this patch doesn't apply. Can you respin it
against the latest -rc tree and resend?

thanks,

greg k-h