Commit 3e7921a0 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman
Browse files

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: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4fdae0d9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;

+12 −4
Original line number Diff line number Diff line
@@ -157,11 +157,19 @@ PSbIsNextTBTTWakeUp(
	struct ieee80211_conf *conf = &hw->conf;
	bool bWakeUp = false;

	if (conf->listen_interval == 1) {
	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);
			MACvRegBitsOn(pDevice->PortOffset,
				      MAC_REG_PSCTL, PSCTL_LNBCN);
			bWakeUp = true;
		}
	}

	return bWakeUp;
}