当前位置: 首页>>代码示例>>C++>>正文


C++ pcmcia_enable_device函数代码示例

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


在下文中一共展示了pcmcia_enable_device函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: airo_config

static int airo_config(struct pcmcia_device *link)
{
    local_info_t *dev;
    int ret;

    dev = link->priv;

    dev_dbg(&link->dev, "airo_config\n");

    link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP |
                          CONF_AUTO_AUDIO | CONF_AUTO_SET_IO;

    ret = pcmcia_loop_config(link, airo_cs_config_check, NULL);
    if (ret)
        goto failed;

    if (!link->irq)
        goto failed;

    ret = pcmcia_enable_device(link);
    if (ret)
        goto failed;
    ((local_info_t *)link->priv)->eth_dev =
        init_airo_card(link->irq,
                       link->resource[0]->start, 1, &link->dev);
    if (!((local_info_t *)link->priv)->eth_dev)
        goto failed;

    return 0;

failed:
    airo_release(link);
    return -ENODEV;
}
开发者ID:MiniBlu,项目名称:cm11_kernel_htc_msm8974a3ul,代码行数:34,代码来源:airo_cs.c

示例2: ide_config

static int ide_config(struct pcmcia_device *link)
{
    ide_info_t *info = link->priv;
    int ret = 0, is_kme = 0;
    unsigned long io_base, ctl_base;
    struct ide_host *host;

    dev_dbg(&link->dev, "ide_config(0x%p)\n", link);

    is_kme = ((link->manf_id == MANFID_KME) &&
	      ((link->card_id == PRODID_KME_KXLC005_A) ||
	       (link->card_id == PRODID_KME_KXLC005_B)));

    if (pcmcia_loop_config(link, pcmcia_check_one_config, &is_kme)) {
	    link->config_flags &= ~CONF_AUTO_CHECK_VCC;
	    if (pcmcia_loop_config(link, pcmcia_check_one_config, &is_kme))
		    goto failed; /* No suitable config found */
    }
    io_base = link->resource[0]->start;
    if (link->resource[1]->end)
	    ctl_base = link->resource[1]->start;
    else
	    ctl_base = link->resource[0]->start + 0x0e;

    if (!link->irq)
	    goto failed;

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

    /* disable drive interrupts during IDE probe */
    outb(0x02, ctl_base);

    /* special setup for KXLC005 card */
    if (is_kme)
	outb(0x81, ctl_base+1);

     host = idecs_register(io_base, ctl_base, link->irq, link);
     if (host == NULL && resource_size(link->resource[0]) == 0x20) {
	    outb(0x02, ctl_base + 0x10);
	    host = idecs_register(io_base + 0x10, ctl_base + 0x10,
				  link->irq, link);
    }

    if (host == NULL)
	goto failed;

    info->ndev = 1;
    info->host = host;
    dev_info(&link->dev, "ide-cs: hd%c: Vpp = %d.%d\n",
	    'a' + host->ports[0]->index * 2,
	    link->vpp / 10, link->vpp % 10);

    return 0;

failed:
    ide_release(link);
    return -ENODEV;
} /* ide_config */
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:60,代码来源:ide-cs.c

示例3: dtl1_config

static int dtl1_config(struct pcmcia_device *link)
{
	dtl1_info_t *info = link->priv;
	int i;

	/* Look for a generic full-sized window */
	link->resource[0]->end = 8;
	if (pcmcia_loop_config(link, dtl1_confcheck, NULL) < 0)
		goto failed;

	i = pcmcia_request_irq(link, dtl1_interrupt);
	if (i != 0)
		goto failed;

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

	if (dtl1_open(info) != 0)
		goto failed;

	return 0;

failed:
	dtl1_release(link);
	return -ENODEV;
}
开发者ID:08opt,项目名称:linux,代码行数:27,代码来源:dtl1_cs.c

示例4: labpc_config

static void labpc_config(struct pcmcia_device *link)
{
	int ret;

	dev_dbg(&link->dev, "labpc_config\n");

	link->config_flags |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ |
		CONF_AUTO_AUDIO | CONF_AUTO_SET_IO;

	ret = pcmcia_loop_config(link, labpc_pcmcia_config_loop, NULL);
	if (ret) {
		dev_warn(&link->dev, "no configuration found\n");
		goto failed;
	}

	if (!link->irq)
		goto failed;

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

	return;

failed:
	labpc_release(link);

}				/* labpc_config */
开发者ID:119-org,项目名称:hi3518-osdrv,代码行数:28,代码来源:ni_labpc_cs.c

示例5: ixj_config

static int ixj_config(struct pcmcia_device * link)
{
	IXJ *j;
	ixj_info_t *info;

	info = link->priv;
	dev_dbg(&link->dev, "ixj_config\n");

	link->config_flags = CONF_AUTO_SET_IO;

	if (pcmcia_loop_config(link, ixj_config_check, NULL))
		goto failed;

	if (pcmcia_enable_device(link))
		goto failed;

	/*
 	 *	Register the card with the core.
	 */
	j = ixj_pcmcia_probe(link->resource[0]->start,
			     link->resource[0]->start + 0x10);

	info->ndev = 1;
	ixj_get_serial(link, j);
	return 0;

failed:
	ixj_cs_release(link);
	return -ENODEV;
}
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:30,代码来源:ixj_pcmcia.c

示例6: dtl1_config

static int dtl1_config(struct pcmcia_device *link)
{
	dtl1_info_t *info = link->priv;
	int ret;

	/* Look for a generic full-sized window */
	link->resource[0]->end = 8;
	ret = pcmcia_loop_config(link, dtl1_confcheck, NULL);
	if (ret)
		goto failed;

	ret = pcmcia_request_irq(link, dtl1_interrupt);
	if (ret)
		goto failed;

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

	ret = dtl1_open(info);
	if (ret)
		goto failed;

	return 0;

failed:
	dtl1_detach(link);
	return ret;
}
开发者ID:24hours,项目名称:linux,代码行数:29,代码来源:dtl1_cs.c

示例7: sl811_cs_config

static int sl811_cs_config(struct pcmcia_device *link)
{
	struct device		*parent = &link->dev;
	int			ret;

	dev_dbg(&link->dev, "sl811_cs_config\n");

	link->config_flags |= CONF_ENABLE_IRQ |	CONF_AUTO_SET_VPP |
		CONF_AUTO_CHECK_VCC | CONF_AUTO_SET_IO;

	if (pcmcia_loop_config(link, sl811_cs_config_check, NULL))
		goto failed;

	/* require an IRQ and two registers */
	if (resource_size(link->resource[0]) < 2)
		goto failed;

	if (!link->irq)
		goto failed;

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

	if (sl811_hc_init(parent, link->resource[0]->start, link->irq)
			< 0) {
failed:
		printk(KERN_WARNING "sl811_cs_config failed\n");
		sl811_cs_release(link);
		return  -ENODEV;
	}
	return 0;
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:33,代码来源:sl811_cs.c

示例8: pdacf_config

static int pdacf_config(struct pcmcia_device *link)
{
	struct snd_pdacf *pdacf = link->priv;
	int ret;

	snd_printdd(KERN_DEBUG "pdacf_config called\n");
	link->config_index = 0x5;
	link->config_flags |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ;

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

	ret = pcmcia_request_irq(link, pdacf_interrupt);
	if (ret)
		goto failed;

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

	if (snd_pdacf_assign_resources(pdacf, link->resource[0]->start,
					link->irq) < 0)
		goto failed;

	return 0;

failed:
	pcmcia_disable_device(link);
	return -ENODEV;
}
开发者ID:ARMWorks,项目名称:FA_2451_Linux_Kernel,代码行数:31,代码来源:pdaudiocf.c

示例9: ft1000_config

static int ft1000_config(struct pcmcia_device *link)
{
    int ret;

    dev_dbg(&link->dev, "ft1000_cs: ft1000_config(0x%p)\n", link);

    /* setup IO window */
    ret = pcmcia_loop_config(link, ft1000_confcheck, NULL);
    if (ret) {
        printk(KERN_INFO "ft1000: Could not configure pcmcia\n");
        return -ENODEV;
    }

    /* configure device */
    ret = pcmcia_enable_device(link);
    if (ret) {
        printk(KERN_INFO "ft1000: could not enable pcmcia\n");
        goto failed;
    }

    link->priv = init_ft1000_card(link, &ft1000_reset);
    if (!link->priv) {
        printk(KERN_INFO "ft1000: Could not register as network device\n");
        goto failed;
    }

    /* Finally, report what we've done */

    return 0;
failed:
    pcmcia_disable_device(link);
    return -ENODEV;
}
开发者ID:Red680812,项目名称:DNA_kitkat,代码行数:33,代码来源:ft1000_cs.c

示例10: avma1cs_config

static int __devinit avma1cs_config(struct pcmcia_device *link)
{
	int i = -1;
	char devname[128];
	IsdnCard_t	icard;
	int busy = 0;

	dev_dbg(&link->dev, "avma1cs_config(0x%p)\n", link);

	devname[0] = 0;
	if (link->prod_id[1])
		strlcpy(devname, link->prod_id[1], sizeof(devname));

	if (pcmcia_loop_config(link, avma1cs_configcheck, NULL))
		return -ENODEV;

	do {
		/*
		 * allocate an interrupt line
		 */
		if (!link->irq) {
			/* undo */
			pcmcia_disable_device(link);
			break;
		}

		/*
		 * configure the PCMCIA socket
		 */
		i = pcmcia_enable_device(link);
		if (i != 0) {
			pcmcia_disable_device(link);
			break;
		}

	} while (0);

	/* If any step failed, release any partially configured state */
	if (i != 0) {
		avma1cs_release(link);
		return -ENODEV;
	}

	icard.para[0] = link->irq;
	icard.para[1] = link->resource[0]->start;
	icard.protocol = isdnprot;
	icard.typ = ISDN_CTYPE_A1_PCMCIA;

	i = hisax_init_pcmcia(link, &busy, &icard);
	if (i < 0) {
		printk(KERN_ERR "avma1_cs: failed to initialize AVM A1 "
		       "PCMCIA %d at i/o %#x\n", i,
		       (unsigned int) link->resource[0]->start);
		avma1cs_release(link);
		return -ENODEV;
	}
	link->priv = (void *) (unsigned long) i;

	return 0;
} /* avma1cs_config */
开发者ID:kprog,项目名称:linux,代码行数:60,代码来源:avma1_cs.c

示例11: bluecard_config

static int bluecard_config(struct pcmcia_device *link)
{
	bluecard_info_t *info = link->priv;
	int i, n;

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
	link->config_index = 0x20;
#else
	link->conf.ConfigIndex = 0x20;
#endif

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
	link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
	link->resource[0]->end = 64;
	link->io_lines = 6;
#else
	link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
	link->io.NumPorts1 = 64;
	link->io.IOAddrLines = 6;
#endif

	for (n = 0; n < 0x400; n += 0x40) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
		link->resource[0]->start = n ^ 0x300;
		i = pcmcia_request_io(link);
#else
		link->io.BasePort1 = n ^ 0x300;
		i = pcmcia_request_io(link, &link->io);
#endif
		if (i == 0)
			break;
	}

	if (i != 0)
		goto failed;

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
	i = pcmcia_request_irq(link, bluecard_interrupt);
	if (i != 0)
		goto failed;
#else
	i = pcmcia_request_irq(link, &link->irq);
	if (i != 0)
		link->irq.AssignedIRQ = 0;
#endif

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

	if (bluecard_open(info) != 0)
		goto failed;

	return 0;

failed:
	bluecard_release(link);
	return -ENODEV;
}
开发者ID:LairdCP,项目名称:laird-linux-backports,代码行数:59,代码来源:bluecard_cs.c

示例12: orinoco_cs_config

static int
orinoco_cs_config(struct pcmcia_device *link)
{
	struct orinoco_private *priv = link->priv;
	hermes_t *hw = &priv->hw;
	int ret;
	void __iomem *mem;

	link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC |
		CONF_AUTO_SET_IO | CONF_ENABLE_IRQ;
	if (ignore_cis_vcc)
		link->config_flags &= ~CONF_AUTO_CHECK_VCC;
	ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL);
	if (ret) {
		if (!ignore_cis_vcc)
			printk(KERN_ERR PFX "GetNextTuple(): No matching "
			       "CIS configuration.  Maybe you need the "
			       "ignore_cis_vcc=1 parameter.\n");
		goto failed;
	}

	ret = pcmcia_request_irq(link, orinoco_interrupt);
	if (ret)
		goto failed;

	/* We initialize the hermes structure before completing PCMCIA
	 * configuration just in case the interrupt handler gets
	 * called. */
	mem = ioport_map(link->resource[0]->start,
			resource_size(link->resource[0]));
	if (!mem)
		goto failed;

	hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING);

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

	/* Initialise the main driver */
	if (orinoco_init(priv) != 0) {
		printk(KERN_ERR PFX "orinoco_init() failed\n");
		goto failed;
	}

	/* Register an interface with the stack */
	if (orinoco_if_add(priv, link->resource[0]->start,
			   link->irq, NULL) != 0) {
		printk(KERN_ERR PFX "orinoco_if_add() failed\n");
		goto failed;
	}

	return 0;

 failed:
	orinoco_cs_release(link);
	return -ENODEV;
}				/* orinoco_cs_config */
开发者ID:Stefan-Schmidt,项目名称:linux-2.6,代码行数:58,代码来源:orinoco_cs.c

示例13: orinoco_cs_config

static int
orinoco_cs_config(struct pcmcia_device *link)
{
	struct orinoco_private *priv = link->priv;
	struct hermes *hw = &priv->hw;
	int ret;
	void __iomem *mem;

	link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC |
		CONF_AUTO_SET_IO | CONF_ENABLE_IRQ;
	if (ignore_cis_vcc)
		link->config_flags &= ~CONF_AUTO_CHECK_VCC;
	ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL);
	if (ret) {
		if (!ignore_cis_vcc)
			printk(KERN_ERR PFX "GetNextTuple(): No matching "
			       "CIS configuration.  Maybe you need the "
			       "ignore_cis_vcc=1 parameter.\n");
		goto failed;
	}

	mem = ioport_map(link->resource[0]->start,
			resource_size(link->resource[0]));
	if (!mem)
		goto failed;

	/*                                                            
                                                         
            */
	hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING);

	ret = pcmcia_request_irq(link, orinoco_interrupt);
	if (ret)
		goto failed;

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

	/*                            */
	if (orinoco_init(priv) != 0) {
		printk(KERN_ERR PFX "orinoco_init() failed\n");
		goto failed;
	}

	/*                                      */
	if (orinoco_if_add(priv, link->resource[0]->start,
			   link->irq, NULL) != 0) {
		printk(KERN_ERR PFX "orinoco_if_add() failed\n");
		goto failed;
	}

	return 0;

 failed:
	orinoco_cs_release(link);
	return -ENODEV;
}				/*                   */
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:58,代码来源:orinoco_cs.c

示例14: wl_adapter_insert

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 */
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:54,代码来源:wl_cs.c

示例15: b43_pcmcia_probe

static int b43_pcmcia_probe(struct pcmcia_device *dev)
{
	struct ssb_bus *ssb;
	int err = -ENOMEM;
	int res = 0;

	ssb = kzalloc(sizeof(*ssb), GFP_KERNEL);
	if (!ssb)
		goto out_error;

	err = -ENODEV;

	dev->config_flags |= CONF_ENABLE_IRQ;

	dev->resource[2]->flags |=  WIN_ENABLE | WIN_DATA_WIDTH_16 |
			 WIN_USE_WAIT;
	dev->resource[2]->start = 0;
	dev->resource[2]->end = SSB_CORE_SIZE;
	res = pcmcia_request_window(dev, dev->resource[2], 250);
	if (res != 0)
		goto err_kfree_ssb;

	res = pcmcia_map_mem_page(dev, dev->resource[2], 0);
	if (res != 0)
		goto err_disable;

	if (!dev->irq)
		goto err_disable;

	res = pcmcia_enable_device(dev);
	if (res != 0)
		goto err_disable;

	err = ssb_bus_pcmciabus_register(ssb, dev, dev->resource[2]->start);
	if (err)
		goto err_disable;
	dev->priv = ssb;

	return 0;

err_disable:
	pcmcia_disable_device(dev);
err_kfree_ssb:
	kfree(ssb);
out_error:
	printk(KERN_ERR "b43-pcmcia: Initialization failed (%d, %d)\n",
	       res, err);
	return err;
}
开发者ID:AdrianHuang,项目名称:linux-3.8.13,代码行数:49,代码来源:pcmcia.c


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