From patchwork Tue Apr 10 15:04:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siva Rebbagondla X-Patchwork-Id: 10333315 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 81A626053C for ; Tue, 10 Apr 2018 15:03:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BCBE28A51 for ; Tue, 10 Apr 2018 15:03:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69509285B9; Tue, 10 Apr 2018 15:03: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, 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 2AFFB285B9 for ; Tue, 10 Apr 2018 15:02:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754346AbeDJPCC (ORCPT ); Tue, 10 Apr 2018 11:02:02 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:46852 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754333AbeDJPCA (ORCPT ); Tue, 10 Apr 2018 11:02:00 -0400 Received: by mail-pl0-f68.google.com with SMTP id 59-v6so7683696plc.13 for ; Tue, 10 Apr 2018 08:02:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SOcYKBaBVcv5zPOQDiun6U3WS0mv2WXAo8b3RpWItww=; b=CEY3yvht/L4l2YjiQQ5UVnY6KxOw6QL1tOkzHX1sce3FAeXmm3j1NO1ol/v41et00x AEoNrSeHKkEYiA6zGFNkWM4u4JCF9k1FojaBVmXKxjGS8OLDQETUJQCAG6wamvWXUh6v dw0f2U6YfjimSnbAYBBVWV1ZCBA+3vnITyUAi70ok28oXMmJCNFR74rBLdcT4gK4cPFu kradOgL0/xMKo7EBScQA+K9dOmLXygqkhmbMsFV/krFdR49W+LtyribbbWkADeqhaAfc DhKFRbW+aLjm0yWCDREfN6Xny9bO+NmXQed4ILYhwnsyg/ShUfGZdr9z0PW8Dwea2pEY jyaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SOcYKBaBVcv5zPOQDiun6U3WS0mv2WXAo8b3RpWItww=; b=Np74f8D8ZEcgd48njOAIuzuDaTwRBvl2kSHRlYZxdrvfYi5/fCFYjcNDrZrcPyQTDe evOEGyGIo0umw8fy5TxxuXtTrEUMxEk2673NmdKgQE7foxHdthJlAahOpoh+wsNH8KEc DEbgb3wvTGQS2RYETdFURotXr89Tqr/SDekFXQhZGe4aCP2w67nXoJvsxqFccX9y3OyW ldZMDzkl0bCiyyWZbpibI6OewEYYS2/JSDf5dEL9nKv2PDfqU74Mmyj2XXIpdQmB8XPz OPuffio4ZimRYgyk5/aa731u95g+aFKJUYj2gDhqqKhZbsQTc0mt+L6muY03P/Iy6nhl /5Qg== X-Gm-Message-State: ALQs6tCALDsx7ZnvMmBvdKFj9XaItBrVS6XY5bbBSSwv79XCJWExFY3/ jaVj7GMNNb4texaXD3OdnWTil3fL3Jc= X-Google-Smtp-Source: AIpwx490kk1OZsKBjOX2ResrI3zKRUjN5cxOxdKelEzGrvq7IesZUHjionfa/ltdLF6QhZYUa7Nbig== X-Received: by 2002:a17:902:2c83:: with SMTP id n3-v6mr816276plb.317.1523372520055; Tue, 10 Apr 2018 08:02:00 -0700 (PDT) Received: from cpu459.localdomain ([203.196.161.90]) by smtp.gmail.com with ESMTPSA id a1sm5913864pff.5.2018.04.10.08.01.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Apr 2018 08:01:59 -0700 (PDT) From: Siva Rebbagondla To: Kalle Valo Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar , Siva Rebbagondla , Sushant Mishra Subject: [v2 7/7] rsi: advertise 5GHz support based on device capability Date: Tue, 10 Apr 2018 20:34:17 +0530 Message-Id: <1523372657-6067-8-git-send-email-siva8118@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1523372657-6067-1-git-send-email-siva8118@gmail.com> References: <1523372657-6067-1-git-send-email-siva8118@gmail.com> 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 From: Amitkumar Karwar Currently 5GHz gets advertised even for the device which supports only 2.4Ghz band. This patch fixes the issue Signed-off-by: Amitkumar Karwar Signed-off-by: Siva Rebbagondla --- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c index bb497bd..766d874 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c +++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c @@ -1957,8 +1957,6 @@ int rsi_mac80211_attach(struct rsi_common *common) hw->max_tx_aggregation_subframes = RSI_MAX_TX_AGGR_FRMS; hw->max_rx_aggregation_subframes = RSI_MAX_RX_AGGR_FRMS; - rsi_register_rates_channels(adapter, NL80211_BAND_2GHZ); - rsi_register_rates_channels(adapter, NL80211_BAND_5GHZ); hw->rate_control_algorithm = "AARF"; SET_IEEE80211_PERM_ADDR(hw, common->mac_addr); @@ -1979,10 +1977,15 @@ int rsi_mac80211_attach(struct rsi_common *common) wiphy->available_antennas_rx = 1; wiphy->available_antennas_tx = 1; + + rsi_register_rates_channels(adapter, NL80211_BAND_2GHZ); wiphy->bands[NL80211_BAND_2GHZ] = &adapter->sbands[NL80211_BAND_2GHZ]; - wiphy->bands[NL80211_BAND_5GHZ] = - &adapter->sbands[NL80211_BAND_5GHZ]; + if (common->num_supp_bands > 1) { + rsi_register_rates_channels(adapter, NL80211_BAND_5GHZ); + wiphy->bands[NL80211_BAND_5GHZ] = + &adapter->sbands[NL80211_BAND_5GHZ]; + } /* AP Parameters */ wiphy->max_ap_assoc_sta = rsi_max_ap_stas[common->oper_mode - 1];