svn commit: r303115 - head/sys/dev/urtwn
Andriy Voskoboinyk
avos at FreeBSD.org
Wed Jul 20 22:05:46 UTC 2016
Author: avos
Date: Wed Jul 20 22:05:44 2016
New Revision: 303115
URL: https://svnweb.freebsd.org/changeset/base/303115
Log:
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
Modified:
head/sys/dev/urtwn/if_urtwn.c
head/sys/dev/urtwn/if_urtwnreg.h
Modified: head/sys/dev/urtwn/if_urtwn.c
==============================================================================
--- head/sys/dev/urtwn/if_urtwn.c Wed Jul 20 22:03:45 2016 (r303114)
+++ head/sys/dev/urtwn/if_urtwn.c Wed Jul 20 22:05:44 2016 (r303115)
@@ -2318,6 +2318,10 @@ urtwn_key_set_cb(struct urtwn_softc *sc,
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),
Modified: head/sys/dev/urtwn/if_urtwnreg.h
==============================================================================
--- head/sys/dev/urtwn/if_urtwnreg.h Wed Jul 20 22:03:45 2016 (r303114)
+++ head/sys/dev/urtwn/if_urtwnreg.h Wed Jul 20 22:05:44 2016 (r303115)
@@ -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
More information about the svn-src-all
mailing list