• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pci_iounmap函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ilo_map_device

static int __devinit ilo_map_device(struct pci_dev *pdev, struct ilo_hwinfo *hw)
{
	int error = -ENOMEM;

	/* map the memory mapped i/o registers */
	hw->mmio_vaddr = pci_iomap(pdev, 1, 0);
	if (hw->mmio_vaddr == NULL) {
		dev_err(&pdev->dev, "Error mapping mmio\n");
		goto out;
	}

	/* map the adapter shared memory region */
	hw->ram_vaddr = pci_iomap(pdev, 2, MAX_CCB * ILOHW_CCB_SZ);
	if (hw->ram_vaddr == NULL) {
		dev_err(&pdev->dev, "Error mapping shared mem\n");
		goto mmio_free;
	}

	/* map the doorbell aperture */
	hw->db_vaddr = pci_iomap(pdev, 3, MAX_CCB * ONE_DB_SIZE);
	if (hw->db_vaddr == NULL) {
		dev_err(&pdev->dev, "Error mapping doorbell\n");
		goto ram_free;
	}

	return 0;
ram_free:
	pci_iounmap(pdev, hw->ram_vaddr);
mmio_free:
	pci_iounmap(pdev, hw->mmio_vaddr);
out:
	return error;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:33,代码来源:hpilo.c


示例2: kvaser_pci_del_chan

static void kvaser_pci_del_chan(struct net_device *dev)
{
	struct sja1000_priv *priv;
	struct kvaser_pci *board;
	int i;

	if (!dev)
		return;
	priv = netdev_priv(dev);
	board = priv->priv;
	if (!board)
		return;

	dev_info(&board->pci_dev->dev, "Removing device %s\n",
		 dev->name);

	/* Disable PCI interrupts */
	kvaser_pci_disable_irq(dev);

	for (i = 0; i < board->no_channels - 1; i++) {
		if (board->slave_dev[i]) {
			dev_info(&board->pci_dev->dev, "Removing device %s\n",
				 board->slave_dev[i]->name);
			unregister_sja1000dev(board->slave_dev[i]);
			free_sja1000dev(board->slave_dev[i]);
		}
	}
	unregister_sja1000dev(dev);

	pci_iounmap(board->pci_dev, priv->reg_base);
	pci_iounmap(board->pci_dev, board->conf_addr);
	pci_iounmap(board->pci_dev, board->res_addr);

	free_sja1000dev(dev);
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:35,代码来源:kvaser_pci.c


示例3: peak_pci_remove

static void __devexit peak_pci_remove(struct pci_dev *pdev)
{
    struct net_device *dev = pci_get_drvdata(pdev); /* Last device */
    struct sja1000_priv *priv = netdev_priv(dev);
    struct peak_pci_chan *chan = priv->priv;
    void __iomem *cfg_base = chan->cfg_base;
    void __iomem *reg_base = priv->reg_base;

    /* Disable interrupts */
    writew(0x0, cfg_base + PITA_ICR + 2);

    /* Loop over all registered devices */
    while (1) {
        dev_info(&pdev->dev, "removing device %s\n", dev->name);
        unregister_sja1000dev(dev);
        free_sja1000dev(dev);
        dev = chan->prev_dev;
        if (!dev)
            break;
        priv = netdev_priv(dev);
        chan = priv->priv;
    }

    pci_iounmap(pdev, reg_base);
    pci_iounmap(pdev, cfg_base);
    pci_release_regions(pdev);
    pci_disable_device(pdev);

    pci_set_drvdata(pdev, NULL);
}
开发者ID:mfkiwl,项目名称:PhoenixA20_linux_sourcecode,代码行数:30,代码来源:peak_pci.c


示例4: ems_pci_del_card

static void ems_pci_del_card(struct pci_dev *pdev)
{
	struct ems_pci_card *card = pci_get_drvdata(pdev);
	struct net_device *dev;
	int i = 0;

	for (i = 0; i < card->channels; i++) {
		dev = card->net_dev[i];

		if (!dev)
			continue;

		dev_info(&pdev->dev, "Removing %s.\n", dev->name);
		unregister_sja1000dev(dev);
		free_sja1000dev(dev);
	}

	if (card->base_addr != NULL)
		pci_iounmap(card->pci_dev, card->base_addr);

	if (card->conf_addr != NULL)
		pci_iounmap(card->pci_dev, card->conf_addr);

	kfree(card);

	pci_disable_device(pdev);
	pci_set_drvdata(pdev, NULL);
}
开发者ID:ARMWorks,项目名称:FA_2451_Linux_Kernel,代码行数:28,代码来源:ems_pci.c


示例5: orinoco_tmd_remove_one

static void orinoco_tmd_remove_one(struct pci_dev *pdev)
{
	struct orinoco_private *priv = pci_get_drvdata(pdev);
	struct orinoco_pci_card *card = priv->card;

	orinoco_if_del(priv);
	free_irq(pdev->irq, priv);
	free_orinocodev(priv);
	pci_iounmap(pdev, priv->hw.iobase);
	pci_iounmap(pdev, card->bridge_io);
	pci_release_regions(pdev);
	pci_disable_device(pdev);
}
开发者ID:020gzh,项目名称:linux,代码行数:13,代码来源:orinoco_tmd.c


示例6: ast_driver_unload

int ast_driver_unload(struct drm_device *dev)
{
	struct ast_private *ast = dev->dev_private;

	ast_mode_fini(dev);
	ast_fbdev_fini(dev);
	drm_mode_config_cleanup(dev);

	ast_mm_fini(ast);
	pci_iounmap(dev->pdev, ast->ioregs);
	pci_iounmap(dev->pdev, ast->regs);
	kfree(ast);
	return 0;
}
开发者ID:03199618,项目名称:linux,代码行数:14,代码来源:ast_main.c


示例7: ec_bhf_remove

static void ec_bhf_remove(struct pci_dev *dev)
{
	struct net_device *net_dev = pci_get_drvdata(dev);
	struct ec_bhf_priv *priv = netdev_priv(net_dev);

	unregister_netdev(net_dev);
	free_netdev(net_dev);

	pci_iounmap(dev, priv->dma_io);
	pci_iounmap(dev, priv->io);
	pci_release_regions(dev);
	pci_clear_master(dev);
	pci_disable_device(dev);
}
开发者ID:AshishNamdev,项目名称:linux,代码行数:14,代码来源:ec_bhf.c


示例8: virtio_pci_legacy_remove

void virtio_pci_legacy_remove(struct virtio_pci_device *vp_dev)
{
	struct pci_dev *pci_dev = vp_dev->pci_dev;

	pci_iounmap(pci_dev, vp_dev->ioaddr);
	pci_release_region(pci_dev, 0);
}
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:7,代码来源:virtio_pci_legacy.c


示例9: plx_pci_reset_marathon_pcie

/* Special reset function for Marathon CAN-bus-PCIe card */
static void plx_pci_reset_marathon_pcie(struct pci_dev *pdev)
{
	void __iomem *addr;
	void __iomem *reset_addr;
	int i;

	plx9056_pci_reset_common(pdev);

	for (i = 0; i < 2; i++) {
		struct plx_pci_channel_map *chan_map =
			&plx_pci_card_info_marathon_pcie.chan_map_tbl[i];
		addr = pci_iomap(pdev, chan_map->bar, chan_map->size);
		if (!addr) {
			dev_err(&pdev->dev, "Failed to remap reset "
				"space %d (BAR%d)\n", i, chan_map->bar);
		} else {
			/* reset the SJA1000 chip */
			#define MARATHON_PCIE_RESET_OFFSET 32
			reset_addr = addr + chan_map->offset +
			             MARATHON_PCIE_RESET_OFFSET;
			iowrite8(0x1, reset_addr);
			udelay(100);
			pci_iounmap(pdev, addr);
		}
	}
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:27,代码来源:plx_pci.c


示例10: marvell_pata_active

static int marvell_pata_active(struct pci_dev *pdev)
{
	int i;
	u32 devices;
	void __iomem *barp;

	/* We don't yet know how to do this for other devices */
	if (pdev->device != 0x6145)
		return 1;

	barp = pci_iomap(pdev, 5, 0x10);
	if (barp == NULL)
		return -ENOMEM;

	printk("BAR5:");
	for(i = 0; i <= 0x0F; i++)
		printk("%02X:%02X ", i, ioread8(barp + i));
	printk("\n");

	devices = ioread32(barp + 0x0C);
	pci_iounmap(pdev, barp);

	if (devices & 0x10)
		return 1;
	return 0;
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:26,代码来源:pata_marvell.c


示例11: mga_vram_fini

/* Unmap the framebuffer from the core and release the memory */
static void mga_vram_fini(struct mga_device *mdev)
{
	pci_iounmap(mdev->dev->pdev, mdev->rmmio);
	mdev->rmmio = NULL;
	if (mdev->mc.vram_base)
		release_mem_region(mdev->mc.vram_base, mdev->mc.vram_window);
}
开发者ID:ARMWorks,项目名称:FA_2451_Linux_Kernel,代码行数:8,代码来源:mgag200_main.c


示例12: orinoco_plx_remove_one

static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev)
{
	struct net_device *dev = pci_get_drvdata(pdev);
	struct orinoco_private *priv = netdev_priv(dev);
	struct orinoco_pci_card *card = priv->card;

	unregister_netdev(dev);
	free_irq(pdev->irq, dev);
	pci_set_drvdata(pdev, NULL);
	free_orinocodev(dev);
	pci_iounmap(pdev, priv->hw.iobase);
	pci_iounmap(pdev, card->attr_io);
	pci_iounmap(pdev, card->bridge_io);
	pci_release_regions(pdev);
	pci_disable_device(pdev);
}
开发者ID:AppEngine,项目名称:linux-2.6,代码行数:16,代码来源:orinoco_plx.c


示例13: marvell_pre_reset

static int marvell_pre_reset(struct ata_link *link, unsigned long deadline)
{
	struct ata_port *ap = link->ap;
	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
	u32 devices;
	void __iomem *barp;
	int i;

	/* Check if our port is enabled */

	barp = pci_iomap(pdev, 5, 0x10);
	if (barp == NULL)
		return -ENOMEM;
	printk("BAR5:");
	for(i = 0; i <= 0x0F; i++)
		printk("%02X:%02X ", i, ioread8(barp + i));
	printk("\n");

	devices = ioread32(barp + 0x0C);
	pci_iounmap(pdev, barp);

	if ((pdev->device == 0x6145) && (ap->port_no == 0) &&
	    (!(devices & 0x10)))	/* PATA enable ? */
		return -ENOENT;

	return ata_std_prereset(link, deadline);
}
开发者ID:PennPanda,项目名称:linux-repo,代码行数:27,代码来源:pata_marvell.c


示例14: adf_cleanup_accel

static void adf_cleanup_accel(struct adf_accel_dev *accel_dev)
{
	struct adf_accel_pci *accel_pci_dev = &accel_dev->accel_pci_dev;
	int i;

	adf_dev_shutdown(accel_dev);

	for (i = 0; i < ADF_PCI_MAX_BARS; i++) {
		struct adf_bar *bar = &accel_pci_dev->pci_bars[i];

		if (bar->virt_addr)
			pci_iounmap(accel_pci_dev->pci_dev, bar->virt_addr);
	}

	if (accel_dev->hw_device) {
		switch (accel_dev->hw_device->pci_dev_id) {
		case ADF_DH895XCC_PCI_DEVICE_ID:
			adf_clean_hw_data_dh895xcc(accel_dev->hw_device);
			break;
		default:
			break;
		}
		kfree(accel_dev->hw_device);
	}
	adf_cfg_dev_remove(accel_dev);
	debugfs_remove(accel_dev->debugfs_dir);
	adf_devmgr_rm_dev(accel_dev);
	pci_release_regions(accel_pci_dev->pci_dev);
	pci_disable_device(accel_pci_dev->pci_dev);
	kfree(accel_dev);
}
开发者ID:hemaprathaban,项目名称:linux-1,代码行数:31,代码来源:adf_drv.c


示例15: mga_vram_init

/* Map the framebuffer from the card and configure the core */
static int mga_vram_init(struct mga_device *mdev)
{
	void __iomem *mem;
	struct apertures_struct *aper = alloc_apertures(1);
	if (!aper)
		return -ENOMEM;

	/* BAR 0 is VRAM */
	mdev->mc.vram_base = pci_resource_start(mdev->dev->pdev, 0);
	mdev->mc.vram_window = pci_resource_len(mdev->dev->pdev, 0);

	aper->ranges[0].base = mdev->mc.vram_base;
	aper->ranges[0].size = mdev->mc.vram_window;

	remove_conflicting_framebuffers(aper, "mgafb", true);
	kfree(aper);

	if (!devm_request_mem_region(mdev->dev->dev, mdev->mc.vram_base, mdev->mc.vram_window,
				"mgadrmfb_vram")) {
		DRM_ERROR("can't reserve VRAM\n");
		return -ENXIO;
	}

	mem = pci_iomap(mdev->dev->pdev, 0, 0);

	mdev->mc.vram_size = mga_probe_vram(mdev, mem);

	pci_iounmap(mdev->dev->pdev, mem);

	return 0;
}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:32,代码来源:mgag200_main.c


示例16: wil_pcie_remove

static void wil_pcie_remove(struct pci_dev *pdev)
{
	struct wil6210_priv *wil = pci_get_drvdata(pdev);
	void __iomem *csr = wil->csr;

	wil_dbg_misc(wil, "%s()\n", __func__);

#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
	unregister_pm_notifier(&wil->pm_notify);
#endif /* CONFIG_PM_SLEEP */
#endif /* CONFIG_PM */

	wil6210_debugfs_remove(wil);
	rtnl_lock();
	wil_p2p_wdev_free(wil);
	rtnl_unlock();
	wil_if_remove(wil);
	wil_if_pcie_disable(wil);
	pci_iounmap(pdev, csr);
	pci_release_region(pdev, 0);
	pci_disable_device(pdev);
	if (wil->platform_ops.uninit)
		wil->platform_ops.uninit(wil->platform_handle);
	wil_if_free(wil);
}
开发者ID:acton393,项目名称:linux,代码行数:26,代码来源:pcie_bus.c


示例17: xordev_remove

void
xordev_remove(struct pci_dev *dev)
/* PCI device destructor */
{
  struct xordev_str *xordev;
  int j;
  dev_t devt;

  mutex_lock(&global_lock);

  xordev = pci_get_drvdata(dev);
  iowrite32(0, xordev->bar + BAR_INTR_EN); /* disable interruptions */
  free_irq(dev->irq, xordev);
  pci_iounmap(dev, xordev->bar);
  pci_release_regions(dev);
  pci_disable_device(dev);
  for (j = 0; j < 3; j++) {
    devt = MKDEV(MAJOR(xordev->devno), MINOR(xordev->devno) + j);
    device_destroy(xordev_class, devt);
    cdev_del(&xordev->cdev[j]);
  }
  mutex_destroy(&xordev->mutex);

  mutex_unlock(&global_lock);
  return ;
}
开发者ID:wojtekzozlak,项目名称:Studia.Archiwum,代码行数:26,代码来源:xordev.c


示例18: mei_me_remove

/**
 * mei_remove - Device Removal Routine
 *
 * @pdev: PCI device structure
 *
 * mei_remove is called by the PCI subsystem to alert the driver
 * that it should release a PCI device.
 */
static void mei_me_remove(struct pci_dev *pdev)
{
	struct mei_device *dev;
	struct mei_me_hw *hw;

	dev = pci_get_drvdata(pdev);
	if (!dev)
		return;

	hw = to_me_hw(dev);


	dev_dbg(&pdev->dev, "stop\n");
	mei_stop(dev);

	/* disable interrupts */
	mei_disable_interrupts(dev);

	free_irq(pdev->irq, dev);
	pci_disable_msi(pdev);

	if (hw->mem_addr)
		pci_iounmap(pdev, hw->mem_addr);

	mei_deregister(dev);

	kfree(dev);

	pci_release_regions(pdev);
	pci_disable_device(pdev);


}
开发者ID:7799,项目名称:linux,代码行数:41,代码来源:pci-me.c


示例19: piix_disable_ahci

static int piix_disable_ahci(struct pci_dev *pdev)
{
	void __iomem *mmio;
	u32 tmp;
	int rc = 0;

	/* BUG: pci_enable_device has not yet been called.  This
	 * works because this device is usually set up by BIOS.
	 */

	if (!pci_resource_start(pdev, AHCI_PCI_BAR) ||
	    !pci_resource_len(pdev, AHCI_PCI_BAR))
		return 0;

	mmio = pci_iomap(pdev, AHCI_PCI_BAR, 64);
	if (!mmio)
		return -ENOMEM;

	tmp = readl(mmio + AHCI_GLOBAL_CTL);
	if (tmp & AHCI_ENABLE) {
		tmp &= ~AHCI_ENABLE;
		writel(tmp, mmio + AHCI_GLOBAL_CTL);

		tmp = readl(mmio + AHCI_GLOBAL_CTL);
		if (tmp & AHCI_ENABLE)
			rc = -EIO;
	}

	pci_iounmap(pdev, mmio);
	return rc;
}
开发者ID:robacklin,项目名称:uclinux-linux,代码行数:31,代码来源:ata_piix.c


示例20: tpci200_unregister

static void tpci200_unregister(struct tpci200_board *tpci200)
{
    free_irq(tpci200->info->pdev->irq, (void *) tpci200);

    pci_iounmap(tpci200->info->pdev, tpci200->info->interface_regs);
    pci_iounmap(tpci200->info->pdev, tpci200->info->cfg_regs);

    pci_release_region(tpci200->info->pdev, TPCI200_IP_INTERFACE_BAR);
    pci_release_region(tpci200->info->pdev, TPCI200_IO_ID_INT_SPACES_BAR);
    pci_release_region(tpci200->info->pdev, TPCI200_MEM16_SPACE_BAR);
    pci_release_region(tpci200->info->pdev, TPCI200_MEM8_SPACE_BAR);
    pci_release_region(tpci200->info->pdev, TPCI200_CFG_MEM_BAR);

    pci_disable_device(tpci200->info->pdev);
    pci_dev_put(tpci200->info->pdev);
}
开发者ID:kennethlyn,项目名称:parallella-lcd-linux,代码行数:16,代码来源:tpci200.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pci_is_pcie函数代码示例发布时间:2022-05-30
下一篇:
C++ pci_ioremap_bar函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap