-/* $OpenBSD: ar5210.c,v 1.42 2008/08/27 09:05:03 damien Exp $ */
+/* $OpenBSD: ar5210.c,v 1.43 2008/08/29 10:05:00 reyk Exp $ */
/*
* Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
AR5K_HAL_FUNCTION(hal, ar5210, is_key_valid);
AR5K_HAL_FUNCTION(hal, ar5210, set_key);
AR5K_HAL_FUNCTION(hal, ar5210, set_key_lladdr);
+ AR5K_HAL_FUNCTION(hal, ar5210, softcrypto);
/*
* Power management functions
return (AH_TRUE);
}
+HAL_BOOL
+ar5k_ar5210_softcrypto(struct ath_hal *hal, HAL_BOOL enable)
+{
+ u_int32_t bits;
+ int i;
+
+ bits = AR5K_AR5210_DIAG_SW_DIS_ENC | AR5K_AR5210_DIAG_SW_DIS_DEC;
+ if (enable == AH_TRUE) {
+ /* Disable the hardware crypto engine */
+ AR5K_REG_ENABLE_BITS(AR5K_AR5210_DIAG_SW, bits);
+ } else {
+ /* Enable the hardware crypto engine */
+ AR5K_REG_DISABLE_BITS(AR5K_AR5210_DIAG_SW, bits);
+ }
+
+ /* Reset the key cache */
+ for (i = 0; i < AR5K_AR5210_KEYTABLE_SIZE; i++)
+ ar5k_ar5210_reset_key(hal, i);
+
+ return (AH_TRUE);
+}
+
/*
* Power management functions
*/
-/* $OpenBSD: ar5211.c,v 1.38 2008/08/27 09:05:03 damien Exp $ */
+/* $OpenBSD: ar5211.c,v 1.39 2008/08/29 10:05:00 reyk Exp $ */
/*
* Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
AR5K_HAL_FUNCTION(hal, ar5211, is_key_valid);
AR5K_HAL_FUNCTION(hal, ar5211, set_key);
AR5K_HAL_FUNCTION(hal, ar5211, set_key_lladdr);
+ AR5K_HAL_FUNCTION(hal, ar5211, softcrypto);
/*
* Power management functions
return (AH_TRUE);
}
+HAL_BOOL
+ar5k_ar5211_softcrypto(struct ath_hal *hal, HAL_BOOL enable)
+{
+ u_int32_t bits;
+ int i;
+
+ bits = AR5K_AR5211_DIAG_SW_DIS_ENC | AR5K_AR5211_DIAG_SW_DIS_DEC;
+ if (enable == AH_TRUE) {
+ /* Disable the hardware crypto engine */
+ AR5K_REG_ENABLE_BITS(AR5K_AR5211_DIAG_SW, bits);
+ } else {
+ /* Enable the hardware crypto engine */
+ AR5K_REG_DISABLE_BITS(AR5K_AR5211_DIAG_SW, bits);
+ }
+
+ /* Reset the key cache */
+ for (i = 0; i < AR5K_AR5211_KEYTABLE_SIZE; i++)
+ ar5k_ar5211_reset_key(hal, i);
+
+ return (AH_TRUE);
+}
+
/*
* Power management functions
*/
-/* $OpenBSD: ar5212.c,v 1.46 2008/08/27 09:05:03 damien Exp $ */
+/* $OpenBSD: ar5212.c,v 1.47 2008/08/29 10:05:00 reyk Exp $ */
/*
* Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
AR5K_HAL_FUNCTION(hal, ar5212, is_key_valid);
AR5K_HAL_FUNCTION(hal, ar5212, set_key);
AR5K_HAL_FUNCTION(hal, ar5212, set_key_lladdr);
+ AR5K_HAL_FUNCTION(hal, ar5212, softcrypto);
/*
* Power management functions
return (AH_TRUE);
}
+HAL_BOOL
+ar5k_ar5212_softcrypto(struct ath_hal *hal, HAL_BOOL enable)
+{
+ u_int32_t bits;
+ int i;
+
+ bits = AR5K_AR5212_DIAG_SW_DIS_ENC | AR5K_AR5212_DIAG_SW_DIS_DEC;
+ if (enable == AH_TRUE) {
+ /* Disable the hardware crypto engine */
+ AR5K_REG_ENABLE_BITS(AR5K_AR5212_DIAG_SW, bits);
+ } else {
+ /* Enable the hardware crypto engine */
+ AR5K_REG_DISABLE_BITS(AR5K_AR5212_DIAG_SW, bits);
+ }
+
+ /* Reset the key cache */
+ for (i = 0; i < AR5K_AR5212_KEYTABLE_SIZE; i++)
+ ar5k_ar5212_reset_key(hal, i);
+
+ return (AH_TRUE);
+}
+
/*
* Power management functions
*/
-/* $OpenBSD: ar5xxx.h,v 1.44 2008/07/30 07:15:39 reyk Exp $ */
+/* $OpenBSD: ar5xxx.h,v 1.45 2008/08/29 10:05:00 reyk Exp $ */
/*
* Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
const HAL_KEYVAL *, const u_int8_t *, int); \
_t HAL_BOOL (_a _n##_set_key_lladdr)(struct ath_hal*, \
u_int16_t, const u_int8_t *); \
+ _t HAL_BOOL (_a _n##_softcrypto)(struct ath_hal *, HAL_BOOL); \
/* Power Management Functions */ \
_t HAL_BOOL (_a _n##_set_power)(struct ath_hal*, \
HAL_POWER_MODE mode, \