本文整理汇总了C++中pci_choose_state函数的典型用法代码示例。如果您正苦于以下问题:C++ pci_choose_state函数的具体用法?C++ pci_choose_state怎么用?C++ pci_choose_state使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pci_choose_state函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: rtsx_suspend
/*
* power management
*/
static int rtsx_suspend(struct pci_dev *pci, pm_message_t state)
{
struct rtsx_dev *dev = pci_get_drvdata(pci);
struct rtsx_chip *chip;
if (!dev)
return 0;
/* lock the device pointers */
mutex_lock(&(dev->dev_mutex));
chip = dev->chip;
rtsx_do_before_power_down(chip, PM_S3);
if (dev->irq >= 0) {
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));
/* unlock the device pointers */
mutex_unlock(&dev->dev_mutex);
return 0;
}
开发者ID:acton393,项目名称:linux,代码行数:36,代码来源:rtsx.c
示例2: rt2860_suspend
static int rt2860_suspend(
struct pci_dev *pci_dev,
pm_message_t state)
{
struct net_device *net_dev = pci_get_drvdata(pci_dev);
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)NULL;
INT32 retval = 0;
DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_suspend()\n"));
if (net_dev == NULL)
{
DBGPRINT(RT_DEBUG_ERROR, ("net_dev == NULL!\n"));
}
else
{
GET_PAD_FROM_NET_DEV(pAd, net_dev);
/* we can not use IFF_UP because ra0 down but ra1 up */
/* and 1 suspend/resume function for 1 module, not for each interface */
/* so Linux will call suspend/resume function once */
if (VIRTUAL_IF_NUM(pAd) > 0)
{
// avoid users do suspend after interface is down
// stop interface
netif_carrier_off(net_dev);
netif_stop_queue(net_dev);
// mark device as removed from system and therefore no longer available
netif_device_detach(net_dev);
// mark halt flag
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
// take down the device
rt28xx_close((PNET_DEV)net_dev);
RT_MOD_DEC_USE_COUNT();
}
}
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,10)
// reference to http://vovo2000.com/type-lab/linux/kernel-api/linux-kernel-api.html
// enable device to generate PME# when suspended
// pci_choose_state(): Choose the power state of a PCI device to be suspended
retval = pci_enable_wake(pci_dev, pci_choose_state(pci_dev, state), 1);
// save the PCI configuration space of a device before suspending
pci_save_state(pci_dev);
// disable PCI device after use
pci_disable_device(pci_dev);
retval = pci_set_power_state(pci_dev, pci_choose_state(pci_dev, state));
#endif
DBGPRINT(RT_DEBUG_TRACE, ("<=== rt2860_suspend()\n"));
return retval;
}
开发者ID:jaskcon,项目名称:rt3090,代码行数:60,代码来源:pci_main_dev.c
示例3: chd_dec_pci_suspend
int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct crystalhd_adp *adp;
struct crystalhd_ioctl_data *temp;
enum BC_STATUS sts = BC_STS_SUCCESS;
adp = (struct crystalhd_adp *)pci_get_drvdata(pdev);
if (!adp) {
BCMLOG_ERR("could not get adp\n");
return -ENODEV;
}
temp = chd_dec_alloc_iodata(adp, false);
if (!temp) {
BCMLOG_ERR("could not get ioctl data\n");
return -ENODEV;
}
sts = crystalhd_suspend(&adp->cmds, temp);
if (sts != BC_STS_SUCCESS) {
BCMLOG_ERR("BCM70012 Suspend %d\n", sts);
return -ENODEV;
}
chd_dec_free_iodata(adp, temp, false);
chd_dec_disable_int(adp);
pci_save_state(pdev);
/* Disable IO/bus master/irq router */
pci_disable_device(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
return 0;
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:33,代码来源:crystalhd_lnx.c
示例4: snd_cs5535audio_suspend
int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state)
{
struct snd_card *card = pci_get_drvdata(pci);
struct cs5535audio *cs5535au = card->private_data;
int i;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(cs5535au->pcm);
snd_ac97_suspend(cs5535au->ac97);
for (i = 0; i < NUM_CS5535AUDIO_DMAS; i++) {
struct cs5535audio_dma *dma = &cs5535au->dmas[i];
if (dma && dma->substream)
dma->saved_prd = dma->ops->read_prd(cs5535au);
}
/* save important regs, then disable aclink in hw */
snd_cs5535audio_stop_hardware(cs5535au);
if (pci_save_state(pci)) {
printk(KERN_ERR "cs5535audio: pci_save_state failed!\n");
return -EIO;
}
pci_disable_device(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
return 0;
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:25,代码来源:cs5535audio_pm.c
示例5: agp_amdk7_suspend
static int agp_amdk7_suspend(struct pci_dev *pdev, pm_message_t state)
{
pci_save_state(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
return 0;
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:7,代码来源:amd-k7-agp.c
示例6: oxygen_pci_suspend
int oxygen_pci_suspend(struct pci_dev *pci, pm_message_t state)
{
struct snd_card *card = pci_get_drvdata(pci);
struct oxygen *chip = card->private_data;
unsigned int i, saved_interrupt_mask;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
for (i = 0; i < PCM_COUNT; ++i)
if (chip->streams[i])
snd_pcm_suspend(chip->streams[i]);
if (chip->model.suspend)
chip->model.suspend(chip);
spin_lock_irq(&chip->reg_lock);
saved_interrupt_mask = chip->interrupt_mask;
chip->interrupt_mask = 0;
oxygen_write16(chip, OXYGEN_DMA_STATUS, 0);
oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, 0);
spin_unlock_irq(&chip->reg_lock);
synchronize_irq(chip->irq);
flush_scheduled_work();
chip->interrupt_mask = saved_interrupt_mask;
pci_disable_device(pci);
pci_save_state(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
return 0;
}
开发者ID:458941968,项目名称:mini2440-kernel-2.6.29,代码行数:31,代码来源:oxygen_lib.c
示例7: snd_emu10k1_suspend
static int snd_emu10k1_suspend(struct pci_dev *pci, pm_message_t state)
{
struct snd_card *card = pci_get_drvdata(pci);
struct snd_emu10k1 *emu = card->private_data;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(emu->pcm);
snd_pcm_suspend_all(emu->pcm_mic);
snd_pcm_suspend_all(emu->pcm_efx);
snd_pcm_suspend_all(emu->pcm_multi);
snd_pcm_suspend_all(emu->pcm_p16v);
snd_ac97_suspend(emu->ac97);
snd_emu10k1_efx_suspend(emu);
snd_emu10k1_suspend_regs(emu);
if (emu->card_capabilities->ca0151_chip)
snd_p16v_suspend(emu);
snd_emu10k1_done(emu);
pci_disable_device(pci);
pci_save_state(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
return 0;
}
开发者ID:303750856,项目名称:linux-3.1,代码行数:27,代码来源:emu10k1.c
示例8: delkin_cb_suspend
static int delkin_cb_suspend(struct pci_dev *dev, pm_message_t state)
{
pci_save_state(dev);
pci_disable_device(dev);
pci_set_power_state(dev, pci_choose_state(dev, state));
return 0;
}
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:8,代码来源:delkin_cb.c
示例9: rtl8192E_suspend
int rtl8192E_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct net_device *dev = pci_get_drvdata(pdev);
struct r8192_priv *priv = rtllib_priv(dev);
u32 ulRegRead;
netdev_info(dev, "============> r8192E suspend call.\n");
del_timer_sync(&priv->gpio_polling_timer);
cancel_delayed_work(&priv->gpio_change_rf_wq);
priv->polling_timer_on = 0;
if (!netif_running(dev)) {
netdev_info(dev,
"RTL819XE:UI is open out of suspend function\n");
goto out_pci_suspend;
}
if (dev->netdev_ops->ndo_stop)
dev->netdev_ops->ndo_stop(dev);
netif_device_detach(dev);
if (!priv->rtllib->bSupportRemoteWakeUp) {
MgntActSet_RF_State(dev, eRfOff, RF_CHANGE_BY_INIT, true);
ulRegRead = read_nic_dword(dev, CPU_GEN);
ulRegRead |= CPU_GEN_SYSTEM_RESET;
write_nic_dword(dev, CPU_GEN, ulRegRead);
} else {
write_nic_dword(dev, WFCRC0, 0xffffffff);
write_nic_dword(dev, WFCRC1, 0xffffffff);
write_nic_dword(dev, WFCRC2, 0xffffffff);
write_nic_byte(dev, PMR, 0x5);
write_nic_byte(dev, MacBlkCtrl, 0xa);
}
out_pci_suspend:
netdev_info(dev, "WOL is %s\n", priv->rtllib->bSupportRemoteWakeUp ?
"Supported" : "Not supported");
pci_save_state(pdev);
pci_disable_device(pdev);
pci_enable_wake(pdev, pci_choose_state(pdev, state),
priv->rtllib->bSupportRemoteWakeUp ? 1 : 0);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
mdelay(20);
return 0;
}
开发者ID:lovejavaee,项目名称:linux-2,代码行数:46,代码来源:rtl_pm.c
示例10: OSPCIResumeDev
/*************************************************************************/ /*!
@Function OSPCIResumeDev
@Description Prepare a PCI device to be resumed by power management
@Input hPVRPCI PCI device handle
@Return PVRSRV_ERROR Services error code
*/ /**************************************************************************/
PVRSRV_ERROR OSPCIResumeDev(PVRSRV_PCI_DEV_HANDLE hPVRPCI)
{
PVR_PCI_DEV *psPVRPCI = (PVR_PCI_DEV *)hPVRPCI;
int err;
int i;
err = pci_set_power_state(psPVRPCI->psPCIDev, pci_choose_state(psPVRPCI->psPCIDev, PMSG_ON));
switch(err)
{
case 0:
break;
case -EIO:
printk(KERN_ERR "OSPCIResumeDev: device doesn't support PCI PM");
break;
case -EINVAL:
printk(KERN_ERR "OSPCIResumeDev: can't enter requested power state");
return PVRSRV_ERROR_UNKNOWN_POWER_STATE;
default:
printk(KERN_ERR "OSPCIResumeDev: pci_set_power_state failed (%d)", err);
return PVRSRV_ERROR_UNKNOWN_POWER_STATE;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
pci_restore_state(psPVRPCI->psPCIDev);
#else
err = pci_restore_state(psPVRPCI->psPCIDev);
if (err != 0)
{
printk(KERN_ERR "OSPCIResumeDev: pci_restore_state failed (%d)", err);
return PVRSRV_ERROR_PCI_CALL_FAILED;
}
#endif
err = pci_enable_device(psPVRPCI->psPCIDev);
if (err != 0)
{
printk(KERN_ERR "OSPCIResumeDev: Couldn't enable device (%d)", err);
return PVRSRV_ERROR_PCI_CALL_FAILED;
}
if (psPVRPCI->ePCIFlags & HOST_PCI_INIT_FLAG_BUS_MASTER) /* PRQA S 3358 */ /* misuse of enums */
pci_set_master(psPVRPCI->psPCIDev);
/* Restore the PCI resource tracking array */
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++)
{
if (psPVRPCI->abPCIResourceInUse[i])
{
err = pci_request_region(psPVRPCI->psPCIDev, i, PVRSRV_MODNAME);
if (err != 0)
{
printk(KERN_ERR "OSPCIResumeDev: pci_request_region_failed (region %d, error %d)", i, err);
}
}
}
return PVRSRV_OK;
}
开发者ID:DanBjorklund,项目名称:ME302C,代码行数:63,代码来源:pci_support.c
示例11: stmmac_pci_suspend
static int stmmac_pci_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct net_device *ndev = pci_get_drvdata(pdev);
int ret;
ret = stmmac_suspend(ndev);
pci_save_state(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
return ret;
}
开发者ID:magnusjjj,项目名称:android_kernel_huawei_rle,代码行数:11,代码来源:stmmac_pci.c
示例12: agnx_pci_suspend
static int agnx_pci_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct ieee80211_hw *dev = pci_get_drvdata(pdev);
AGNX_TRACE;
ieee80211_stop_queues(dev);
agnx_stop(dev);
pci_save_state(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
return 0;
}
开发者ID:AppEngine,项目名称:linux-2.6,代码行数:12,代码来源:pci.c
示例13: snd_vx222_suspend
static int snd_vx222_suspend(struct pci_dev *pci, pm_message_t state)
{
struct snd_card *card = pci_get_drvdata(pci);
struct snd_vx222 *vx = card->private_data;
int err;
err = snd_vx_suspend(&vx->core, state);
pci_disable_device(pci);
pci_save_state(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
return err;
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:12,代码来源:vx222.c
示例14: spi_suspend
static int spi_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct dw_spi_pci *dwpci = pci_get_drvdata(pdev);
int ret;
ret = dw_spi_suspend_host(&dwpci->dws);
if (ret)
return ret;
pci_save_state(pdev);
pci_disable_device(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
return ret;
}
开发者ID:Scorpio92,项目名称:mstar6a918,代码行数:13,代码来源:spi-dw-pci.c
示例15: 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
示例16: pch_suspend
static s32 pch_suspend(struct pci_dev *pdev, pm_message_t state)
{
pci_disable_device(pdev);
pci_enable_wake(pdev, PCI_D3hot, 0);
if (pci_save_state(pdev) != 0) {
dev_err(&pdev->dev, "could not save PCI config state\n");
return -ENOMEM;
}
pci_set_power_state(pdev, pci_choose_state(pdev, state));
return 0;
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:13,代码来源:ptp_pch.c
示例17: ssb_pcihost_suspend
static int ssb_pcihost_suspend(struct pci_dev *dev, pm_message_t state)
{
struct ssb_bus *ssb = pci_get_drvdata(dev);
int err;
err = ssb_bus_suspend(ssb);
if (err)
return err;
pci_save_state(dev);
pci_disable_device(dev);
pci_set_power_state(dev, pci_choose_state(dev, state));
return 0;
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:14,代码来源:pcihost_wrapper.c
示例18: nm256_suspend
/*
* APM event handler, so the card is properly reinitialized after a power
* event.
*/
static int nm256_suspend(struct pci_dev *pci, pm_message_t state)
{
struct snd_card *card = pci_get_drvdata(pci);
struct nm256 *chip = card->private_data;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(chip->pcm);
snd_ac97_suspend(chip->ac97);
chip->coeffs_current = 0;
pci_disable_device(pci);
pci_save_state(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
return 0;
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:18,代码来源:nm256.c
示例19: p54p_suspend
static int p54p_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct ieee80211_hw *dev = pci_get_drvdata(pdev);
struct p54p_priv *priv = dev->priv;
if (priv->common.mode != NL80211_IFTYPE_UNSPECIFIED) {
ieee80211_stop_queues(dev);
p54p_stop(dev);
}
pci_save_state(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
return 0;
}
开发者ID:valentil,项目名称:CS-411-Group-13,代码行数:14,代码来源:p54pci.c
示例20: serial_hsu_suspend
static int serial_hsu_suspend(struct pci_dev *pdev, pm_message_t state)
{
void *priv = pci_get_drvdata(pdev);
struct uart_hsu_port *up;
/* Make sure this is not the internal dma controller */
if (priv && (pdev->device != 0x081E)) {
up = priv;
uart_suspend_port(&serial_hsu_reg, &up->port);
}
pci_save_state(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
return 0;
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:15,代码来源:mfd.c
注:本文中的pci_choose_state函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论