PCIe pause testing
PCIe pause testing
- Subject: PCIe pause testing
- From: "David A. Hoatson via Darwin-kernel" <email@hidden>
- Date: Fri, 19 Jul 2019 11:27:27 -0700
- Organization: Lynx Studio Technology, Inc.
Hello,
I am trying to implement PCIe pause on our kExt and cannot figure out how to
test if it is working properly.
I have added IOPCIPauseCompatible to our info.plist and System Info shows
"Pause Compatible: Yes" for our kExt.
Following the example from IOService.cpp, I have added:
static const IOPMPowerState powerStatesV2[kNumberOfPowerStates] =
{
// verison, capabilityFlags, outputPowerCharacter,
inputPowerRequirement
{ kIOPMPowerStateVersion2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ kIOPMPowerStateVersion2, 0, kIOPMSoftSleep, kIOPMSoftSleep, 0, 1,
0, 0, 0, 0, 0, 0 },
{ kIOPMPowerStateVersion2, kIOPMPowerOn, kIOPMPowerOn, kIOPMPowerOn,
0, 3, 0, 0, 0, 0, 0, 0 },
{ kIOPMPowerStateVersion2, kIOPMConfigRetained, kIOPMConfigRetained,
kIOPMConfigRetained, 0, 2, 0, 0, 0, 0, 0, 0 }
};
static const IOPMPowerState powerStatesV1[kNumberOfPowerStates-1] =
{
// verison, capabilityFlags, outputPowerCharacter,
inputPowerRequirement
{ kIOPMPowerStateVersion1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ kIOPMPowerStateVersion1, 0, kIOPMSoftSleep, kIOPMSoftSleep, 0, 1,
0, 0, 0, 0, 0, 0 },
{ kIOPMPowerStateVersion1, kIOPMPowerOn, kIOPMPowerOn, kIOPMPowerOn,
0, 3, 0, 0, 0, 0, 0, 0 },
};
PMinit();
if (kIOReturnSuccess != registerPowerDriver( this, (IOPMPowerState
*)powerStatesV2, kIOPCIDevicePowerStateCount ))
{
IOLog( "registerPowerDriver V2 failed!\n" );
if( kIOReturnSuccess != registerPowerDriver( this, (IOPMPowerState
*)powerStatesV1, kIOPCIDevicePowerStateCount-1 ) )
{
IOLog( "registerPowerDriver V1 failed!\n" );
}
}
pIOServiceProvider->joinPMtree( this );
and here is the code just to see if it is working:
/////////////////////////////////////////////////////////////////
IOReturn LynxAudioDevice::setPowerState( unsigned long whichState,
IOService * whatDevice )
/////////////////////////////////////////////////////////////////
{
IOLog("setPowerState( %lu )\n", whichState );
return IOAudioDevice::setPowerState( whichState, whatDevice );
// also tried returning IOPMAckImplied with no difference
}
I have added the pci flags to the boot-args with: sudo nvram
boot-args="pci=0x200" which should mean every PCIe device that is
added/removed will generate a new setPowerState call to put the device into
pause mode.
When I load the driver is see:
setPowerState( 2 )
setPowerState( 1 )
which doesn't seem to correspond to the powerStatesV2 table passed into
registerPowerDriver. I never see another setPowerState call no matter what
PCIe devices are added or removed.
Does anyone have any experience with PCIe pause? What am I missing to get
this working so I can actually test this?
Thank you,
David A. Hoatson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden