Re: [PATCH rtw-next v2 7/7] wifi: rtw88: 8812a, 8821a: respect peer A-MPDU size limits

From: Luka Gejak

Date: Fri Nov 06 2026 - 12:35:49 EST


Hi Jie Feng,

Two small comments below.

October 31, 2026 at 8:09 AM, "Ho Jie Feng" <hjf3108@xxxxxxxxx> wrote:

> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821a.c b/drivers/net/wireless/realtek/rtw88/rtw8821a.c
> index f7391f6aa3039c7ba4d88249d968a5f1763ea866..f597edec290f64fda1c457812b240515360dc387 100644
> --- a/drivers/net/wireless/realtek/rtw88/rtw8821a.c
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8821a.c
> @@ -49,6 +49,13 @@ static void rtw8821a_cfg_ldo25(struct rtw_dev *rtwdev, bool enable)
> {
> }
>
> +static void rtw8821a_set_ampdu_factor(struct rtw_dev *rtwdev, u8 factor)
> +{
> + factor = min_t(u8, factor, IEEE80211_HT_MAX_AMPDU_64K);

For a VHT peer rtw_set_ampdu_factor() passes the VHT exponent here, so
IEEE80211_VHT_MAX_AMPDU_64K would match the 8812a version. It is the
same value, so this is only about readability.

> +
> + rtw_write32(rtwdev, REG_AMPDU_MAX_LENGTH, (8192 << factor) - 1);
> +}

This is the same as rtw8812a_set_ampdu_factor() apart from the limit.
Maybe a single rtw88xxa_set_ampdu_factor() that picks the limit by chip
id, like rtw88xxa_set_crystal_cap() in patch 5 does for the mask?

Best regards,
Luka Gejak