From patchwork Wed Aug 2 12:20:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 9876695 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 D1A4D602BC for ; Wed, 2 Aug 2017 12:20:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB7EE28536 for ; Wed, 2 Aug 2017 12:20:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1F482882C; Wed, 2 Aug 2017 12:20:26 +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 C0B06287D3 for ; Wed, 2 Aug 2017 12:20:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753162AbdHBMUL (ORCPT ); Wed, 2 Aug 2017 08:20:11 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33533 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753077AbdHBMUK (ORCPT ); Wed, 2 Aug 2017 08:20:10 -0400 Received: by mail-pf0-f195.google.com with SMTP id c65so5694922pfl.0 for ; Wed, 02 Aug 2017 05:20:10 -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=l8Vi+urp2G7AM1l5Wk+YEfBL77IEaU/FS67owJyto6ITCQrNbicPxn5tyGQyPylffZ T6MFsSKTk46Lctv23QsQmnC7DUGC1mPGPQM202mdhjJ8GmVr7fuXL09BL7LhWkiFaemL ASzI85yddtLW0gssKQZLtIR4r8QpNxhMeGfYobk1/iau805W1FaC7L5Rw5oGI35DHzRV KqEPGYYygKijrvl7rNjWFzNT4K2eIWGddlyZTIhEg0drSpQImYajzOgJm9l0X5uPiuct 2v2r6gE5ZeOaYZGt12rUK+8OeHE74bDO5RUQBXCq8nJCAasytjpACQE7hVU+Ha/gHJlT sDJA== 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=Z5I/5StyS4ecXCUcj5j03nPizj5n/uSkrq1k/kJ/O6nxE34ybgIg8sgYQU41rZbuZX n6ergBPkV5lcmQBBydO+LDr9xT9GN9CKyM2O7Z9SHroLPeMAnrSD5Dj6IlE8L7I9hzoi Il6Tg+yPMesu9bOyDhLEtr+gb2taFb3SaHyf7iTGpuiNWHxrU5sv2Dl5bw+jPj/aGVXL HeTM7q9eOmJ+hGU3N5B2Dg+8szbjIRk0NJ88vbEULX8x0PY7MNLjSptHgFHGdB4gXN8s AD4VidNN0BH5FC+c23QL8aTUfLTo6cD4ugZTIschDmbG5g/+oyhiZ/enkdM/tIowDx0i dHQg== X-Gm-Message-State: AIVw111DjX3rHTji5E3q0Ft6ZHhTtq+u0mpXUsV/VpdKc9d1j5c2HMQw Gm7zVgO4sFu2o0uZ X-Received: by 10.99.97.69 with SMTP id v66mr8101580pgb.332.1501676409639; Wed, 02 Aug 2017 05:20:09 -0700 (PDT) Received: from symbol-HP-ZBook-15 ([223.31.70.102]) by smtp.gmail.com with ESMTPSA id q79sm58744514pfi.99.2017.08.02.05.20.07 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 05:20:08 -0700 (PDT) Date: Wed, 2 Aug 2017 17:50:05 +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: <20170802122005.GA4652@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..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)