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


C++ pci_release_region函数代码示例

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


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

示例1: kp2000_pcie_remove

static void kp2000_pcie_remove(struct pci_dev *pdev)
{
	struct kp2000_device *pcard = pci_get_drvdata(pdev);

	dev_dbg(&pdev->dev, "kp2000_pcie_remove(pdev=%p)\n", pdev);

	if (pcard == NULL)
		return;

	mutex_lock(&pcard->sem);
	kp2000_remove_cores(pcard);
	mfd_remove_devices(PCARD_TO_DEV(pcard));
	misc_deregister(&pcard->miscdev);
	sysfs_remove_files(&(pdev->dev.kobj), kp_attr_list);
	free_irq(pcard->pdev->irq, pcard);
	pci_disable_msi(pcard->pdev);
	if (pcard->dma_bar_base != NULL) {
		iounmap(pcard->dma_bar_base);
		pci_release_region(pdev, DMA_BAR);
		pcard->dma_bar_base = NULL;
	}
	if (pcard->regs_bar_base != NULL) {
		iounmap(pcard->regs_bar_base);
		pci_release_region(pdev, REG_BAR);
		pcard->regs_bar_base = NULL;
	}
	pci_disable_device(pcard->pdev);
	pci_set_drvdata(pdev, NULL);
	mutex_unlock(&pcard->sem);
	ida_simple_remove(&card_num_ida, pcard->card_num);
	kfree(pcard);
}
开发者ID:grate-driver,项目名称:linux,代码行数:32,代码来源:core.c

示例2: cxl_map_adapter_regs

static int cxl_map_adapter_regs(struct cxl *adapter, struct pci_dev *dev)
{
	if (pci_request_region(dev, 2, "priv 2 regs"))
		goto err1;
	if (pci_request_region(dev, 0, "priv 1 regs"))
		goto err2;

	pr_devel("cxl_map_adapter_regs: p1: %#.16llx %#llx, p2: %#.16llx %#llx",
			p1_base(dev), p1_size(dev), p2_base(dev), p2_size(dev));

	if (!(adapter->p1_mmio = ioremap(p1_base(dev), p1_size(dev))))
		goto err3;

	if (!(adapter->p2_mmio = ioremap(p2_base(dev), p2_size(dev))))
		goto err4;

	return 0;

err4:
	iounmap(adapter->p1_mmio);
	adapter->p1_mmio = NULL;
err3:
	pci_release_region(dev, 0);
err2:
	pci_release_region(dev, 2);
err1:
	return -ENOMEM;
}
开发者ID:greguu,项目名称:linux-4.2.3-c3x00,代码行数:28,代码来源:pci.c

示例3: intel_mcu_remove

static void intel_mcu_remove(struct pci_dev *pdev)
{
	struct mcu *mcu;

	mcu = dev_get_drvdata(&pdev->dev);
	iounmap((void __iomem *)mcu->ddr[0]);
	iounmap((void __iomem *)mcu->ddr[1]);

	pci_release_region(pdev, 0);
	pci_release_region(pdev, 1);
	pci_dev_put(pdev);
}
开发者ID:0x000000FF,项目名称:Linux4Edison,代码行数:12,代码来源:intel_mcu_common.c

示例4: asd_unmap_memio

static void __devexit asd_unmap_memio(struct asd_ha_struct *asd_ha)
{
	struct asd_ha_addrspace *io_handle;

	io_handle = &asd_ha->io_handle[1];
	iounmap(io_handle->addr);
	pci_release_region(asd_ha->pcidev, 2);

	io_handle = &asd_ha->io_handle[0];
	iounmap(io_handle->addr);
	pci_release_region(asd_ha->pcidev, 0);
}
开发者ID:Mr-Aloof,项目名称:wl500g,代码行数:12,代码来源:aic94xx_init.c

示例5: asd_map_memio

static int asd_map_memio(struct asd_ha_struct *asd_ha)
{
	int err, i;
	struct asd_ha_addrspace *io_handle;

	asd_ha->iospace = 0;
	for (i = 0; i < 3; i += 2) {
		io_handle = &asd_ha->io_handle[i==0?0:1];
		io_handle->start = pci_resource_start(asd_ha->pcidev, i);
		io_handle->len   = pci_resource_len(asd_ha->pcidev, i);
		io_handle->flags = pci_resource_flags(asd_ha->pcidev, i);
		err = -ENODEV;
		if (!io_handle->start || !io_handle->len) {
			asd_printk("MBAR%d start or length for %s is 0.\n",
				   i==0?0:1, pci_name(asd_ha->pcidev));
			goto Err;
		}
		err = pci_request_region(asd_ha->pcidev, i, ASD_DRIVER_NAME);
		if (err) {
			asd_printk("couldn't reserve memory region for %s\n",
				   pci_name(asd_ha->pcidev));
			goto Err;
		}
		if (io_handle->flags & IORESOURCE_CACHEABLE)
			io_handle->addr = ioremap(io_handle->start,
						  io_handle->len);
		else
			io_handle->addr = ioremap_nocache(io_handle->start,
							  io_handle->len);
		if (!io_handle->addr) {
			asd_printk("couldn't map MBAR%d of %s\n", i==0?0:1,
				   pci_name(asd_ha->pcidev));
			err = -ENOMEM;
			goto Err_unreq;
		}
	}

	return 0;
Err_unreq:
	pci_release_region(asd_ha->pcidev, i);
Err:
	if (i > 0) {
		io_handle = &asd_ha->io_handle[0];
		iounmap(io_handle->addr);
		pci_release_region(asd_ha->pcidev, 0);
	}
	return err;
}
开发者ID:aejsmith,项目名称:linux,代码行数:48,代码来源:aic94xx_init.c

示例6: OSPCIReleaseDev

/*************************************************************************/ /*!
@Function       OSPCIReleaseDev
@Description    Release a PCI device that is no longer being used
@Input          hPVRPCI                 PCI device handle
@Return	        PVRSRV_ERROR	        Services error code
*/ /**************************************************************************/
PVRSRV_ERROR OSPCIReleaseDev(PVRSRV_PCI_DEV_HANDLE hPVRPCI)
{
	PVR_PCI_DEV *psPVRPCI = (PVR_PCI_DEV *)hPVRPCI;
	int i;

	/* Release all PCI regions that are currently in use */
	for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
	{
		if (psPVRPCI->abPCIResourceInUse[i])
		{
			pci_release_region(psPVRPCI->psPCIDev, i);
			psPVRPCI->abPCIResourceInUse[i] = IMG_FALSE;
		}
	}

#if defined(CONFIG_PCI_MSI)
	if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_MSI)		/* PRQA S 3358 */ /* misuse of enums */
	{
		pci_disable_msi(psPVRPCI->psPCIDev);
	}
#endif

	if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER)	/* PRQA S 3358 */ /* misuse of enums */
	{
		pci_clear_master(psPVRPCI->psPCIDev);
	}

	pci_disable_device(psPVRPCI->psPCIDev);

	kfree((IMG_VOID *)psPVRPCI);
	/*not nulling pointer, copy on stack*/

	return PVRSRV_OK;
}
开发者ID:DanBjorklund,项目名称:ME302C,代码行数:40,代码来源:pci_support.c

示例7: 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

示例8: 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

示例9: tc86c001_init_one

static int __devinit tc86c001_init_one(struct pci_dev *dev,
				       const struct pci_device_id *id)
{
	int rc;

	rc = pci_enable_device(dev);
	if (rc)
		goto out;

	rc = pci_request_region(dev, 5, DRV_NAME);
	if (rc) {
		printk(KERN_ERR DRV_NAME ": system control regs already in use");
		goto out_disable;
	}

	rc = ide_pci_init_one(dev, &tc86c001_chipset, NULL);
	if (rc)
		goto out_release;

	goto out;

out_release:
	pci_release_region(dev, 5);
out_disable:
	pci_disable_device(dev);
out:
	return rc;
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:28,代码来源:tc86c001.c

示例10: virtio_pci_legacy_probe

/* the PCI probing function */
int virtio_pci_legacy_probe(struct virtio_pci_device *vp_dev)
{
	struct pci_dev *pci_dev = vp_dev->pci_dev;
	int rc;

	/* We only own devices >= 0x1000 and <= 0x103f: leave the rest. */
	if (pci_dev->device < 0x1000 || pci_dev->device > 0x103f)
		return -ENODEV;

	if (pci_dev->revision != VIRTIO_PCI_ABI_VERSION) {
		printk(KERN_ERR "virtio_pci: expected ABI version %d, got %d\n",
		       VIRTIO_PCI_ABI_VERSION, pci_dev->revision);
		return -ENODEV;
	}

	rc = dma_set_mask(&pci_dev->dev, DMA_BIT_MASK(64));
	if (rc) {
		rc = dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32));
	} else {
		/*
		 * The virtio ring base address is expressed as a 32-bit PFN,
		 * with a page size of 1 << VIRTIO_PCI_QUEUE_ADDR_SHIFT.
		 */
		dma_set_coherent_mask(&pci_dev->dev,
				DMA_BIT_MASK(32 + VIRTIO_PCI_QUEUE_ADDR_SHIFT));
	}

	if (rc)
		dev_warn(&pci_dev->dev, "Failed to enable 64-bit or 32-bit DMA.  Trying to continue, but this might not work.\n");

	rc = pci_request_region(pci_dev, 0, "virtio-pci-legacy");
	if (rc)
		return rc;

	rc = -ENOMEM;
	vp_dev->ioaddr = pci_iomap(pci_dev, 0, 0);
	if (!vp_dev->ioaddr)
		goto err_iomap;

	vp_dev->isr = vp_dev->ioaddr + VIRTIO_PCI_ISR;

	/* we use the subsystem vendor/device id as the virtio vendor/device
	 * id.  this allows us to use the same PCI vendor/device id for all
	 * virtio devices and to identify the particular virtio driver by
	 * the subsystem ids */
	vp_dev->vdev.id.vendor = pci_dev->subsystem_vendor;
	vp_dev->vdev.id.device = pci_dev->subsystem_device;

	vp_dev->vdev.config = &virtio_pci_config_ops;

	vp_dev->config_vector = vp_config_vector;
	vp_dev->setup_vq = setup_vq;
	vp_dev->del_vq = del_vq;

	return 0;

err_iomap:
	pci_release_region(pci_dev, 0);
	return rc;
}
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:61,代码来源:virtio_pci_legacy.c

示例11: 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

示例12: ath_pci_cleanup

static void ath_pci_cleanup(struct ath_softc *sc)
{
	struct pci_dev *pdev = to_pci_dev(sc->dev);

	pci_iounmap(pdev, sc->mem);
	pci_disable_device(pdev);
	pci_release_region(pdev, 0);
}
开发者ID:Addision,项目名称:LVS,代码行数:8,代码来源:pci.c

示例13: piix4_poweroff_remove

static void piix4_poweroff_remove(struct pci_dev *dev)
{
	if (pm_power_off == piix4_poweroff)
		pm_power_off = NULL;

	pci_release_region(dev, piix4_pm_io_region);
	pm_dev = NULL;
}
开发者ID:AshishNamdev,项目名称:linux,代码行数:8,代码来源:piix4-poweroff.c

示例14: test_pci_remove

static void test_pci_remove(struct pci_dev *pdev)
{
	pci_free_consistent(dev_data->pdev, TEST_CDMA_BUFFER_SIZE,
			dev_data->cdma_buffer, dev_data->cdma_addr);

	cdev_del(dev_data->cdev);
	unregister_chrdev_region(test_pci_devt, test_pci_devs_max);

	free_irq(dev_data->pdev->irq, dev_data->pdev);

	iounmap(dev_data->mmio_addr);

	pci_release_region(dev_data->pdev, BAR_MMIO);
	pci_release_region(dev_data->pdev, BAR_PIO);
	pci_disable_device(dev_data->pdev);

	tprintk("%s driver (major %d) unloaded\n", DRIVER_TEST_NAME, test_pci_major);
}
开发者ID:Jameshzc,项目名称:qemu_example_virtual_pcidev,代码行数:18,代码来源:test_pci_driver.c

示例15: cxl_remove_adapter

static void cxl_remove_adapter(struct cxl *adapter)
{
	struct pci_dev *pdev = to_pci_dev(adapter->dev.parent);

	pr_devel("cxl_release_adapter\n");

	cxl_sysfs_adapter_remove(adapter);
	cxl_debugfs_adapter_remove(adapter);
	cxl_release_psl_err_irq(adapter);
	cxl_unmap_adapter_regs(adapter);
	cxl_remove_adapter_nr(adapter);

	device_unregister(&adapter->dev);

	pci_release_region(pdev, 0);
	pci_release_region(pdev, 2);
	pci_disable_device(pdev);
}
开发者ID:greguu,项目名称:linux-4.2.3-c3x00,代码行数:18,代码来源:pci.c


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