summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2001-06-29 21:52:43 +0000
committerJason Wright <jason@cvs.openbsd.org>2001-06-29 21:52:43 +0000
commit7ef9f514b387475baa51f83caad0366a0ff362aa (patch)
treeaff27f4a361366ae8f6b8ce24143dedd64686753 /sys/dev
parentf859f6a737df43805988f21a7004ccd010a3b34d (diff)
move definitions around a bit and define a few more constants
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/ubsec.c17
-rw-r--r--sys/dev/pci/ubsecreg.h7
-rw-r--r--sys/dev/pci/ubsecvar.h21
3 files changed, 22 insertions, 23 deletions
diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c
index ed967ce847b..77f2e95e1dc 100644
--- a/sys/dev/pci/ubsec.c
+++ b/sys/dev/pci/ubsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubsec.c,v 1.63 2001/06/29 16:19:15 jason Exp $ */
+/* $OpenBSD: ubsec.c,v 1.64 2001/06/29 21:52:41 jason Exp $ */
/*
* Copyright (c) 2000 Jason L. Wright (jason@thought.net)
@@ -335,8 +335,8 @@ ubsec_feed(sc)
void *v, *mcr2;
npkts = sc->sc_nqueue;
- if (npkts > 5)
- npkts = 5;
+ if (npkts > UBS_MAX_AGGR)
+ npkts = UBS_MAX_AGGR;
if (npkts < 2)
goto feed1;
goto feed1;
@@ -795,10 +795,10 @@ ubsec_process(crp)
if (crp->crp_flags & CRYPTO_F_IMBUF)
q->q_src_l = mbuf2pages(q->q_src_m, &q->q_src_npa, q->q_src_packp,
- q->q_src_packl, MAX_SCATTER, &nicealign);
+ q->q_src_packl, UBS_MAX_SCATTER, &nicealign);
else if (crp->crp_flags & CRYPTO_F_IOV)
q->q_src_l = iov2pages(q->q_src_io, &q->q_src_npa,
- q->q_src_packp, q->q_src_packl, MAX_SCATTER, &nicealign);
+ q->q_src_packp, q->q_src_packl, UBS_MAX_SCATTER, &nicealign);
if (q->q_src_l == 0) {
err = ENOMEM;
goto errout;
@@ -933,10 +933,10 @@ ubsec_process(crp)
if (crp->crp_flags & CRYPTO_F_IMBUF)
q->q_dst_l = mbuf2pages(q->q_dst_m, &q->q_dst_npa,
- q->q_dst_packp, q->q_dst_packl, MAX_SCATTER, NULL);
+ q->q_dst_packp, q->q_dst_packl, UBS_MAX_SCATTER, NULL);
else if (crp->crp_flags & CRYPTO_F_IOV)
q->q_dst_l = iov2pages(q->q_dst_io, &q->q_dst_npa,
- q->q_dst_packp, q->q_dst_packl, MAX_SCATTER, NULL);
+ q->q_dst_packp, q->q_dst_packl, UBS_MAX_SCATTER, NULL);
#ifdef UBSEC_DEBUG
printf("dst skip: %d\n", dskip);
@@ -963,9 +963,6 @@ ubsec_process(crp)
else
pb = &q->q_dstpkt[j - 1];
-#ifdef UBSEC_DEBUG
- printf(" pb v %08x p %08x\n", pb, vtophys(pb));
-#endif
pb->pb_addr = q->q_dst_packp[i];
if (dtheend) {
diff --git a/sys/dev/pci/ubsecreg.h b/sys/dev/pci/ubsecreg.h
index 15d60e44bed..5c2828bb7fa 100644
--- a/sys/dev/pci/ubsecreg.h
+++ b/sys/dev/pci/ubsecreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubsecreg.h,v 1.13 2001/05/30 02:26:14 jason Exp $ */
+/* $OpenBSD: ubsecreg.h,v 1.14 2001/06/29 21:52:42 jason Exp $ */
/*
* Copyright (c) 2000 Theo de Raadt
@@ -71,11 +71,6 @@
#define BS_ERR_ADDR 0xfffffffc /* error address mask */
#define BS_ERR_READ 0x00000002 /* fault was on read */
-#define UBSEC_CARD(sid) (((sid) & 0xf0000000) >> 28)
-#define UBSEC_SESSION(sid) ( (sid) & 0x0fffffff)
-#define UBSEC_SID(crd, sesn) (((crd) << 28) | ((sesn) & 0x0fffffff))
-#define MAX_SCATTER 64
-
struct ubsec_pktctx {
u_int32_t pc_deskey[6]; /* 3DES key */
u_int32_t pc_hminner[5]; /* hmac inner state */
diff --git a/sys/dev/pci/ubsecvar.h b/sys/dev/pci/ubsecvar.h
index d75eda9a2fb..3af1d449812 100644
--- a/sys/dev/pci/ubsecvar.h
+++ b/sys/dev/pci/ubsecvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubsecvar.h,v 1.20 2001/06/29 16:19:15 jason Exp $ */
+/* $OpenBSD: ubsecvar.h,v 1.21 2001/06/29 21:52:42 jason Exp $ */
/*
* Copyright (c) 2000 Theo de Raadt
@@ -32,6 +32,13 @@
#define UBS_MAX_NQUEUE 60
#endif
+#define UBS_MAX_SCATTER 64 /* Maximum scatter/gather depth */
+#define UBS_MAX_AGGR 5 /* Maximum aggregation count */
+
+#define UBSEC_CARD(sid) (((sid) & 0xf0000000) >> 28)
+#define UBSEC_SESSION(sid) ( (sid) & 0x0fffffff)
+#define UBSEC_SID(crd, sesn) (((crd) << 28) | ((sesn) & 0x0fffffff))
+
struct ubsec_dma_alloc {
u_int32_t dma_paddr;
caddr_t dma_vaddr;
@@ -90,19 +97,19 @@ struct ubsec_q {
SIMPLEQ_ENTRY(ubsec_q) q_next;
struct cryptop *q_crp;
struct ubsec_mcr *q_mcr;
- struct ubsec_pktbuf q_srcpkt[MAX_SCATTER-1];
- struct ubsec_pktbuf q_dstpkt[MAX_SCATTER-1];
+ struct ubsec_pktbuf q_srcpkt[UBS_MAX_SCATTER-1];
+ struct ubsec_pktbuf q_dstpkt[UBS_MAX_SCATTER-1];
struct ubsec_dma *q_dma;
struct mbuf *q_src_m, *q_dst_m;
struct uio *q_src_io, *q_dst_io;
- long q_src_packp[MAX_SCATTER];
- int q_src_packl[MAX_SCATTER];
+ long q_src_packp[UBS_MAX_SCATTER];
+ int q_src_packl[UBS_MAX_SCATTER];
int q_src_npa, q_src_l;
- long q_dst_packp[MAX_SCATTER];
- int q_dst_packl[MAX_SCATTER];
+ long q_dst_packp[UBS_MAX_SCATTER];
+ int q_dst_packl[UBS_MAX_SCATTER];
int q_dst_npa, q_dst_l;
u_int32_t q_macbuf[5];
int q_sesn;