Skip to contentSkip to conversation

staging: vt6655: Fix missing power saving support

PATCH Superseded Malcolm Priestley 2 participants 4 messages Jun 21, 2015 – Jul 15, 2015 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 staging: vt6655: Fix missing power saving support

Add IEEE80211_HW_SUPPORTS_PS to ieee80211_hw flags enabling this feature.

---
 drivers/staging/vt6655/device_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/vt6655/device_main.c +2 -1
index 0bfc939..b1357af 100644
@@ -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;
 
Signature · 4 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
#1 lore raw

PATCH 2/3 staging: vt6655: vnt_tx_packet don't wakeup from power saving.

mac80211 changes the wake state before attempting to tx data

---
 drivers/staging/vt6655/device_main.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/vt6655/device_main.c +0 -3
index b1357af..c421f78 100644
@@ -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;
Signature · 4 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
#2 lore raw

PATCH 3/3 staging: vt6655: Correct listen interval TBTT wake up

In reply to Malcolm Priestley

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.

---
 drivers/staging/vt6655/device.h |  1 +
 drivers/staging/vt6655/power.c  | 16 ++++++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)
drivers/staging/vt6655/device.h +1 -0
index 5cf1b33..6aebb49 100644
@@ -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;
 
drivers/staging/vt6655/power.c +12 -4
index be3c4e9..06e6b9d 100644
@@ -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;
Signature · 4 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
maintainer
#3 lore raw
In reply to Malcolm Priestley
Quoted 13 lines · Malcolm Priestley

Add IEEE80211_HW_SUPPORTS_PS to ieee80211_hw flags enabling this feature.

---
 drivers/staging/vt6655/device_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/vt6655/device_main.c +0 -0
index 0bfc939..b1357af 100644

drivers/staging/vt6655/device_main.c vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent) · line 1825

Quoted 8 lines
drivers/staging/vt6655/device_main.c +2 -1
@@ -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