summaryrefslogtreecommitdiff
path: root/sys/dev/pci/hifn7751.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2000-04-11 16:22:10 +0000
committerJason Wright <jason@cvs.openbsd.org>2000-04-11 16:22:10 +0000
commitbded0e9688e11da5c175a71cadab6d48538b5bf6 (patch)
treea82e4d125063cd3711e63776aa4059c0aa1c582b /sys/dev/pci/hifn7751.c
parente33a189c92fc273250fcade0eaaed736146c7789 (diff)
- Don't bother with PCI_COMMAND_IO_ENABLE, the card doesn't support it.
- remove some debugging code - fix arguments to last call to crypto_register() - for sram boards, only check 1mb of ram - when the rings are full, call the crp->callback with crp->crp_etype == ENOMEM so it can clean up, then return 0 - some KNF
Diffstat (limited to 'sys/dev/pci/hifn7751.c')
-rw-r--r--sys/dev/pci/hifn7751.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c
index 74be7d6ba0d..1ba05a7d510 100644
--- a/sys/dev/pci/hifn7751.c
+++ b/sys/dev/pci/hifn7751.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hifn7751.c,v 1.27 2000/04/10 18:40:47 jason Exp $ */
+/* $OpenBSD: hifn7751.c,v 1.28 2000/04/11 16:22:09 jason Exp $ */
/*
* Invertex AEON / Hi/fn 7751 driver
@@ -146,8 +146,7 @@ hifn_attach(parent, self, aux)
caddr_t kva;
cmd = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
- cmd |= PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE |
- PCI_COMMAND_MASTER_ENABLE;
+ cmd |= PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE;
pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, cmd);
cmd = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
@@ -175,9 +174,6 @@ hifn_attach(parent, self, aux)
return;
}
sc->sc_st1 = pa->pa_memt;
-#ifdef HIFN_DEBUG
- printf(" mem %x %x", sc->sc_sh0, sc->sc_sh1);
-#endif
sc->sc_dmat = pa->pa_dmat;
if (bus_dmamem_alloc(sc->sc_dmat, sizeof(*sc->sc_dma), PAGE_SIZE, 0,
@@ -283,7 +279,7 @@ hifn_attach(parent, self, aux)
crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC96,
NULL, NULL, NULL);
crypto_register(sc->sc_cid, CRYPTO_DES_CBC,
- hifn_newsession, hifn_freesession, hifn_process);
+ NULL, NULL, NULL);
}
}
@@ -559,7 +555,7 @@ hifn_sramsize(sc)
hifn_reset_board(sc);
hifn_init_dma(sc);
hifn_init_pci_registers(sc);
- end = 1 << 21; /* 2MB */
+ end = 1 << 20; /* 1MB */
for (a = 0; a < end; a += 16384) {
if (hifn_checkramaddr(sc, a) < 0)
return (0);
@@ -1515,7 +1511,8 @@ errout:
else
hifnstats.hst_nomem++;
crp->crp_etype = err;
- return (crp->crp_callback(crp));
+ crp->crp_callback(crp);
+ return (0);
}
void
@@ -1550,7 +1547,7 @@ hifn_callback(cmd, macbuf)
crd->crd_alg != CRYPTO_SHA1_HMAC96)
continue;
m_copyback((struct mbuf *)crp->crp_buf,
- crd->crd_inject, 12, macbuf);
+ crd->crd_inject, 12, macbuf);
break;
}
}