1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-26 16:18:31 +00:00

urtwn: fix A-MSDU tx aggregation when encryption is used.

Clear unused (undocumented) CAM bytes while setting a key;
without that, hardware does weird things when A-MSDU bit in QoS header
is set.

Tested with RTL8188CUS (AP) -> RTL8188EU (STA) (A-MSDU transmit).

Reported by:	many
Obtained from:	https://github.com/s3erios/urtwm
MFC after:	5 days
This commit is contained in:
Andriy Voskoboinyk 2016-07-20 22:05:44 +00:00
parent bd0371c964
commit 73bb505548
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=303115
2 changed files with 6 additions and 0 deletions

View File

@ -2318,6 +2318,10 @@ urtwn_key_set_cb(struct urtwn_softc *sc, union sec_param *data)
k->wk_cipher->ic_cipher, algo, k->wk_flags, k->wk_keylen,
ether_sprintf(k->wk_macaddr));
/* Clear high bits. */
urtwn_cam_write(sc, R92C_CAM_CTL6(k->wk_keyix), 0);
urtwn_cam_write(sc, R92C_CAM_CTL7(k->wk_keyix), 0);
/* Write key. */
for (i = 0; i < 4; i++) {
error = urtwn_cam_write(sc, R92C_CAM_KEY(k->wk_keyix, i),

View File

@ -871,6 +871,8 @@
#define R92C_CAM_CTL0(entry) ((entry) * 8 + 0)
#define R92C_CAM_CTL1(entry) ((entry) * 8 + 1)
#define R92C_CAM_KEY(entry, i) ((entry) * 8 + 2 + (i))
#define R92C_CAM_CTL6(entry) ((entry) * 8 + 6)
#define R92C_CAM_CTL7(entry) ((entry) * 8 + 7)
/* Bits for R92C_CAM_CTL0(i). */
#define R92C_CAM_KEYID_M 0x00000003