diff --git a/sys/dev/rtwn/rtl8812a/r12a_var.h b/sys/dev/rtwn/rtl8812a/r12a_var.h --- a/sys/dev/rtwn/rtl8812a/r12a_var.h +++ b/sys/dev/rtwn/rtl8812a/r12a_var.h @@ -99,6 +99,7 @@ int ac_usb_dma_size; int ac_usb_dma_time; int ampdu_max_time; + int ampdu_max_size; }; #define R12A_SOFTC(_sc) ((struct r12a_softc *)((_sc)->sc_priv)) diff --git a/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c b/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c --- a/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c +++ b/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c @@ -141,6 +141,7 @@ rs->rs_iq_calib_sw = r12a_iq_calib_sw; rs->ampdu_max_time = 0x70; + rs->ampdu_max_size = 0x1ffff; /* 128k */ sc->sc_priv = rs; } diff --git a/sys/dev/rtwn/rtl8812a/usb/r12au_init.c b/sys/dev/rtwn/rtl8812a/usb/r12au_init.c --- a/sys/dev/rtwn/rtl8812a/usb/r12au_init.c +++ b/sys/dev/rtwn/rtl8812a/usb/r12au_init.c @@ -142,7 +142,17 @@ /* Setup AMPDU aggregation. */ rtwn_write_1(sc, R12A_AMPDU_MAX_TIME, rs->ampdu_max_time); - rtwn_write_4(sc, R12A_AMPDU_MAX_LENGTH, 0xffffffff); + /* + * Note: The vendor driver (hal/rtl8812a_hal_init.c:SetHwReg8812A()) + * also sets bit 31. + */ + /* + * TODO: this should be limited to the peer in STA mode, + * and perhaps the minimum A-MPDU of all VAPs/peers in + * multi-STA / other operating modes. + */ + rtwn_write_4(sc, R12A_AMPDU_MAX_LENGTH, + rs->ampdu_max_size | (1<<31)); /* 80 MHz clock (again?) */ rtwn_write_1(sc, R92C_USTIME_TSF, 0x50); diff --git a/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c b/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c --- a/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c +++ b/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c @@ -141,6 +141,7 @@ rs->rs_iq_calib_sw = r21a_iq_calib_sw; rs->ampdu_max_time = 0x5e; + rs->ampdu_max_size = 0xffff; /* 64k */ rs->ac_usb_dma_size = 0x01; rs->ac_usb_dma_time = 0x10;