#include <IOKit/storage/IODVDBlockStorageDriver.h>
#include <IOKit/storage/IODVDMedia.h>
#define super IOMedia
OSDefineMetaClassAndStructors(IODVDMedia, IOMedia)
IODVDBlockStorageDriver * IODVDMedia::getProvider() const
{
return (IODVDBlockStorageDriver *) IOService::getProvider();
}
bool IODVDMedia::matchPropertyTable(OSDictionary * table, SInt32 * score)
{
if (super::matchPropertyTable(table, score) == false) return false;
return compareProperty(table, kIODVDMediaTypeKey);
}
IOReturn IODVDMedia::reportKey( IOMemoryDescriptor * buffer,
const DVDKeyClass keyClass,
const UInt32 address,
const UInt8 grantID,
const DVDKeyFormat format )
{
if (isInactive())
{
return kIOReturnNoMedia;
}
if (buffer == 0 && format != kDVDKeyFormatAGID_Invalidate)
{
return kIOReturnBadArgument;
}
return getProvider()->reportKey( buffer,
keyClass,
address,
grantID,
format );
}
IOReturn IODVDMedia::sendKey( IOMemoryDescriptor * buffer,
const DVDKeyClass keyClass,
const UInt8 grantID,
const DVDKeyFormat format )
{
if (isInactive())
{
return kIOReturnNoMedia;
}
if (buffer == 0 && format != kDVDKeyFormatAGID_Invalidate)
{
return kIOReturnBadArgument;
}
return getProvider()->sendKey( buffer,
keyClass,
grantID,
format );
}
IOReturn IODVDMedia::readStructure( IOMemoryDescriptor * buffer,
const DVDStructureFormat format,
const UInt32 address,
const UInt8 layer,
const UInt8 grantID )
{
if (isInactive())
{
return kIOReturnNoMedia;
}
if (buffer == 0)
{
return kIOReturnBadArgument;
}
return getProvider()->readStructure( buffer,
format,
address,
layer,
grantID );
}
IOReturn IODVDMedia::getSpeed(UInt16 * kilobytesPerSecond)
{
if (isInactive())
{
return kIOReturnNoMedia;
}
return getProvider()->getSpeed(kilobytesPerSecond);
}
IOReturn IODVDMedia::setSpeed(UInt16 kilobytesPerSecond)
{
if (isInactive())
{
return kIOReturnNoMedia;
}
return getProvider()->setSpeed(kilobytesPerSecond);
}
IOReturn IODVDMedia::readDiscInfo( IOMemoryDescriptor * buffer,
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 IODVDMedia::readRZoneInfo( IOMemoryDescriptor * buffer,
UInt32 address,
DVDRZoneInfoAddressType addressType,
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 );
}
#ifdef __LP64__
OSMetaClassDefineReservedUnused(IODVDMedia, 0);
OSMetaClassDefineReservedUnused(IODVDMedia, 1);
OSMetaClassDefineReservedUnused(IODVDMedia, 2);
OSMetaClassDefineReservedUnused(IODVDMedia, 3);
OSMetaClassDefineReservedUnused(IODVDMedia, 4);
OSMetaClassDefineReservedUnused(IODVDMedia, 5);
OSMetaClassDefineReservedUnused(IODVDMedia, 6);
#else
OSMetaClassDefineReservedUsed(IODVDMedia, 0);
OSMetaClassDefineReservedUsed(IODVDMedia, 1);
OSMetaClassDefineReservedUsed(IODVDMedia, 2);
OSMetaClassDefineReservedUsed(IODVDMedia, 3);
OSMetaClassDefineReservedUsed(IODVDMedia, 4);
OSMetaClassDefineReservedUsed(IODVDMedia, 5);
OSMetaClassDefineReservedUsed(IODVDMedia, 6);
#endif
OSMetaClassDefineReservedUnused(IODVDMedia, 7);
OSMetaClassDefineReservedUnused(IODVDMedia, 8);
OSMetaClassDefineReservedUnused(IODVDMedia, 9);
OSMetaClassDefineReservedUnused(IODVDMedia, 10);
OSMetaClassDefineReservedUnused(IODVDMedia, 11);
OSMetaClassDefineReservedUnused(IODVDMedia, 12);
OSMetaClassDefineReservedUnused(IODVDMedia, 13);
OSMetaClassDefineReservedUnused(IODVDMedia, 14);
OSMetaClassDefineReservedUnused(IODVDMedia, 15);
OSMetaClassDefineReservedUnused(IODVDMedia, 16);
OSMetaClassDefineReservedUnused(IODVDMedia, 17);
OSMetaClassDefineReservedUnused(IODVDMedia, 18);
OSMetaClassDefineReservedUnused(IODVDMedia, 19);
OSMetaClassDefineReservedUnused(IODVDMedia, 20);
OSMetaClassDefineReservedUnused(IODVDMedia, 21);
OSMetaClassDefineReservedUnused(IODVDMedia, 22);
OSMetaClassDefineReservedUnused(IODVDMedia, 23);
OSMetaClassDefineReservedUnused(IODVDMedia, 24);
OSMetaClassDefineReservedUnused(IODVDMedia, 25);
OSMetaClassDefineReservedUnused(IODVDMedia, 26);
OSMetaClassDefineReservedUnused(IODVDMedia, 27);
OSMetaClassDefineReservedUnused(IODVDMedia, 28);
OSMetaClassDefineReservedUnused(IODVDMedia, 29);
OSMetaClassDefineReservedUnused(IODVDMedia, 30);
OSMetaClassDefineReservedUnused(IODVDMedia, 31);