From patchwork Wed Aug 2 11:59:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 9876685 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DED6B60360 for ; Wed, 2 Aug 2017 11:59:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE4C828774 for ; Wed, 2 Aug 2017 11:59:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C16B628795; Wed, 2 Aug 2017 11:59:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FB3128774 for ; Wed, 2 Aug 2017 11:59:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753093AbdHBL71 (ORCPT ); Wed, 2 Aug 2017 07:59:27 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:37177 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752121AbdHBL70 (ORCPT ); Wed, 2 Aug 2017 07:59:26 -0400 Received: by mail-pg0-f67.google.com with SMTP id 83so6246277pgb.4 for ; Wed, 02 Aug 2017 04:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=CzBk/+bNRgmAM6QWZDwBwcd4r9Y4iTxTRHv/YO8YwkQ=; b=ZVXWfFrRwt1ZDDOBTtYJw94fzt0yfLvqkDo71ETXZfECrjzjkxaEEsgjev3E893eUs cQ/JkiDRSvU/zX39m7fcZfvs89RqB1rsCJgGiYECVB9jx47gsKXjOjtPyioj5DaLvfsi /ZnDN+rNY3viQmvWTtAMCE5dXk63oCGhPxHKxII81CDI0sazO1C5z2dr5ZlpBKF8oF4a Vpn9uBJ+zfqBLIE7uImtuJiNbTbqGCZJISpAqtBaSUM0J4Qdv9w9maLrgZtmX43ChkiS oluWK87X3AaPcLFrExjA0JZXfMoPhi4w940hwzvBSUuCc/rjLV4eP04g0beOjM2ZWxrt SCzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=CzBk/+bNRgmAM6QWZDwBwcd4r9Y4iTxTRHv/YO8YwkQ=; b=RO6/AGI8muy4Pwg+8DrOne+lSuPcL0LAEnsq65bhWTAxuvOIbc0DCsQv7REepjB/Ze O2XQ7BjWSGY+k+k/1XXtHleLjP/0cAsAIrnnZg6+rwiRuLZtGKAiuPT9EIx09jtuD5fR /Te9sktXxiengbX0FiyGSPfBE0HF/kTa+jq7yUmT3AVjC9M/MVNGFJteRrA9SNNDKIL6 NuIt/5izfVQhOKUnjlJARyoFSInIMBM7ItYIE9f3EJlYphmytg/2tNKDBiYJ7e7fvDL/ jKf/2sR62mqeP2KSyIXqVnl0ShsCW+Uba0Uam6Y2o5hdA0pHinHnFI99RXIOQ5bpwlVu xunA== X-Gm-Message-State: AIVw111BridBjvzkJgSxHIPBglF1ZQ4ef9KFrbbrLMjVmb1+CERm8cKa 1mp7GOan318ZEk3s X-Received: by 10.99.104.129 with SMTP id d123mr21685710pgc.236.1501675165770; Wed, 02 Aug 2017 04:59:25 -0700 (PDT) Received: from symbol-HP-ZBook-15 ([223.31.70.102]) by smtp.gmail.com with ESMTPSA id e64sm61965385pfb.129.2017.08.02.04.59.23 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 04:59:24 -0700 (PDT) Date: Wed, 2 Aug 2017 17:29:21 +0530 From: Souptick Joarder To: kvalo@codeaurora.org, Larry.Finger@lwfinger.net Cc: linux-wireless@vger.kernel.org Subject: [PATCH v4] rtlwifi: Replace hardcode value with macro Message-ID: <20170802115921.GA4381@symbol-HP-ZBook-15> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In _rtl_init_mac80211(), hardcoded value for hw->max_listen_interval and hw->max_rate_tries are replaced by macro and removed the comment. Signed-off-by: Souptick Joarder --- drivers/net/wireless/realtek/rtlwifi/base.c | 5 ++--- drivers/net/wireless/realtek/rtlwifi/base.h | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c index 8b833e2..ea18aa7 100644 --- a/drivers/net/wireless/realtek/rtlwifi/base.c +++ b/drivers/net/wireless/realtek/rtlwifi/base.c @@ -426,9 +426,8 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw) hw->extra_tx_headroom = RTL_TX_HEADER_SIZE; /* TODO: Correct this value for our hw */ - /* TODO: define these hard code value */ - hw->max_listen_interval = 10; - hw->max_rate_tries = 4; + hw->max_listen_interval = MAX_LISTEN_INTERVAL; + hw->max_rate_tries = MAX_RATE_TRIES; /* hw->max_rates = 1; */ hw->sta_data_size = sizeof(struct rtl_sta_info); diff --git a/drivers/net/wireless/realtek/rtlwifi/base.h b/drivers/net/wireless/realtek/rtlwifi/base.h index ab7d819..c591d75 100644 --- a/drivers/net/wireless/realtek/rtlwifi/base.h +++ b/drivers/net/wireless/realtek/rtlwifi/base.h @@ -65,6 +65,8 @@ enum ap_peer { #define FRAME_OFFSET_ADDRESS3 16 #define FRAME_OFFSET_SEQUENCE 22 #define FRAME_OFFSET_ADDRESS4 24 +#define MAX_LISTEN_INTERVAL 10 +#define MAX_RATE_TRIES 4 #define SET_80211_HDR_FRAME_CONTROL(_hdr, _val) \ WRITEEF2BYTE(_hdr, _val)