IOUSBHubPolicyMaker.h [plain text]
#ifndef _IOKIT_IOUSBHUBPOLICYMAKER_H
#define _IOKIT_IOUSBHUBPOLICYMAKER_H
#include <IOKit/IOService.h>
#include <IOKit/usb/IOUSBController.h>
#include <IOKit/usb/IOUSBHubDevice.h>
enum {
kIOUSBHubPowerStateOff = 0, kIOUSBHubPowerStateRestart = 1, kIOUSBHubPowerStateSleep = 2, kIOUSBHubPowerStateLowPower = 3, kIOUSBHubPowerStateOn = 4, kIOUSBHubNumberPowerStates = 5
};
enum {
kHubResumeRecoveryTime = 10, kPortResumeRecoveryTime = 10 };
#define kIOUSBHubPowerStateStable -1
class IOUSBHubPolicyMaker : public IOService
{
OSDeclareAbstractStructors(IOUSBHubPolicyMaker)
protected:
IOUSBControllerV2 * _bus;
IOUSBHubDevice * _device; IOUSBHubDevice * _parentHubDevice; bool _isRootHub; bool _dozeEnabled; bool _dontAllowLowPower; bool _dontAllowSleepPower; SInt32 _powerStateChangingTo; unsigned long _myPowerState; UInt32 _extraPower; UInt32 _extraPowerRemaining; UInt32 _hubResumeRecoveryTime; struct ExpansionData
{
};
ExpansionData *_expansionData;
public:
virtual bool start(IOService * provider);
virtual IOReturn powerStateWillChangeTo ( IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice);
virtual unsigned long powerStateForDomainState ( IOPMPowerFlags domainState );
virtual IOReturn setPowerState ( unsigned long powerStateOrdinal, IOService* whatDevice );
virtual IOReturn powerStateDidChangeTo ( IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice);
virtual unsigned long maxCapabilityForDomainState ( IOPMPowerFlags domainState );
virtual void powerChangeDone ( unsigned long fromState );
virtual IOReturn EnsureUsability(void);
void AllocateExtraPower();
IOReturn GetExtraPortPower(UInt32 portNum, UInt32 *extraPower);
IOReturn ReturnExtraPortPower(UInt32 portNum, UInt32 extraPower);
virtual bool ConfigureHubDriver(void) = 0;
virtual IOReturn HubPowerChange(unsigned long powerStateOrdinal) = 0;
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 0);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 1);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 2);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 3);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 4);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 5);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 6);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 7);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 8);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 9);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 10);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 11);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 12);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 13);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 14);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 15);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 16);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 17);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 18);
OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 19);
};
#endif _IOKIT_IOUSBHUBPOLICYMAKER_H