示例#1
0
void wl_adapter_insert(struct pcmcia_device *link)
{
	struct net_device *dev;
	int i;
	int ret;
	/*--------------------------------------------------------------------*/

	DBG_FUNC("wl_adapter_insert");
	DBG_ENTER(DbgInfo);
	DBG_PARAM(DbgInfo, "link", "0x%p", link);

	dev     = link->priv;

	/* Do we need to allocate an interrupt? */
	link->config_flags |= CONF_ENABLE_IRQ;
	link->io_lines = 6;

	ret = pcmcia_request_io(link);
	if (ret != 0)
		goto failed;

	ret = pcmcia_request_irq(link, (void *) wl_isr);
	if (ret != 0)
		goto failed;

	ret = pcmcia_enable_device(link);
	if (ret != 0)
		goto failed;

	dev->irq        = link->irq;
	dev->base_addr  = link->resource[0]->start;

	SET_NETDEV_DEV(dev, &link->dev);
	if (register_netdev(dev) != 0) {
;
		goto failed;
	}

	register_wlags_sysfs(dev);

//	printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ",
;
	for (i = 0; i < ETH_ALEN; i++)
;

	DBG_LEAVE(DbgInfo);
	return;

failed:
	wl_adapter_release(link);

	DBG_LEAVE(DbgInfo);
	return;
} /* wl_adapter_insert */
示例#2
0
void wl_adapter_insert( struct pcmcia_device *link )
{
    struct net_device       *dev;
    int i;
    int                     ret;
    /*------------------------------------------------------------------------*/

    DBG_FUNC( "wl_adapter_insert" );
    DBG_ENTER( DbgInfo );
    DBG_PARAM( DbgInfo, "link", "0x%p", link );

    dev     = link->priv;

    /* Do we need to allocate an interrupt? */
    link->conf.Attributes |= CONF_ENABLE_IRQ;

    ret = pcmcia_request_io(link, &link->io);
    if (ret != 0)
        goto failed;

    ret = pcmcia_request_irq(link, (void *) wl_isr);
    if (ret != 0)
        goto failed;

    ret = pcmcia_request_configuration(link, &link->conf);
    if (ret != 0)
        goto failed;

    dev->irq        = link->irq;
    dev->base_addr  = link->io.BasePort1;

    SET_NETDEV_DEV(dev, &link->dev);
    if (register_netdev(dev) != 0) {
	printk("%s: register_netdev() failed\n", MODULE_NAME);
	goto failed;
    }

    register_wlags_sysfs(dev);

    printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ",
               dev->name, dev->base_addr, dev->irq);
    for( i = 0; i < ETH_ALEN; i++ ) {
        printk("%02X%c", dev->dev_addr[i], ((i < (ETH_ALEN-1)) ? ':' : '\n'));
    }

    DBG_LEAVE( DbgInfo );
    return;

failed:
    wl_adapter_release( link );

    DBG_LEAVE(DbgInfo);
    return;
} // wl_adapter_insert