• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ISAPNP_VENDOR函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了ISAPNP_VENDOR函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:19Dan01,项目名称:linux,代码行数:34,代码来源:ni_atmio.c


示例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;
}
开发者ID:niubl,项目名称:camera_project,代码行数:11,代码来源:8250_pnp.c


示例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;
}
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:37,代码来源:ni_atmio.c


示例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)
{
开发者ID:robacklin,项目名称:ts7800,代码行数:31,代码来源:sedlbauer.c


示例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.
 */
开发者ID:GunioRobot,项目名称:MI424WR_GEN2_Rev_E-F,代码行数:30,代码来源:ide-pnp.c


示例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
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:30,代码来源:teles3.c


示例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 */
开发者ID:liexusong,项目名称:Linux-2.4.16,代码行数:31,代码来源:opl3sa2.c


示例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];}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:31,代码来源:ne.c


示例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),
开发者ID:asmalldev,项目名称:linux,代码行数:30,代码来源:diva.c


示例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)
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-ef_fw-20-19-8,代码行数:30,代码来源:ns558.c


示例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;
//.........这里部分代码省略.........
开发者ID:archith,项目名称:camera_project,代码行数:101,代码来源:sb1000.c


示例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)
开发者ID:archith,项目名称:camera_project,代码行数:31,代码来源:sb1000.c


示例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;
}
开发者ID:liexusong,项目名称:Linux-2.4.16,代码行数:70,代码来源:opl3sa2.c


示例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");
开发者ID:dmgerman,项目名称:linux-pre-history,代码行数:31,代码来源:ns558.c


示例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 {
开发者ID:JBTech,项目名称:ralink_rt5350,代码行数:61,代码来源:isurf.c


示例16: MODULE_DEVICE_TABLE

#ifndef PCI_DEVICE_ID_AVM_A1_V2
#define PCI_DEVICE_ID_AVM_A1_V2 0x0e00
#endif

static struct pci_device_id fcpci_ids[] __initdata = {
	{ PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1   , PCI_ANY_ID, PCI_ANY_ID,
	  0, 0, (unsigned long) "Fritz!Card PCI" },
	{ PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1_V2, PCI_ANY_ID, PCI_ANY_ID,
	  0, 0, (unsigned long) "Fritz!Card PCI v2" },
	{ }
};
MODULE_DEVICE_TABLE(pci, fcpci_ids);

static struct isapnp_device_id fcpnp_ids[] __initdata = {
	{ ISAPNP_VENDOR('A', 'V', 'M'), ISAPNP_FUNCTION(0x0900),
	  ISAPNP_VENDOR('A', 'V', 'M'), ISAPNP_FUNCTION(0x0900), 
	  (unsigned long) "Fritz!Card PnP" },
	{ }
};
MODULE_DEVICE_TABLE(isapnp, fcpnp_ids);

static int protocol = 2;       /* EURO-ISDN Default */
MODULE_PARM(protocol, "i");

static LIST_HEAD(adapter_list);

// ----------------------------------------------------------------------

#define  AVM_INDEX              0x04
#define  AVM_DATA               0x10
开发者ID:cilynx,项目名称:dd-wrt,代码行数:30,代码来源:hisax_fcpcipnp.c


示例17: setup_niccy

int __devinit setup_niccy(struct IsdnCard *card)
{
	struct IsdnCardState *cs = card->cs;
	char tmp[64];

	strcpy(tmp, niccy_revision);
	printk(KERN_INFO "HiSax: Niccy driver Rev. %s\n", HiSax_getrev(tmp));
	if (cs->typ != ISDN_CTYPE_NICCY)
		return 0;
#ifdef __ISAPNP__
	if (!card->para[1] && isapnp_present()) {
		struct pnp_dev *pnp_d = NULL;
		int err;

		pnp_c = pnp_find_card(ISAPNP_VENDOR('S', 'D', 'A'),
				ISAPNP_FUNCTION(0x0150), pnp_c);
		if (pnp_c) {
			pnp_d = pnp_find_dev(pnp_c,
					ISAPNP_VENDOR('S', 'D', 'A'),
					ISAPNP_FUNCTION(0x0150), pnp_d);
			if (!pnp_d) {
				printk(KERN_ERR "NiccyPnP: PnP error card "
					"found, no device\n");
				return 0;
			}
			pnp_disable_dev(pnp_d);
			err = pnp_activate_dev(pnp_d);
			if (err < 0) {
				printk(KERN_WARNING "%s: pnp_activate_dev "
					"ret(%d)\n", __func__, err);
				return 0;
			}
			card->para[1] = pnp_port_start(pnp_d, 0);
			card->para[2] = pnp_port_start(pnp_d, 1);
			card->para[0] = pnp_irq(pnp_d, 0);
			if (!card->para[0] || !card->para[1] ||
					!card->para[2]) {
				printk(KERN_ERR "NiccyPnP:some resources are "
					"missing %ld/%lx/%lx\n",
					card->para[0], card->para[1],
					card->para[2]);
				pnp_disable_dev(pnp_d);
				return 0;
			}
		} else
			printk(KERN_INFO "NiccyPnP: no ISAPnP card found\n");
	}
#endif
	if (card->para[1]) {
		cs->hw.niccy.isac = card->para[1] + ISAC_PNP;
		cs->hw.niccy.hscx = card->para[1] + HSCX_PNP;
		cs->hw.niccy.isac_ale = card->para[2] + ISAC_PNP;
		cs->hw.niccy.hscx_ale = card->para[2] + HSCX_PNP;
		cs->hw.niccy.cfg_reg = 0;
		cs->subtyp = NICCY_PNP;
		cs->irq = card->para[0];
		if (!request_region(cs->hw.niccy.isac, 2, "niccy data")) {
			printk(KERN_WARNING "HiSax: NICCY data port %x-%x "
				"already in use\n",
				cs->hw.niccy.isac, cs->hw.niccy.isac + 1);
			return 0;
		}
		if (!request_region(cs->hw.niccy.isac_ale, 2, "niccy addr")) {
			printk(KERN_WARNING "HiSax: NICCY address port %x-%x "
				"already in use\n",
				cs->hw.niccy.isac_ale,
				cs->hw.niccy.isac_ale + 1);
			release_region(cs->hw.niccy.isac, 2);
			return 0;
		}
	} else {
#ifdef CONFIG_PCI
		static struct pci_dev *niccy_dev __devinitdata;

		u_int pci_ioaddr;
		cs->subtyp = 0;
		if ((niccy_dev = hisax_find_pci_device(PCI_VENDOR_ID_SATSAGEM,
						 PCI_DEVICE_ID_SATSAGEM_NICCY,
						 niccy_dev))) {
			if (pci_enable_device(niccy_dev))
				return 0;
			/* get IRQ */
			if (!niccy_dev->irq) {
				printk(KERN_WARNING
				       "Niccy: No IRQ for PCI card found\n");
				return 0;
			}
			cs->irq = niccy_dev->irq;
			cs->hw.niccy.cfg_reg = pci_resource_start(niccy_dev, 0);
			if (!cs->hw.niccy.cfg_reg) {
				printk(KERN_WARNING
				       "Niccy: No IO-Adr for PCI cfg found\n");
				return 0;
			}
			pci_ioaddr = pci_resource_start(niccy_dev, 1);
			if (!pci_ioaddr) {
				printk(KERN_WARNING
				       "Niccy: No IO-Adr for PCI card found\n");
				return 0;
			}
//.........这里部分代码省略.........
开发者ID:Vincentxiaojie,项目名称:xpenology,代码行数:101,代码来源:niccy.c


示例18: free_irq

        free_irq(aironet4500_devices[i]->irq,aironet4500_devices[i]);
        kfree(aironet4500_devices[i]->priv);
        kfree(aironet4500_devices[i]);

        aironet4500_devices[i]=0;


        i++;
    }


}

static struct isapnp_device_id id_table[] = {
    {   ISAPNP_ANY_ID, ISAPNP_ANY_ID,
        ISAPNP_VENDOR('A','W','L'), ISAPNP_DEVICE(1), 0
    },
    {0}
};

MODULE_DEVICE_TABLE(isapnp, id_table);

#endif //MODULE
#endif /* CONFIG_AIRONET4500_PNP */

#ifdef  CONFIG_AIRONET4500_ISA

static int irq[] = {0,0,0,0,0};
static int io[] = {0,0,0,0,0};

/*
开发者ID:niubl,项目名称:camera_project,代码行数:31,代码来源:aironet4500_card.c


示例19: setup_isurf

int __devinit
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__
		if (isapnp_present()) {
			struct pnp_dev *pnp_d = NULL;
			int err;

			cs->subtyp = 0;
			if ((pnp_c = pnp_find_card(
				ISAPNP_VENDOR('S', 'I', 'E'),
				ISAPNP_FUNCTION(0x0010), pnp_c))) {
				if (!(pnp_d = pnp_find_dev(pnp_c,
					ISAPNP_VENDOR('S', 'I', 'E'),
					ISAPNP_FUNCTION(0x0010), pnp_d))) {
					printk(KERN_ERR "ISurfPnP: PnP error card found, no device\n");
					return (0);
				}
				pnp_disable_dev(pnp_d);
				err = pnp_activate_dev(pnp_d);
				cs->hw.isurf.reset = pnp_port_start(pnp_d, 0);
				cs->hw.isurf.phymem = pnp_mem_start(pnp_d, 1);
				cs->irq = pnp_irq(pnp_d, 0);
				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);
					pnp_disable_dev(pnp_d);
					return(0);
				}
			} else {
				printk(KERN_INFO "ISurfPnP: no ISAPnP card found\n");
				return(0);
			}
		} else {
			printk(KERN_INFO "ISurfPnP: no ISAPnP bus found\n");
			return(0);
		}
#else
		printk(KERN_WARNING "HiSax: Siemens I-Surf port/mem not set\n");
		return (0);
#endif
	}
	if (!request_region(cs->hw.isurf.reset, 1, "isurf isdn")) {
		printk(KERN_WARNING
			"HiSax: Siemens I-Surf config port %x already in use\n",
			cs->hw.isurf.reset);
			return (0);
	}
	if (!request_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE, "isurf iomem")) {
		printk(KERN_WARNING "HiSax: Siemens I-Surf memory region "
			"%lx-%lx already in use\n",
			cs->hw.isurf.phymem,
			cs->hw.isurf.phymem + ISURF_IOMEM_SIZE);
		release_region(cs->hw.isurf.reset, 1);
		return (0);
	}
	cs->hw.isurf.isar = ioremap(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
	cs->hw.isurf.isac = cs->hw.isurf.isar + ISURF_ISAC_OFFSET;
	printk(KERN_INFO
	       "ISurf: defined at 0x%x 0x%lx IRQ %d\n",
	       cs->hw.isurf.reset,
	       cs->hw.isurf.phymem,
	       cs->irq);

	setup_isac(cs);
	cs->cardmsg = &ISurf_card_msg;
	cs->irq_func = &isurf_interrupt;
	cs->auxcmd = &isurf_auxcmd;
	cs->readisac = &ReadISAC;
	cs->writeisac = &WriteISAC;
	cs->readisacfifo = &ReadISACfifo;
	cs->writeisacfifo = &WriteISACfifo;
	cs->bcs[0].hw.isar.reg = &cs->hw.isurf.isar_r;
	cs->bcs[1].hw.isar.reg = &cs->hw.isurf.isar_r;
	test_and_set_bit(HW_ISAR, &cs->HW_Flags);
	ISACVersion(cs, "ISurf:");
	cs->BC_Read_Reg = &ReadISAR;
	cs->BC_Write_Reg = &WriteISAR;
	cs->BC_Send_Data = &isar_fill_fifo;
	ver = ISARVersion(cs, "ISurf:");
	if (ver < 0) {
		printk(KERN_WARNING
			"ISurf: wrong ISAR version (ret = %d)\n", ver);
		release_io_isurf(cs);
		return (0);
	}
//.........这里部分代码省略.........
开发者ID:robacklin,项目名称:ts4700,代码行数:101,代码来源:isurf.c


示例20: awc4500_pnp_probe

int awc4500_pnp_probe(struct net_device *dev)
{
    int isa_index = 0;
    int isa_irq_line = 0;
    int isa_ioaddr = 0;
    int card = 0;
    int i=0;
    struct isapnp_dev * pnp_dev ;
    struct isapnp_logdev *logdev;

    while (1) {

        pnp_dev = isapnp_find_device(
                      ISAPNP_VENDOR('A','W','L'),
                      ISAPNP_DEVICE(1),
                      0);

        if (!pnp_dev) break;

        isa_index++;

        logdev = isapnp_find_logdev(pnp_dev, ISAPNP_VENDOR('A','W','L'),
                                    ISAPNP_FUNCTION(1),
                                    0);
        if (!logdev) {
            printk("No logical device found on Aironet board \n");
            return -ENODEV;
        }
        if (isapnp_cfg_begin(logdev->PNP_BUS->PNP_BUS_NUMBER, logdev->PNP_DEV_NUMBER) < 0) {
            printk("cfg begin failed for csn %x devnum %x \n",
                   logdev->PNP_BUS->PNP_BUS_NUMBER, logdev->PNP_DEV_NUMBER);
            return -EAGAIN;
        }
        isapnp_activate(logdev->PNP_DEV_NUMBER);	/* activate device */
        isapnp_cfg_end();

        isa_irq_line = logdev->irq;
        isa_ioaddr = logdev->resource[0].start;
        request_region(isa_ioaddr, AIRONET4X00_IO_SIZE, "aironet4x00 ioaddr");

        if (!dev) {
            dev = init_etherdev(NULL, 0);
            if (!dev) {
                release_region(isa_ioaddr, AIRONET4X00_IO_SIZE);
                isapnp_cfg_begin(logdev->PNP_BUS->PNP_BUS_NUMBER,
                                 logdev->PNP_DEV_NUMBER);
                isapnp_deactivate(logdev->PNP_DEV_NUMBER);
                isapnp_cfg_end();
                return -ENOMEM;
            }
        }
        dev->priv = kmalloc(sizeof(struct awc_private),GFP_KERNEL );
        memset(dev->priv,0,sizeof(struct awc_private));
        if (!dev->priv) {
            printk(KERN_CRIT "aironet4x00: could not allocate device private, some unstability may follow\n");
            return -1;
        };
        ((struct awc_private *)dev->priv)->bus =  logdev;

        //	ether_setup(dev);

        //	dev->tx_queue_len = tx_queue_len;

        dev->hard_start_xmit = 		&awc_start_xmit;
        //	dev->set_config = 		&awc_config_misiganes,aga mitte awc_config;
        dev->get_stats = 		&awc_get_stats;
        //	dev->set_multicast_list = 	&awc_set_multicast_list;
        dev->change_mtu		=	awc_change_mtu;
        dev->init = &awc_init;
        dev->open = &awc_open;
        dev->stop = &awc_close;
        dev->base_addr = isa_ioaddr;
        dev->irq = isa_irq_line;
        dev->tx_timeout = &awc_tx_timeout;
        dev->watchdog_timeo = AWC_TX_TIMEOUT;

        netif_start_queue (dev);

        request_irq(dev->irq,awc_interrupt , SA_SHIRQ | SA_INTERRUPT ,"Aironet 4X00",dev);

        awc_private_init( dev);

        ((struct awc_private *)dev->priv)->bus =  logdev;

        cli();
        if ( awc_init(dev) ) {
            printk("card not found at irq %x io %lx\n",dev->irq, dev->base_addr);
            if (card==0) {
                sti();
                return -1;
            }
            sti();
            break;
        }
        udelay(10);
        sti();
        i=0;
        while (aironet4500_devices[i] && i < MAX_AWCS-1) i++;
        if (!aironet4500_devices[i] && i < MAX_AWCS-1 ) {
            aironet4500_devices[i]=dev;
//.........这里部分代码省略.........
开发者ID:niubl,项目名称:camera_project,代码行数:101,代码来源:aironet4500_card.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ISA_PNP_PROBE函数代码示例发布时间:2022-05-30
下一篇:
C++ ISALPHA函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap