Exemple #1
0
/*******************************************************************************
 *	wl_adapter_attach()
 *******************************************************************************
 *
 *  DESCRIPTION:
 *
 *      Creates an instance of the driver, allocating local data structures for
 *  one device. The device is registered with Card Services.
 *
 *  PARAMETERS:
 *
 *      none
 *
 *  RETURNS:
 *
 *      pointer to an allocated dev_link_t structure
 *      NULL on failure
 *
 ******************************************************************************/
static int wl_adapter_attach(struct pcmcia_device *link)
{
	struct net_device   *dev;
	struct wl_private   *lp;
	/*--------------------------------------------------------------------*/

	DBG_FUNC("wl_adapter_attach");
	DBG_ENTER(DbgInfo);

	dev = wl_device_alloc();
	if (dev == NULL) {
		DBG_ERROR(DbgInfo, "wl_device_alloc returned NULL\n");
		return -ENOMEM;
	}

	link->resource[0]->end  = HCF_NUM_IO_PORTS;
	link->resource[0]->flags= IO_DATA_PATH_WIDTH_16;
	link->config_flags     |= CONF_ENABLE_IRQ;
	link->config_index      = 5;
	link->config_regs       = PRESENT_OPTION;

	link->priv = dev;
	lp = wl_priv(dev);
	lp->link = link;

	wl_adapter_insert(link);

	DBG_LEAVE(DbgInfo);
	return 0;
} /* wl_adapter_attach */
Exemple #2
0
static int wl_adapter_attach(struct pcmcia_device *link)
{
    struct net_device   *dev;
    struct wl_private	*lp;
    /*------------------------------------------------------------------------*/

    DBG_FUNC( "wl_adapter_attach" );
    DBG_ENTER( DbgInfo );

    dev = wl_device_alloc();
    if(dev == NULL) {
        DBG_ERROR( DbgInfo, "wl_device_alloc returned NULL\n");
	return -ENOMEM;
    }

    link->io.NumPorts1      = HCF_NUM_IO_PORTS;
    link->io.Attributes1    = IO_DATA_PATH_WIDTH_16;
    link->io.IOAddrLines    = 6;
    link->conf.Attributes   = CONF_ENABLE_IRQ;
    link->conf.IntType      = INT_MEMORY_AND_IO;
    link->conf.ConfigIndex  = 5;
    link->conf.Present      = PRESENT_OPTION;

    link->priv = dev;
    lp = wl_priv(dev);
    lp->link = link;

    wl_adapter_insert(link);

    DBG_LEAVE( DbgInfo );
    return 0;
} // wl_adapter_attach