コード例 #1
0
const struct ahd_pci_identity *
ahd_find_pci_device(ahd_dev_softc_t pci)
{
	uint64_t  full_id;
	uint16_t  device;
	uint16_t  vendor;
	uint16_t  subdevice;
	uint16_t  subvendor;
	const struct ahd_pci_identity *entry;
	u_int	  i;

	vendor = ahd_pci_read_config(pci, PCIR_DEVVENDOR, 2);
	device = ahd_pci_read_config(pci, PCIR_DEVICE, 2);
	subvendor = ahd_pci_read_config(pci, PCIR_SUBVEND_0, 2);
	subdevice = ahd_pci_read_config(pci, PCIR_SUBDEV_0, 2);
	full_id = ahd_compose_id(device,
				 vendor,
				 subdevice,
				 subvendor);

	
	
	full_id &= ID_ALL_IROC_MASK;

	for (i = 0; i < ahd_num_pci_devs; i++) {
		entry = &ahd_pci_ident_table[i];
		if (entry->full_id == (full_id & entry->id_mask)) {
			
			if (entry->name == NULL)
				return (NULL);
			return (entry);
		}
	}
	return (NULL);
}
コード例 #2
0
struct ahd_pci_identity *
ahd_find_pci_device(ahd_dev_softc_t pci)
{
	uint64_t  full_id;
	uint16_t  device;
	uint16_t  vendor;
	uint16_t  subdevice;
	uint16_t  subvendor;
	struct	  ahd_pci_identity *entry;
	u_int	  i;

	vendor = ahd_pci_read_config(pci, PCIR_DEVVENDOR, /*bytes*/2);
	device = ahd_pci_read_config(pci, PCIR_DEVICE, /*bytes*/2);
	subvendor = ahd_pci_read_config(pci, PCIR_SUBVEND_0, /*bytes*/2);
	subdevice = ahd_pci_read_config(pci, PCIR_SUBDEV_0, /*bytes*/2);
	full_id = ahd_compose_id(device,
				 vendor,
				 subdevice,
				 subvendor);

	for (i = 0; i < ahd_num_pci_devs; i++) {
		entry = &ahd_pci_ident_table[i];
		if (entry->full_id == (full_id & entry->id_mask)) {
			/* Honor exclusion entries. */
			if (entry->name == NULL)
				return (NULL);
			return (entry);
		}
	}
	return (NULL);
}
コード例 #3
0
ファイル: aic79xx_pci.c プロジェクト: coyizumi/cs111
struct ahd_pci_identity *
ahd_find_pci_device(aic_dev_softc_t pci)
{
	uint64_t  full_id;
	uint16_t  device;
	uint16_t  vendor;
	uint16_t  subdevice;
	uint16_t  subvendor;
	struct	  ahd_pci_identity *entry;
	u_int	  i;

	vendor = aic_pci_read_config(pci, PCIR_DEVVENDOR, /*bytes*/2);
	device = aic_pci_read_config(pci, PCIR_DEVICE, /*bytes*/2);
	subvendor = aic_pci_read_config(pci, PCIR_SUBVEND_0, /*bytes*/2);
	subdevice = aic_pci_read_config(pci, PCIR_SUBDEV_0, /*bytes*/2);

	if ((vendor == ADAPTECVENDORID) && (subvendor == SUBVENDOR9005)) {
		if ((device == DEVICE8081) || (device == DEVICE8088) || 
			(device == DEVICE8089)) {
			printf("Controller device ID conflict with PMC Adaptec HBA\n");
			return (NULL);
		}
	}

	full_id = ahd_compose_id(device,
				 vendor,
				 subdevice,
				 subvendor);

	/*
	 * If we are configured to attach to HostRAID
	 * controllers, mask out the IROC/HostRAID bit
	 * in the 
	 */
	if (ahd_attach_to_HostRAID_controllers)
		full_id &= ID_ALL_IROC_MASK;

	for (i = 0; i < ahd_num_pci_devs; i++) {
		entry = &ahd_pci_ident_table[i];
		if (entry->full_id == (full_id & entry->id_mask)) {
			/* Honor exclusion entries. */
			if (entry->name == NULL)
				return (NULL);
			return (entry);
		}
	}
	return (NULL);
}
コード例 #4
0
static const struct ahd_pci_identity *
ahd_find_pci_device(pcireg_t id, pcireg_t subid)
{
	u_int64_t  full_id;
	const struct	   ahd_pci_identity *entry;
	u_int	   i;

	full_id = ahd_compose_id(PCI_PRODUCT(id), PCI_VENDOR(id),
				 PCI_PRODUCT(subid), PCI_VENDOR(subid));

	for (i = 0; i < ahd_num_pci_devs; i++) {
		entry = &ahd_pci_ident_table[i];
		if (entry->full_id == (full_id & entry->id_mask))
			return (entry);
	}
	return (NULL);
}