当前位置: 首页>>代码示例>>C++>>正文


C++ PCI_VENDOR函数代码示例

本文整理汇总了C++中PCI_VENDOR函数的典型用法代码示例。如果您正苦于以下问题:C++ PCI_VENDOR函数的具体用法?C++ PCI_VENDOR怎么用?C++ PCI_VENDOR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PCI_VENDOR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: gscpcib_match

int
gscpcib_match(struct device *parent, void *match, void *aux)
{
    struct pci_attach_args *pa = aux;

    if (PCI_CLASS(pa->pa_class) != PCI_CLASS_BRIDGE ||
            PCI_SUBCLASS(pa->pa_class) != PCI_SUBCLASS_BRIDGE_ISA)
        return (0);

    if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_NS &&
            PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_NS_SC1100_ISA)
        return (2);	/* supersede pcib(4) */

    return (0);
}
开发者ID:repos-holder,项目名称:openbsd-patches,代码行数:15,代码来源:gscpcib.c

示例2: ath_pci_match

int
ath_pci_match(struct device *parent, void *match, void *aux)
{
	const char* devname;
	struct pci_attach_args *pa = aux;
	pci_vendor_id_t vendor;

	vendor = PCI_VENDOR(pa->pa_id);
	if (vendor == 0x128c)
		vendor = PCI_VENDOR_ATHEROS;
	devname = ath_hal_probe(vendor, PCI_PRODUCT(pa->pa_id));
	if (devname)
		return 1;

	return 0;
}
开发者ID:orumin,项目名称:openbsd-efivars,代码行数:16,代码来源:if_ath_pci.c

示例3: siop_lookup_product

const struct siop_product_desc *
siop_lookup_product(uint32_t id, int rev)
{
	const struct siop_product_desc *pp;
	const struct siop_product_desc *rp = NULL;

	if (PCI_VENDOR(id) != PCI_VENDOR_SYMBIOS)
		return NULL;

	for (pp = siop_products; pp->name != NULL; pp++) {
		if (PCI_PRODUCT(id) == pp->product && pp->revision <= rev)
			if (rp == NULL || pp->revision > rp->revision)
				rp = pp;
	}
	return rp;
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:16,代码来源:siop_pci_common.c

示例4: mfi_pci_find_device

const struct mfi_pci_device *
mfi_pci_find_device(struct pci_attach_args *pa)
{
	const struct mfi_pci_device *mpd;
	int i;

	for (i = 0; i < sizeofa(mfi_pci_devices); i++) {
		mpd = &mfi_pci_devices[i];

		if (mpd->mpd_vendor == PCI_VENDOR(pa->pa_id) &&
		    mpd->mpd_product == PCI_PRODUCT(pa->pa_id))
			return (mpd);
	}

	return (NULL);
}
开发者ID:repos-holder,项目名称:openbsd-patches,代码行数:16,代码来源:mfi_pci.c

示例5: viaide_lookup

static const struct pciide_product_desc *
viaide_lookup(pcireg_t id)
{

	switch (PCI_VENDOR(id)) {
	case PCI_VENDOR_VIATECH:
		return (pciide_lookup_product(id, pciide_via_products));

	case PCI_VENDOR_AMD:
		return (pciide_lookup_product(id, pciide_amd_products));

	case PCI_VENDOR_NVIDIA:
		return (pciide_lookup_product(id, pciide_nvidia_products));
	}
	return (NULL);
}
开发者ID:RyanLucchese,项目名称:rumpkernel-netbsd-src,代码行数:16,代码来源:viaide.c

示例6: igma_newpch_match

static int
igma_newpch_match(const struct pci_attach_args *pa)
{
	if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_INTEL)
		return 0;
	switch (0xff00 & PCI_PRODUCT(pa->pa_id)) {
	case 0x3b00: /* ibex peak */
	case 0x1c00: /* cougar point */
	case 0x1e00: /* panther point */
	case 0x8c00: /* lynx point */
	case 0x9c00: /* lynx point lp */
		return 1;
	}

	return 0;
}
开发者ID:ryoon,项目名称:netbsd-xhci,代码行数:16,代码来源:igma.c

示例7: igsfb_pci_match_by_id

static int
igsfb_pci_match_by_id(pcireg_t id)
{

	if (PCI_VENDOR(id) != PCI_VENDOR_INTEGRAPHICS)
		return 0;

	switch (PCI_PRODUCT(id)) {
	case PCI_PRODUCT_INTEGRAPHICS_IGA1682:		/* FALLTHROUGH */
	case PCI_PRODUCT_INTEGRAPHICS_CYBERPRO2000:	/* FALLTHROUGH */
	case PCI_PRODUCT_INTEGRAPHICS_CYBERPRO2010:
		return 1;
	default:
		return 0;
	}
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:16,代码来源:igsfb_pci.c

示例8: PCI_VENDOR

static struct cxgb_ident *cxgb_get_ident(struct pci_attach_args *pa)
{
    struct cxgb_ident *id;
    int vendorid, deviceid;

    vendorid = PCI_VENDOR(pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_ID_REG));
    deviceid = PCI_PRODUCT(pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_ID_REG));

    for (id = cxgb_identifiers; id->desc != NULL; id++) {
        if ((id->vendor == vendorid) &&
            (id->device == deviceid)) {
            return (id);
        }
    }
    return (NULL);
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:16,代码来源:cxgb_main.c

示例9: virtio_match

static int
virtio_match(device_t parent, cfdata_t match, void *aux)
{
	struct pci_attach_args *pa;

	pa = (struct pci_attach_args *)aux;
	switch (PCI_VENDOR(pa->pa_id)) {
	case PCI_VENDOR_QUMRANET:
		if ((0x1000 <= PCI_PRODUCT(pa->pa_id)) &&
		    (PCI_PRODUCT(pa->pa_id) <= 0x103f))
			return 1;
		break;
	}

	return 0;
}
开发者ID:arroway,项目名称:virtio_DragonFlyBSD,代码行数:16,代码来源:virtio.c

示例10: cy_pci_lookup

static const struct cy_pci_product *
cy_pci_lookup(const struct pci_attach_args *pa)
{
	const struct cy_pci_product *cp;
	int i;

	if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_CYCLADES)
		return (NULL);

	for (i = 0; i < cy_pci_nproducts; i++) {
		cp = &cy_pci_products[i];
		if (PCI_PRODUCT(pa->pa_id) == cp->cp_product)
			return (cp);
	}
	return (NULL);
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:16,代码来源:cy_pci.c

示例11: cs4280_match

static int
cs4280_match(device_t parent, cfdata_t match, void *aux)
{
	struct pci_attach_args *pa;

	pa = (struct pci_attach_args *)aux;
	if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_CIRRUS)
		return 0;
	if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CIRRUS_CS4280
#if 0  /* I can't confirm */
	    || PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CIRRUS_CS4610
#endif
	    )
		return 1;
	return 0;
}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:16,代码来源:cs4280.c

示例12: malo_pci_match

static int
malo_pci_match(device_t parent, cfdata_t match, void *aux)
{
	struct pci_attach_args *pa = aux;

	if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_MARVELL)
		return (0);

	switch (PCI_PRODUCT(pa->pa_id)) {
	case PCI_PRODUCT_MARVELL_88W8310:
	case PCI_PRODUCT_MARVELL_88W8335_1:
	case PCI_PRODUCT_MARVELL_88W8335_2:
		return (1);
	}

	return (0);
}
开发者ID:RyanLucchese,项目名称:rumpkernel-netbsd-src,代码行数:17,代码来源:if_malo_pci.c

示例13: piccolo_attach

static void
piccolo_attach(device_t parent, device_t self, void *aux)
{
	struct pci_attach_args *pa = aux;
	struct pciide_softc *sc = device_private(self);
	const struct pciide_product_desc *pp;

	sc->sc_wdcdev.sc_atac.atac_dev = self;

	if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_TOSHIBA2)
		pp = pciide_lookup_product(pa->pa_id, pciide_toshiba2_products);
	else
		pp = NULL;
	if (pp == NULL)
		panic("toshide_attach");
	pciide_common_attach(sc, pa, pp);
}
开发者ID:RyanLucchese,项目名称:rumpkernel-netbsd-src,代码行数:17,代码来源:toshide.c

示例14: pci_scan_bus

static int
pci_scan_bus(struct pci_bus *bus)
{
	int totaldev = 0;
	struct pci_func df;
	memset(&df, 0, sizeof(df));
	df.bus = bus;

	for (df.dev = 0; df.dev < 32; df.dev++) {
		uint32_t bhlc = pci_conf_read(&df, PCI_BHLC_REG);
		struct pci_func f;
		if (PCI_HDRTYPE_TYPE(bhlc) > 1)	/* Unsupported or no device */
			continue;

		/* found a device */
		totaldev++;
		f = df;

		for (f.func = 0; f.func < (PCI_HDRTYPE_MULTIFN(bhlc) ? 8 : 1);
				f.func++) {
			struct pci_func *af;
			uint32_t dev_id;
			uint32_t intr;

			dev_id = pci_conf_read(&f, PCI_ID_REG);
			if (PCI_VENDOR(dev_id) == 0xffff)
				continue;	

			/* found a function */
			af = kmem_alloc(sizeof(*af));
			*af = f;
			list_init(&af->link);
			list_insert(&pci_func_list, &af->link);
			af->dev_id = dev_id;

			intr = pci_conf_read(af, PCI_INTERRUPT_REG);
			af->irq_line = PCI_INTERRUPT_LINE(intr);
			af->dev_class = pci_conf_read(af, PCI_CLASS_REG);
#ifdef SHOW_PCI_VERBOSE_INFO
			pci_print_func(af);
#endif
		}
	}

	return totaldev;
}
开发者ID:m943040028,项目名称:prex,代码行数:46,代码来源:pci.c

示例15: pci_func_enable

void
pci_func_enable(struct pci_func *f, uint8_t flags)
{

	uint32_t v = 0;
	if (flags & PCI_MEM_ENABLE)
		v |= PCI_COMMAND_MEM_ENABLE;
	if (flags & PCI_IO_ENABLE)
		v |= PCI_COMMAND_IO_ENABLE;

	pci_conf_write(f, PCI_COMMAND_STATUS_REG,
			  v | PCI_COMMAND_MASTER_ENABLE);

	printf("pci: function %02x:%02x.%d (%04x:%04x) enabled\n",
		f->bus->busno, f->dev, f->func,
		PCI_VENDOR(f->dev_id), PCI_PRODUCT(f->dev_id));
}
开发者ID:m943040028,项目名称:prex,代码行数:17,代码来源:pci.c


注:本文中的PCI_VENDOR函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。