From patchwork Wed Aug 2 12:29:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 9876703 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 8F0AB602BC for ; Wed, 2 Aug 2017 12:29:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84A7928779 for ; Wed, 2 Aug 2017 12:29:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 787BF2877D; Wed, 2 Aug 2017 12:29:22 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI 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 1D9DD28779 for ; Wed, 2 Aug 2017 12:29:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753260AbdHBM3U (ORCPT ); Wed, 2 Aug 2017 08:29:20 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:37099 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753248AbdHBM3T (ORCPT ); Wed, 2 Aug 2017 08:29:19 -0400 Received: by mail-pg0-f65.google.com with SMTP id 83so6321320pgb.4 for ; Wed, 02 Aug 2017 05:29:19 -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=94B8RMl7+EGBoY4OOAPQ7X7Ix6lHcHJ25iLBG9nc9Cs=; b=uxLRPzEyR7QNcCQC4S5x9xJHMHI1FMU6PWzZtRA2GyE0THT47G7sD0eVFv8+AAv9QB QDgCByVXnPdFSmTUwqaHqe86qJDAAnQ+cHxd4wU12GiyTffcCmg2d/+Bl6TYcz+K+VpU eLeQlE658MBuAIOiAb/jfB3hHcx1QzAB77i1L/zIOCaE/YSi5jzytcWmngzvhsDrjJza iJu3Oy+yNgfz6JFC8rUyzRLUsMwwHBEWAracZmWJXEQBxJbIvRErGUSj1k8MWOLTqOqx sbJO0k+xqsC5ebKZDFKGEagLw+2aIPGJOfhNxed6FT7qcpHNoiBp2NDH5rfBox52QlQw bfLQ== 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=94B8RMl7+EGBoY4OOAPQ7X7Ix6lHcHJ25iLBG9nc9Cs=; b=tbZKoK3i57qe2R4bJI/Zctym4a9ChBex0I58dEm0VHI16cYzp8WgMVfzUu3J4Uxj8b scgf6r7fkfTKztrWJHEWEM99aK+rGxxm92CvE0AxyydL54mALWl3ZdEJUzMcbhzrXPli kfPaWEUKiEmx1yqkCLDeR5LWZ8mux8t7PpgmxHzvps0aCFs+m2AahDdfFsR++2+B0+uz 7DaUTWoyUEFKFpzQD4jDe9p3LqSZxpbnuYZHW/En27TL10LNApcShhhTAtfCp3skdNTN 1+RPP7b1d1SbbOQtqqG46ZTeGp138wMfkvqRyn1wo48b5xs1mcOLsTK8WarviwRYANiB ST9A== X-Gm-Message-State: AIVw113fzA5Zfm5+Yvuo0XF6izfof/40nCsZu6+6NhPg+N/os7Nt4wJA rn3Qhw5omR91pxXp X-Received: by 10.84.209.204 with SMTP id y70mr25743257plh.44.1501676958579; Wed, 02 Aug 2017 05:29:18 -0700 (PDT) Received: from symbol-HP-ZBook-15 ([223.31.70.102]) by smtp.gmail.com with ESMTPSA id q24sm25048786pgc.61.2017.08.02.05.29.17 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 05:29:18 -0700 (PDT) Date: Wed, 2 Aug 2017 17:59:15 +0530 From: Souptick Joarder To: arend.vanspriel@broadcom.com, kvalo@codeaurora.org, Larry.Finger@lwfinger.net Cc: linux-wireless@vger.kernel.org Subject: [PATCH v5] rtlwifi: Replace hardcode value with macro Message-ID: <20170802122915.GA4759@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 Acked-by: Larry Finger --- drivers/net/wireless/realtek/rtlwifi/base.c | 5 ++--- drivers/net/wireless/realtek/rtlwifi/base.h | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) 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..b56d1b7 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)