summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2003-02-17 16:48:23 +0000
committerJason Wright <jason@cvs.openbsd.org>2003-02-17 16:48:23 +0000
commitc217fded180b300fe4b23aa6d85051a2da519de8 (patch)
tree401210e0a3bd67561472235641cbaad6e7741612
parent9e11ca43e970ad7b99211258ca4f0a4c7e105888 (diff)
whitespace, typos, and compression structure defns
-rw-r--r--sys/dev/pci/hifn7751.c18
-rw-r--r--sys/dev/pci/hifn7751reg.h20
-rw-r--r--sys/dev/pci/hifn7751var.h12
3 files changed, 34 insertions, 16 deletions
diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c
index 81acb78a7e0..f4a367e05a1 100644
--- a/sys/dev/pci/hifn7751.c
+++ b/sys/dev/pci/hifn7751.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hifn7751.c,v 1.136 2003/02/15 23:39:12 jason Exp $ */
+/* $OpenBSD: hifn7751.c,v 1.137 2003/02/17 16:48:22 jason Exp $ */
/*
* Invertex AEON / Hifn 7751 driver
@@ -1931,9 +1931,9 @@ hifn_process(crp)
}
} else {
if ((crd1->crd_alg == CRYPTO_MD5_HMAC ||
- crd1->crd_alg == CRYPTO_SHA1_HMAC ||
- crd1->crd_alg == CRYPTO_MD5 ||
- crd1->crd_alg == CRYPTO_SHA1) &&
+ crd1->crd_alg == CRYPTO_SHA1_HMAC ||
+ crd1->crd_alg == CRYPTO_MD5 ||
+ crd1->crd_alg == CRYPTO_SHA1) &&
(crd2->crd_alg == CRYPTO_DES_CBC ||
crd2->crd_alg == CRYPTO_3DES_CBC ||
crd2->crd_alg == CRYPTO_ARC4) &&
@@ -1945,9 +1945,9 @@ hifn_process(crp)
crd1->crd_alg == CRYPTO_ARC4 ||
crd1->crd_alg == CRYPTO_3DES_CBC) &&
(crd2->crd_alg == CRYPTO_MD5_HMAC ||
- crd2->crd_alg == CRYPTO_SHA1_HMAC ||
- crd2->crd_alg == CRYPTO_MD5 ||
- crd2->crd_alg == CRYPTO_SHA1) &&
+ crd2->crd_alg == CRYPTO_SHA1_HMAC ||
+ crd2->crd_alg == CRYPTO_MD5 ||
+ crd2->crd_alg == CRYPTO_SHA1) &&
(crd1->crd_flags & CRD_F_ENCRYPT)) {
enccrd = crd1;
maccrd = crd2;
@@ -2036,7 +2036,7 @@ hifn_process(crp)
cmd->mac_masks |= HIFN_MAC_CMD_ALG_MD5 |
HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HASH |
HIFN_MAC_CMD_POS_IPSEC;
- break;
+ break;
case CRYPTO_MD5_HMAC:
cmd->mac_masks |= HIFN_MAC_CMD_ALG_MD5 |
HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HMAC |
@@ -2279,7 +2279,7 @@ hifn_callback(sc, cmd, macbuf)
if (crp->crp_flags & CRYPTO_F_IMBUF)
m_copyback((struct mbuf *)crp->crp_buf,
- crd->crd_inject, len, macbuf);
+ crd->crd_inject, len, macbuf);
else if ((crp->crp_flags & CRYPTO_F_IOV) && crp->crp_mac)
bcopy((caddr_t)macbuf, crp->crp_mac, len);
break;
diff --git a/sys/dev/pci/hifn7751reg.h b/sys/dev/pci/hifn7751reg.h
index 1bf462fdd9c..b24fafcebd7 100644
--- a/sys/dev/pci/hifn7751reg.h
+++ b/sys/dev/pci/hifn7751reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: hifn7751reg.h,v 1.40 2003/02/15 23:39:13 jason Exp $ */
+/* $OpenBSD: hifn7751reg.h,v 1.41 2003/02/17 16:48:22 jason Exp $ */
/*
* Invertex AEON / Hifn 7751 driver
@@ -439,6 +439,24 @@ struct hifn_mac_command {
#define HIFN_MAC_CMD_POS_IPSEC 0x0200
#define HIFN_MAC_CMD_NEW_KEY 0x0800
+struct hifn_comp_command {
+ volatile u_int16_t masks;
+ volatile u_int16_t header_skip;
+ volatile u_int16_t source_count;
+ volatile u_int16_t reserved;
+};
+
+#define HIFN_COMP_CMD_SRCLEN_M 0xc000
+#define HIFN_COMP_CMD_SRCLEN_S 14
+#define HIFN_COMP_CMD_ONE 0x0100 /* must be one */
+#define HIFN_COMP_CMD_CLEARHIST 0x0010 /* clear history */
+#define HIFN_COMP_CMD_UPDATEHIST 0x0008 /* update history */
+#define HIFN_COMP_CMD_LZS_STRIP0 0x0004 /* LZS: strip zero */
+#define HIFN_COMP_CMD_MPPC_RESTART 0x0004 /* MPPC: restart */
+#define HIFN_COMP_CMD_ALG_MASK 0x0001 /* compression mode: */
+#define HIFN_COMP_CMD_ALG_MPPC 0x0001 /* MPPC */
+#define HIFN_COMP_CMD_ALG_LZS 0x0000 /* LZS */
+
/*
* The poll frequency and poll scalar defines are unshifted values used
* to set fields in the DMA Configuration Register.
diff --git a/sys/dev/pci/hifn7751var.h b/sys/dev/pci/hifn7751var.h
index c4a4e0025ad..31afba74e7c 100644
--- a/sys/dev/pci/hifn7751var.h
+++ b/sys/dev/pci/hifn7751var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: hifn7751var.h,v 1.46 2003/01/05 20:07:44 deraadt Exp $ */
+/* $OpenBSD: hifn7751var.h,v 1.47 2003/02/17 16:48:22 jason Exp $ */
/*
* Invertex AEON / Hifn 7751 driver
@@ -107,6 +107,11 @@ struct hifn_session {
u_int8_t hs_iv[HIFN_IV_LENGTH];
};
+/* We use a state machine on sessions */
+#define HS_STATE_FREE 0 /* unused session entry */
+#define HS_STATE_USED 1 /* allocated, but key not on card */
+#define HS_STATE_KEY 2 /* allocated and key is on card */
+
#define HIFN_RING_SYNC(sc, r, i, f) \
bus_dmamap_sync((sc)->sc_dmat, (sc)->sc_dmamap, \
offsetof(struct hifn_dma, r[i]), sizeof(struct hifn_desc), (f))
@@ -126,11 +131,6 @@ struct hifn_session {
offsetof(struct hifn_dma, result_bufs[(i)][0]), \
HIFN_MAX_RESULT, (f))
-/* We use a state machine to on sessions */
-#define HS_STATE_FREE 0 /* unused session entry */
-#define HS_STATE_USED 1 /* allocated, but key not on card */
-#define HS_STATE_KEY 2 /* allocated and key is on card */
-
/*
* Holds data specific to a single HIFN board.
*/