summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2012-11-19 23:42:46 +0000
committeradrian <adrian@FreeBSD.org>2012-11-19 23:42:46 +0000
commitef169546aee3c0c9cf7a585aa5c3ea44be6b0a31 (patch)
treee78f78be572126f946520d3dde53e69f7a8a3958 /sys/dev/ath/ath_hal/ar5210/ar5210_misc.c
parent7f1a5459c2b85c2af1a31812494e65f4ecb82224 (diff)
downloadFreeBSD-src-ef169546aee3c0c9cf7a585aa5c3ea44be6b0a31.zip
FreeBSD-src-ef169546aee3c0c9cf7a585aa5c3ea44be6b0a31.tar.gz
Disable WEP hardware encryption on the AR5210, in order to allow other
encryption types. The AR5210 only has four WEP key slots, in contrast to what the later MACs have (ie, the keycache.) So there's no way to store a "clear" key. Even if the driver is taught to not allocate CLR key entries for the AR5210, the hardware will actually attempt to decode the encrypted frames with the (likely all 0!) WEP keys. So for now, disable the hardware encryption entirely and just so it all in software. That allows both WEP -and- WPA to actually work. If someone wishes to try and make hardware WEP _but_ software WPA work, they'll have to create a HAL capability to enable/disable hardware encryption based on the current STA/Hostap mode. However, making multi-vap work with one WEP and one WPA VAP will require hardware encryption to be disabled anyway.
Diffstat (limited to 'sys/dev/ath/ath_hal/ar5210/ar5210_misc.c')
-rw-r--r--sys/dev/ath/ath_hal/ar5210/ar5210_misc.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c b/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c
index 88decf3..bf4b8d0 100644
--- a/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c
+++ b/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c
@@ -576,8 +576,6 @@ ar5210MibEvent(struct ath_hal *ah, const HAL_NODE_STATS *stats)
{
}
-#define AR_DIAG_SW_DIS_CRYPTO (AR_DIAG_SW_DIS_ENC | AR_DIAG_SW_DIS_DEC)
-
HAL_STATUS
ar5210GetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type,
uint32_t capability, uint32_t *result)
@@ -585,7 +583,11 @@ ar5210GetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type,
switch (type) {
case HAL_CAP_CIPHER: /* cipher handled in hardware */
+#if 0
return (capability == HAL_CIPHER_WEP ? HAL_OK : HAL_ENOTSUPP);
+#else
+ return HAL_ENOTSUPP;
+#endif
default:
return ath_hal_getcapability(ah, type, capability, result);
}
@@ -608,7 +610,7 @@ ar5210SetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type,
#else
AH_PRIVATE(ah)->ah_diagreg = setting & 0x6; /* ACK+CTS */
#endif
- OS_REG_WRITE(ah, AR_DIAG_SW, AH_PRIVATE(ah)->ah_diagreg);
+ ar5210UpdateDiagReg(ah, AH_PRIVATE(ah)->ah_diagreg);
return AH_TRUE;
case HAL_CAP_RXORN_FATAL: /* HAL_INT_RXORN treated as fatal */
return AH_FALSE; /* NB: disallow */
@@ -677,3 +679,18 @@ void
ar5210GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe)
{
}
+
+/*
+ * Update the diagnostic register.
+ *
+ * This merges in the diagnostic register setting with the default
+ * value, which may or may not involve disabling hardware encryption.
+ */
+void
+ar5210UpdateDiagReg(struct ath_hal *ah, uint32_t val)
+{
+
+ /* Disable all hardware encryption */
+ val |= AR_DIAG_SW_DIS_CRYPTO;
+ OS_REG_WRITE(ah, AR_DIAG_SW, val);
+}
OpenPOWER on IntegriCloud