diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-03-10 19:54:25 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-03-10 19:54:25 +0000 |
commit | be14c55d489e58f3ab7be4c8e95236a8e54673a0 (patch) | |
tree | 480915e9ccbf1f7c75f9e4720b696e6a51da2dd5 /sys/dev | |
parent | cf1b4e08510bc8999948bda7359768d09c39a204 (diff) |
repair ramcfg whacking code; mickey
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/aeon.c | 18 | ||||
-rw-r--r-- | sys/dev/pci/hifn7751.c | 18 |
2 files changed, 10 insertions, 26 deletions
diff --git a/sys/dev/pci/aeon.c b/sys/dev/pci/aeon.c index 1a14103f4aa..82205674fbe 100644 --- a/sys/dev/pci/aeon.c +++ b/sys/dev/pci/aeon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aeon.c,v 1.7 2000/03/10 08:44:59 mickey Exp $ */ +/* $OpenBSD: aeon.c,v 1.8 2000/03/10 19:54:24 deraadt Exp $ */ /* * Invertex AEON driver @@ -342,12 +342,14 @@ aeon_enable_crypto(sc, pciid) return (1); } + ramcfg = READ_REG_0(sc, AEON_RAM_CONFIG); + dmacfg = READ_REG_1(sc, AEON_DMA_CFG); + /* * The RAM config register's encrypt level bit needs to be set before * every read performed on the encryption level register. */ - WRITE_REG_0(sc, AEON_RAM_CONFIG, - READ_REG_0(sc, AEON_RAM_CONFIG) | (0x1 << 5)); + WRITE_REG_0(sc, AEON_RAM_CONFIG, ramcfg | 0x20); encl = READ_REG_0(sc, AEON_CRYPTLEVEL); @@ -360,21 +362,11 @@ aeon_enable_crypto(sc, pciid) printf("%s: Strong Crypto already enabled!\n", sc->sc_dv.dv_xname); #endif -#if 0 - /* XXX impossible, this writes garbage to these registers */ WRITE_REG_0(sc, AEON_RAM_CONFIG, ramcfg); WRITE_REG_1(sc, AEON_DMA_CFG, dmacfg); -#endif return 0; /* success */ } - ramcfg = READ_REG_0(sc, AEON_RAM_CONFIG); - dmacfg = READ_REG_1(sc, AEON_DMA_CFG); - - WRITE_REG_0(sc, AEON_RAM_CONFIG, ramcfg | 0x20); - - encl = READ_REG_0(sc, AEON_CRYPTLEVEL); - if (encl != 0 && encl != 0x3020) { #ifdef AEON_DEBUG printf("%: Unknown encryption level\n", sc->sc_dv.dv_xname); diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c index 9de73d92b4b..05e0b4ce2ae 100644 --- a/sys/dev/pci/hifn7751.c +++ b/sys/dev/pci/hifn7751.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hifn7751.c,v 1.7 2000/03/10 08:44:59 mickey Exp $ */ +/* $OpenBSD: hifn7751.c,v 1.8 2000/03/10 19:54:24 deraadt Exp $ */ /* * Invertex AEON driver @@ -342,12 +342,14 @@ aeon_enable_crypto(sc, pciid) return (1); } + ramcfg = READ_REG_0(sc, AEON_RAM_CONFIG); + dmacfg = READ_REG_1(sc, AEON_DMA_CFG); + /* * The RAM config register's encrypt level bit needs to be set before * every read performed on the encryption level register. */ - WRITE_REG_0(sc, AEON_RAM_CONFIG, - READ_REG_0(sc, AEON_RAM_CONFIG) | (0x1 << 5)); + WRITE_REG_0(sc, AEON_RAM_CONFIG, ramcfg | 0x20); encl = READ_REG_0(sc, AEON_CRYPTLEVEL); @@ -360,21 +362,11 @@ aeon_enable_crypto(sc, pciid) printf("%s: Strong Crypto already enabled!\n", sc->sc_dv.dv_xname); #endif -#if 0 - /* XXX impossible, this writes garbage to these registers */ WRITE_REG_0(sc, AEON_RAM_CONFIG, ramcfg); WRITE_REG_1(sc, AEON_DMA_CFG, dmacfg); -#endif return 0; /* success */ } - ramcfg = READ_REG_0(sc, AEON_RAM_CONFIG); - dmacfg = READ_REG_1(sc, AEON_DMA_CFG); - - WRITE_REG_0(sc, AEON_RAM_CONFIG, ramcfg | 0x20); - - encl = READ_REG_0(sc, AEON_CRYPTLEVEL); - if (encl != 0 && encl != 0x3020) { #ifdef AEON_DEBUG printf("%: Unknown encryption level\n", sc->sc_dv.dv_xname); |