diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2008-08-29 10:05:01 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2008-08-29 10:05:01 +0000 |
commit | 036478ff19f5df6938f2fd985d960eb66b5231ae (patch) | |
tree | 37f6870bb1faa8c7d83c47b04f2145b7498c5827 /sys/dev/ic/ar5210.c | |
parent | 70f8ff43495eccb24cff14a6387bcc43041808bb (diff) |
add a HAL function to force disabling the hardware crypto engine
Diffstat (limited to 'sys/dev/ic/ar5210.c')
-rw-r--r-- | sys/dev/ic/ar5210.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/sys/dev/ic/ar5210.c b/sys/dev/ic/ar5210.c index ee600939c29..2d8270a5176 100644 --- a/sys/dev/ic/ar5210.c +++ b/sys/dev/ic/ar5210.c @@ -1,4 +1,4 @@ -/* $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> @@ -132,6 +132,7 @@ ar5k_ar5210_fill(struct ath_hal *hal) 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 @@ -1915,6 +1916,28 @@ ar5k_ar5210_set_key_lladdr(struct ath_hal *hal, u_int16_t entry, 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 */ |