Example #1
0
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;
}
Example #2
0
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;
}
Example #3
0
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;
}
Example #4
0
			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)
{
	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.
 */
Example #6
0
	unsigned int CARD_portlist[] =
	{0x160, 0x170, 0x260, 0x360, 0};

	for (i = 0; CARD_portlist[i]; i++) {
		if ((cs->subtyp = probe_elsa_adr(CARD_portlist[i], cs->typ)))
			break;
	}
	return (CARD_portlist[i]);
}

static 	struct pci_dev *dev_qs1000 __devinitdata = NULL;
static 	struct pci_dev *dev_qs3000 __devinitdata = NULL;

#ifdef __ISAPNP__
static struct isapnp_device_id elsa_ids[] __devinitdata = {
	{ ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
	  ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133), 
	  (unsigned long) "Elsa QS1000" },
	{ ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0134),
	  ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0134), 
	  (unsigned long) "Elsa QS3000" },
	{ 0, }
};

static struct isapnp_device_id *ipid __devinitdata = &elsa_ids[0];
static struct pnp_card *pnp_c __devinitdata = NULL;
#endif

int __devinit
setup_elsa(struct IsdnCard *card)
{
Example #7
0
			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
Example #8
0
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 */
Example #9
0
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];}
Example #10
0
	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),
	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)
Example #12
0
        set_current_state(TASK_UNINTERRUPTIBLE);
        schedule_timeout((80*HZ)/1000);
        cs->hw.hfcD.ctmt |= HFCD_TIM800;
        cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_CTMT, cs->hw.hfcD.ctmt);
        cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_MST_MODE, cs->hw.hfcD.mst_m);
        restore_flags(flags);
        return(0);
    case CARD_TEST:
        return(0);
    }
    return(0);
}

#ifdef __ISAPNP__
static struct isapnp_device_id hfc_ids[] __initdata = {
    {   ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114),
        ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114),
        (unsigned long) "Acer P10"
    },
    {   ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0002),
        ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0002),
        (unsigned long) "Billion 2"
    },
    {   ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0001),
        ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0001),
        (unsigned long) "Billion 1"
    },
    {   ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x7410),
        ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x7410),
        (unsigned long) "IStar PnP"
    },
Example #13
0
/* 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;
		dev->rebuild_header 	= NULL;
		dev->set_mac_address 	= NULL;
		dev->header_cache_update= NULL;

		dev->type		= ARPHRD_ETHER;
		dev->hard_header_len 	= 0;
		dev->mtu		= 1500;
		dev->addr_len		= ETH_ALEN;
		/* hardware address is 0:0:serial_number */
		dev->dev_addr[0] = 0;
		dev->dev_addr[1] = 0;
		dev->dev_addr[2] = serial_number >> 24 & 0xff;
		dev->dev_addr[3] = serial_number >> 16 & 0xff;
		dev->dev_addr[4] = serial_number >>  8 & 0xff;
		dev->dev_addr[5] = serial_number >>  0 & 0xff;
		dev->tx_queue_len	= 0;
	
		/* New-style flags. */
		dev->flags		= IFF_POINTOPOINT|IFF_NOARP;

		/* Lock resources */

		return 0;
	}
}
Example #14
0
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)
Example #15
0
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;
}
Example #16
0
 *
 * 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");
Example #17
0
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 {
Example #18
0
#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
Example #19
0
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;
			}
			cs->subtyp = NICCY_PCI;
		} else {
			printk(KERN_WARNING "Niccy: No PCI card found\n");
			return 0;
		}
		cs->irq_flags |= IRQF_SHARED;
		cs->hw.niccy.isac = pci_ioaddr + ISAC_PCI_DATA;
		cs->hw.niccy.isac_ale = pci_ioaddr + ISAC_PCI_ADDR;
		cs->hw.niccy.hscx = pci_ioaddr + HSCX_PCI_DATA;
		cs->hw.niccy.hscx_ale = pci_ioaddr + HSCX_PCI_ADDR;
		if (!request_region(cs->hw.niccy.isac, 4, "niccy")) {
			printk(KERN_WARNING
			       "HiSax: NICCY data port %x-%x already in use\n",
			       cs->hw.niccy.isac, cs->hw.niccy.isac + 4);
			return 0;
		}
		if (!request_region(cs->hw.niccy.cfg_reg, 0x40, "niccy pci")) {
			printk(KERN_WARNING
			       "HiSax: NICCY pci port %x-%x already in use\n",
			       cs->hw.niccy.cfg_reg,
			       cs->hw.niccy.cfg_reg + 0x40);
			release_region(cs->hw.niccy.isac, 4);
			return 0;
		}
#else
		printk(KERN_WARNING "Niccy: io0 0 and NO_PCI_BIOS\n");
		printk(KERN_WARNING "Niccy: unable to config NICCY PCI\n");
		return 0;
#endif				/* CONFIG_PCI */
	}
	printk(KERN_INFO "HiSax: NICCY %s config irq:%d data:0x%X ale:0x%X\n",
		(cs->subtyp == 1) ? "PnP" : "PCI",
		cs->irq, cs->hw.niccy.isac, cs->hw.niccy.isac_ale);
	setup_isac(cs);
	cs->readisac = &ReadISAC;
	cs->writeisac = &WriteISAC;
	cs->readisacfifo = &ReadISACfifo;
	cs->writeisacfifo = &WriteISACfifo;
	cs->BC_Read_Reg = &ReadHSCX;
	cs->BC_Write_Reg = &WriteHSCX;
	cs->BC_Send_Data = &hscx_fill_fifo;
	cs->cardmsg = &niccy_card_msg;
	cs->irq_func = &niccy_interrupt;
	ISACVersion(cs, "Niccy:");
	if (HscxVersion(cs, "Niccy:")) {
		printk(KERN_WARNING "Niccy: wrong HSCX versions check IO "
			"address\n");
		release_io_niccy(cs);
		return 0;
	}
	return 1;
}
Example #20
0
int __init
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 pci_bus *pb;
		struct pci_dev *pd;

		if ((pb = isapnp_find_card(
			ISAPNP_VENDOR('S', 'D', 'A'),
			ISAPNP_FUNCTION(0x0150), pnp_c))) {
			pnp_c = pb;
			pd = NULL;
			if (!(pd = isapnp_find_dev(pnp_c,
				ISAPNP_VENDOR('S', 'D', 'A'),
				ISAPNP_FUNCTION(0x0150), pd))) {
				printk(KERN_ERR "NiccyPnP: PnP error card found, no device\n");
				return (0);
			}
			pd->prepare(pd);
			pd->deactivate(pd);
			pd->activate(pd);
			card->para[1] = pd->resource[0].start;
			card->para[2] = pd->resource[1].start;
			card->para[0] = pd->irq_resource[0].start;
			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]);
				pd->deactivate(pd);
				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 (check_region((cs->hw.niccy.isac), 2)) {
			printk(KERN_WARNING
				"HiSax: %s data port %x-%x already in use\n",
				CardType[card->typ],
				cs->hw.niccy.isac,
				cs->hw.niccy.isac + 1);
			return (0);
		} else
			request_region(cs->hw.niccy.isac, 2, "niccy data");
		if (check_region((cs->hw.niccy.isac_ale), 2)) {
			printk(KERN_WARNING
				"HiSax: %s address port %x-%x already in use\n",
				CardType[card->typ],
				cs->hw.niccy.isac_ale,
				cs->hw.niccy.isac_ale + 1);
			release_region(cs->hw.niccy.isac, 2);
			return (0);
		} else
			request_region(cs->hw.niccy.isac_ale, 2, "niccy addr");
	} else {
#if CONFIG_PCI
		u_int pci_ioaddr;
		if (!pci_present()) {
			printk(KERN_ERR "Niccy: no PCI bus present\n");
			return(0);
		}
		cs->subtyp = 0;
		if ((niccy_dev = pci_find_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);
			}
			cs->subtyp = NICCY_PCI;
		} else {
			printk(KERN_WARNING "Niccy: No PCI card found\n");
			return(0);
		}
		cs->irq_flags |= SA_SHIRQ;
		cs->hw.niccy.isac = pci_ioaddr + ISAC_PCI_DATA;
		cs->hw.niccy.isac_ale = pci_ioaddr + ISAC_PCI_ADDR;
		cs->hw.niccy.hscx = pci_ioaddr + HSCX_PCI_DATA;
		cs->hw.niccy.hscx_ale = pci_ioaddr + HSCX_PCI_ADDR;
		if (check_region((cs->hw.niccy.isac), 4)) {
			printk(KERN_WARNING
				"HiSax: %s data port %x-%x already in use\n",
				CardType[card->typ],
				cs->hw.niccy.isac,
				cs->hw.niccy.isac + 4);
			return (0);
		} else
			request_region(cs->hw.niccy.isac, 4, "niccy");
		if (check_region(cs->hw.niccy.cfg_reg, 0x40)) {
			printk(KERN_WARNING
			       "HiSax: %s pci port %x-%x already in use\n",
				CardType[card->typ],
				cs->hw.niccy.cfg_reg,
				cs->hw.niccy.cfg_reg + 0x40);
			release_region(cs->hw.niccy.isac, 4);
			return (0);
		} else {
			request_region(cs->hw.niccy.cfg_reg, 0x40, "niccy pci");
		}
#else
		printk(KERN_WARNING "Niccy: io0 0 and NO_PCI_BIOS\n");
		printk(KERN_WARNING "Niccy: unable to config NICCY PCI\n");
		return (0);
#endif /* CONFIG_PCI */
	}
	printk(KERN_INFO
		"HiSax: %s %s config irq:%d data:0x%X ale:0x%X\n",
		CardType[cs->typ], (cs->subtyp==1) ? "PnP":"PCI",
		cs->irq, cs->hw.niccy.isac, cs->hw.niccy.isac_ale);
	cs->readisac = &ReadISAC;
	cs->writeisac = &WriteISAC;
	cs->readisacfifo = &ReadISACfifo;
	cs->writeisacfifo = &WriteISACfifo;
	cs->BC_Read_Reg = &ReadHSCX;
	cs->BC_Write_Reg = &WriteHSCX;
	cs->BC_Send_Data = &hscx_fill_fifo;
	cs->cardmsg = &niccy_card_msg;
	cs->irq_func = &niccy_interrupt;
	ISACVersion(cs, "Niccy:");
	if (HscxVersion(cs, "Niccy:")) {
		printk(KERN_WARNING
		    "Niccy: wrong HSCX versions check IO address\n");
		release_io_niccy(cs);
		return (0);
	}
	return (1);
}
Example #21
0
        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};

/*
Example #22
0
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);
	}
	return (1);
}
Example #23
0
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;

            ((struct awc_private *)
             aironet4500_devices[i]->priv)->card_type = AIRONET4500_PNP;

            if (awc_proc_set_fun)
                awc_proc_set_fun(i);
        } else {
            printk(KERN_CRIT "Out of resources (MAX_AWCS) \n");
            return -1;
        }

        card++;
    }

    if (card == 0) return -ENODEV;
    return 0;
}
Example #24
0
			return(0);
		case CARD_INIT:
			spin_lock_irqsave(&cs->lock, flags);
			ix1_reset(cs);
			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 itk_ids[] __devinitdata = {
	{ ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25),
	  ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25), 
	  (unsigned long) "ITK micro 2" },
	{ ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x29),
	  ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x29), 
	  (unsigned long) "ITK micro 2." },
	{ 0, }
};

static struct isapnp_device_id *ipid __devinitdata = &itk_ids[0];
static struct pnp_card *pnp_c __devinitdata = NULL;
#endif


int __devinit
setup_ix1micro(struct IsdnCard *card)
Example #25
0
static const struct v4l2_ioctl_ops fmi_ioctl_ops = {
	.vidioc_querycap    = vidioc_querycap,
	.vidioc_g_tuner     = vidioc_g_tuner,
	.vidioc_s_tuner     = vidioc_s_tuner,
	.vidioc_g_frequency = vidioc_g_frequency,
	.vidioc_s_frequency = vidioc_s_frequency,
	.vidioc_log_status  = v4l2_ctrl_log_status,
	.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
	.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
};

/* ladis: this is my card. does any other types exist? */
static struct isapnp_device_id id_table[] = {
		/* SF16-FMI */
	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
		ISAPNP_VENDOR('M','F','R'), ISAPNP_FUNCTION(0xad10), 0},
		/* SF16-FMD */
	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
		ISAPNP_VENDOR('M','F','R'), ISAPNP_FUNCTION(0xad12), 0},
	{	ISAPNP_CARD_END, },
};

MODULE_DEVICE_TABLE(isapnp, id_table);

static int __init isapnp_fmi_probe(void)
{
	int i = 0;

	while (id_table[i].card_vendor != 0 && dev == NULL) {
		dev = pnp_find_dev(NULL, id_table[i].vendor,
				   id_table[i].function, NULL);
Example #26
0
        return(0);
    case CARD_INIT:
        spin_lock_irqsave(&cs->lock, flags);
        cs->debug |= L1_DEB_IPAC;
        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 asus_ids[] __initdata = {
    {   ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688),
        ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688),
        (unsigned long) "Asus1688 PnP"
    },
    {   ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1690),
        ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1690),
        (unsigned long) "Asus1690 PnP"
    },
    {   ISAPNP_VENDOR('S', 'I', 'E'), ISAPNP_FUNCTION(0x0020),
        ISAPNP_VENDOR('S', 'I', 'E'), ISAPNP_FUNCTION(0x0020),
        (unsigned long) "Isurf2 PnP"
    },
    {   ISAPNP_VENDOR('E', 'L', 'F'), ISAPNP_FUNCTION(0x0000),
        ISAPNP_VENDOR('E', 'L', 'F'), ISAPNP_FUNCTION(0x0000),
        (unsigned long) "Iscas TE320"
    },
Example #27
0
int __init
setup_niccy(struct IsdnCard *card)
{
	char tmp[64];

	strcpy(tmp, niccy_revision);
	printk(KERN_INFO "HiSax: Niccy driver Rev. %s\n", HiSax_getrev(tmp));
#ifdef __ISAPNP__
	if (!card->para[1] && isapnp_present()) {
		struct pnp_card *pb;
		struct pnp_dev  *pd;

		if ((pb = pnp_find_card(
			ISAPNP_VENDOR('S', 'D', 'A'),
			ISAPNP_FUNCTION(0x0150), pnp_c))) {
			pnp_c = pb;
			pd = NULL;
			if (!(pd = pnp_find_dev(pnp_c,
				ISAPNP_VENDOR('S', 'D', 'A'),
				ISAPNP_FUNCTION(0x0150), pd))) {
				printk(KERN_ERR "NiccyPnP: PnP error card found, no device\n");
				return (0);
			}
			if (pnp_device_attach(pd) < 0) {
				printk(KERN_ERR "NiccyPnP: attach failed\n");
				return 0;
			}
			if (pnp_activate_dev(pd) < 0) {
				printk(KERN_ERR "NiccyPnP: activate failed\n");
				pnp_device_detach(pd);
				return 0;
			}
			if (!pnp_irq_valid(pd, 0) || !pnp_port_valid(pd, 0) || !pnp_port_valid(pd, 1)) {
				printk(KERN_ERR "NiccyPnP:some resources are missing %ld/%lx/%lx\n",
					pnp_irq(pd, 0), pnp_port_start(pd, 0), pnp_port_start(pd, 1));
				pnp_device_detach(pd);
				return(0);
			}
			card->para[1] = pnp_port_start(pd, 0);
			card->para[2] = pnp_port_start(pd, 1);
			card->para[0] = pnp_irq(pd, 0);
		} else {
			printk(KERN_INFO "NiccyPnP: no ISAPnP card found\n");
		}
	}
#endif
	if (card->para[1]) {
		if (niccy_pnp_probe(card->cs, card) < 0)
			return 0;
		return 1;
	} else {
#ifdef CONFIG_PCI
		if ((niccy_dev = pci_find_device(PCI_VENDOR_ID_SATSAGEM,
			PCI_DEVICE_ID_SATSAGEM_NICCY, niccy_dev))) {
			if (niccy_pci_probe(card->cs, niccy_dev) < 0)
				return 0;
			return 1;
		}
#endif /* CONFIG_PCI */
	}
	return 0;
}