From patchwork Tue Feb 18 01:10:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Merello X-Patchwork-Id: 3666441 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CC2C2BF13A for ; Tue, 18 Feb 2014 01:10:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F32B3201F7 for ; Tue, 18 Feb 2014 01:10:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C64E20142 for ; Tue, 18 Feb 2014 01:10:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753536AbaBRBKo (ORCPT ); Mon, 17 Feb 2014 20:10:44 -0500 Received: from mail-ee0-f43.google.com ([74.125.83.43]:52652 "EHLO mail-ee0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753337AbaBRBKn (ORCPT ); Mon, 17 Feb 2014 20:10:43 -0500 Received: by mail-ee0-f43.google.com with SMTP id c41so7393654eek.16 for ; Mon, 17 Feb 2014 17:10:41 -0800 (PST) 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=SbUkDCiqVoXTdAtpkXYE9qr+iPZTREXP955DWfHskPY=; b=AIfM4gwxXs1uqyqRkixcO7C9g5dMeXqAA8HNXvyyX+arZ1t7PHYY0/cDe8+KdyaYuq IS+edeKDMfEozJwT8g92W8oZTwpTCrhX3gHAnPxDyyAzAO+3Yl3yxOySiL0UMXnb0poN wAuhwZA+ZUJMNFp/RgBM3u91BUcJH63ugacej5isvNKdosmD/woUEOPX5guDii3EclZC 6tJBqXhMR87li/1FTB4jzwgkilGVQxttet81RsB2/+cqjSoeEIpjkKWrdADMxaBDaXXa uOkjWsxAlXPUFvu7xzlueKdu3badFDKSpz8lOqaxzyoteUgEenYJ0gy92hwmMA0kFVTn HOXw== X-Received: by 10.15.43.76 with SMTP id w52mr76807eev.112.1392685841370; Mon, 17 Feb 2014 17:10:41 -0800 (PST) Received: from localhost.localdomain ([95.237.125.26]) by mx.google.com with ESMTPSA id j41sm63723093eeg.10.2014.02.17.17.10.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 17:10:40 -0800 (PST) From: Andrea Merello To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, Larry.Finger@lwfinger.net, bernhard@schiffner-limbach.de, dan.carpenter@oracle.com, liuhq11@mails.tsinghua.edu.cn, andrea merello Subject: [PATCH 5/7] rtl818x: add comments to explain few not obvious HW configs. Date: Tue, 18 Feb 2014 02:10:44 +0100 Message-Id: <1392685846-10116-6-git-send-email-andrea.merello@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1392685846-10116-1-git-send-email-andrea.merello@gmail.com> References: <1392685846-10116-1-git-send-email-andrea.merello@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=-7.3 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 From: andrea merello Certain HW options (TX packet retry count, CW configuration and TX power configuration) can be specified in both the TX packet descriptor and also into HW "global" registers. The HW is thus configured to honour the global register or the TX descriptor field depending by the case. This patch adds few comments that hopefully clarify in which cases the driver uses one method and in which cases it uses the other. Signed-off-by: Andrea Merello --- drivers/net/wireless/rtl818x/rtl8180/dev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c index cb97380..be9a8a1 100644 --- a/drivers/net/wireless/rtl818x/rtl8180/dev.c +++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c @@ -634,11 +634,23 @@ static int rtl8180_start(struct ieee80211_hw *dev) if (priv->r8185) { reg = rtl818x_ioread8(priv, &priv->map->CW_CONF); + + /* CW is not on per-packet basis. + * in rtl8185 the CW_VALUE reg is used. + */ reg &= ~RTL818X_CW_CONF_PERPACKET_CW; + /* retry limit IS on per-packet basis. + * the short and long retry limit in TX_CONF + * reg are ignored + */ reg |= RTL818X_CW_CONF_PERPACKET_RETRY; rtl818x_iowrite8(priv, &priv->map->CW_CONF, reg); reg = rtl818x_ioread8(priv, &priv->map->TX_AGC_CTL); + /* TX antenna and TX gain are not on per-packet basis. + * TX Antenna is selected by ANTSEL reg (RX in BB regs). + * TX gain is selected with CCK_TX_AGC and OFDM_TX_AGC regs + */ reg &= ~RTL818X_TX_AGC_CTL_PERPACKET_GAIN; reg &= ~RTL818X_TX_AGC_CTL_PERPACKET_ANTSEL; reg |= RTL818X_TX_AGC_CTL_FEEDBACK_ANT;