From patchwork Wed Apr 2 15:30:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bitterblue Smith X-Patchwork-Id: 14036186 X-Patchwork-Delegate: pkshih@realtek.com Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (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 CBBE078F45 for ; Wed, 2 Apr 2025 15:30:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743607809; cv=none; b=XXzF9jI9EsveV83RGB5JLmshCv8t4qxoIoGvKwsTX+LCsVPNfcdJuiwpzqBqVC+V8biJYfThD+eyvy/cjmMbhh05Ru1EVaXtNuAh8sB7XV6aYBZ+ZuSxe/S3CV3xdSWndOAccLl+cBIhaf3CrD8soLGf5bRsc9K8brOk1nz7IG0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743607809; c=relaxed/simple; bh=1h4SzRexHYVNROVlbnzfDohEzMJ9KH0KMDkREUwmeaM=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=XmOzOczsdhXiULQ0pkgWva7Xj0U6kHwZz4/QdVewBJrlI9vkrd0M7zv1h0uGCvwTYikA6Ye5Wq0wXBhitfWs111mtUjE8lrQvn+oDLeeoSBaV/U9QrXJVPTI9tfXLzxInBlQTucW4PpgU02dcxtVesCmtKf6Srn+g1hwIrXgf6k= 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=F0ZvoRSx; arc=none smtp.client-ip=209.85.208.48 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="F0ZvoRSx" Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5e5e0caa151so12899337a12.0 for ; Wed, 02 Apr 2025 08:30:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743607806; x=1744212606; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=lNN2C6Lw81HiAEOn4QUZUVpsWka9DrVA0E0zTnuIz7o=; b=F0ZvoRSxFxqBwJ9mZg65HEj7Vk5O2gQIICqIc+1/fRACXiJ6v+15RwQZD9ZvU/Ybnp EYHGYC88WYP+LgSh7XKd24Z/+etkRkNI2ovF31c/sPGuuKIXzQmbHg53TiFrT6k8JyO5 qMaPEbHYFPtRrZ2DYNkdlKAhq/l4PUW0vssFTkgHXevPLQmXKik3Uh9Q3SeXxgd/oooj eUA4nZN8GGrbdXtwYG9Wvvg/onICxIyKcpwJeWG5MgE7Pbh56A9J2l+8fBIsOt/y7Yq5 mJe2PwZz2Mbz+pKLahKFJijETKFGY/3FztzeLLcs7M6CZN+rCuUYnA1RIMaorwIdWIS7 uKxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743607806; x=1744212606; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lNN2C6Lw81HiAEOn4QUZUVpsWka9DrVA0E0zTnuIz7o=; b=rNvp/ik2cf3cq7PrN7WCkLaC8YAtdDDdu6sTRMXpbXWdejPsq6nLaG+pjk+DrptCMa zn2we75KUXZZ07oO2tE41iQKErXJSSoT13tciQdjms0uTRRBPIs+/KAbkkSVNOpqor08 +k0xB0YPbvRQFFyBJRiiPLR1EOHQIIaiSf4d2XeC5UVRxotb6RuN9aLrYFiF+fPdKusE 98DxLbG/lRMffDZ92HIsKY0GChxpn6v0uDWV3JaBU1WEv3KxOMXQKM4VnqdC1oWtmUcy Q4z5rVWcra9XLrCzPOApJHSQ77CdB11kJPTJ1Ue4VB15+J1uw9kT45YJiXxPebibh5az us+g== X-Gm-Message-State: AOJu0YyusbKkuAdu4BArCVmkZPSmrwa+c+S3/umfoa84Udy8dzwvJO2Y rzj1N/r7AUl4znnrstiBY/M3m6/nNmSdjxngkJDDhP+a5ZNblevzRIxruw== X-Gm-Gg: ASbGnct1cQBSEbZQ3Z0nEZOYmz1H/8OsT9BYoKdw+aCJW78ZlXxMRG9xy0f9Xw95rto Nqqbw5xck5EJULenIJiKRP3jiwcc7iEetv4dRpyJmseyZFeoyGZxb5A7ikztJexe07Jwvsgqt+o cl66uoPTYpgufpjcTIPh0yHtxieb1n0VoMXI/k8WIBxwpqmGOIgSM99EiOpi8lP07sV1IGBkoK5 Ur7VWSe48rPDfRMp9j8JSJcQhdZ0iOXuTlTyNR408aiLl98hUiuOpumZVbLOCTsCj6KEhJ3+GQV h89/PYtMdWEFoZAUERfn6bEPatmFiDl81u52BdSt5rnWUAhxdBQcwg== X-Google-Smtp-Source: AGHT+IGkTfS9VxUYndSDypO3N6WqaxiJaX2izmoLeMhOPdWPa70MvfWdgpMxYdT4GQGfCQM3/PLVEw== X-Received: by 2002:a05:6402:524d:b0:5e5:bdfe:6bfb with SMTP id 4fb4d7f45d1cf-5edfd0fdba1mr14503255a12.16.1743607805901; Wed, 02 Apr 2025 08:30:05 -0700 (PDT) Received: from [192.168.0.50] ([79.119.240.177]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5edc16aae4bsm8634055a12.1.2025.04.02.08.30.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Apr 2025 08:30:05 -0700 (PDT) Message-ID: Date: Wed, 2 Apr 2025 18:30:02 +0300 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH rtw-next v3 1/4] wifi: rtw88: usb: Enable switching the RTL8814AU to USB 3 From: Bitterblue Smith To: "linux-wireless@vger.kernel.org" Cc: Ping-Ke Shih References: <257632d8-4347-45bc-ab39-4e88d87cdb3b@gmail.com> Content-Language: en-US In-Reply-To: <257632d8-4347-45bc-ab39-4e88d87cdb3b@gmail.com> The Realtek wifi 5 devices which support USB 3 are weird: when first plugged in, they pretend to be USB 2. The driver needs to send some commands to the device, which make it disappear and come back as a USB 3 device. The method used to switch the RTL8812AU also works for the RTL8814AU. Signed-off-by: Bitterblue Smith Acked-by: Ping-Ke Shih --- v2: - Add Acked-by. v3: - No change. --- drivers/net/wireless/realtek/rtw88/usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c index 667473b7a9f5..4994f5934e80 100644 --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c @@ -1092,7 +1092,8 @@ static int rtw_usb_switch_mode_new(struct rtw_dev *rtwdev) static bool rtw_usb3_chip_old(u8 chip_id) { - return chip_id == RTW_CHIP_TYPE_8812A; + return chip_id == RTW_CHIP_TYPE_8812A || + chip_id == RTW_CHIP_TYPE_8814A; } static bool rtw_usb3_chip_new(u8 chip_id) From patchwork Wed Apr 2 15:30:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bitterblue Smith X-Patchwork-Id: 14036187 X-Patchwork-Delegate: pkshih@realtek.com Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 8FCBC10F9 for ; Wed, 2 Apr 2025 15:30:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743607835; cv=none; b=NMkBWAq9xh89XwCxheKjo255CwuodkHNANBN1jNyxEdrEhO0VGRawOKe/XJqJbrWv66nk1io4QTnKNgvINz1B52Bbdk5IiLkW+qiPISkWVy2RagY5y+wlBI25R1zCdEji1u908ADXZf3PNCKHgimDYf6SxfDL/U0hGjyAFgTjU0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743607835; c=relaxed/simple; bh=Ge3m/gPwwUEjdSMeftW4WANHX+g63Zh0yutEyeuSul0=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=GYwaYoBrsn/99HOiQ/M3tcUDGvnCixOJz0429KSVJrQc4fquTqVjb5OoWOITybZYG0CRmkWYYVLlWjezhJqPKM3mJvbq+LeZtF4s14OKKnCprQVx8XcD62keFvve73mrX+ZTOGUhz+/D2By2bj+rfsel6uIT8I6QnC89C9xR4FE= 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=miP6urUt; arc=none smtp.client-ip=209.85.208.46 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="miP6urUt" Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5eb5ecf3217so12806258a12.3 for ; Wed, 02 Apr 2025 08:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743607832; x=1744212632; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=bK1aEY8utmYSlmnJKSiDFu2TdR+wkC6ga5wZEqtixYk=; b=miP6urUtvcdViW+4IoOZQgz4AYPDXWMouNKaRJTDjdF8JoXeawyRSJ+9CeIWJSALu5 Q+soOJs4ECY+DnlUEdDDSO3EETmCfE+ReaAvyFgbuta5kpXRYMqF7FQr1jlbOnkxcwPf s2Lne8ynrn6nnAEgHIBSKNaVP13xi1YQKbBbiJOzD1pqioVAf/lZXWo1ieGVMaKZouxC 6O50hi+/YbZ33V2eWeQxLMRriek7Rw7/ruhKSjznYYLWa0KWxMQP5FiRrW8jc9nA0quj pQ4s84VIvAHJ0DIEaEc6n4w5mTTBP/9H4U/HB7AUeMnD6sUbIE4H80ndYQOtzb02yXYK 6fJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743607832; x=1744212632; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bK1aEY8utmYSlmnJKSiDFu2TdR+wkC6ga5wZEqtixYk=; b=O74kQdIH+SofCwuCMgboEkgT/Ls2nOJXLmdfblu5o1PeqRFK7ZuXwwXKdZxSIZpFf8 SGpSJyaEH9YyjyMhcrbg2LADOuUzUH/qtx/HXNnx/mGPv/7ukt1ZWAZyJUvOpZfu1S80 suVYQhR/2oGEMa1NGQb8TUSkLPYeH5JZ2926QWuCyEZ2FkiqUuC7kDAdoq924lU7zaor hLMYUdqAcKzrhfJV1cZxnNJPhsc12UQnsDkbu5bruiI9qmsvv4m9RAwybnrmp7Kfs2+P 5iYRSVNz3IBSx6g7+g3IeUWTyU9pojtgrtLzYss9RZvUTSqT3sGMRUsmB9S7WP3lh7Mt s1GQ== X-Gm-Message-State: AOJu0YxYyOskeWT7bkS3VkKECiyD/dooVcpncVdZnSO0uNotlaYjOo9t eLecRMMPII2Ynt1omQhQTbtHiqiLrnc0Y/cNEV71VopRqB+EJ+FnHvqXUA== X-Gm-Gg: ASbGncuWzR5o+xYIf3vC1R09tnV7/YeZ65NqZDB+qlDvuia+v1Qap/i/qnENiZ/aTco ASODapXm2B4Pfln13nYvufjtqx/wXTs39e3YymLAIGogNex0sNKXX1l1Ksk6W6mHlvDcUpHNNlu zukru36ZiJQgrsbYVPdoPZ5maNF7rMxFwm17UONnp8RBYDVOI98KvPIZ7t30S6AYOfHQfU68fMP lsKM7bCSwGBBYuZdaBUWrKSxQmAtYFg9Uibffo0Tdn/tva/mDmtTuEpBEihfKboslRLSu4jRVV3 RETS+ECT10vgyXRJJd110RZWWTPBNliel/3UvpWN/Y6xCofHjcINpA== X-Google-Smtp-Source: AGHT+IGDJ6kkz4mhEPE/GwwGl/F60sngBZQkvzn+pQY5ZyY2AGLImy4xds3yyoJ4nKQJ6lArgxwFpQ== X-Received: by 2002:a05:6402:2789:b0:5e5:b3cb:38aa with SMTP id 4fb4d7f45d1cf-5edfd6ff9ebmr16446366a12.25.1743607831471; Wed, 02 Apr 2025 08:30:31 -0700 (PDT) Received: from [192.168.0.50] ([79.119.240.177]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5edc16d3320sm8725313a12.20.2025.04.02.08.30.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Apr 2025 08:30:30 -0700 (PDT) Message-ID: <672397ac-dd4d-4420-8b3e-7011578e2243@gmail.com> Date: Wed, 2 Apr 2025 18:30:28 +0300 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH rtw-next v3 2/4] wifi: rtw88: usb: Enable RX aggregation for RTL8814AU From: Bitterblue Smith To: "linux-wireless@vger.kernel.org" Cc: Ping-Ke Shih References: <257632d8-4347-45bc-ab39-4e88d87cdb3b@gmail.com> Content-Language: en-US In-Reply-To: <257632d8-4347-45bc-ab39-4e88d87cdb3b@gmail.com> Let the chip transfer several frames in a single USB Request Block. This is supposed to improve the RX speed. It can use the same code used for RTL8822CU, RTL8822BU, and RTL8821CU. Signed-off-by: Bitterblue Smith Acked-by: Ping-Ke Shih --- v2: - Add Acked-by. v3: - No change. --- drivers/net/wireless/realtek/rtw88/usb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c index 4994f5934e80..204343ac2558 100644 --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c @@ -866,6 +866,7 @@ static void rtw_usb_dynamic_rx_agg(struct rtw_dev *rtwdev, bool enable) case RTW_CHIP_TYPE_8822C: case RTW_CHIP_TYPE_8822B: case RTW_CHIP_TYPE_8821C: + case RTW_CHIP_TYPE_8814A: rtw_usb_dynamic_rx_agg_v1(rtwdev, enable); break; case RTW_CHIP_TYPE_8821A: From patchwork Wed Apr 2 15:31:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bitterblue Smith X-Patchwork-Id: 14036188 X-Patchwork-Delegate: pkshih@realtek.com Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 1579C2E3372 for ; Wed, 2 Apr 2025 15:31:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743607879; cv=none; b=Jk8QDm/ZVd6HXecTdXKvJrPXFi7JMuUNs2CQXzNopsDCRwfmNiajvGfLs/Dj5AgB7lZq67+uO5qEN7/evEmitbrgzFcKyt3vJNG2b9bku0kaTqG3B+JhfFr4y8UYfut0PnRh0pOOXEFQGPDbjFs/z3RpcWmj3CM+E8nHoq1MMQM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743607879; c=relaxed/simple; bh=thUvma92iDqONjVFNgeAzdcm/zphCm0/xbk59jTcsl8=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=c5m1M0uZXSnasc/KSsbbDlsV6RlCSCeM3iGF2l78CCI3a78wGpaZZhChYMViA6QBQ+O0RQsQTtsxQQ2RS9moz6JyzDLUm1Ot53ggA5cj426/80GqSSYL+krC+p7VAG5cXidoa4JTqsfIiovyyhdzyLw5BiW9oO74YhsJ8xlehug= 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=hpMVucOD; arc=none smtp.client-ip=209.85.218.50 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="hpMVucOD" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-ac25520a289so1158825366b.3 for ; Wed, 02 Apr 2025 08:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743607875; x=1744212675; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=RF1edLnEaKS8/8iDOXJ2CiX0xjvg9e1g/TmU+I09aK4=; b=hpMVucODboujWMEfNTXAYVWk2NDB4cebl6nZIa6pg6FqagUCWKplD+H4pPdAosghuD qIDihbp/ILRa7K5JBCI2r0zmZ1ewHuKrtww9AK7xU4B7DpZ37YRjni84/MerSwSOTZQa HzqDFG1xJsqgIi7gLfgYzF8GHKiqf4EJRyuZ7sE0PgR+QWg/vP/ng0PaEuHcMPg+afr6 W7S7IQfw+w294D2KSza055xE1sWYQMOeBeboWZJqrts6I0JZ7Y4xFFYGV/q2O/zu66t/ wwqq2jpSt2jedFLc7Xps7wljRqJ8LHeV5Uia+1j7YSU04x1DZ0H7bd64x90VdAM6a4n+ 2kLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743607875; x=1744212675; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RF1edLnEaKS8/8iDOXJ2CiX0xjvg9e1g/TmU+I09aK4=; b=RhU691SnlWM44zFsJIhcWAMlFqELJ/7Z2tbn8+Ia964wFz1NoLKWxIczw8V6/xo/vp UHkYgmQsghopZA/sdlHwro3+trS7DNHNPXQE1wN3iy4UGOcsv9FsfSixwIv0JFZ824pb tqDOzSKG13V8VOviaRDcLRTSAQeio3PXwUnXFgX81FbnxiYB2kKTbYkNGJvXlLmSS5I6 dxAPi6Wtrt4k9jU+tXliIplUgW+LcfA8TPWIBxt43Fo/AadinDDVvckGhXlvMzQ3abF4 PgUmzBk7kaMIH6u7ClAMWEiySq4zkfAqQZmjLuXdwOseftn6qYXnfe6Zgf8g5nKIkNgb U/UQ== X-Gm-Message-State: AOJu0YyEBnVThLhUdv5t2LzHstaZ6xgNBrEmsCiy0t0uYiNK/bOQ/cby fsMl/3QFZblrn7hDn5F2dMCXsjaKhAgm418MijIdrs5nYmo82UF0TX8Tig== X-Gm-Gg: ASbGncuyEw5Q0HbtON6Il7xI6ZEEjCGSm7ZQ4rw0gswIVr5NIEA0F/E0YW86c25e476 a9SFQeYlZg8/TO6GYGdsTpZ/Rw8jJvi4h+d8dlfHnYBxqmEtyxnHpguODTxFOR724i6pD/+qOmA kdP506agCyO8XK3PATInT/YGZ7F/o/3K7tZ86xrqRix477gFGECWmasdk5haPc71uP2iSRRn8/L L6Z9rppSgt0AeamvFsQ7sJaIL/LhSZ/bptVXAcq3GijC7H9EL7gXreoiv0JLfDjuq+2t5c7zx+z 5jJtg4wSnRDEgfYp0JMk9/x9ap8l1RQDxqPn9liDMZJrgNuf0Vei/A== X-Google-Smtp-Source: AGHT+IFI3c7cXezmuHtUCy3rVzKBzD1RIZx9MmIA7lWWyT4FB2EaaGyBwcVGUW6GHtKQw1/W8+JrtQ== X-Received: by 2002:a17:907:9625:b0:ac2:a5c7:7fc9 with SMTP id a640c23a62f3a-ac738c13711mr1523180966b.51.1743607874985; Wed, 02 Apr 2025 08:31:14 -0700 (PDT) Received: from [192.168.0.50] ([79.119.240.177]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac7196dc49csm919122666b.168.2025.04.02.08.31.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Apr 2025 08:31:14 -0700 (PDT) Message-ID: <4edc2a63-81b3-431c-9a37-5a7d899a6cc2@gmail.com> Date: Wed, 2 Apr 2025 18:31:12 +0300 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH rtw-next v3 3/4] wifi: rtw88: Set AMPDU factor to hardware for RTL8814A From: Bitterblue Smith To: "linux-wireless@vger.kernel.org" Cc: Ping-Ke Shih References: <257632d8-4347-45bc-ab39-4e88d87cdb3b@gmail.com> Content-Language: en-US In-Reply-To: <257632d8-4347-45bc-ab39-4e88d87cdb3b@gmail.com> Tell the chip the maximum AMPDU size supported by the AP. This greatly improves the TX speed of RTL8814AU in the 2.4 GHz band. Before: ~90 Mbps. After: ~300 Mbps. Signed-off-by: Bitterblue Smith --- v2: - Do this only for RTL8814A. - Add a comment explaining why this is needed. v3: - Explicitly initialise the set_ampdu_factor member with NULL for the other chips. --- drivers/net/wireless/realtek/rtw88/mac80211.c | 2 ++ drivers/net/wireless/realtek/rtw88/main.c | 32 +++++++++++++++++++ drivers/net/wireless/realtek/rtw88/main.h | 3 ++ drivers/net/wireless/realtek/rtw88/rtw8703b.c | 1 + drivers/net/wireless/realtek/rtw88/rtw8723d.c | 1 + drivers/net/wireless/realtek/rtw88/rtw8812a.c | 1 + drivers/net/wireless/realtek/rtw88/rtw8814a.c | 11 +++++++ drivers/net/wireless/realtek/rtw88/rtw8821a.c | 1 + drivers/net/wireless/realtek/rtw88/rtw8821c.c | 1 + drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 + drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 + 11 files changed, 55 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c index 026fbf4ad9cc..77f9fbe1870c 100644 --- a/drivers/net/wireless/realtek/rtw88/mac80211.c +++ b/drivers/net/wireless/realtek/rtw88/mac80211.c @@ -396,6 +396,8 @@ static void rtw_ops_bss_info_changed(struct ieee80211_hw *hw, if (rtw_bf_support) rtw_bf_assoc(rtwdev, vif, conf); + rtw_set_ampdu_factor(rtwdev, vif, conf); + rtw_fw_beacon_filter_config(rtwdev, true, vif); } else { rtw_leave_lps(rtwdev); diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c index 959f56a3cc1a..bc2c1a5a30b3 100644 --- a/drivers/net/wireless/realtek/rtw88/main.c +++ b/drivers/net/wireless/realtek/rtw88/main.c @@ -2447,6 +2447,38 @@ void rtw_core_enable_beacon(struct rtw_dev *rtwdev, bool enable) } } +void rtw_set_ampdu_factor(struct rtw_dev *rtwdev, struct ieee80211_vif *vif, + struct ieee80211_bss_conf *bss_conf) +{ + const struct rtw_chip_ops *ops = rtwdev->chip->ops; + struct ieee80211_sta *sta; + u8 factor = 0xff; + + if (!ops->set_ampdu_factor) + return; + + rcu_read_lock(); + + sta = ieee80211_find_sta(vif, bss_conf->bssid); + if (!sta) { + rcu_read_unlock(); + rtw_warn(rtwdev, "%s: failed to find station %pM\n", + __func__, bss_conf->bssid); + return; + } + + if (sta->deflink.vht_cap.vht_supported) + factor = u32_get_bits(sta->deflink.vht_cap.cap, + IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK); + else if (sta->deflink.ht_cap.ht_supported) + factor = sta->deflink.ht_cap.ampdu_factor; + + rcu_read_unlock(); + + if (factor != 0xff) + ops->set_ampdu_factor(rtwdev, factor); +} + MODULE_AUTHOR("Realtek Corporation"); MODULE_DESCRIPTION("Realtek 802.11ac wireless core module"); MODULE_LICENSE("Dual BSD/GPL"); diff --git a/drivers/net/wireless/realtek/rtw88/main.h b/drivers/net/wireless/realtek/rtw88/main.h index 02343e059fd9..f410c554da58 100644 --- a/drivers/net/wireless/realtek/rtw88/main.h +++ b/drivers/net/wireless/realtek/rtw88/main.h @@ -878,6 +878,7 @@ struct rtw_chip_ops { u32 antenna_rx); void (*cfg_ldo25)(struct rtw_dev *rtwdev, bool enable); void (*efuse_grant)(struct rtw_dev *rtwdev, bool enable); + void (*set_ampdu_factor)(struct rtw_dev *rtwdev, u8 factor); void (*false_alarm_statistics)(struct rtw_dev *rtwdev); void (*phy_calibration)(struct rtw_dev *rtwdev); void (*dpk_track)(struct rtw_dev *rtwdev); @@ -2272,4 +2273,6 @@ void rtw_update_channel(struct rtw_dev *rtwdev, u8 center_channel, void rtw_core_port_switch(struct rtw_dev *rtwdev, struct ieee80211_vif *vif); bool rtw_core_check_sta_active(struct rtw_dev *rtwdev); void rtw_core_enable_beacon(struct rtw_dev *rtwdev, bool enable); +void rtw_set_ampdu_factor(struct rtw_dev *rtwdev, struct ieee80211_vif *vif, + struct ieee80211_bss_conf *bss_conf); #endif diff --git a/drivers/net/wireless/realtek/rtw88/rtw8703b.c b/drivers/net/wireless/realtek/rtw88/rtw8703b.c index 1d232adbdd7e..5e59cfe4dfdf 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c @@ -1904,6 +1904,7 @@ static const struct rtw_chip_ops rtw8703b_ops = { .set_antenna = NULL, .cfg_ldo25 = rtw8723x_cfg_ldo25, .efuse_grant = rtw8723x_efuse_grant, + .set_ampdu_factor = NULL, .false_alarm_statistics = rtw8723x_false_alarm_statistics, .phy_calibration = rtw8703b_phy_calibration, .dpk_track = NULL, diff --git a/drivers/net/wireless/realtek/rtw88/rtw8723d.c b/drivers/net/wireless/realtek/rtw88/rtw8723d.c index 87715bd54860..31876e708f9e 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c @@ -1404,6 +1404,7 @@ static const struct rtw_chip_ops rtw8723d_ops = { .set_antenna = NULL, .cfg_ldo25 = rtw8723x_cfg_ldo25, .efuse_grant = rtw8723x_efuse_grant, + .set_ampdu_factor = NULL, .false_alarm_statistics = rtw8723x_false_alarm_statistics, .phy_calibration = rtw8723d_phy_calibration, .cck_pd_set = rtw8723d_phy_cck_pd_set, diff --git a/drivers/net/wireless/realtek/rtw88/rtw8812a.c b/drivers/net/wireless/realtek/rtw88/rtw8812a.c index f9ba2aa2928a..adbfb37105d0 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8812a.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8812a.c @@ -925,6 +925,7 @@ static const struct rtw_chip_ops rtw8812a_ops = { .set_tx_power_index = rtw88xxa_set_tx_power_index, .cfg_ldo25 = rtw8812a_cfg_ldo25, .efuse_grant = rtw88xxa_efuse_grant, + .set_ampdu_factor = NULL, .false_alarm_statistics = rtw88xxa_false_alarm_statistics, .phy_calibration = rtw8812a_phy_calibration, .cck_pd_set = rtw88xxa_phy_cck_pd_set, diff --git a/drivers/net/wireless/realtek/rtw88/rtw8814a.c b/drivers/net/wireless/realtek/rtw88/rtw8814a.c index cfd35d40d46e..ce8d4e4c6c57 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8814a.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8814a.c @@ -1332,6 +1332,16 @@ static void rtw8814a_cfg_ldo25(struct rtw_dev *rtwdev, bool enable) { } +/* Without this RTL8814A sends too many frames and (some?) 11n AP + * can't handle it, resulting in low TX speed. Other chips seem fine. + */ +static void rtw8814a_set_ampdu_factor(struct rtw_dev *rtwdev, u8 factor) +{ + factor = min_t(u8, factor, IEEE80211_VHT_MAX_AMPDU_256K); + + rtw_write32(rtwdev, REG_AMPDU_MAX_LENGTH, (8192 << factor) - 1); +} + static void rtw8814a_false_alarm_statistics(struct rtw_dev *rtwdev) { struct rtw_dm_info *dm_info = &rtwdev->dm_info; @@ -2051,6 +2061,7 @@ static const struct rtw_chip_ops rtw8814a_ops = { .set_antenna = NULL, .cfg_ldo25 = rtw8814a_cfg_ldo25, .efuse_grant = rtw8814a_efuse_grant, + .set_ampdu_factor = rtw8814a_set_ampdu_factor, .false_alarm_statistics = rtw8814a_false_alarm_statistics, .phy_calibration = rtw8814a_phy_calibration, .cck_pd_set = rtw8814a_phy_cck_pd_set, diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821a.c b/drivers/net/wireless/realtek/rtw88/rtw8821a.c index f68239b07319..4d81fb29c9fc 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8821a.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8821a.c @@ -871,6 +871,7 @@ static const struct rtw_chip_ops rtw8821a_ops = { .set_tx_power_index = rtw88xxa_set_tx_power_index, .cfg_ldo25 = rtw8821a_cfg_ldo25, .efuse_grant = rtw88xxa_efuse_grant, + .set_ampdu_factor = NULL, .false_alarm_statistics = rtw88xxa_false_alarm_statistics, .phy_calibration = rtw8821a_phy_calibration, .cck_pd_set = rtw88xxa_phy_cck_pd_set, diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c b/drivers/net/wireless/realtek/rtw88/rtw8821c.c index 0ade7f11cbd2..f68b0041dcc0 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c @@ -1668,6 +1668,7 @@ static const struct rtw_chip_ops rtw8821c_ops = { .set_antenna = NULL, .set_tx_power_index = rtw8821c_set_tx_power_index, .cfg_ldo25 = rtw8821c_cfg_ldo25, + .set_ampdu_factor = NULL, .false_alarm_statistics = rtw8821c_false_alarm_statistics, .phy_calibration = rtw8821c_phy_calibration, .cck_pd_set = rtw8821c_phy_cck_pd_set, diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.c b/drivers/net/wireless/realtek/rtw88/rtw8822b.c index b4934da88e33..0da212e27d55 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c @@ -2158,6 +2158,7 @@ static const struct rtw_chip_ops rtw8822b_ops = { .set_tx_power_index = rtw8822b_set_tx_power_index, .set_antenna = rtw8822b_set_antenna, .cfg_ldo25 = rtw8822b_cfg_ldo25, + .set_ampdu_factor = NULL, .false_alarm_statistics = rtw8822b_false_alarm_statistics, .phy_calibration = rtw8822b_phy_calibration, .pwr_track = rtw8822b_pwr_track, diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net/wireless/realtek/rtw88/rtw8822c.c index 5e53e0db177e..ca0cf26b9055 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c @@ -4968,6 +4968,7 @@ static const struct rtw_chip_ops rtw8822c_ops = { .set_tx_power_index = rtw8822c_set_tx_power_index, .set_antenna = rtw8822c_set_antenna, .cfg_ldo25 = rtw8822c_cfg_ldo25, + .set_ampdu_factor = NULL, .false_alarm_statistics = rtw8822c_false_alarm_statistics, .dpk_track = rtw8822c_dpk_track, .phy_calibration = rtw8822c_phy_calibration, From patchwork Wed Apr 2 15:31:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bitterblue Smith X-Patchwork-Id: 14036189 X-Patchwork-Delegate: pkshih@realtek.com Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 ED1EF3C0B for ; Wed, 2 Apr 2025 15:31:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743607903; cv=none; b=fHzy3wBCbNEY7aAEjWtUK9XeLpEAR5WZI4hGLEJooaF7YJ1tgI1uJ36qIvR4uea+wN3t0BR0kYuzhqZsZIvpYoE+mLd4MNfMroOP0iuVCXrbyQ3U09jr3KBv4ZHdBgVmtil+N8NI2bEmFiQhcNhDnGrVlxjl1rvh5L6YRf9FJL8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743607903; c=relaxed/simple; bh=A0C4lTs0aori9GvCAckx1EvhG/nrGpnUzjW4i71lBDc=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=XY3cfWq4ZAIlMTQJlXiDhYEGp8zg9ox1Ey7RegM53vT2N9EhFWvqi2yaXCjfrRnEdKosRkcO7Sl26yTkvL0vqGrRoykc0dquvOt+suKQKo9JSI2M2Sgq0r0bXAjDsOectHnGPEqrptfh2nmaJj+1eGh3/+/HgiXO1DmkChlQp7Y= 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=lii1fMIb; arc=none smtp.client-ip=209.85.218.43 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="lii1fMIb" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-ac2bb7ca40bso1383986366b.3 for ; Wed, 02 Apr 2025 08:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743607900; x=1744212700; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=Jel2dOvgHfvNtDXHvg3sajmUKpoOO3yCshyEVJHzjbM=; b=lii1fMIbDYvTWY8O7TbM41ralSVbpbGOhPdTPocT0k8EhlARAIMKKd3Uzg/qD8MUQI jlYNYXFcuotHzzl9THTBfapMCH2yZ6Pgadg2oGD781fhfBS9Jri5AAlcWSXpWkyBmowZ xD0QdnpAhi/fGBbmCUf41wjWF2KuyIpT9pG/9UNFTaFGl6XYKt78pmc037cchJsCt0Ms qGdNKLfDarwkSSODrVsqNlJYx5Y7Hj2EzmYIgYadPdePGbolcqRK5ZNxgpAQER6yA5m5 f2r/2zoqD3f6+DsfkhY+STDQiFKlr8eyDkqG6aVBBNnEzEdyiNqU7XjR9a/af1po8ePM Q5sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743607900; x=1744212700; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Jel2dOvgHfvNtDXHvg3sajmUKpoOO3yCshyEVJHzjbM=; b=ZO6cwB7PsTkRIRuj+FK73RkKTlszLWbZ2IDjXzitX7JqByGBJmexivdoATsxM6PLiV ytOS+2XgtGmha3DjhA3zVM6fftjQNlOOW8NjzPl9xaQSYQ8q98PVhgZWVs9qaMbSpZW4 VPPv2NKa9+Wsvz2OpjodbR4OneQslvP4kH2KlcaoZrOu9CHGYVMiPzRKjShJeejpEIFj sLrX4wum3NtQ555B/bmuzB/bEof9oHMJprJYQs9jFTcfWjpG/6XCfwK5XQPVPww/LbIE 0Joav8pV5DF8dphpJqYyuOgsPIcE1O1emO4W7JrZanlkDMY7raAnvH5SAD+Jh+OfBDvv k5kA== X-Gm-Message-State: AOJu0YxbTVlWmjYRgE/xGGG1HJtViULiO2udzyYTQBhb56C0bNJ4EnLs 64169QecaEtxiQhVag4/az4OZykqz9tZ0Yqn9rqY50g4o/C7Ax/e3OgXag== X-Gm-Gg: ASbGnct+ALrjHoWhhbl87N3ob901TpaA0IVaaOqCHBER2xtUyNhN9BCgLOqIhkNUVlF xCQez2bY9tyn3MpL+XoHgrlA09dL2z3HDrE/72GnMkPWd4Crn3XHhL8r5m1mTh3KVZsKR8kFJhv wRmFPqFmmq73WfLR6ciE1AWs0LeApxthyD5KUPhaTRLrxntUkl0u72qhDGZcceE5pUgUd4uvBBy RK1YmuQQp85crGf2EW9o1FCuRRdZSXgzvkd5xVnjSv1JfYIbdRfZybjVq/areZMrb8I7cE7/D/i 1bXOJNl1CJe/RWkjZNYv8VXuQBivGm9etilLWouBggji7dkD0yEkhw== X-Google-Smtp-Source: AGHT+IFMxVf7cl2wPZ7zutwhai8JMMSwxD9MTXPoIg8MUmgo9mhHNZ2BEsX9ds9ZI5f08PFNJvSA0g== X-Received: by 2002:a17:907:d1a:b0:ac3:8aa0:9d70 with SMTP id a640c23a62f3a-ac782e939femr714125766b.51.1743607899921; Wed, 02 Apr 2025 08:31:39 -0700 (PDT) Received: from [192.168.0.50] ([79.119.240.177]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac71922ba63sm928951566b.2.2025.04.02.08.31.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Apr 2025 08:31:39 -0700 (PDT) Message-ID: <6202ccfb-feb0-4107-a08d-db2699e179f0@gmail.com> Date: Wed, 2 Apr 2025 18:31:36 +0300 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH rtw-next v3 4/4] wifi: rtw88: Don't set SUPPORTS_AMSDU_IN_AMPDU for RTL8814AU From: Bitterblue Smith To: "linux-wireless@vger.kernel.org" Cc: Ping-Ke Shih References: <257632d8-4347-45bc-ab39-4e88d87cdb3b@gmail.com> Content-Language: en-US In-Reply-To: <257632d8-4347-45bc-ab39-4e88d87cdb3b@gmail.com> RTL8814AU doesn't work well with SUPPORTS_AMSDU_IN_AMPDU. The RX speed is noticeably lower and the VHT RX statistics are strange. Typical values with SUPPORTS_AMSDU_IN_AMPDU: Reverse mode, remote host 192.168.0.1 is sending [ 5] local 192.168.0.50 port 60710 connected to 192.168.0.1 port 5201 [ ID] Interval Transfer Bitrate [ 5] 0.00-1.00 sec 74.6 MBytes 626 Mbits/sec [ 5] 1.00-2.00 sec 79.2 MBytes 665 Mbits/sec [ 5] 2.00-3.00 sec 84.9 MBytes 712 Mbits/sec [ 5] 3.00-4.00 sec 83.8 MBytes 703 Mbits/sec [ 5] 4.00-5.00 sec 85.9 MBytes 720 Mbits/sec [ 5] 5.00-6.00 sec 78.9 MBytes 662 Mbits/sec [ 5] 6.00-7.00 sec 81.2 MBytes 682 Mbits/sec [ 5] 7.00-8.00 sec 80.5 MBytes 675 Mbits/sec [ 5] 8.00-9.00 sec 79.4 MBytes 666 Mbits/sec [ 5] 9.00-10.00 sec 82.2 MBytes 689 Mbits/sec [ 5] 10.00-11.00 sec 82.0 MBytes 688 Mbits/sec [ 5] 11.00-12.00 sec 84.2 MBytes 707 Mbits/sec [ 5] 12.00-13.00 sec 71.0 MBytes 596 Mbits/sec [ 5] 13.00-14.00 sec 69.4 MBytes 582 Mbits/sec [ 5] 14.00-15.00 sec 80.2 MBytes 673 Mbits/sec [ 5] 15.00-16.00 sec 74.5 MBytes 625 Mbits/sec [Rx Counter]: * CCA (CCK, OFDM, Total) = (0, 2455, 2455) * False Alarm (CCK, OFDM, Total) = (0, 69, 69) * CCK cnt (ok, err) = (0, 0) * OFDM cnt (ok, err) = (1239, 2) * HT cnt (ok, err) = (0, 0) * VHT cnt (ok, err) = (21, 12109) The "VHT ok" number is not believable. And without SUPPORTS_AMSDU_IN_AMPDU: Reverse mode, remote host 192.168.0.1 is sending [ 5] local 192.168.0.50 port 50030 connected to 192.168.0.1 port 5201 [ ID] Interval Transfer Bitrate [ 5] 0.00-1.00 sec 70.5 MBytes 591 Mbits/sec [ 5] 1.00-2.00 sec 86.9 MBytes 729 Mbits/sec [ 5] 2.00-3.00 sec 98.6 MBytes 827 Mbits/sec [ 5] 3.00-4.00 sec 97.4 MBytes 817 Mbits/sec [ 5] 4.00-5.00 sec 98.6 MBytes 827 Mbits/sec [ 5] 5.00-6.00 sec 96.9 MBytes 813 Mbits/sec [ 5] 6.00-7.00 sec 98.2 MBytes 824 Mbits/sec [ 5] 7.00-8.00 sec 98.0 MBytes 822 Mbits/sec [ 5] 8.00-9.00 sec 99.9 MBytes 838 Mbits/sec [ 5] 9.00-10.00 sec 99.2 MBytes 833 Mbits/sec [ 5] 10.00-11.00 sec 98.0 MBytes 822 Mbits/sec [ 5] 11.00-12.00 sec 98.1 MBytes 823 Mbits/sec [ 5] 12.00-13.00 sec 97.0 MBytes 814 Mbits/sec [ 5] 13.00-14.00 sec 98.2 MBytes 824 Mbits/sec [ 5] 14.00-15.00 sec 98.5 MBytes 826 Mbits/sec [ 5] 15.00-16.00 sec 97.4 MBytes 817 Mbits/sec [Rx Counter]: * CCA (CCK, OFDM, Total) = (0, 3860, 3860) * False Alarm (CCK, OFDM, Total) = (0, 2, 2) * CCK cnt (ok, err) = (0, 0) * OFDM cnt (ok, err) = (1486, 0) * HT cnt (ok, err) = (0, 0) * VHT cnt (ok, err) = (7399, 9118) Add a new member "amsdu_in_ampdu" in struct rtw_chip_info and use it to set SUPPORTS_AMSDU_IN_AMPDU only for the other chips. Signed-off-by: Bitterblue Smith Acked-by: Ping-Ke Shih --- v2: - Add a comment explaining why this is needed. v3: - Add Acked-by. --- drivers/net/wireless/realtek/rtw88/main.c | 3 ++- drivers/net/wireless/realtek/rtw88/main.h | 1 + drivers/net/wireless/realtek/rtw88/rtw8812a.c | 1 + drivers/net/wireless/realtek/rtw88/rtw8814a.c | 1 + drivers/net/wireless/realtek/rtw88/rtw8821a.c | 1 + drivers/net/wireless/realtek/rtw88/rtw8821c.c | 1 + drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 + drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 + 8 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c index bc2c1a5a30b3..c4de5d114eda 100644 --- a/drivers/net/wireless/realtek/rtw88/main.c +++ b/drivers/net/wireless/realtek/rtw88/main.c @@ -2242,7 +2242,8 @@ int rtw_register_hw(struct rtw_dev *rtwdev, struct ieee80211_hw *hw) ieee80211_hw_set(hw, SUPPORTS_PS); ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS); ieee80211_hw_set(hw, SUPPORT_FAST_XMIT); - ieee80211_hw_set(hw, SUPPORTS_AMSDU_IN_AMPDU); + if (rtwdev->chip->amsdu_in_ampdu) + ieee80211_hw_set(hw, SUPPORTS_AMSDU_IN_AMPDU); ieee80211_hw_set(hw, HAS_RATE_CONTROL); ieee80211_hw_set(hw, TX_AMSDU); ieee80211_hw_set(hw, SINGLE_SCAN_ON_ALL_BANDS); diff --git a/drivers/net/wireless/realtek/rtw88/main.h b/drivers/net/wireless/realtek/rtw88/main.h index f410c554da58..b0f1fabe9554 100644 --- a/drivers/net/wireless/realtek/rtw88/main.h +++ b/drivers/net/wireless/realtek/rtw88/main.h @@ -1230,6 +1230,7 @@ struct rtw_chip_info { u16 fw_fifo_addr[RTW_FW_FIFO_MAX]; const struct rtw_fwcd_segs *fwcd_segs; + bool amsdu_in_ampdu; u8 usb_tx_agg_desc_num; bool hw_feature_report; u8 c2h_ra_report_size; diff --git a/drivers/net/wireless/realtek/rtw88/rtw8812a.c b/drivers/net/wireless/realtek/rtw88/rtw8812a.c index adbfb37105d0..c2ef41767ff9 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8812a.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8812a.c @@ -1076,6 +1076,7 @@ const struct rtw_chip_info rtw8812a_hw_spec = { .rfe_defs = rtw8812a_rfe_defs, .rfe_defs_size = ARRAY_SIZE(rtw8812a_rfe_defs), .rx_ldpc = false, + .amsdu_in_ampdu = true, .hw_feature_report = false, .c2h_ra_report_size = 4, .old_datarate_fb_limit = true, diff --git a/drivers/net/wireless/realtek/rtw88/rtw8814a.c b/drivers/net/wireless/realtek/rtw88/rtw8814a.c index ce8d4e4c6c57..44dd3090484b 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8814a.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8814a.c @@ -2200,6 +2200,7 @@ const struct rtw_chip_info rtw8814a_hw_spec = { .rx_ldpc = true, .max_power_index = 0x3f, .ampdu_density = IEEE80211_HT_MPDU_DENSITY_2, + .amsdu_in_ampdu = false, /* RX speed is better without AMSDU */ .usb_tx_agg_desc_num = 3, .hw_feature_report = false, .c2h_ra_report_size = 6, diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821a.c b/drivers/net/wireless/realtek/rtw88/rtw8821a.c index 4d81fb29c9fc..413aec694c33 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8821a.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8821a.c @@ -1176,6 +1176,7 @@ const struct rtw_chip_info rtw8821a_hw_spec = { .rfe_defs = rtw8821a_rfe_defs, .rfe_defs_size = ARRAY_SIZE(rtw8821a_rfe_defs), .rx_ldpc = false, + .amsdu_in_ampdu = true, .hw_feature_report = false, .c2h_ra_report_size = 4, .old_datarate_fb_limit = true, diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c b/drivers/net/wireless/realtek/rtw88/rtw8821c.c index f68b0041dcc0..413130a30ca9 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c @@ -1991,6 +1991,7 @@ const struct rtw_chip_info rtw8821c_hw_spec = { .band = RTW_BAND_2G | RTW_BAND_5G, .page_size = TX_PAGE_SIZE, .dig_min = 0x1c, + .amsdu_in_ampdu = true, .usb_tx_agg_desc_num = 3, .hw_feature_report = true, .c2h_ra_report_size = 7, diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.c b/drivers/net/wireless/realtek/rtw88/rtw8822b.c index 0da212e27d55..ab199eaea3c7 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c @@ -2532,6 +2532,7 @@ const struct rtw_chip_info rtw8822b_hw_spec = { .band = RTW_BAND_2G | RTW_BAND_5G, .page_size = TX_PAGE_SIZE, .dig_min = 0x1c, + .amsdu_in_ampdu = true, .usb_tx_agg_desc_num = 3, .hw_feature_report = true, .c2h_ra_report_size = 7, diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net/wireless/realtek/rtw88/rtw8822c.c index ca0cf26b9055..369ca75061b2 100644 --- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c +++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c @@ -5350,6 +5350,7 @@ const struct rtw_chip_info rtw8822c_hw_spec = { .band = RTW_BAND_2G | RTW_BAND_5G, .page_size = TX_PAGE_SIZE, .dig_min = 0x20, + .amsdu_in_ampdu = true, .usb_tx_agg_desc_num = 3, .hw_feature_report = true, .c2h_ra_report_size = 7,