From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DFF641F350 for ; Fri, 24 Jul 2026 22:29:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784932154; cv=none; b=V6rpq3FCJgJrNy0AxtibVne3T7iqR+oZHuTDCT5NIzKvd6lOYpnt43EI8sOmha/cVTNspudlDPxRWa+hzJf8ZiSBNPgjH7rl+pHzZqPkMOIk/1DVVJJeMUJ9E+wwowntwD4pdKRh0WY3FZRvaH/ar88dhj+VCAh45hei48v6yB8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784932154; c=relaxed/simple; bh=gXxh3+jWrWr1GT6V9rtVJjSM6LU9GmXwMdM64ZEIrMg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MsbgtJR1F7KEAiD+yno1xigzTGg0jhUZ0n9ViRZMo3rpLVU0SpPfhFTahEOSgyRb5Lft2tNvdefefDAEQPJCuwa4CVQ8RHBcNX8MLQPZQTzpMsdfh/vRYjeTG4hasoVQvOSYo90mI02bznFsRbPhKJAr/pDTES9r7dBGOk3jqz4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=pKGd9Nsd; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pKGd9Nsd" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-495590dde14so10261035e9.0 for ; Fri, 24 Jul 2026 15:29:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784932149; x=1785536949; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=n7AxiMwu180qx1wKkVNTB/3I32OKIXq73YUipEU9nTc=; b=pKGd9NsdDw6IB5y2eq+KLNyEK5OkOSlZaJqGxVnQPjiEdGBBBKiAy1uP5H5Q4sx87E oaahlFMgl0ap1P1fNQT8U0/1iInWGkpDOk7KvrRm7VH5K/vhCJtoLlI4KrVNTiLQCThJ ShEySULQiyG6leoLSjfgQZ9MB9xmIGqlsuckIlSnvlYDD//Msvr4x81V5/BmP31ZggFN HYZegJRy2b65Oh1SYk4uP54iBQwz7zfmuyJD+iY9y8LYP9d0oxyLFiRdjrtqoh+gByjk Bh2WASznof415VXnnHrqu8LHV09RAlQ5pq955qCPxKyYv4it9EZbM7TT9awMRUVcQMo4 q0gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784932149; x=1785536949; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=n7AxiMwu180qx1wKkVNTB/3I32OKIXq73YUipEU9nTc=; b=keB3jq8KbtVyOvj6xbBSYohYTta6pX5iQc4dBekKdQHstcayj2ZOeKHysmuDwg6euc /Q+IPYljrpbPFsIGO86V9e0kahahLs8qMr1hbB1eGGu585AiIaaxTQxumrz9a938mg/H 3HN8IFqRXlc41XdvhiwihxhxcqRxppRxNR3Ux3P0Kx6k233AAxrO/cR+B1iAjAF9aEG3 sorODKq1HJ6ksO8mAGh4tdtHZtf5QdAz34nbJivZZZ6wP+NAx3lyMywzScKVAHfoOI2D srXVLcScxTIxOyi4YfMPhPkZ1mwCTr61MPTnVmrQEX2CFxXpVIHJ+x7iuVJaOMNyPE4Q ergQ== X-Forwarded-Encrypted: i=1; AHgh+RoMc1209bGyRmOPlvmeiAcRi+VfzmzP2/1/VhNXdqn/gDC7CM5FZzpjchqZl9HJILAQo13SmYlv0H+0CjA=@vger.kernel.org X-Gm-Message-State: AOJu0Yy+EtYW3KbB+O7J1CyCh156FtyLyBnCg9N1MmyT7kjwIJ4JaV6D rXAY9O8OrT0zR5V2+40UW2SYesXH3hTMfUxa89+9KdzEHVcq5bjsblSM X-Gm-Gg: AR+sD127xiZwyjcRURWiA2ZDYAwWzPpShxkmTEG0nmKVupHZ2Eku3uP8gefuvPbZIuN 8t3XPf2YOwn/cyEucvmXyUCKYB+j+g1tKsoemtmDHQiZ3YrzkzFIITMmTrpuI+PO9xfWdSASi/o 2bASyr+7+xUlSQN3sVlLlm/+93YvhGAomNSwdwEEtWz047HqUUL/2E444mrDI2zovOOqScOQNYO qSDbb/c+69YfyhEx60arCxuxJyKfAjcNWLvCrZJWoqVdZqEThrU9sX58KimigFR1bE+UAtUNtuV qS4PMe8jTpMbFDLJn9SKKOQBQBbpzBWq7r2anRb1DZgjS0s+pcOoxRDSyAmkBHQwBZBG/borMtW CcZUQxaxEnYC1oQTXXpDIyjsR76iakfEojEFOsAUkEvZMyFimuyFptUGJANIDo1H3UpFVY8269v iCplJR/pq5 X-Received: by 2002:a05:600c:a196:b0:492:45a0:dcef with SMTP id 5b1f17b1804b1-496b56e6f4fmr1130605e9.5.1784932148942; Fri, 24 Jul 2026 15:29:08 -0700 (PDT) Received: from [192.168.1.50] ([79.118.68.61]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4957e334f63sm53465745e9.1.2026.07.24.15.29.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Jul 2026 15:29:08 -0700 (PDT) Message-ID: <92272d90-a549-437d-886e-308807418485@gmail.com> Date: Sat, 25 Jul 2026 01:29:05 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 19/19] wifi: rtw88: advertise the correct receive capabilities on RTL8723BS To: luka.gejak@linux.dev, Ping-Ke Shih Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Straube , Peter Robinson References: <20260724181858.192903-1-luka.gejak@linux.dev> <20260724183330.197283-1-luka.gejak@linux.dev> Content-Language: en-US From: Bitterblue Smith In-Reply-To: <20260724183330.197283-1-luka.gejak@linux.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 24/07/2026 21:33, luka.gejak@linux.dev wrote: > From: Luka Gejak > > This chip has neither a firmware feature report nor an efuse hardware > capability parser, so the capability struct is left at zero. A zero > stream count builds an HT capability with no usable RX MCS rates, and > APs drop the station immediately after an otherwise successful > association. Fill in the stream and antenna counts from the RF path > count, and advertise the 20 and 40 MHz support the chip has. > > RTL8723BS also leaves BIT_APP_FCS clear, so received frames do not carry > the FCS. Advertising RX_INCLUDES_FCS would make mac80211 trim four bytes > of real frame data and corrupt the trailing element of beacons and probe > responses, so leave it unset for this chip. > > Signed-off-by: Luka Gejak > --- > drivers/net/wireless/realtek/rtw88/main.c | 61 +++++++++++++++-------- > 1 file changed, 40 insertions(+), 21 deletions(-) > > diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c > index 63d1fb4bc87e..e2f0fd367beb 100644 > --- a/drivers/net/wireless/realtek/rtw88/main.c > +++ b/drivers/net/wireless/realtek/rtw88/main.c > @@ -126,6 +126,25 @@ static void rtw_power_on_8723bs_sdio_rfk(struct rtw_dev *rtwdev) > rtwdev->initial_rfk_done = true; > } > > +static bool rtw8723bs_station_media_status(struct rtw_dev *rtwdev, > + struct ieee80211_sta *sta, > + struct ieee80211_vif *vif) > +{ > + return rtw_is_8723bs(rtwdev) && > + vif->type == NL80211_IFTYPE_STATION && !sta->tdls; > +} > + > +/* 8723BS SDIO: defer the connect MEDIA_STATUS_RPT until the STA is actually > + * associated (the vendor firmware sends it at assoc completion, not sta-add). > + */ > +static bool rtw8723bs_defer_sta_media_status(struct rtw_dev *rtwdev, > + struct ieee80211_sta *sta, > + struct ieee80211_vif *vif) > +{ > + return rtw8723bs_station_media_status(rtwdev, sta, vif) && > + !vif->cfg.assoc; > +} > + > static struct ieee80211_channel rtw_channeltable_2g[] = { > {.center_freq = 2412, .hw_value = 1,}, > {.center_freq = 2417, .hw_value = 2,}, > @@ -304,25 +323,6 @@ static void rtw_sw_beacon_loss_check(struct rtw_dev *rtwdev, > /* process TX/RX statistics periodically for hardware, > * the information helps hardware to enhance performance > */ > -static bool rtw8723bs_station_media_status(struct rtw_dev *rtwdev, > - struct ieee80211_sta *sta, > - struct ieee80211_vif *vif) > -{ > - return rtw_is_8723bs(rtwdev) && > - vif->type == NL80211_IFTYPE_STATION && !sta->tdls; > -} > - > -/* 8723BS SDIO: defer the connect MEDIA_STATUS_RPT until the STA is actually > - * associated (the vendor firmware sends it at assoc completion, not sta-add). > - */ > -static bool rtw8723bs_defer_sta_media_status(struct rtw_dev *rtwdev, > - struct ieee80211_sta *sta, > - struct ieee80211_vif *vif) > -{ > - return rtw8723bs_station_media_status(rtwdev, sta, vif) && > - !vif->cfg.assoc; > -} > - > static void rtw_watch_dog_work(struct work_struct *work) > { > struct rtw_dev *rtwdev = container_of(work, struct rtw_dev, > @@ -401,6 +401,7 @@ static void rtw_watch_dog_work(struct work_struct *work) > * get that vif and check if device is having traffic more than the > * threshold. > */ > + > /* On 8723BS SDIO the firmware's per-packet wake latency out of LPS > * throttles bursty traffic hard. The stock check enters LPS after a > * single quiet 2s window, which a normal bursty session hits > @@ -2122,8 +2123,21 @@ static int rtw_dump_hw_feature(struct rtw_dev *rtwdev) > u8 bw; > int i; > > - if (!rtwdev->chip->hw_feature_report) > + if (!rtwdev->chip->hw_feature_report) { > + /* 8723BS has neither a firmware feature report nor an efuse hw_cap > + * parser, so hw_cap is otherwise left at zero. A zero stream count > + * produces an HT capability with no usable RX MCS rates, which makes > + * APs drop the station immediately after a successful association. > + * Other report-less chips fill hw_cap in when parsing the efuse. You can do that too instead of adding special code here. You can make your own rtw8723b_read_efuse() which calls rtw8723x_read_efuse() and also fills hw_cap. > + */ > + if (rtw_is_8723bs(rtwdev)) { > + efuse->hw_cap.nss = rtwdev->hal.rf_path_num ? : 1; > + efuse->hw_cap.ant_num = rtwdev->hal.rf_path_num ? : 1; > + efuse->hw_cap.bw = BIT(RTW_CHANNEL_WIDTH_20) | > + BIT(RTW_CHANNEL_WIDTH_40); > + } > return 0; > + } > > id = rtw_read8(rtwdev, REG_C2HEVT); > if (id != C2H_HW_FEATURE_REPORT) { > @@ -2429,7 +2443,12 @@ int rtw_register_hw(struct rtw_dev *rtwdev, struct ieee80211_hw *hw) > hw->vif_data_size = sizeof(struct rtw_vif); > > ieee80211_hw_set(hw, SIGNAL_DBM); > - ieee80211_hw_set(hw, RX_INCLUDES_FCS); > + /* RTL8723BS keeps BIT_APP_FCS clear, so received frames do not contain > + * the FCS. Advertising RX_INCLUDES_FCS would make mac80211 trim four > + * bytes of frame data and corrupt the tail IE in beacons/probe responses. > + */ The driver is supposed to set that bit. The default value of rtwdev->hal.rcr includes it. I think that should work for this chip too. > + if (!rtw_is_8723bs(rtwdev)) > + ieee80211_hw_set(hw, RX_INCLUDES_FCS); > ieee80211_hw_set(hw, AMPDU_AGGREGATION); > ieee80211_hw_set(hw, MFP_CAPABLE); > ieee80211_hw_set(hw, REPORTS_TX_ACK_STATUS);