本文整理汇总了C++中ISAPNP_VENDOR函数的典型用法代码示例。如果您正苦于以下问题:C++ ISAPNP_VENDOR函数的具体用法?C++ ISAPNP_VENDOR怎么用?C++ ISAPNP_VENDOR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ISAPNP_VENDOR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ni_isapnp_find_board
static int ni_isapnp_find_board(struct pnp_dev **dev)
{
struct pnp_dev *isapnp_dev = NULL;
int i;
for (i = 0; i < ARRAY_SIZE(ni_boards); i++) {
isapnp_dev = pnp_find_dev(NULL,
ISAPNP_VENDOR('N', 'I', 'C'),
ISAPNP_FUNCTION(ni_boards[i].
isapnp_id), NULL);
if (!isapnp_dev || !isapnp_dev->card)
continue;
if (pnp_device_attach(isapnp_dev) < 0)
continue;
if (pnp_activate_dev(isapnp_dev) < 0) {
pnp_device_detach(isapnp_dev);
return -EAGAIN;
}
if (!pnp_port_valid(isapnp_dev, 0) ||
!pnp_irq_valid(isapnp_dev, 0)) {
pnp_device_detach(isapnp_dev);
return -ENOMEM;
}
break;
}
if (i == ARRAY_SIZE(ni_boards))
return -ENODEV;
*dev = isapnp_dev;
return 0;
}
示例2: check_compatible_id
static int inline check_compatible_id(struct pci_dev *dev)
{
int i;
for (i = 0; i < DEVICE_COUNT_COMPATIBLE; i++)
if ((dev->vendor_compatible[i] ==
ISAPNP_VENDOR('P', 'N', 'P')) &&
(swab16(dev->device_compatible[i]) >= 0xc000) &&
(swab16(dev->device_compatible[i]) <= 0xdfff))
return 0;
return 1;
}
示例3: ni_isapnp_find_board
static int ni_isapnp_find_board(struct pnp_dev **dev)
{
struct pnp_dev *isapnp_dev = NULL;
int i;
for (i = 0; i < n_ni_boards; i++) {
isapnp_dev = pnp_find_dev(NULL,
ISAPNP_VENDOR('N', 'I', 'C'),
ISAPNP_FUNCTION(ni_boards[i].
isapnp_id), NULL);
if (isapnp_dev == NULL || isapnp_dev->card == NULL)
continue;
if (pnp_device_attach(isapnp_dev) < 0) {
printk
("ni_atmio: %s found but already active, skipping.\n",
ni_boards[i].name);
continue;
}
if (pnp_activate_dev(isapnp_dev) < 0) {
pnp_device_detach(isapnp_dev);
return -EAGAIN;
}
if (!pnp_port_valid(isapnp_dev, 0)
|| !pnp_irq_valid(isapnp_dev, 0)) {
pnp_device_detach(isapnp_dev);
printk("ni_atmio: pnp invalid port or irq, aborting\n");
return -ENOMEM;
}
break;
}
if (i == n_ni_boards)
return -ENODEV;
*dev = isapnp_dev;
return 0;
}
示例4: byteout
if ((long) arg)
cs->hw.sedl.reset_off |= SEDL_ISAR_PCI_LED2;
else
cs->hw.sedl.reset_off |= SEDL_ISAR_PCI_LED1;
byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off);
spin_unlock_irqrestore(&cs->lock, flags);
break;
}
return(0);
}
static struct pci_dev *dev_sedl __devinitdata = NULL;
#ifdef __ISAPNP__
static struct isapnp_device_id sedl_ids[] __devinitdata = {
{ ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01),
ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01),
(unsigned long) "Speed win" },
{ ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x02),
ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x02),
(unsigned long) "Speed Fax+" },
{ 0, }
};
static struct isapnp_device_id *ipid __devinitdata = &sedl_ids[0];
static struct pnp_card *pnp_c __devinitdata = NULL;
#endif
int __devinit
setup_sedlbauer(struct IsdnCard *card)
{
示例5: ide_register_hw
index = ide_register_hw(&hw, NULL);
if (index != -1) {
printk(KERN_INFO "ide%d: %s IDE interface\n", index, DEV_NAME(dev));
return 0;
}
return 1;
}
/* Add your devices here :)) */
struct pnp_dev_t idepnp_devices[] __initdata = {
/* Generic ESDI/IDE/ATA compatible hard disk controller */
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,
ISAPNP_VENDOR('P', 'N', 'P'), ISAPNP_DEVICE(0x0600),
pnpide_generic_init },
{ 0 }
};
#define NR_PNP_DEVICES 8
struct pnp_dev_inst {
struct pci_dev *dev;
struct pnp_dev_t *dev_type;
};
static struct pnp_dev_inst devices[NR_PNP_DEVICES];
static int pnp_ide_dev_idx = 0;
/*
* Probe for ISA PnP IDE interfaces.
*/
示例6: return
return(0);
case CARD_INIT:
spin_lock_irqsave(&cs->lock, flags);
inithscxisac(cs, 3);
spin_unlock_irqrestore(&cs->lock, flags);
return(0);
case CARD_TEST:
return(0);
}
return(0);
}
#ifdef __ISAPNP__
static struct isapnp_device_id teles_ids[] __devinitdata = {
{ ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2110),
ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2110),
(unsigned long) "Teles 16.3 PnP" },
{ ISAPNP_VENDOR('C', 'T', 'X'), ISAPNP_FUNCTION(0x0),
ISAPNP_VENDOR('C', 'T', 'X'), ISAPNP_FUNCTION(0x0),
(unsigned long) "Creatix 16.3 PnP" },
{ ISAPNP_VENDOR('C', 'P', 'Q'), ISAPNP_FUNCTION(0x1002),
ISAPNP_VENDOR('C', 'P', 'Q'), ISAPNP_FUNCTION(0x1002),
(unsigned long) "Compaq ISDN S0" },
{ 0, }
};
static struct isapnp_device_id *ipid __devinitdata = &teles_ids[0];
static struct pnp_card *pnp_c __devinitdata = NULL;
#endif
示例7: unload_opl3sa2
static void __exit unload_opl3sa2(struct address_info* hw_config, int card)
{
/* Release control ports */
release_region(hw_config->io_base, 2);
/* Unload mixer */
if(opl3sa2_mixer[card] >= 0)
sound_unload_mixerdev(opl3sa2_mixer[card]);
}
#if defined CONFIG_ISAPNP || defined CONFIG_ISAPNP_MODULE
struct isapnp_device_id isapnp_opl3sa2_list[] __initdata = {
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,
ISAPNP_VENDOR('Y','M','H'), ISAPNP_FUNCTION(0x0021),
0 },
{0}
};
MODULE_DEVICE_TABLE(isapnp, isapnp_opl3sa2_list);
static int __init opl3sa2_isapnp_probe(struct address_info* hw_cfg,
struct address_info* mss_cfg,
struct address_info* mpu_cfg,
int card)
{
static struct pci_dev* dev;
int ret;
/* Find and configure device */
示例8: defined
ISA device autoprobes on a running machine are not recommended anyway. */
#if !defined(MODULE) && (defined(CONFIG_ISA) || defined(CONFIG_M32R))
/* Do we need a portlist for the ISA auto-probe ? */
#define NEEDS_PORTLIST
#endif
/* A zero-terminated list of I/O addresses to be probed at boot. */
#ifdef NEEDS_PORTLIST
static unsigned int netcard_portlist[] __initdata = {
0x300, 0x280, 0x320, 0x340, 0x360, 0x380, 0
};
#endif
static struct isapnp_device_id isapnp_clone_list[] __initdata = {
{ ISAPNP_CARD_ID('A','X','E',0x2011),
ISAPNP_VENDOR('A','X','E'), ISAPNP_FUNCTION(0x2011),
(long) "NetGear EA201" },
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,
ISAPNP_VENDOR('E','D','I'), ISAPNP_FUNCTION(0x0216),
(long) "NN NE2000" },
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,
ISAPNP_VENDOR('P','N','P'), ISAPNP_FUNCTION(0x80d6),
(long) "Generic PNP" },
{ } /* terminate list */
};
MODULE_DEVICE_TABLE(isapnp, isapnp_clone_list);
#ifdef SUPPORT_NE_BAD_CLONES
/* A list of bad clones that we none-the-less recognize. */
static struct { const char *name8, *name16; unsigned char SAprefix[4];}
示例9: return
return (1); /* card found */
}
#else /* if !CONFIG_ISA */
static int setup_diva_isa(struct IsdnCard *card)
{
return (-1); /* card not found; continue search */
}
#endif /* CONFIG_ISA */
#ifdef __ISAPNP__
static struct isapnp_device_id diva_ids[] = {
{ ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
(unsigned long) "Diva picola" },
{ ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0x51),
(unsigned long) "Diva picola" },
{ ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71),
ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71),
(unsigned long) "Diva 2.0" },
{ ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71),
ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0x71),
(unsigned long) "Diva 2.0" },
{ ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1),
ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1),
(unsigned long) "Diva 2.01" },
{ ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1),
示例10: printk
printk(KERN_INFO "gameport%d: NS558 ISA at %#x", port->gameport.number, port->gameport.io);
if (port->size > 1) printk(" size %d", port->size);
printk(" speed %d kHz\n", port->gameport.speed);
return port;
}
#if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE))
#define NSS558_ISAPNP
#endif
#ifdef NSS558_ISAPNP
static struct isapnp_device_id pnp_devids[] = {
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('@','P','@'), ISAPNP_DEVICE(0x0001), 0 },
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('@','P','@'), ISAPNP_DEVICE(0x2001), 0 },
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x7001), 0 },
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x7002), 0 },
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C','S','C'), ISAPNP_DEVICE(0x0010), 0 },
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C','S','C'), ISAPNP_DEVICE(0x0110), 0 },
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C','S','C'), ISAPNP_DEVICE(0x0b35), 0 },
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C','S','C'), ISAPNP_DEVICE(0x0010), 0 },
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C','S','C'), ISAPNP_DEVICE(0x0110), 0 },
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('P','N','P'), ISAPNP_DEVICE(0xb02f), 0 },
{ 0, },
};
MODULE_DEVICE_TABLE(isapnp, pnp_devids);
static struct ns558* ns558_pnp_probe(struct pci_dev *dev, struct ns558 *next)
示例11: sb1000_probe
/* probe for SB1000 using Plug-n-Play mechanism */
int
sb1000_probe(struct net_device *dev)
{
unsigned short ioaddr[2], irq;
struct pci_dev *idev=NULL;
unsigned int serial_number;
while(1)
{
/*
* Find the card
*/
idev=isapnp_find_dev(NULL, ISAPNP_VENDOR('G','I','C'),
ISAPNP_FUNCTION(0x1000), idev);
/*
* No card
*/
if(idev==NULL)
return -ENODEV;
/*
* Bring it online
*/
idev->prepare(idev);
idev->activate(idev);
/*
* Ports free ?
*/
if(!idev->resource[0].start || check_region(idev->resource[0].start, 16))
continue;
if(!idev->resource[1].start || check_region(idev->resource[1].start, 16))
continue;
serial_number = idev->bus->serial;
ioaddr[0]=idev->resource[0].start;
ioaddr[1]=idev->resource[1].start;
irq = idev->irq_resource[0].start;
/* check I/O base and IRQ */
if (dev->base_addr != 0 && dev->base_addr != ioaddr[0])
continue;
if (dev->rmem_end != 0 && dev->rmem_end != ioaddr[1])
continue;
if (dev->irq != 0 && dev->irq != irq)
continue;
/*
* Ok set it up.
*/
if (!request_region(ioaddr[0], 16, dev->name))
continue;
if (!request_region(ioaddr[1], 16, dev->name)) {
release_region(ioaddr[0], 16);
continue;
}
dev->base_addr = ioaddr[0];
/* rmem_end holds the second I/O address - fv */
dev->rmem_end = ioaddr[1];
dev->irq = irq;
if (sb1000_debug > 0)
printk(KERN_NOTICE "%s: sb1000 at (%#3.3lx,%#3.3lx), "
"S/N %#8.8x, IRQ %d.\n", dev->name, dev->base_addr,
dev->rmem_end, serial_number, dev->irq);
dev = init_etherdev(dev, 0);
if (!dev)
return -ENOMEM;
SET_MODULE_OWNER(dev);
/* Make up a SB1000-specific-data structure. */
dev->priv = kmalloc(sizeof(struct sb1000_private), GFP_KERNEL);
if (dev->priv == NULL)
return -ENOMEM;
memset(dev->priv, 0, sizeof(struct sb1000_private));
if (sb1000_debug > 0)
printk(KERN_NOTICE "%s", version);
/* The SB1000-specific entries in the device structure. */
dev->open = sb1000_open;
dev->do_ioctl = sb1000_dev_ioctl;
dev->hard_start_xmit = sb1000_start_xmit;
dev->stop = sb1000_close;
dev->get_stats = sb1000_stats;
/* Fill in the generic fields of the device structure. */
dev->change_mtu = NULL;
dev->hard_header = NULL;
//.........这里部分代码省略.........
示例12: sb1000_get_frequency
static inline int sb1000_get_frequency(const int ioaddr[], const char* name,
int* frequency);
static inline int sb1000_set_frequency(const int ioaddr[], const char* name,
int frequency);
static inline int sb1000_get_PIDs(const int ioaddr[], const char* name,
short PID[]);
static inline int sb1000_set_PIDs(const int ioaddr[], const char* name,
const short PID[]);
/* SB1000 commands for frame rx interrupt */
static inline int sb1000_rx(struct net_device *dev);
static inline void sb1000_error_dpc(struct net_device *dev);
static struct isapnp_device_id id_table[] = {
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID,
ISAPNP_VENDOR('G','I','C'), ISAPNP_FUNCTION(0x1000), 0 },
{0}
};
MODULE_DEVICE_TABLE(isapnp, id_table);
/* probe for SB1000 using Plug-n-Play mechanism */
int
sb1000_probe(struct net_device *dev)
{
unsigned short ioaddr[2], irq;
struct pci_dev *idev=NULL;
unsigned int serial_number;
while(1)
示例13: opl3sa2_isapnp_probe
static int __init opl3sa2_isapnp_probe(struct address_info* hw_cfg,
struct address_info* mss_cfg,
struct address_info* mpu_cfg,
int card)
{
static struct pci_dev* dev;
int ret;
/* Find and configure device */
dev = isapnp_find_dev(NULL,
ISAPNP_VENDOR('Y','M','H'),
ISAPNP_FUNCTION(0x0021),
dev);
if(dev == NULL) {
return -ENODEV;
}
/*
* If device is active, assume configured with /proc/isapnp
* and use anyway. Any other way to check this?
*/
ret = dev->prepare(dev);
if(ret && ret != -EBUSY) {
printk(KERN_ERR "opl3sa2: ISA PnP found device that could not be autoconfigured.\n");
return -ENODEV;
}
if(ret == -EBUSY) {
opl3sa2_activated[card] = 1;
}
else {
if(dev->activate(dev) < 0) {
printk(KERN_WARNING "opl3sa2: ISA PnP activate failed\n");
opl3sa2_activated[card] = 0;
return -ENODEV;
}
printk(KERN_DEBUG
"opl3sa2: Activated ISA PnP card %d (active=%d)\n",
card, dev->active);
}
/* Our own config: */
hw_cfg->io_base = dev->resource[4].start;
hw_cfg->irq = dev->irq_resource[0].start;
hw_cfg->dma = dev->dma_resource[0].start;
hw_cfg->dma2 = dev->dma_resource[1].start;
/* The MSS config: */
mss_cfg->io_base = dev->resource[1].start;
mss_cfg->irq = dev->irq_resource[0].start;
mss_cfg->dma = dev->dma_resource[0].start;
mss_cfg->dma2 = dev->dma_resource[1].start;
mss_cfg->card_subtype = 1; /* No IRQ or DMA setup */
mpu_cfg->io_base = dev->resource[3].start;
mpu_cfg->irq = dev->irq_resource[0].start;
mpu_cfg->dma = -1;
mpu_cfg->dma2 = -1;
mpu_cfg->always_detect = 1; /* It's there, so use shared IRQs */
/* Call me paranoid: */
opl3sa2_clear_slots(hw_cfg);
opl3sa2_clear_slots(mss_cfg);
opl3sa2_clear_slots(mpu_cfg);
opl3sa2_dev[card] = dev;
return 0;
}
示例14: ISAPNP_VENDOR
*
* CTL00c1 - SB AWE32 PnP
* CTL00c3 - SB AWE64 PnP
* CTL00f0 - SB16 PnP / Vibra 16x
* CTL7001 - SB Vibra16C PnP
* CSC0b35 - Crystal ** doesn't have compatibility ID **
* TER1141 - Terratec AD1818
* YMM0800 - Yamaha OPL3-SA3
*
* PNPb02f - Generic gameport
*/
static struct pnp_devid {
unsigned int vendor, device;
} pnp_devids[] = {
{ ISAPNP_VENDOR('C','T','L'), ISAPNP_DEVICE(0x7002) },
{ ISAPNP_VENDOR('C','S','C'), ISAPNP_DEVICE(0x0b35) },
{ ISAPNP_VENDOR('P','N','P'), ISAPNP_DEVICE(0xb02f) },
{ 0, },
};
static struct ns558* ns558_pnp_probe(struct pci_dev *dev, struct ns558 *next)
{
int ioport, iolen;
struct ns558 *port;
if (dev->prepare && dev->prepare(dev) < 0)
return next;
if (!(dev->resource[0].flags & IORESOURCE_IO)) {
printk(KERN_WARNING "No i/o ports on a gameport? Weird\n");
示例15: setup_isurf
int __init
setup_isurf(struct IsdnCard *card)
{
int ver;
struct IsdnCardState *cs = card->cs;
char tmp[64];
strcpy(tmp, ISurf_revision);
printk(KERN_INFO "HiSax: ISurf driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_ISURF)
return(0);
if (card->para[1] && card->para[2]) {
cs->hw.isurf.reset = card->para[1];
cs->hw.isurf.phymem = card->para[2];
cs->irq = card->para[0];
} else {
#ifdef __ISAPNP__
struct pci_bus *pb;
struct pci_dev *pd;
if (isapnp_present()) {
cs->subtyp = 0;
if ((pb = isapnp_find_card(
ISAPNP_VENDOR('S', 'I', 'E'),
ISAPNP_FUNCTION(0x0010), pnp_surf))) {
pnp_surf = pb;
pd = NULL;
if (!(pd = isapnp_find_dev(pnp_surf,
ISAPNP_VENDOR('S', 'I', 'E'),
ISAPNP_FUNCTION(0x0010), pd))) {
printk(KERN_ERR "ISurfPnP: PnP error card found, no device\n");
return (0);
}
pd->prepare(pd);
pd->deactivate(pd);
pd->activate(pd);
/* The ISA-PnP logic apparently
* expects upper limit address to be
* set. Since the isa-pnp module
* doesn't do this, so we have to make
* up for it.
*/
isapnp_cfg_begin(pd->bus->number, pd->devfn);
isapnp_write_word(ISAPNP_CFG_MEM+3,
pd->resource[8].end >> 8);
isapnp_cfg_end();
cs->hw.isurf.reset = pd->resource[0].start;
cs->hw.isurf.phymem = pd->resource[8].start;
cs->irq = pd->irq_resource[0].start;
if (!cs->irq || !cs->hw.isurf.reset || !cs->hw.isurf.phymem) {
printk(KERN_ERR "ISurfPnP:some resources are missing %d/%x/%lx\n",
cs->irq, cs->hw.isurf.reset, cs->hw.isurf.phymem);
pd->deactivate(pd);
return(0);
}
} else {
printk(KERN_INFO "ISurfPnP: no ISAPnP card found\n");
return(0);
}
} else {