From patchwork Thu Jun 22 05:58:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 9803503 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 D9759600C5 for ; Thu, 22 Jun 2017 05:58:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C85D9285CB for ; Thu, 22 Jun 2017 05:58:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBF24285CF; Thu, 22 Jun 2017 05:58:43 +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 54A29285CB for ; Thu, 22 Jun 2017 05:58:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752398AbdFVF6k (ORCPT ); Thu, 22 Jun 2017 01:58:40 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:35391 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751064AbdFVF6j (ORCPT ); Thu, 22 Jun 2017 01:58:39 -0400 Received: by mail-pg0-f67.google.com with SMTP id f127so1175050pgc.2 for ; Wed, 21 Jun 2017 22:58:38 -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=wNZ64yFpyZaRmJlBDLVQIIzF3RuiTF/biG4pbD0Ky7U=; b=NCaJaXmeKqSiKT+mIOk9A8ZueD27cN4vTmeLT0K3+2dIPFjf8oFMBM4Rlt/Qn7oJIW D4uE/u1gb0lIHGzveaW1QDrlG6N5iGwS8njDrTq++kqiY74kBJcpM781RfXQHX27wsa8 cdob85Nj6Gm2dYjJ7clDz81mOnLlB9UL6yrVk513ETk8KaCL+b32WPsBW7bxkkSsIrfk 6+PqgvrpHuobhqa8jGkzFxYV9Ms39iGNrp21rWEXJ5iTQAMfWJGT+Vx+so23qQ2azFFu IdS4Z0Fq9bVmB+PZ//PQz2JMgSp/i+4Hj596dJWsV1OiZQFBUao80bJ8kRol6kOuzboK lO3A== 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=wNZ64yFpyZaRmJlBDLVQIIzF3RuiTF/biG4pbD0Ky7U=; b=NS8C0AaLd+WkbSQGRGnJ0w35yz/BZZvWzBaTMRxQ9p3I9Vt88uEAc8WB/XV8ASkOKA WATMCPLMw/0onfOPpb9a+oBJW/aVQT8JHGyaRcU9dIuOA0BDEBa4Xemd1AqDjSc2bdjX PyVorMMRfi/4TC6xO7ybh6IPbKMbGDnN/nrbVH3qf95BhKv71KgkYRLb/3dmWiXETFR1 d3KzysIfWwbJ7pyylZ7bHGXyikpLOb/U4hgO6dTppwzpOoulBzjHw5c5X0MGmlrrOHzg bovJFTf2Lyw6R1nFfNHPRSV5NETSSR0OYQijoUsdAmRNmsygTjr2ljS+futJMBWnVTvU 5KXQ== X-Gm-Message-State: AKS2vOynd6ecniXD87lHI3XVh6NGzVSpyjOLRaRvlQGHz729wAIo6uDV DFuHOpFhqfPAnf6h X-Received: by 10.99.123.18 with SMTP id w18mr950746pgc.122.1498111118205; Wed, 21 Jun 2017 22:58:38 -0700 (PDT) Received: from symbol-HP-ZBook-15 ([223.31.70.102]) by smtp.gmail.com with ESMTPSA id r81sm1298167pfi.61.2017.06.21.22.58.37 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Jun 2017 22:58:37 -0700 (PDT) Date: Thu, 22 Jun 2017 11:28:35 +0530 From: Souptick Joarder To: Larry.Finger@lwfinger.net, chaoming_li@realsil.com.cn Cc: linux-wireless@vger.kernel.org Subject: [PATCH] rtlwifi: Replace hardcode value with macro Message-ID: <20170622055835.GA19293@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. --- drivers/net/wireless/realtek/rtlwifi/base.c | 6 +++--- drivers/net/wireless/realtek/rtlwifi/base.h | 2 ++ 2 files changed, 5 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 bdc3791..f45d093 100644 --- a/drivers/net/wireless/realtek/rtlwifi/base.c +++ b/drivers/net/wireless/realtek/rtlwifi/base.c @@ -422,9 +422,9 @@ 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; + /* defined these hard code values */ + 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 02ff0c5..d03e198 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)