#include <IOKit/assert.h>
#include <IOKit/IOService.h>
#include <IOKit/hidsystem/IOHIDevice.h>
#include <IOKit/hidsystem/IOHIDParameter.h>
#define super IOService
OSDefineMetaClassAndStructors(IOHIDevice, IOService);
bool IOHIDevice::init(OSDictionary * properties)
{
if (!super::init(properties)) return false;
return true;
}
void IOHIDevice::free()
{
super::free();
}
bool IOHIDevice::start(IOService * provider)
{
if (!super::start(provider))
return false;
if (!getProperty(kIOHIDVirtualHIDevice))
{
while (provider)
{
if ( provider == getResourceService() )
{
setProperty(kIOHIDVirtualHIDevice, kOSBooleanTrue);
return true;
}
provider = provider->getProvider();
}
setProperty(kIOHIDVirtualHIDevice, kOSBooleanFalse);
}
return true;
}
bool IOHIDevice::open(IOService * forClient,
IOOptionBits options,
void * arg)
{
if(forClient == this) return true;
return super::open(forClient, options, arg);
}
IOHIDKind IOHIDevice::hidKind()
{
return kHIUnknownDevice;
}
UInt32 IOHIDevice::interfaceID()
{
return 0;
}
UInt32 IOHIDevice::deviceType()
{
return 0;
}
UInt64 IOHIDevice::getGUID()
{
return(0xffffffffffffffffULL);
}
bool IOHIDevice::updateProperties( void )
{
bool ok;
ok = setProperty( kIOHIDKindKey, hidKind(), 32 )
& setProperty( kIOHIDInterfaceIDKey, interfaceID(), 32 )
& setProperty( kIOHIDSubinterfaceIDKey, deviceType(), 32 );
return( ok );
}
IOReturn IOHIDevice::setParamProperties( OSDictionary * dict )
{
return( kIOReturnSuccess );
}