From d95ce12a0ec6b6a5517a06fe2878b7b8054501d2 Mon Sep 17 00:00:00 2001 From: jason Date: Wed, 29 Mar 2000 21:03:11 +0000 Subject: [PATCH] remove round-robin use of the boards. We're depending on the upper layer being more intelligent about allocation in the future. --- sys/dev/pci/hifn7751.c | 22 +++++++--------------- sys/dev/pci/hifn7751var.h | 3 +-- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c index 4e8e648beeb..87f87b7118d 100644 --- a/sys/dev/pci/hifn7751.c +++ b/sys/dev/pci/hifn7751.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hifn7751.c,v 1.17 2000/03/29 20:54:59 jason Exp $ */ +/* $OpenBSD: hifn7751.c,v 1.18 2000/03/29 21:03:11 jason Exp $ */ /* * Invertex AEON / Hi/fn 7751 driver @@ -93,6 +93,7 @@ int hifn_process __P((struct cryptop *)); void hifn_callback __P((struct hifn_command *)); void hifn_timeout __P((void *)); void hifn_print_stats __P((struct hifn_softc *)); +int hifn_crypto __P((struct hifn_softc *, hifn_command_t *)); int hifn_probe(parent, match, aux) @@ -1003,25 +1004,16 @@ hifn_mbuf(m, np, pp, lp, maxp, nicep) } int -hifn_crypto(struct hifn_command *cmd) +hifn_crypto(sc, cmd) + struct hifn_softc *sc; + struct hifn_command *cmd; { u_int32_t cmdlen; - static u_int32_t current_device = 0; - struct hifn_softc *sc; - struct hifn_dma *dma; + struct hifn_dma *dma = sc->sc_dma; struct hifn_command_buf_data cmd_buf_data; int cmdi, srci, dsti, resi, nicealign = 0; int error, s, i; - /* Pick the hifn board to send the data to. Right now we use a round - * robin approach. */ - sc = hifn_cd.cd_devs[current_device]; - current_device++; - if (current_device == hifn_cd.cd_ndevs || - hifn_cd.cd_devs[current_device] == NULL) - current_device = 0; - dma = sc->sc_dma; - if (cmd->src_npa == 0 && cmd->src_m) cmd->src_l = hifn_mbuf(cmd->src_m, &cmd->src_npa, cmd->src_packp, cmd->src_packl, MAX_SCATTER, &nicealign); @@ -1410,7 +1402,7 @@ hifn_process(crp) cmd->private_data = (u_long)crp; cmd->dest_ready_callback = hifn_callback; - if (hifn_crypto(cmd) == 0) + if (hifn_crypto(sc, cmd) == 0) return (0); errout: diff --git a/sys/dev/pci/hifn7751var.h b/sys/dev/pci/hifn7751var.h index 4b758174348..b4d8f779838 100644 --- a/sys/dev/pci/hifn7751var.h +++ b/sys/dev/pci/hifn7751var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hifn7751var.h,v 1.7 2000/03/29 20:54:59 jason Exp $ */ +/* $OpenBSD: hifn7751var.h,v 1.8 2000/03/29 21:03:11 jason Exp $ */ /* * Invertex AEON / Hi/fn 7751 driver @@ -272,7 +272,6 @@ typedef struct hifn_command { * behaviour was requested. * *************************************************************************/ -int hifn_crypto __P((hifn_command_t *command)); /* * Convert back and forth from 'sid' to 'card' and 'session' -- 2.20.1