Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hifn/hifn7751.c
Context not available. | |||||
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 { | |||||
uint16_t vendorid; | |||||
uint16_t deviceid; | |||||
} hifn_devs[] = { | |||||
{PCI_VENDOR_INVERTEX, PCI_PRODUCT_INVERTEX_AEON}, | |||||
{PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7751}, | |||||
{PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7951}, | |||||
{PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7955}, | |||||
{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), | ||||
Context not available. | |||||
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, | |||||
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); | ||||
Context not available. | |||||
static int | static int | ||||
hifn_probe(device_t dev) | hifn_probe(device_t dev) | ||||
{ | { | ||||
if (pci_get_vendor(dev) == PCI_VENDOR_INVERTEX && | const struct hifn_dev *hifd; | ||||
pci_get_device(dev) == PCI_PRODUCT_INVERTEX_AEON) | size_t i; | ||||
return (BUS_PROBE_DEFAULT); | u_int16_t vid; | ||||
if (pci_get_vendor(dev) == PCI_VENDOR_HIFN && | u_int16_t did; | ||||
(pci_get_device(dev) == PCI_PRODUCT_HIFN_7751 || | |||||
pci_get_device(dev) == PCI_PRODUCT_HIFN_7951 || | vid = pci_get_vendor(dev); | ||||
pci_get_device(dev) == PCI_PRODUCT_HIFN_7955 || | did = pci_get_device(dev); | ||||
pci_get_device(dev) == PCI_PRODUCT_HIFN_7956 || | for (i = 0; i < nitems(hifn_devs); i++) { | ||||
pci_get_device(dev) == PCI_PRODUCT_HIFN_7811)) | hifd = &hifn_devs[i]; | ||||
return (BUS_PROBE_DEFAULT); | if ((hifd->vendorid == vid) && | ||||
if (pci_get_vendor(dev) == PCI_VENDOR_NETSEC && | (hifd->deviceid == did)) { | ||||
pci_get_device(dev) == PCI_PRODUCT_NETSEC_7751) | return (BUS_PROBE_DEFAULT); | ||||
return (BUS_PROBE_DEFAULT); | } | ||||
} | |||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
Context not available. |