本文整理汇总了C++中PCI_PRODUCT函数的典型用法代码示例。如果您正苦于以下问题:C++ PCI_PRODUCT函数的具体用法?C++ PCI_PRODUCT怎么用?C++ PCI_PRODUCT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PCI_PRODUCT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ral_cardbus_match
int
ral_cardbus_match(struct device *parent,
struct cfdata *cfdata, void *aux)
{
struct cardbus_attach_args *ca = aux;
if (PCI_VENDOR(ca->ca_id) == PCI_VENDOR_RALINK) {
switch (PCI_PRODUCT(ca->ca_id)) {
case PCI_PRODUCT_RALINK_RT2560:
case PCI_PRODUCT_RALINK_RT2561:
case PCI_PRODUCT_RALINK_RT2561S:
case PCI_PRODUCT_RALINK_RT2661:
return 1;
default:
return 0;
}
}
return 0;
}
示例2: pci_bus_flags
/*
* Determine which flags should be passed to the primary PCI bus's
* autoconfiguration node. We use this to detect broken chipsets
* which cannot safely use memory-mapped device access.
*/
int
pci_bus_flags()
{
int rval = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
int device, maxndevs;
pcitag_t tag;
pcireg_t id;
maxndevs = pci_bus_maxdevs(NULL, 0);
for (device = 0; device < maxndevs; device++) {
tag = pci_make_tag(NULL, 0, device, 0);
id = pci_conf_read(NULL, tag, PCI_ID_REG);
/* Invalid vendor ID value? */
if (PCI_VENDOR(id) == PCI_VENDOR_INVALID)
continue;
/* XXX Not invalid, but we've done this ~forever. */
if (PCI_VENDOR(id) == 0)
continue;
switch (PCI_VENDOR(id)) {
case PCI_VENDOR_SIS:
switch (PCI_PRODUCT(id)) {
case PCI_PRODUCT_SIS_85C496:
goto disable_mem;
}
break;
}
}
return (rval);
disable_mem:
printf("Warning: broken PCI-Host bridge detected; "
"disabling memory-mapped access\n");
rval &= ~(PCI_FLAGS_MEM_ENABLED|PCI_FLAGS_MRL_OKAY|PCI_FLAGS_MRM_OKAY|
PCI_FLAGS_MWI_OKAY);
return (rval);
}
示例3: iop_pci_match
static int
iop_pci_match(struct device *parent, struct cfdata *match,
void *aux)
{
struct pci_attach_args *pa;
u_int product, vendor;
pcireg_t reg;
pa = aux;
/*
* Look for an "intelligent I/O processor" that adheres to the I2O
* specification. Ignore the device if it doesn't support interrupt
* driven operation.
*/
if (PCI_CLASS(pa->pa_class) == PCI_CLASS_I2O &&
PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_I2O_STANDARD &&
PCI_INTERFACE(pa->pa_class) == PCI_INTERFACE_I2O_INTRDRIVEN)
return (1);
/*
* Match boards that don't conform exactly to the spec.
*/
vendor = PCI_VENDOR(pa->pa_id);
product = PCI_PRODUCT(pa->pa_id);
if (vendor == PCI_VENDOR_DPT &&
(product == PCI_PRODUCT_DPT_RAID_I2O ||
product == PCI_PRODUCT_DPT_RAID_2005S))
return (1);
if (vendor == PCI_VENDOR_INTEL &&
(product == PCI_PRODUCT_INTEL_80960RM_2 ||
product == PCI_PRODUCT_INTEL_80960_RP)) {
reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
if (PCI_VENDOR(reg) == PCI_VENDOR_PROMISE)
return (1);
}
return (0);
}
示例4: obio_match
int
obio_match(device_t parent, cfdata_t cf, void *aux)
{
struct pci_attach_args *pa = aux;
if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_APPLE)
switch (PCI_PRODUCT(pa->pa_id)) {
case PCI_PRODUCT_APPLE_GC:
case PCI_PRODUCT_APPLE_OHARE:
case PCI_PRODUCT_APPLE_HEATHROW:
case PCI_PRODUCT_APPLE_PADDINGTON:
case PCI_PRODUCT_APPLE_KEYLARGO:
case PCI_PRODUCT_APPLE_PANGEA_MACIO:
case PCI_PRODUCT_APPLE_INTREPID:
case PCI_PRODUCT_APPLE_K2:
case PCI_PRODUCT_APPLE_SHASTA:
return 1;
}
return 0;
}
示例5: pchb_match
static int
pchb_match(struct device *parent, struct cfdata *match, void *aux)
{
struct pci_attach_args *pa = aux;
/*
* Match all known PCI host chipsets.
*/
if (PCI_CLASS(pa->pa_class) == PCI_CLASS_BRIDGE &&
PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_BRIDGE_HOST) {
switch (PCI_VENDOR(pa->pa_id)) {
case PCI_VENDOR_GALILEO:
switch (PCI_PRODUCT(pa->pa_id)) {
case PCI_PRODUCT_GALILEO_GT64120:
return (!pcifound);
}
break;
}
}
return (0);
}
示例6: fwohci_pci_match
static int
fwohci_pci_match(device_t parent, cfdata_t match, void *aux)
{
struct pci_attach_args *pa = (struct pci_attach_args *) aux;
/*
* XXX
* Firewire controllers used in some G3 PowerBooks hang the system
* when trying to discover devices - don't attach to those for now
* until someone with the right hardware can investigate
*/
if ((PCI_VENDOR(pa->pa_id) == PCI_VENDOR_APPLE) &&
(PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_PBG3_FW))
return 0;
if (PCI_CLASS(pa->pa_class) == PCI_CLASS_SERIALBUS &&
PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_SERIALBUS_FIREWIRE &&
PCI_INTERFACE(pa->pa_class) == PCI_INTERFACE_OHCI)
return 1;
return 0;
}
示例7: pci_conf_hook
int
pci_conf_hook(pci_chipset_tag_t pc, int bus, int dev, int func, pcireg_t id)
{
/* ignore bogus IDs */
if (PCI_VENDOR(id) == 0)
return 0;
/* 2700 hardware wedges on accesses to device 6. */
if (bus == 0 && dev == 6)
return 0;
/* 2800 hardware wedges on accesses to device 31. */
if (bus == 0 && dev == 31)
return 0;
/* Don't configure the bridge and PCI probe. */
if (PCI_VENDOR(id) == PCI_VENDOR_MARVELL &&
PCI_PRODUCT(id) == PCI_PRODUCT_MARVELL_GT64011)
return 0;
/* Don't configure on-board VIA VT82C586 (pcib, uhci) */
if (bus == 0 && dev == 9 && (func == 0 || func == 2))
return 0;
/* Enable viaide secondary port. Some firmware doesn't enable it. */
if (bus == 0 && dev == 9 && func == 1) {
pcitag_t tag;
pcireg_t csr;
#define APO_VIAIDECONF (APO_VIA_REGBASE + 0x00)
tag = pci_make_tag(pc, bus, dev, func);
csr = pci_conf_read(pc, tag, APO_VIAIDECONF);
pci_conf_write(pc, tag, APO_VIAIDECONF,
csr | APO_IDECONF_EN(1));
}
return PCI_CONF_DEFAULT & ~(PCI_COMMAND_SERR_ENABLE |
PCI_COMMAND_PARITY_ENABLE);
}
示例8: yds_match
static int
yds_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_YAMAHA:
switch (PCI_PRODUCT(pa->pa_id)) {
case PCI_PRODUCT_YAMAHA_YMF724:
case PCI_PRODUCT_YAMAHA_YMF740:
case PCI_PRODUCT_YAMAHA_YMF740C:
case PCI_PRODUCT_YAMAHA_YMF724F:
case PCI_PRODUCT_YAMAHA_YMF744B:
case PCI_PRODUCT_YAMAHA_YMF754:
return 1;
}
break;
}
return 0;
}
示例9: ppbmatch
int
ppbmatch(struct device *parent, void *match, void *aux)
{
struct pci_attach_args *pa = aux;
/*
* This device is mislabeled. It is not a PCI bridge.
*/
if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_VIATECH &&
PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_VIATECH_VT82C586_PWR)
return (0);
/*
* Check the ID register to see that it's a PCI bridge.
* If it is, we assume that we can deal with it; it _should_
* work in a standardized way...
*/
if (PCI_CLASS(pa->pa_class) == PCI_CLASS_BRIDGE &&
PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_BRIDGE_PCI)
return (1);
return (0);
}
示例10: scan_pci_bus
static void
scan_pci_bus(void)
{
pcitag_t tag;
int i, x;
for (i=0;i<32;i++){
tag = pci_make_tag(0, 0, i, 0);
x = pci_conf_read(0, tag, 0);
printf("%d tag=%08x : %08x\n", i, tag, x);
#if 0
if (PCI_VENDOR(x) == PCI_VENDOR_INTEL
&& PCI_PRODUCT(x) == PCI_PRODUCT_INTEL_80960_RP) {
/* Do not configure PCI bus analyzer */
continue;
}
x = pci_conf_read(0, tag, PCI_COMMAND_STATUS_REG);
x |= PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE | PCI_COMMAND_MASTER_ENABLE;
pci_conf_write(0, tag, PCI_COMMAND_STATUS_REG, x);
#endif
}
}
示例11: gdt_pci_probe
int
gdt_pci_probe(struct device *parent, void *match, void *aux)
{
struct pci_attach_args *pa = aux;
if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_VORTEX &&
((PCI_PRODUCT(pa->pa_id) >= GDT_DEVICE_ID_MIN &&
PCI_PRODUCT(pa->pa_id) <= GDT_DEVICE_ID_MAX) ||
PCI_PRODUCT(pa->pa_id) == GDT_DEVICE_ID_NEWRX ||
PCI_PRODUCT(pa->pa_id) == GDT_DEVICE_ID_NEWRX2))
return (1);
if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_INTEL &&
(PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INTEL_GDT_RAID1 ||
PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INTEL_GDT_RAID2))
return (1);
return (0);
}
示例12: kauaiatamatch
int
kauaiatamatch(struct device *parent, void *match, void *aux)
{
struct pci_attach_args *pa = aux;
/*
* Match the adapter
* XXX match routine??
*/
switch(PCI_VENDOR(pa->pa_id)) {
case PCI_VENDOR_APPLE:
switch (PCI_PRODUCT(pa->pa_id)) {
case PCI_PRODUCT_APPLE_UNINORTH_ATA:
case PCI_PRODUCT_APPLE_INTREPID_ATA:
case PCI_PRODUCT_APPLE_INTREPID2_ATA:
case PCI_PRODUCT_APPLE_K2_ATA:
case PCI_PRODUCT_APPLE_SHASTA_ATA:
return (1);
}
break;
}
return 0;
}
示例13: iwic_find_card
static const char *
iwic_find_card(const struct pci_attach_args * pa)
{
pcireg_t type = pa->pa_id;
pcireg_t reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
int sv = PCI_VENDOR(reg);
int sd = PCI_PRODUCT(reg);
struct winids *wip = win_ids;
while (wip->type) {
if (wip->type == type) {
if (((wip->sv == -1) && (wip->sd == -1)) ||
((wip->sv == sv) && (wip->sd == sd)))
break;
}
++wip;
}
if (wip->desc)
return wip->desc;
return 0;
}
示例14: pci_matchbyid
static int
pci_matchbyid(lua_State *L)
{
struct pci_attach_args *pa;
const struct pci_matchid *ids;
int nent;
const struct pci_matchid *pm;
int i;
pa = lua_touserdata(L, -3);
ids = lua_touserdata(L, -2);
nent = lua_tointeger(L, -1);
lua_pop(L, 3);
for (i = 0, pm = ids; i < nent; i++, pm++)
if (PCI_VENDOR(pa->pa_id) == pm->pm_vid &&
PCI_PRODUCT(pa->pa_id) == pm->pm_pid) {
lua_pushinteger(L, 1);
return 1;
}
lua_pushinteger(L, 0);
return 1;
}
示例15: yds_read_codec
static int
yds_read_codec(void *sc_, uint8_t reg, uint16_t *data)
{
struct yds_codec_softc *sc;
sc = sc_;
YWRITE2(sc->sc, AC97_CMD_ADDR, AC97_CMD_READ | AC97_ID(sc->id) | reg);
if (yds_ready_codec(sc)) {
aprint_error_dev(sc->sc->sc_dev, "yds_read_codec timeout\n");
return EIO;
}
if (PCI_PRODUCT(sc->sc->sc_id) == PCI_PRODUCT_YAMAHA_YMF744B &&
sc->sc->sc_revision < 2) {
int i;
for (i=0; i<600; i++)
(void)YREAD2(sc->sc, sc->status_data);
}
*data = YREAD2(sc->sc, sc->status_data);
return 0;
}