Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hifn/hifn7751.c
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | |||||
static int hifn_suspend(device_t); | static int hifn_suspend(device_t); | ||||
static int hifn_resume(device_t); | static int hifn_resume(device_t); | ||||
static int hifn_shutdown(device_t); | static int hifn_shutdown(device_t); | ||||
static int hifn_newsession(device_t, u_int32_t *, struct cryptoini *); | static int hifn_newsession(device_t, u_int32_t *, struct cryptoini *); | ||||
static int hifn_freesession(device_t, u_int64_t); | static int hifn_freesession(device_t, u_int64_t); | ||||
static int hifn_process(device_t, struct cryptop *, int); | static int hifn_process(device_t, struct cryptop *, int); | ||||
static struct hifn_dev { | struct pci_device_table hifn_devs[] = { | ||||
uint16_t vendorid; | {PCI_DEV(PCI_VENDOR_INVERTEX, PCI_PRODUCT_INVERTEX_AEON)}, | ||||
uint16_t deviceid; | {PCI_DEV(PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7751)}, | ||||
} hifn_devs[] = { | {PCI_DEV(PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7951)}, | ||||
{PCI_VENDOR_INVERTEX, PCI_PRODUCT_INVERTEX_AEON}, | {PCI_DEV(PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7955)}, | ||||
{PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7751}, | {PCI_DEV(PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7956)}, | ||||
{PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7951}, | {PCI_DEV(PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7811)}, | ||||
{PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7955}, | {PCI_DEV(PCI_VENDOR_NETSEC, PCI_PRODUCT_NETSEC_7751)} | ||||
{PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7956}, | |||||
{PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7811}, | |||||
{PCI_VENDOR_NETSEC, PCI_PRODUCT_NETSEC_7751}, | |||||
{0, 0}, | |||||
}; | }; | ||||
static device_method_t hifn_methods[] = { | static device_method_t hifn_methods[] = { | ||||
/* Device interface */ | /* Device interface */ | ||||
DEVMETHOD(device_probe, hifn_probe), | DEVMETHOD(device_probe, hifn_probe), | ||||
DEVMETHOD(device_attach, hifn_attach), | DEVMETHOD(device_attach, hifn_attach), | ||||
DEVMETHOD(device_detach, hifn_detach), | DEVMETHOD(device_detach, hifn_detach), | ||||
Show All 11 Lines | |||||
static driver_t hifn_driver = { | static driver_t hifn_driver = { | ||||
"hifn", | "hifn", | ||||
hifn_methods, | hifn_methods, | ||||
sizeof (struct hifn_softc) | sizeof (struct hifn_softc) | ||||
}; | }; | ||||
static devclass_t hifn_devclass; | static devclass_t hifn_devclass; | ||||
DRIVER_MODULE(hifn, pci, hifn_driver, hifn_devclass, 0, 0); | DRIVER_MODULE(hifn, pci, hifn_driver, hifn_devclass, 0, 0); | ||||
MODULE_PNP_INFO("U16:vendor;U16:device", pci, hifn, hifn_devs, | PCI_PNP_INFO(hifn_devs); | ||||
sizeof(hifn_devs[0]), nitems(hifn_devs) - 1); | |||||
MODULE_DEPEND(hifn, crypto, 1, 1, 1); | MODULE_DEPEND(hifn, crypto, 1, 1, 1); | ||||
#ifdef HIFN_RNDTEST | #ifdef HIFN_RNDTEST | ||||
MODULE_DEPEND(hifn, rndtest, 1, 1, 1); | MODULE_DEPEND(hifn, rndtest, 1, 1, 1); | ||||
#endif | #endif | ||||
static void hifn_reset_board(struct hifn_softc *, int); | static void hifn_reset_board(struct hifn_softc *, int); | ||||
static void hifn_reset_puc(struct hifn_softc *); | static void hifn_reset_puc(struct hifn_softc *); | ||||
static void hifn_puc_wait(struct hifn_softc *); | static void hifn_puc_wait(struct hifn_softc *); | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Probe for a supported device. The PCI vendor and device | * Probe for a supported device. The PCI vendor and device | ||||
* IDs are used to detect devices we know how to handle. | * IDs are used to detect devices we know how to handle. | ||||
*/ | */ | ||||
static int | static int | ||||
hifn_probe(device_t dev) | hifn_probe(device_t dev) | ||||
{ | { | ||||
const struct hifn_dev *hifd; | const struct pci_device_table *hifd; | ||||
size_t i; | |||||
u_int16_t vid; | |||||
u_int16_t did; | |||||
vid = pci_get_vendor(dev); | hifd = PCI_MATCH(dev, hifn_devs); | ||||
did = pci_get_device(dev); | if (hifd == NULL) | ||||
for (i = 0; i < nitems(hifn_devs); i++) { | |||||
hifd = &hifn_devs[i]; | |||||
if ((hifd->vendorid == vid) && | |||||
(hifd->deviceid == did)) { | |||||
return (BUS_PROBE_DEFAULT); | |||||
} | |||||
} | |||||
return (ENXIO); | return (ENXIO); | ||||
return (BUS_PROBE_DEFAULT); | |||||
} | } | ||||
static void | static void | ||||
hifn_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) | hifn_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) | ||||
{ | { | ||||
bus_addr_t *paddr = (bus_addr_t*) arg; | bus_addr_t *paddr = (bus_addr_t*) arg; | ||||
*paddr = segs->ds_addr; | *paddr = segs->ds_addr; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2,703 Lines • Show Last 20 Lines |