From patchwork Mon Apr 18 13:28:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivo van Doorn X-Patchwork-Id: 715201 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3IDZmEM000691 for ; Mon, 18 Apr 2011 13:36:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753920Ab1DRNfs (ORCPT ); Mon, 18 Apr 2011 09:35:48 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:53097 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753324Ab1DRNfr (ORCPT ); Mon, 18 Apr 2011 09:35:47 -0400 Received: by mail-fx0-f46.google.com with SMTP id 17so2833789fxm.19 for ; Mon, 18 Apr 2011 06:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=DBTqD1yZZhRTVR0v5TIwR8gy+ghm/rqs5iw08kFiwX0=; b=GBz0fcb3fAHdyjPDFpvkyLI4I6KHRtCRP5BHWZjTGh23nE9NTFfevaiHIiQL7sYlyb CrfnbBHyM5X2Gyn9l597ZeKaGrFkGNZ0kysuvta1zbyfvewfl6bGWT3NCAAj+Vn/lziC jTlP8khBWXLISc9WW2WIdtTAy3IkMSiWAXkGo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=wIcAVOsE44KXMd+Wi4WZ0h1gjjHHdRm/l/9ySusLHNjw1bhKUo9oFWSPFgowDv7XvW Huha1bTxKv7SfxYEUaDAmy9+6YtDB29IkWl0l6iOlP7HRr6elBGaIQ+cve+/jq50kF8X NuDiXWNjVN7BqX6dLC2lN32MqHdCMQ9Q/zX/4= Received: by 10.223.110.21 with SMTP id l21mr4975044fap.70.1303133746744; Mon, 18 Apr 2011 06:35:46 -0700 (PDT) Received: from localhost.localdomain (g121037.upc-g.chello.nl [80.57.121.37]) by mx.google.com with ESMTPS id c21sm1673551fac.46.2011.04.18.06.35.44 (version=SSLv3 cipher=OTHER); Mon, 18 Apr 2011 06:35:45 -0700 (PDT) From: Ivo van Doorn To: "John W. Linville" Subject: [PATCH 05/23] rt2x00: Use correct TBTT_SYNC config in AP mode Date: Mon, 18 Apr 2011 15:28:04 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.x86_64; KDE/4.4.5; x86_64; ; ) Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com References: <201104181526.01722.IvDoorn@gmail.com> <201104181527.06956.IvDoorn@gmail.com> <201104181527.44542.IvDoorn@gmail.com> In-Reply-To: <201104181527.44542.IvDoorn@gmail.com> MIME-Version: 1.0 Message-Id: <201104181528.05047.IvDoorn@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 18 Apr 2011 13:36:10 +0000 (UTC) From: Helmut Schaa This seems to fix problems with some powersaving clients since a positive value in TBTT_SYNC_CFG_TBTT_ADJUST introduces beacon skew, which is not wanted in AP mode. Also update the rest of the TBTT_SYNC config according to the legacy drivers in AP mode. Signed-off-by: Helmut Schaa Signed-off-by: Ivo van Doorn --- drivers/net/wireless/rt2x00/rt2800lib.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index c6f5584..e0fa559 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c @@ -1245,6 +1245,25 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf, rt2800_register_read(rt2x00dev, BCN_TIME_CFG, ®); rt2x00_set_field32(®, BCN_TIME_CFG_TSF_SYNC, conf->sync); rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg); + + if (conf->sync == TSF_SYNC_AP_NONE) { + /* + * Tune beacon queue transmit parameters for AP mode + */ + rt2800_register_read(rt2x00dev, TBTT_SYNC_CFG, ®); + rt2x00_set_field32(®, TBTT_SYNC_CFG_BCN_CWMIN, 0); + rt2x00_set_field32(®, TBTT_SYNC_CFG_BCN_AIFSN, 1); + rt2x00_set_field32(®, TBTT_SYNC_CFG_BCN_EXP_WIN, 32); + rt2x00_set_field32(®, TBTT_SYNC_CFG_TBTT_ADJUST, 0); + rt2800_register_write(rt2x00dev, TBTT_SYNC_CFG, reg); + } else { + rt2800_register_read(rt2x00dev, TBTT_SYNC_CFG, ®); + rt2x00_set_field32(®, TBTT_SYNC_CFG_BCN_CWMIN, 4); + rt2x00_set_field32(®, TBTT_SYNC_CFG_BCN_AIFSN, 2); + rt2x00_set_field32(®, TBTT_SYNC_CFG_BCN_EXP_WIN, 32); + rt2x00_set_field32(®, TBTT_SYNC_CFG_TBTT_ADJUST, 16); + rt2800_register_write(rt2x00dev, TBTT_SYNC_CFG, reg); + } } if (flags & CONFIG_UPDATE_MAC) {