From patchwork Sun Jun 21 10:05:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 6652421 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5FD3EC05AC for ; Sun, 21 Jun 2015 10:06:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BBBC320675 for ; Sun, 21 Jun 2015 10:06:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 19601205BC for ; Sun, 21 Jun 2015 10:06:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751320AbbFUKG0 (ORCPT ); Sun, 21 Jun 2015 06:06:26 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:34337 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752610AbbFUKGX (ORCPT ); Sun, 21 Jun 2015 06:06:23 -0400 Received: by wicnd19 with SMTP id nd19so52395271wic.1 for ; Sun, 21 Jun 2015 03:06:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8dC271An0sLfFG41qg8s8ZUXooSRw/IicZeTKP86HF8=; b=m+eK6xB81Tsh4gnAqgVGc91jkPdlihk2tkTv2oazGU1GPwEiKHa05vkaw5+yr5GTIf H2lL80pmvzcDN2synSM/XCFBoGcj+i131pnxjw+dX1KNHqtXhLqiFn/0H2FJOKmc7aGK bmUoLTKDGvA4dmQTEiQ35cNY+5Yppenvr/SMSAZbf13mo9/8O5+02i7QYoi1+MyhN6IQ g53IR8+hMXlZ3SMep5zP+5hx2boeM2a1f+sdzKdithEj8d+/IOBJkIyl5mO6PfT0RQnY LisyDiD3U/zDYNrjenS+bj1zWoTJ3YDTu0UmkNHXPjgr8C5aMJipnuVV/EAYjrBNGA7d ox5Q== X-Received: by 10.180.98.103 with SMTP id eh7mr22034465wib.75.1434881181967; Sun, 21 Jun 2015 03:06:21 -0700 (PDT) Received: from tipsey.3.home (188.30.133.23.threembb.co.uk. [188.30.133.23]) by mx.google.com with ESMTPSA id p2sm9141898wix.11.2015.06.21.03.06.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 21 Jun 2015 03:06:21 -0700 (PDT) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, Malcolm Priestley Subject: [PATCH 3/3] staging: vt6655: Correct listen interval TBTT wake up Date: Sun, 21 Jun 2015 11:05:55 +0100 Message-Id: <1434881155-3464-3-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1434881155-3464-1-git-send-email-tvboxspy@gmail.com> References: <1434881155-3464-1-git-send-email-tvboxspy@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;