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


C++ pci_disable_msi函数代码示例

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


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

示例1: mei_me_remove

/**
 * mei_me_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;

	if (mei_pg_is_enabled(dev))
		pm_runtime_get_noresume(&pdev->dev);

	hw = to_me_hw(dev);


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

	if (!pci_dev_run_wake(pdev))
		mei_me_unset_pm_domain(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:andy-shev,项目名称:linux,代码行数:47,代码来源:pci-me.c

示例2: rtsx_suspend

/*
 * power management
 */
static int rtsx_suspend(struct pci_dev *pci, pm_message_t state)
{
	struct rtsx_dev *dev = (struct rtsx_dev *)pci_get_drvdata(pci);
	struct rtsx_chip *chip;

	printk(KERN_INFO "Ready to suspend\n");

	if (!dev) {
		printk(KERN_ERR "Invalid memory\n");
		return 0;
	}
	
	
	mutex_lock(&(dev->dev_mutex));

	chip = dev->chip;
	
	rtsx_do_before_power_down(chip, PM_S3);
	
	if (dev->irq >= 0) {
		synchronize_irq(dev->irq);
		free_irq(dev->irq, (void *)dev);
		dev->irq = -1;
	}
	
	if (chip->msi_en) {
		pci_disable_msi(pci);
	}

	pci_save_state(pci);
	pci_enable_wake(pci, pci_choose_state(pci, state), 1);
	pci_disable_device(pci);
	pci_set_power_state(pci, pci_choose_state(pci, state));

	
	mutex_unlock(&dev->dev_mutex);
	
	return 0;
}
开发者ID:uran1980,项目名称:RTS5209-linux-driver,代码行数:42,代码来源:rtsx.c

示例3: vfio_msi_disable

static void vfio_msi_disable(struct vfio_pci_device *vdev, bool msix)
{
	struct pci_dev *pdev = vdev->pdev;
	int i;

	vfio_msi_set_block(vdev, 0, vdev->num_ctx, NULL, msix);

	for (i = 0; i < vdev->num_ctx; i++) {
		virqfd_disable(vdev, &vdev->ctx[i].unmask);
		virqfd_disable(vdev, &vdev->ctx[i].mask);
	}

	if (msix) {
		pci_disable_msix(vdev->pdev);
		kfree(vdev->msix);
	} else
		pci_disable_msi(pdev);

	vdev->irq_type = VFIO_PCI_NUM_IRQS;
	vdev->num_ctx = 0;
	kfree(vdev->ctx);
}
开发者ID:7799,项目名称:linux,代码行数:22,代码来源:vfio_pci_intrs.c

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

	if (mei_pdev != pdev)
		return;

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

	hw = to_me_hw(dev);


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

	mei_pdev = NULL;

	/* 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:spacex,项目名称:kernel-centos7,代码行数:46,代码来源:pci-me.c

示例5: amdgpu_irq_fini

/**
 * amdgpu_irq_fini - tear down driver interrupt info
 *
 * @adev: amdgpu device pointer
 *
 * Tears down the work irq handlers, vblank handlers, MSIs, etc. (all asics).
 */
void amdgpu_irq_fini(struct amdgpu_device *adev)
{
	unsigned i;

	drm_vblank_cleanup(adev->ddev);
	if (adev->irq.installed) {
		drm_irq_uninstall(adev->ddev);
		adev->irq.installed = false;
		if (adev->irq.msi_enabled)
			pci_disable_msi(adev->pdev);
		flush_work(&adev->hotplug_work);
	}

	for (i = 0; i < AMDGPU_MAX_IRQ_SRC_ID; ++i) {
		struct amdgpu_irq_src *src = adev->irq.sources[i];

		if (!src)
			continue;

		kfree(src->enabled_types);
		src->enabled_types = NULL;
	}
}
开发者ID:WiFiZero,项目名称:ath9k_ocb_linux_4.2.8,代码行数:30,代码来源:amdgpu_irq.c

示例6: i2c_vr_remove

static void i2c_vr_remove(struct pci_dev *dev)
{
	struct i2c_vr_regs __iomem *regs;

	/* disable device */
	regs = i2c_vr[0].regs;
	writel(0, &regs->icr);
	regs = i2c_vr[1].regs;
	writel(0, &regs->icr);

	pci_set_drvdata(dev, NULL);
	i2c_del_adapter(&i2c_vr[1].adap);
	i2c_del_adapter(&i2c_vr[0].adap);

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

	i2c_vr_unmapregs(dev, 1);
	i2c_vr_unmapregs(dev, 0);

	pci_release_regions(dev);
	pci_disable_device(dev);
}
开发者ID:prime5711,项目名称:blackbox,代码行数:23,代码来源:i2c-vr.c

示例7: chd_dec_enable_int

static int chd_dec_enable_int(struct crystalhd_adp *adp)
{
	int rc = 0;

	if (!adp || !adp->pdev) {
		BCMLOG_ERR("Invalid arg!!\n");
		return -EINVAL;
	}

	if (adp->pdev->msi_enabled)
		adp->msi = 1;
	else
		adp->msi = pci_enable_msi(adp->pdev);

	rc = request_irq(adp->pdev->irq, chd_dec_isr, IRQF_SHARED,
			 adp->name, (void *)adp);
	if (rc) {
		BCMLOG_ERR("Interrupt request failed..\n");
		pci_disable_msi(adp->pdev);
	}

	return rc;
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:23,代码来源:crystalhd_lnx.c

示例8: xen_pcibk_disable_msi

static
int xen_pcibk_disable_msi(struct xen_pcibk_device *pdev,
			  struct pci_dev *dev, struct xen_pci_op *op)
{
	if (unlikely(verbose_request))
		printk(KERN_DEBUG DRV_NAME ": %s: disable MSI\n",
		       pci_name(dev));

	if (dev->msi_enabled) {
		struct xen_pcibk_dev_data *dev_data;

		pci_disable_msi(dev);

		dev_data = pci_get_drvdata(dev);
		if (dev_data)
			dev_data->ack_intr = 1;
	}
	op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0;
	if (unlikely(verbose_request))
		printk(KERN_DEBUG DRV_NAME ": %s: MSI: %d\n", pci_name(dev),
			op->value);
	return 0;
}
开发者ID:andy-padavan,项目名称:rt-n56u,代码行数:23,代码来源:pciback_ops.c

示例9: atomisp_pci_remove

static void __devexit atomisp_pci_remove(struct pci_dev *dev)
{
	struct atomisp_device *isp = (struct atomisp_device *)
		pci_get_drvdata(dev);

	pm_runtime_forbid(&dev->dev);
	pm_runtime_get_noresume(&dev->dev);
	pm_qos_remove_request(&isp->pm_qos);

	atomisp_msi_irq_uninit(isp, dev);
	free_irq(dev->irq, isp);
	pci_disable_msi(dev);
	pci_dev_put(isp->hw_contex.pci_root);

	atomisp_unregister_entities(isp);

	flush_workqueue(isp->work_queue);
	destroy_workqueue(isp->work_queue);

	iounmap(atomisp_io_base);
	pci_set_drvdata(dev, NULL);
	pci_release_region(dev, 0);
	pci_disable_device(dev);

	/* in case user forget to close */
	/*
	 * fixing me:
	 * MRFLD VP does not use firmware loading
	 * from file system
	 */
	if (!IS_MRFLD)
		release_firmware(isp->firmware);

	hmm_pool_unregister(HMM_POOL_TYPE_RESERVED);

	kfree(isp);
}
开发者ID:kamarush,项目名称:ZTE_GXIn_Kernel-3.0.8,代码行数:37,代码来源:atomisp_v4l2.c

示例10: rtsx_release_resources

/* Release all our dynamic resources */
static void rtsx_release_resources(struct rtsx_dev *dev)
{
	dev_info(&dev->pci->dev, "-- %s\n", __func__);

	/* Tell the control thread to exit.  The SCSI host must
	 * already have been removed so it won't try to queue
	 * any more commands.
	 */
	dev_info(&dev->pci->dev, "-- sending exit command to thread\n");
	complete(&dev->cmnd_ready);
	if (dev->ctl_thread)
		wait_for_completion(&dev->control_exit);
	if (dev->polling_thread)
		wait_for_completion(&dev->polling_exit);

	wait_timeout(200);

	if (dev->rtsx_resv_buf) {
		dma_free_coherent(&(dev->pci->dev), RTSX_RESV_BUF_LEN,
				dev->rtsx_resv_buf, dev->rtsx_resv_buf_addr);
		dev->chip->host_cmds_ptr = NULL;
		dev->chip->host_sg_tbl_ptr = NULL;
	}

	if (dev->irq > 0)
		free_irq(dev->irq, (void *)dev);
	if (dev->chip->msi_en)
		pci_disable_msi(dev->pci);
	if (dev->remap_addr)
		iounmap(dev->remap_addr);

	pci_disable_device(dev->pci);
	pci_release_regions(dev->pci);

	rtsx_release_chip(dev->chip);
	kfree(dev->chip);
}
开发者ID:alisheikh,项目名称:ktsan,代码行数:38,代码来源:rtsx.c

示例11: mei_txe_remove

/**
 * mei_txe_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_txe_remove(struct pci_dev *pdev)
{
    struct mei_device *dev;
    struct mei_txe_hw *hw;

    dev = pci_get_drvdata(pdev);
    if (!dev) {
        dev_err(&pdev->dev, "mei: dev =NULL\n");
        return;
    }

    pm_runtime_get_noresume(&pdev->dev);

    hw = to_txe_hw(dev);

    mei_stop(dev);

    if (!pci_dev_run_wake(pdev))
        mei_txe_unset_pm_domain(dev);

    /* disable interrupts */
    mei_disable_interrupts(dev);
    free_irq(pdev->irq, dev);
    pci_disable_msi(pdev);

    pci_set_drvdata(pdev, NULL);

    mei_txe_pci_iounmap(pdev, hw);

    mei_deregister(dev);

    kfree(dev);

    pci_release_regions(pdev);
    pci_disable_device(pdev);
}
开发者ID:mhei,项目名称:linux,代码行数:44,代码来源:pci-txe.c

示例12: bcwc_pci_remove

static void bcwc_pci_remove(struct pci_dev *pdev)
{
	struct bcwc_private *dev_priv;

	dev_priv = pci_get_drvdata(pdev);

	if (dev_priv) {
		bcwc_irq_disable(dev_priv);
		pci_disable_msi(pdev);

		if (dev_priv->s2_io)
			iounmap(dev_priv->s2_io);
		if (dev_priv->s2_mem)
			iounmap(dev_priv->s2_mem);
		if (dev_priv->isp_io)
			iounmap(dev_priv->isp_io);

		pci_release_region(pdev, BCWC_PCI_S2_IO);
		pci_release_region(pdev, BCWC_PCI_S2_MEM);
		pci_release_region(pdev, BCWC_PCI_ISP_IO);
	}

	pci_disable_device(pdev);
}
开发者ID:ddcc,项目名称:bcwc_pcie,代码行数:24,代码来源:bcwc_drv.c

示例13: ddb_remove

static void __devexit ddb_remove(struct pci_dev *pdev)
{
	struct ddb *dev = (struct ddb *) pci_get_drvdata(pdev);

	ddb_ports_detach(dev);
	ddb_i2c_release(dev);

	ddbwritel(dev, 0, INTERRUPT_ENABLE);
	ddbwritel(dev, 0, MSI1_ENABLE);
	if (dev->msi == 2)
		free_irq(dev->pdev->irq + 1, dev);
	free_irq(dev->pdev->irq, dev);
#ifdef CONFIG_PCI_MSI
	if (dev->msi)
		pci_disable_msi(dev->pdev);
#endif
	ddb_ports_release(dev);
	ddb_buffers_free(dev);
	ddb_device_destroy(dev);

	ddb_unmap(dev);
	pci_set_drvdata(pdev, 0);
	pci_disable_device(pdev);
}
开发者ID:flensrocker,项目名称:dddvb,代码行数:24,代码来源:ddbridge.c

示例14: pci_endpoint_test_probe


//.........这里部分代码省略.........
		test_reg_bar = data->test_reg_bar;
		test->alignment = data->alignment;
		no_msi = data->no_msi;
	}

	init_completion(&test->irq_raised);
	mutex_init(&test->mutex);

	err = pci_enable_device(pdev);
	if (err) {
		dev_err(dev, "Cannot enable PCI device\n");
		return err;
	}

	err = pci_request_regions(pdev, DRV_MODULE_NAME);
	if (err) {
		dev_err(dev, "Cannot obtain PCI resources\n");
		goto err_disable_pdev;
	}

	pci_set_master(pdev);

	if (!no_msi) {
		irq = pci_alloc_irq_vectors(pdev, 1, 32, PCI_IRQ_MSI);
		if (irq < 0)
			dev_err(dev, "failed to get MSI interrupts\n");
	}

	err = devm_request_irq(dev, pdev->irq, pci_endpoint_test_irqhandler,
			       IRQF_SHARED, DRV_MODULE_NAME, test);
	if (err) {
		dev_err(dev, "failed to request IRQ %d\n", pdev->irq);
		goto err_disable_msi;
	}

	for (i = 1; i < irq; i++) {
		err = devm_request_irq(dev, pdev->irq + i,
				       pci_endpoint_test_irqhandler,
				       IRQF_SHARED, DRV_MODULE_NAME, test);
		if (err)
			dev_err(dev, "failed to request IRQ %d for MSI %d\n",
				pdev->irq + i, i + 1);
	}

	for (bar = BAR_0; bar <= BAR_5; bar++) {
		base = pci_ioremap_bar(pdev, bar);
		if (!base) {
			dev_err(dev, "failed to read BAR%d\n", bar);
			WARN_ON(bar == test_reg_bar);
		}
		test->bar[bar] = base;
	}

	test->base = test->bar[test_reg_bar];
	if (!test->base) {
		dev_err(dev, "Cannot perform PCI test without BAR%d\n",
			test_reg_bar);
		goto err_iounmap;
	}

	pci_set_drvdata(pdev, test);

	id = ida_simple_get(&pci_endpoint_test_ida, 0, 0, GFP_KERNEL);
	if (id < 0) {
		dev_err(dev, "unable to get id\n");
		goto err_iounmap;
	}

	snprintf(name, sizeof(name), DRV_MODULE_NAME ".%d", id);
	misc_device = &test->miscdev;
	misc_device->minor = MISC_DYNAMIC_MINOR;
	misc_device->name = name;
	misc_device->fops = &pci_endpoint_test_fops,

	err = misc_register(misc_device);
	if (err) {
		dev_err(dev, "failed to register device\n");
		goto err_ida_remove;
	}

	return 0;

err_ida_remove:
	ida_simple_remove(&pci_endpoint_test_ida, id);

err_iounmap:
	for (bar = BAR_0; bar <= BAR_5; bar++) {
		if (test->bar[bar])
			pci_iounmap(pdev, test->bar[bar]);
	}

err_disable_msi:
	pci_disable_msi(pdev);
	pci_release_regions(pdev);

err_disable_pdev:
	pci_disable_device(pdev);

	return err;
}
开发者ID:mkrufky,项目名称:linux,代码行数:101,代码来源:pci_endpoint_test.c

示例15: adf_disable_msi

/*
 * adf_disable_msi
 * Function disables MSI capability
 */
STATIC void adf_disable_msi(icp_accel_pci_info_t *pci_dev_info)
{
        ADF_DEBUG("Disabling MSI capability\n");
        pci_disable_msi(pci_dev_info->pDev);
        pci_dev_info->irq = pci_dev_info->pDev->irq;
}
开发者ID:lecoq,项目名称:qat_c2xxx,代码行数:10,代码来源:adf_acceldev_isr.c


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