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


C++ pcmcia_dev_present函数代码示例

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


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

示例1: wl_adapter_open

/*******************************************************************************
 *	wl_adapter_open()
 *******************************************************************************
 *
 *  DESCRIPTION:
 *
 *      Open the device.
 *
 *  PARAMETERS:
 *
 *      dev - a pointer to a net_device structure representing the network
 *            device to open.
 *
 *  RETURNS:
 *
 *      0 on success
 *      errno value otherwise
 *
 ******************************************************************************/
int wl_adapter_open(struct net_device *dev)
{
	struct wl_private *lp = wl_priv(dev);
	struct pcmcia_device *link = lp->link;
	int result = 0;
	int hcf_status = HCF_SUCCESS;
	/*--------------------------------------------------------------------*/

	DBG_FUNC("wl_adapter_open");
	DBG_ENTER(DbgInfo);
	DBG_PRINT("%s\n", VERSION_INFO);
	DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);

	if (!pcmcia_dev_present(link)) {
		DBG_LEAVE(DbgInfo);
		return -ENODEV;
	}

	link->open++;

	hcf_status = wl_open(dev);

	if (hcf_status != HCF_SUCCESS) {
		link->open--;
		result = -ENODEV;
	}

	DBG_LEAVE(DbgInfo);
	return result;
} /* wl_adapter_open */
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:49,代码来源:wl_cs.c

示例2: prism2_pccard_card_present

static int prism2_pccard_card_present(local_info_t *local)
{
	struct hostap_cs_priv *hw_priv = local->hw_priv;
	if (hw_priv != NULL && hw_priv->link != NULL && pcmcia_dev_present(hw_priv->link))
		return 1;
	return 0;
}
开发者ID:119-org,项目名称:hi3518-osdrv,代码行数:7,代码来源:hostap_cs.c

示例3: card_present

/* Call-back function to interrogate PCMCIA-specific information
   about the current existance of the card */
static int card_present(void *arg)
{
	struct pcmcia_device *link = (struct pcmcia_device *)arg;

	if (pcmcia_dev_present(link))
		return 1;

	return 0;
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:11,代码来源:atmel_cs.c

示例4: spectrum_reset

/*
 * Reset the card using configuration registers COR and CCSR.
 * If IDLE is 1, stop the firmware, so that it can be safely rewritten.
 */
static int
spectrum_reset(struct pcmcia_device *link, int idle)
{
	int last_ret, last_fn;
	conf_reg_t reg;
	u_int save_cor;

	/* Doing it if hardware is gone is guaranteed crash */
	if (!pcmcia_dev_present(link))
		return -ENODEV;

	/* Save original COR value */
	reg.Function = 0;
	reg.Action = CS_READ;
	reg.Offset = CISREG_COR;
	CS_CHECK(AccessConfigurationRegister,
		 pcmcia_access_configuration_register(link, &reg));
	save_cor = reg.Value;

	/* Soft-Reset card */
	reg.Action = CS_WRITE;
	reg.Offset = CISREG_COR;
	reg.Value = (save_cor | COR_SOFT_RESET);
	CS_CHECK(AccessConfigurationRegister,
		 pcmcia_access_configuration_register(link, &reg));
	udelay(1000);

	/* Read CCSR */
	reg.Action = CS_READ;
	reg.Offset = CISREG_CCSR;
	CS_CHECK(AccessConfigurationRegister,
		 pcmcia_access_configuration_register(link, &reg));

	/*
	 * Start or stop the firmware.  Memory width bit should be
	 * preserved from the value we've just read.
	 */
	reg.Action = CS_WRITE;
	reg.Offset = CISREG_CCSR;
	reg.Value = (idle ? HCR_IDLE : HCR_RUN) | (reg.Value & HCR_MEM16);
	CS_CHECK(AccessConfigurationRegister,
		 pcmcia_access_configuration_register(link, &reg));
	udelay(1000);

	/* Restore original COR configuration index */
	reg.Action = CS_WRITE;
	reg.Offset = CISREG_COR;
	reg.Value = (save_cor & ~COR_SOFT_RESET);
	CS_CHECK(AccessConfigurationRegister,
		 pcmcia_access_configuration_register(link, &reg));
	udelay(1000);
	return 0;

      cs_failed:
	cs_error(link, last_fn, last_ret);
	return -ENODEV;
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:61,代码来源:spectrum_cs.c

示例5: wl_adapter_is_open

/*******************************************************************************
 *	wl_adapter_is_open()
 *******************************************************************************
 *
 *  DESCRIPTION:
 *
 *      Check with Card Services to determine if this device is open.
 *
 *  PARAMETERS:
 *
 *      dev - a pointer to the net_device structure whose open status will be
 *            checked
 *
 *  RETURNS:
 *
 *      nonzero if device is open
 *      0 otherwise
 *
 ******************************************************************************/
int wl_adapter_is_open(struct net_device *dev)
{
	struct wl_private *lp = wl_priv(dev);
	struct pcmcia_device *link = lp->link;

	if (!pcmcia_dev_present(link))
		return 0;

	return link->open;
} /* wl_adapter_is_open */
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:29,代码来源:wl_cs.c

示例6: serial_resume

static int serial_resume(struct pcmcia_device *link)
{
	if (pcmcia_dev_present(link)) {
		struct serial_info *info = link->priv;
		int i;

		for (i = 0; i < info->ndev; i++)
			serial8250_resume_port(info->line[i]);
		wakeup_card(info);
	}

	return 0;
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:13,代码来源:serial_cs.c

示例7: netdev_priv

static struct net_device_stats *el3_get_stats(struct net_device *dev)
{
    struct el3_private *lp = netdev_priv(dev);
    unsigned long flags;
    struct pcmcia_device *link = lp->p_dev;

    if (pcmcia_dev_present(link)) {
	spin_lock_irqsave(&lp->lock, flags);
	update_stats(dev);
	spin_unlock_irqrestore(&lp->lock, flags);
    }
    return &dev->stats;
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:13,代码来源:3c589_cs.c

示例8: spectrum_reset

/*
 * Reset the card using configuration registers COR and CCSR.
 * If IDLE is 1, stop the firmware, so that it can be safely rewritten.
 */
static int
spectrum_reset(struct pcmcia_device *link, int idle)
{
    int ret;
    u8 save_cor;
    u8 ccsr;

    /* Doing it if hardware is gone is guaranteed crash */
    if (!pcmcia_dev_present(link))
        return -ENODEV;

    /* Save original COR value */
    ret = pcmcia_read_config_byte(link, CISREG_COR, &save_cor);
    if (ret)
        goto failed;

    /* Soft-Reset card */
    ret = pcmcia_write_config_byte(link, CISREG_COR,
                                   (save_cor | COR_SOFT_RESET));
    if (ret)
        goto failed;
    udelay(1000);

    /* Read CCSR */
    ret = pcmcia_read_config_byte(link, CISREG_CCSR, &ccsr);
    if (ret)
        goto failed;

    /*
     * Start or stop the firmware.  Memory width bit should be
     * preserved from the value we've just read.
     */
    ccsr = (idle ? HCR_IDLE : HCR_RUN) | (ccsr & HCR_MEM16);
    ret = pcmcia_write_config_byte(link, CISREG_CCSR, ccsr);
    if (ret)
        goto failed;
    udelay(1000);

    /* Restore original COR configuration index */
    ret = pcmcia_write_config_byte(link, CISREG_COR,
                                   (save_cor & ~COR_SOFT_RESET));
    if (ret)
        goto failed;
    udelay(1000);
    return 0;

failed:
    return -ENODEV;
}
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:53,代码来源:spectrum_cs.c

示例9: spectrum_reset

static int
spectrum_reset(struct pcmcia_device *link, int idle)
{
	int ret;
	u8 save_cor;
	u8 ccsr;

	/*                                                  */
	if (!pcmcia_dev_present(link))
		return -ENODEV;

	/*                         */
	ret = pcmcia_read_config_byte(link, CISREG_COR, &save_cor);
	if (ret)
		goto failed;

	/*                 */
	ret = pcmcia_write_config_byte(link, CISREG_COR,
				(save_cor | COR_SOFT_RESET));
	if (ret)
		goto failed;
	udelay(1000);

	/*           */
	ret = pcmcia_read_config_byte(link, CISREG_CCSR, &ccsr);
	if (ret)
		goto failed;

	/*
                                                           
                                             
  */
	ccsr = (idle ? HCR_IDLE : HCR_RUN) | (ccsr & HCR_MEM16);
	ret = pcmcia_write_config_byte(link, CISREG_CCSR, ccsr);
	if (ret)
		goto failed;
	udelay(1000);

	/*                                          */
	ret = pcmcia_write_config_byte(link, CISREG_COR,
				(save_cor & ~COR_SOFT_RESET));
	if (ret)
		goto failed;
	udelay(1000);
	return 0;

failed:
	return -ENODEV;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:49,代码来源:spectrum_cs.c

示例10: pdacf_resume

static int pdacf_resume(struct pcmcia_device *link)
{
	struct snd_pdacf *chip = link->priv;

	snd_printdd(KERN_DEBUG "RESUME\n");
	if (pcmcia_dev_present(link)) {
		if (chip) {
			snd_printdd(KERN_DEBUG "calling snd_pdacf_resume\n");
			snd_pdacf_resume(chip);
		}
	}
	snd_printdd(KERN_DEBUG "resume done!\n");

	return 0;
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:15,代码来源:pdaudiocf.c

示例11: dtl1_write_wakeup

static void dtl1_write_wakeup(dtl1_info_t *info)
{
	if (!info) {
		BT_ERR("Unknown device");
		return;
	}

	if (test_bit(XMIT_WAITING, &(info->tx_state))) {
		set_bit(XMIT_WAKEUP, &(info->tx_state));
		return;
	}

	if (test_and_set_bit(XMIT_SENDING, &(info->tx_state))) {
		set_bit(XMIT_WAKEUP, &(info->tx_state));
		return;
	}

	do {
		unsigned int iobase = info->p_dev->resource[0]->start;
		register struct sk_buff *skb;
		int len;

		clear_bit(XMIT_WAKEUP, &(info->tx_state));

		if (!pcmcia_dev_present(info->p_dev))
			return;

		skb = skb_dequeue(&(info->txq));
		if (!skb)
			break;

		/* Send frame */
		len = dtl1_write(iobase, 32, skb->data, skb->len);

		if (len == skb->len) {
			set_bit(XMIT_WAITING, &(info->tx_state));
			kfree_skb(skb);
		} else {
			skb_pull(skb, len);
			skb_queue_head(&(info->txq), skb);
		}

		info->hdev->stat.byte_tx += len;

	} while (test_bit(XMIT_WAKEUP, &(info->tx_state)));

	clear_bit(XMIT_SENDING, &(info->tx_state));
}
开发者ID:24hours,项目名称:linux,代码行数:48,代码来源:dtl1_cs.c

示例12: vxp_resume

static int vxp_resume(struct pcmcia_device *link)
{
	struct vx_core *chip = link->priv;

	snd_printdd(KERN_DEBUG "RESUME\n");
	if (pcmcia_dev_present(link)) {
		//struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip;
		if (chip) {
			snd_printdd(KERN_DEBUG "calling snd_vx_resume\n");
			snd_vx_resume(chip);
		}
	}
	snd_printdd(KERN_DEBUG "resume done!\n");

	return 0;
}
开发者ID:1yankeedt,项目名称:D710BST_FL24_Kernel,代码行数:16,代码来源:vxpocket.c

示例13: btuart_write_wakeup

static void btuart_write_wakeup(btuart_info_t *info)
{
	if (!info) {
		BT_ERR("Unknown device");
		return;
	}

	if (test_and_set_bit(XMIT_SENDING, &(info->tx_state))) {
		set_bit(XMIT_WAKEUP, &(info->tx_state));
		return;
	}

	do {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
		register unsigned int iobase = info->p_dev->resource[0]->start;
#else
		register unsigned int iobase = info->p_dev->io.BasePort1;
#endif
		register struct sk_buff *skb;
		register int len;

		clear_bit(XMIT_WAKEUP, &(info->tx_state));

		if (!pcmcia_dev_present(info->p_dev))
			return;

		if (!(skb = skb_dequeue(&(info->txq))))
			break;

		/* Send frame */
		len = btuart_write(iobase, 16, skb->data, skb->len);
		set_bit(XMIT_WAKEUP, &(info->tx_state));

		if (len == skb->len) {
			kfree_skb(skb);
		} else {
			skb_pull(skb, len);
			skb_queue_head(&(info->txq), skb);
		}

		info->hdev->stat.byte_tx += len;

	} while (test_bit(XMIT_WAKEUP, &(info->tx_state)));

	clear_bit(XMIT_SENDING, &(info->tx_state));
}
开发者ID:791254467,项目名称:android_cm11_fullsource,代码行数:46,代码来源:btuart_cs.c

示例14: mace_open

/* ----------------------------------------------------------------------------
mace_open
	Open device driver.
---------------------------------------------------------------------------- */
static int mace_open(struct net_device *dev)
{
  kio_addr_t ioaddr = dev->base_addr;
  mace_private *lp = netdev_priv(dev);
  struct pcmcia_device *link = lp->p_dev;

  if (!pcmcia_dev_present(link))
    return -ENODEV;

  link->open++;

  MACEBANK(0);

  netif_start_queue(dev);
  nmclan_reset(dev);

  return 0; /* Always succeed */
} /* mace_open */
开发者ID:cilynx,项目名称:dd-wrt,代码行数:22,代码来源:nmclan_cs.c

示例15: el3_open

static int el3_open(struct net_device *dev)
{
	struct el3_private *lp = netdev_priv(dev);
	struct pcmcia_device *link = lp->p_dev;

	if (!pcmcia_dev_present(link))
		return -ENODEV;

	link->open++;
	netif_start_queue(dev);

	tc589_reset(dev);
	setup_timer(&lp->media, media_check, (unsigned long)dev);
	mod_timer(&lp->media, jiffies + HZ);

	dev_dbg(&link->dev, "%s: opened, status %4.4x.\n",
	  dev->name, inw(dev->base_addr + EL3_STATUS));

	return 0;
}
开发者ID:AshishNamdev,项目名称:linux,代码行数:20,代码来源:3c589_cs.c


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