From patchwork Thu Jun 22 12:00:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 9804121 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 052A260329 for ; Thu, 22 Jun 2017 12:00:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9C3827FB6 for ; Thu, 22 Jun 2017 12:00:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDFE828584; Thu, 22 Jun 2017 12:00:12 +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 78A8B27FB6 for ; Thu, 22 Jun 2017 12:00:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751138AbdFVMAL (ORCPT ); Thu, 22 Jun 2017 08:00:11 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:35363 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750812AbdFVMAJ (ORCPT ); Thu, 22 Jun 2017 08:00:09 -0400 Received: by mail-pg0-f67.google.com with SMTP id f127so2142662pgc.2 for ; Thu, 22 Jun 2017 05:00:09 -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=3wzX2OCUMFwhn6ktC0sr7cumLFI7lJO1Ep+RKu+wewg=; b=bgZP+7+IIrDhHulFr3hy9/Lm8yr/944MUNAcdcPKMZ4uLBA8ou9rOfIwsmXtlFMVVX QtNrpmFdq71ueuWLzDoi8nSuW7svaLHNlqY/VfU6rZIzFYEVqhEsBN0bXNvJu/1rHRE8 z8EKmbsIFdfHaGTFyuzv/6+bruikj5rPXE5ZHODAD8YlUGXr/ugOLR/cZ8fL5jjhqVA6 VLBIkJkhJJmHd8fNbCh96i/ZvZNPpnvdTvolEfACN3CQt/+5MJUeODBSiNMNXpeddVr1 klUtrJmMBY9GhtPmrO61vVy2Ye2fCrKAev600nvRa7IdFhCyc5Ay2BrYl+Pvt7jT6CTx AIrA== 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=3wzX2OCUMFwhn6ktC0sr7cumLFI7lJO1Ep+RKu+wewg=; b=phUWdnvcplOnyzfFrCTz8UUhBLAxVUH66zi8GSKAeoF0vZ210atckbvz9F5tfY6UgK 5/SX07HNwal0lzAEjSFlPSsSIsX34cw0v2IPqNz9+eSlNpwE3xQ1gvKslpU3XhGFvVhS vMB4u6bAhqybPb/twMdqW2MX1c7EeYQ9h2GHtwiRv4sZBAiUq7PhSU3CTsR1I3G7sthS wpVQ6EmiKKDe2ajWX8QXwAe8eBUuYHNhO7R8pQahmrtuCuwMNrcB6KOER1BfUR7uv+dl nsU58n1ayuyfEdQkJzmMC+3aBl6dVUwEHPynKfGMbi76voCCMJK/T+KmGP2lvAO3GzjJ SA5g== X-Gm-Message-State: AKS2vOx2vDJeO7OYOuBVmPBFacy2aVuZsaoCGEmPLGygAJi5q2AKByh2 z9SW7NIZr3iIC8Nr X-Received: by 10.84.135.101 with SMTP id 92mr2561608pli.56.1498132808291; Thu, 22 Jun 2017 05:00:08 -0700 (PDT) Received: from symbol-HP-ZBook-15 ([223.31.70.102]) by smtp.gmail.com with ESMTPSA id z70sm3420055pgz.3.2017.06.22.05.00.06 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Jun 2017 05:00:07 -0700 (PDT) Date: Thu, 22 Jun 2017 17:30:04 +0530 From: Souptick Joarder To: Larry.Finger@lwfinger.net, chaoming_li@realsil.com.cn Cc: linux-wireless@vger.kernel.org Subject: [PATCH v2] rtlwifi: Replace hardcode value with macro Message-ID: <20170622120004.GA5783@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 Acked-by: Larry Finger --- Changes in v2: - Signed-off was missing in previous one. 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)