From patchwork Fri Jun 30 08:19:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 9818675 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 B2A606035F for ; Fri, 30 Jun 2017 08:19:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7067285D8 for ; Fri, 30 Jun 2017 08:19:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BC862860A; Fri, 30 Jun 2017 08:19:54 +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 41669285D8 for ; Fri, 30 Jun 2017 08:19:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751782AbdF3ITw (ORCPT ); Fri, 30 Jun 2017 04:19:52 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33079 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751729AbdF3ITu (ORCPT ); Fri, 30 Jun 2017 04:19:50 -0400 Received: by mail-pf0-f193.google.com with SMTP id e199so16208858pfh.0 for ; Fri, 30 Jun 2017 01:19:50 -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=zPeKssb5vg+D+DUrEIdCDwhcCh79Fo4A+r+zZ+pCg18=; b=Oa71Fxvj/YT8nEKFPS7O7aVqBT803hBC+cq79lra8MW5e3pZBIHX84RCLhwww6lG0j Q9b/xFP7hgB9xk5On6XT4ntcK985jv85o0/IrNrqa7vPLQY5nVQOlbHElwQPPEB6UVKz 8OFJr0Eh50lE3p8OSNnui+DCCFhvikBWBV62gy8D4VF7HPyP950TYIaukG9qM5pt9B9y 2vJkNjY3y2n3up4CBe/g1cB9WJstyQCsKJgE2R6uN0r5RQzU0NXgpUYemQ6P6sr/JXfC WxqLNZnCAZeFWRSITnIg8MCRKgr+S9Tfh6ym4Jx02pF4WiOHwf086mip6uCj25YO44xo i2zg== 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=zPeKssb5vg+D+DUrEIdCDwhcCh79Fo4A+r+zZ+pCg18=; b=byCUZ/83FnYg95DN7yykyT40ObdpmP47w/twyI4zRuP1V/R0kuv5Qu6+QMP5KPVSVm Xk/3ZAzCtJejMDF4cxVhpd06++rE8ZX8TaGO9aD5wYWJWlqBQYsUZYcrdFbiILliKUZR oSMTqEMxTSbsVEmUrK/7iG/Fg0aCRlqYAmbasDxQya2m+Uqex2RYuLgAfVGUiEwIn5gI x7ggS0mumGmjSalodWg7P3T+IuhVXdeihcWgFtTyCgzRP1Wo47u427djKdyPQNkx4pMx Xwahvnn1s6SAwvl7yEy38FqwgEv0HDZkzIjNPWfrklFf1XTof2VNfmPC/uaGO7zro1nt 4xIQ== X-Gm-Message-State: AKS2vOxjwpG1bBfTsX9wTu5cTj8HI5GXCm602j+Q+21pWRxeq+xxkNql xbY2dikDcvoB/56k X-Received: by 10.98.131.134 with SMTP id h128mr20779480pfe.132.1498810789828; Fri, 30 Jun 2017 01:19:49 -0700 (PDT) Received: from symbol-HP-ZBook-15 ([223.31.70.102]) by smtp.gmail.com with ESMTPSA id d89sm16844176pfl.7.2017.06.30.01.19.47 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Jun 2017 01:19:48 -0700 (PDT) Date: Fri, 30 Jun 2017 13:49:45 +0530 From: Souptick Joarder To: kvalo@codeaurora.org, Larry.Finger@lwfinger.net, chaoming_li@realsil.com.cn Cc: linux-wireless@vger.kernel.org Subject: [PATCH v3] rtlwifi: Replace hardcode value with macro Message-ID: <20170630081945.GA3265@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. Signed-off-by: Souptick Joarder --- 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)