#include <IOKit/storage/IOBDBlockStorageDriver.h>
#include <IOKit/storage/IOBDMedia.h>
#define super IOMedia
OSDefineMetaClassAndStructors(IOBDMedia, IOMedia)
IOBDBlockStorageDriver * IOBDMedia::getProvider() const
{
return (IOBDBlockStorageDriver *) IOService::getProvider();
}
bool IOBDMedia::matchPropertyTable(OSDictionary * table, SInt32 * score)
{
if (super::matchPropertyTable(table, score) == false) return false;
return compareProperty(table, kIOBDMediaTypeKey);
}
IOReturn IOBDMedia::reportKey( IOMemoryDescriptor * buffer,
UInt8 keyClass,
UInt32 address,
UInt8 grantID,
UInt8 format )
{
if (isInactive())
{
return kIOReturnNoMedia;
}
return getProvider()->reportKey( buffer,
(DVDKeyClass) keyClass,
address,
grantID,
(DVDKeyFormat) format );
}
IOReturn IOBDMedia::sendKey( IOMemoryDescriptor * buffer,
UInt8 keyClass,
UInt8 grantID,
UInt8 format )
{
if (isInactive())
{
return kIOReturnNoMedia;
}
return getProvider()->sendKey( buffer,
(DVDKeyClass) keyClass,
grantID,
(DVDKeyFormat) format );
}
IOReturn IOBDMedia::readStructure( IOMemoryDescriptor * buffer,
UInt8 format,
UInt32 address,
UInt8 layer,
UInt8 grantID )
{
if (isInactive())
{
return kIOReturnNoMedia;
}
if (buffer == 0)
{
return kIOReturnBadArgument;
}
return getProvider()->readStructure( buffer,
format,
address,
layer,
grantID );
}
IOReturn IOBDMedia::getSpeed(UInt16 * kilobytesPerSecond)
{
if (isInactive())
{
return kIOReturnNoMedia;
}
return getProvider()->getSpeed(kilobytesPerSecond);
}
IOReturn IOBDMedia::setSpeed(UInt16 kilobytesPerSecond)
{
if (isInactive())
{
return kIOReturnNoMedia;
}
return getProvider()->setSpeed(kilobytesPerSecond);
}
IOReturn IOBDMedia::readDiscInfo( IOMemoryDescriptor * buffer,
UInt8 type,
UInt16 * actualByteCount )
{
if (isInactive())
{
if (actualByteCount) *actualByteCount = 0;
return kIOReturnNoMedia;
}
if (buffer == 0)
{
if (actualByteCount) *actualByteCount = 0;
return kIOReturnBadArgument;
}
return getProvider()->readDiscInfo( buffer,
actualByteCount );
}
IOReturn IOBDMedia::readTrackInfo( IOMemoryDescriptor * buffer,
UInt32 address,
UInt8 addressType,
UInt8 open,
UInt16 * actualByteCount )
{
if (isInactive())
{
if (actualByteCount) *actualByteCount = 0;
return kIOReturnNoMedia;
}
if (buffer == 0)
{
if (actualByteCount) *actualByteCount = 0;
return kIOReturnBadArgument;
}
return getProvider()->readTrackInfo(
buffer,
address,
addressType,
actualByteCount );
}
IOReturn IOBDMedia::splitTrack(UInt32 address)
{
if (isInactive())
{
return kIOReturnNoMedia;
}
return getProvider()->splitTrack(address);
}
OSMetaClassDefineReservedUnused(IOBDMedia, 0);
OSMetaClassDefineReservedUnused(IOBDMedia, 1);
OSMetaClassDefineReservedUnused(IOBDMedia, 2);
OSMetaClassDefineReservedUnused(IOBDMedia, 3);
OSMetaClassDefineReservedUnused(IOBDMedia, 4);
OSMetaClassDefineReservedUnused(IOBDMedia, 5);
OSMetaClassDefineReservedUnused(IOBDMedia, 6);
OSMetaClassDefineReservedUnused(IOBDMedia, 7);
OSMetaClassDefineReservedUnused(IOBDMedia, 8);
OSMetaClassDefineReservedUnused(IOBDMedia, 9);
OSMetaClassDefineReservedUnused(IOBDMedia, 10);
OSMetaClassDefineReservedUnused(IOBDMedia, 11);
OSMetaClassDefineReservedUnused(IOBDMedia, 12);
OSMetaClassDefineReservedUnused(IOBDMedia, 13);
OSMetaClassDefineReservedUnused(IOBDMedia, 14);
OSMetaClassDefineReservedUnused(IOBDMedia, 15);