Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2233801rwl; Sun, 26 Mar 2023 18:58:12 -0700 (PDT) X-Google-Smtp-Source: AKy350bXz72r9agHr0GFDjA5erbNSoog5J/uu5cGKFMANfYPGRRiVr6WWEESndIyNyYrWWvBDJ0K X-Received: by 2002:a17:907:a4b:b0:93e:9362:7602 with SMTP id be11-20020a1709070a4b00b0093e93627602mr10849632ejc.50.1679882292503; Sun, 26 Mar 2023 18:58:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679882292; cv=none; d=google.com; s=arc-20160816; b=0vCUpGjOUk+QnxCoIwTfPh0c+xAcwsNUc/0GAksw0l7YsgzlbLrL1+YRycKbc1/ILr MEsDDvowRkEbmzQgyZADIVByFLZlIxA8l7vsMj1/p5AI4jX4drApGnW9HMG8kC6C1ZXI /fGcPpWc+vsmww2Na4QFy6bvlS+YmFmwB23s/wOXbqUDG9B/H/txGn8lG/DYfZJ82f09 S56yooiJynDAHz2xyK2r3/4sk1Kcbbi1R1HMqHAjOcf9xbbPtY1PSjNfR41uLbB+zqYS XqK9e3kMO8XrL33zpKk0v8BwD479rkCFl/9BYb6n9Vwo7Qx+PVjZikS8hZO/cAY8Srir Wcmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:authenticated-by; bh=u+aZdWPY0szLxYBfMLzKO/4Eg/zKFSEtU9cx3oo6Uic=; b=QGWQRJs1Ipt3yoxHEVQ2BxhAXjWYJIv+Yv7u2b2OS4o1pyn3emqse+yQV3U34hfEnd GWnO0nBzcMXl9NMhLaG6a8XrSxUhIIryG/q1vN04Yd0zkNbp0TJOSfOfunzbI00mS2P6 hZZEstPBewaNF1fu1RbvALQwTRaS3yCn0m8SNmCm3poWE7v9MkVSAaeMcW4n0570cTbD KjgbfmG091Q3EOcrAtjEmbSF+S1h58MJS2ZI9R8SQoP8eOeMFyw6Llz8EIADc+pz4kZI MZr5vDKc/YmLFLwmZYOY/1SQIsx4hSSeykU8IarH7rhm8TZryVt00qGiqPu2dJLOkJOo Je+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh10-20020a1709076e8a00b00939fc1918e2si20402692ejc.639.2023.03.26.18.57.58; Sun, 26 Mar 2023 18:58:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229746AbjC0BzC convert rfc822-to-8bit (ORCPT + 59 others); Sun, 26 Mar 2023 21:55:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbjC0BzB (ORCPT ); Sun, 26 Mar 2023 21:55:01 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FB2F4EFF for ; Sun, 26 Mar 2023 18:55:00 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 32R1sVixD007454, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 32R1sVixD007454 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK); Mon, 27 Mar 2023 09:54:31 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Mon, 27 Mar 2023 09:54:47 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Mon, 27 Mar 2023 09:54:46 +0800 Received: from RTEXMBS04.realtek.com.tw ([fe80::b4a2:2bcc:48d1:8b02]) by RTEXMBS04.realtek.com.tw ([fe80::b4a2:2bcc:48d1:8b02%5]) with mapi id 15.01.2375.007; Mon, 27 Mar 2023 09:54:46 +0800 From: Ping-Ke Shih To: Martin Kaistra , "linux-wireless@vger.kernel.org" CC: Jes Sorensen , Kalle Valo , Bitterblue Smith , Sebastian Andrzej Siewior Subject: RE: [RFC PATCH 09/14] wifi: rtl8xxxu: Add parameter role to report_connect Thread-Topic: [RFC PATCH 09/14] wifi: rtl8xxxu: Add parameter role to report_connect Thread-Index: AQHZXOKh24QZImxVPEenlEapVWzjgq8N4teA Date: Mon, 27 Mar 2023 01:54:46 +0000 Message-ID: <9d985022b5224a5cb371449b69ac680a@realtek.com> References: <20230322171905.492855-1-martin.kaistra@linutronix.de> <20230322171905.492855-10-martin.kaistra@linutronix.de> In-Reply-To: <20230322171905.492855-10-martin.kaistra@linutronix.de> Accept-Language: en-US, zh-TW Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.21.69.188] x-kse-serverinfo: RTEXMBS04.realtek.com.tw, 9 x-kse-antispam-interceptor-info: fallback x-kse-antivirus-interceptor-info: fallback Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org > -----Original Message----- > From: Martin Kaistra > Sent: Thursday, March 23, 2023 1:19 AM > To: linux-wireless@vger.kernel.org > Cc: Jes Sorensen ; Kalle Valo ; Ping-Ke Shih > ; Bitterblue Smith ; Sebastian Andrzej Siewior > > Subject: [RFC PATCH 09/14] wifi: rtl8xxxu: Add parameter role to report_connect > > This allows to tell the HW if a connection is made to a STA or an AP. > Add the implementation for the gen2 version. > > Signed-off-by: Martin Kaistra > --- > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 9 ++++++--- > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 11 ++++++----- > 2 files changed, 12 insertions(+), 8 deletions(-) > > diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h > b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h > index c06ad33645974..e78e0bbd23354 100644 > --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h > +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h > @@ -1280,6 +1280,9 @@ struct rtl8xxxu_rfregs { > #define H2C_JOIN_BSS_DISCONNECT 0 > #define H2C_JOIN_BSS_CONNECT 1 > > +#define H2C_ROLE_STA 1 > +#define H2C_ROLE_AP 2 > + > /* > * H2C (firmware) commands differ between the older generation chips > * 8188[cr]u, 819[12]cu, and 8723au, and the more recent chips 8723bu, > @@ -1908,7 +1911,7 @@ struct rtl8xxxu_fileops { > u32 ramask, u8 rateid, int sgi, int txbw_40mhz, > u8 macid); > void (*report_connect) (struct rtl8xxxu_priv *priv, > - u8 macid, bool connect); > + u8 macid, u8 role, bool connect); > void (*report_rssi) (struct rtl8xxxu_priv *priv, u8 macid, u8 rssi); > void (*fill_txdesc) (struct ieee80211_hw *hw, struct ieee80211_hdr *hdr, > struct ieee80211_tx_info *tx_info, > @@ -2012,9 +2015,9 @@ void rtl8xxxu_update_rate_mask(struct rtl8xxxu_priv *priv, > void rtl8xxxu_gen2_update_rate_mask(struct rtl8xxxu_priv *priv, > u32 ramask, u8 rateid, int sgi, int txbw_40mhz, u8 macid); > void rtl8xxxu_gen1_report_connect(struct rtl8xxxu_priv *priv, > - u8 macid, bool connect); > + u8 macid, u8 role, bool connect); > void rtl8xxxu_gen2_report_connect(struct rtl8xxxu_priv *priv, > - u8 macid, bool connect); > + u8 macid, u8 role, bool connect); > void rtl8xxxu_gen1_report_rssi(struct rtl8xxxu_priv *priv, u8 macid, u8 rssi); > void rtl8xxxu_gen2_report_rssi(struct rtl8xxxu_priv *priv, u8 macid, u8 rssi); > void rtl8xxxu_gen1_init_aggregation(struct rtl8xxxu_priv *priv); > diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c > b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c > index 4209880d724be..5e36fddbbb488 100644 > --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c > +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c > @@ -4524,7 +4524,7 @@ void rtl8xxxu_gen2_update_rate_mask(struct rtl8xxxu_priv *priv, > } > > void rtl8xxxu_gen1_report_connect(struct rtl8xxxu_priv *priv, > - u8 macid, bool connect) > + u8 macid, u8 role, bool connect) > { > struct h2c_cmd h2c; > > @@ -4541,7 +4541,7 @@ void rtl8xxxu_gen1_report_connect(struct rtl8xxxu_priv *priv, > } > > void rtl8xxxu_gen2_report_connect(struct rtl8xxxu_priv *priv, > - u8 macid, bool connect) > + u8 macid, u8 role, bool connect) > { > /* > * The firmware turns on the rate control when it knows it's > @@ -4557,6 +4557,7 @@ void rtl8xxxu_gen2_report_connect(struct rtl8xxxu_priv *priv, > else > h2c.media_status_rpt.parm &= ~BIT(0); > > + h2c.media_status_rpt.parm |= ((role << 4) & 0xf0); > h2c.media_status_rpt.macid = macid; > > rtl8xxxu_gen2_h2c_cmd(priv, &h2c, sizeof(h2c.media_status_rpt)); > @@ -4886,13 +4887,13 @@ rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, > rtl8xxxu_write16(priv, REG_BCN_PSR_RPT, > 0xc000 | vif->cfg.aid); > > - priv->fops->report_connect(priv, 0, true); > + priv->fops->report_connect(priv, 0, H2C_ROLE_AP, true); Should it be called only AP mode? Because STA mode can run into this too. > } else { > val8 = rtl8xxxu_read8(priv, REG_BEACON_CTRL); > val8 |= BEACON_DISABLE_TSF_UPDATE; > rtl8xxxu_write8(priv, REG_BEACON_CTRL, val8); > > - priv->fops->report_connect(priv, 0, false); > + priv->fops->report_connect(priv, 0, H2C_ROLE_AP, false); > } > } > > @@ -4953,7 +4954,7 @@ static int rtl8xxxu_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif, > dev_dbg(dev, "Start AP mode\n"); > rtl8xxxu_set_bssid(priv, vif->bss_conf.bssid); > rtl8xxxu_write16(priv, REG_BCN_INTERVAL, vif->bss_conf.beacon_int); > - priv->fops->report_connect(priv, 0, true); > + priv->fops->report_connect(priv, 0, 0, true); > > return 0; > } > -- > 2.30.2