FreeBSD/sys/dev/ixgbe/if_ixv.c
/*********************************************************************
 *  Device identification routine
 *
 *  ixv_probe determines if the driver should be loaded on
 *  adapter based on PCI vendor/device id of the adapter.
 *
 *  return BUS_PROBE_DEFAULT on success, positive on failure
 *********************************************************************/
Device identification routine
ixv_probe determines if the driver should be loaded on
adapter based on PCI vendor/device id of the adapter.

return BUS_PROBE_DEFAULT on success, positive on failure
Device identification routine ixv_probe determines if the driver should be loaded on adapter based on PCI vendor / device id of the adapter . return BUS_PROBE_DEFAULT on success positive on failure
static int
ixv_probe(device_t dev)
{
	ixgbe_vendor_info_t *ent;
	u16	pci_vendor_id = 0;
	u16	pci_device_id = 0;
	u16	pci_subvendor_id = 0;
	u16	pci_subdevice_id = 0;
	char	adapter_name[256];
	pci_vendor_id = pci_get_vendor(dev);
	if (pci_vendor_id != IXGBE_INTEL_VENDOR_ID)
		return (ENXIO);
	pci_device_id = pci_get_device(dev);
	pci_subvendor_id = pci_get_subvendor(dev);
	pci_subdevice_id = pci_get_subdevice(dev);
	ent = ixv_vendor_info_array;
	while (ent->vendor_id != 0) {
		if ((pci_vendor_id == ent->vendor_id) &&
		    (pci_device_id == ent->device_id) &&
		    ((pci_subvendor_id == ent->subvendor_id) ||
		     (ent->subvendor_id == 0)) &&
		    ((pci_subdevice_id == ent->subdevice_id) ||
		     (ent->subdevice_id == 0))) {
			sprintf(adapter_name, "%s, Version - %s",
				ixv_strings[ent->index],
				ixv_driver_version);
			device_set_desc_copy(dev, adapter_name);
			return (BUS_PROBE_DEFAULT);
		}
		ent++;
	}
	return (ENXIO);
}
static int ixv_probe ( device_t dev ) { ixgbe_vendor_info_t * ent ; u16 pci_vendor_id = 0 ; u16 pci_device_id = 0 ; u16 pci_subvendor_id = 0 ; u16 pci_subdevice_id = 0 ; char adapter_name [ 256 ] ; pci_vendor_id = pci_get_vendor ( dev ) ; if ( pci_vendor_id != IXGBE_INTEL_VENDOR_ID ) return ( ENXIO ) ; pci_device_id = pci_get_device ( dev ) ; pci_subvendor_id = pci_get_subvendor ( dev ) ; pci_subdevice_id = pci_get_subdevice ( dev ) ; ent = ixv_vendor_info_array ; while ( ent -> vendor_id != 0 ) { if ( ( pci_vendor_id == ent -> vendor_id ) && ( pci_device_id == ent -> device_id ) && ( ( pci_subvendor_id == ent -> subvendor_id ) || ( ent -> subvendor_id == 0 ) ) && ( ( pci_subdevice_id == ent -> subdevice_id ) || ( ent -> subdevice_id == 0 ) ) ) { sprintf ( adapter_name , " " , ixv_strings [ ent -> index ] , ixv_driver_version ) ; device_set_desc_copy ( dev , adapter_name ) ; return ( BUS_PROBE_DEFAULT ) ; } ent ++ ; } return ( ENXIO ) ; }
Device identification routine
  ixv_probe determines if the driver should be loaded on
  adapter based on PCI vendor/device id of the adapter.
Device identification routine ixv_probe determines if the driver should be loaded on adapter based on PCI vendor / device id of the adapter .