=================================================================== RCS file: /MkLinux/floppy-darwin/floppy.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- floppy-darwin/floppy.cpp 2002/04/16 00:43:17 1.51 +++ floppy-darwin/floppy.cpp 2002/04/17 00:33:11 1.52 @@ -729,6 +729,80 @@ // IOReturn +org_mklinux_iokit_swim3_driver::setProperties ( OSObject * properties ) +{ + +#if 0 + OSDictionary * dict = NULL; + OSNumber * number = NULL; + IOReturn status = kIOReturnSuccess; + UInt32 features = 0; +#endif + OSDictionary *dict = OSDynamicCast(OSDictionary, properties); + OSNumber *debugProp = NULL; + + IOLog( "org_mklinux_iokit_swim3_device::setProperties called\n"); + + if (dict) { + debugProp = OSDynamicCast(OSNumber, + dict->getObject("SWIM3 Debug")); + } + + if (debugProp) { + org_mklinux_iokit_swim3_debug = debugProp->unsigned32BitValue(); + } + +#if 0 + + number = ( OSNumber * ) fProvider->getProperty ( kIOATASupportedFeaturesKey ); + features = number->unsigned32BitValue ( ); + + if ( ( features & kIOATAFeatureAdvancedPowerManagement ) == 0 ) + { + + IOLog( "org_mklinux_iokit_swim3_device::setProperties called on unsupported drive\n" ); + return kIOReturnUnsupported; + + } + + dict = OSDynamicCast ( OSDictionary, properties ); + if ( dict != NULL ) + { + number = OSDynamicCast ( OSNumber, dict->getObject ( "APM Level" ) ); + } + + if ( number != NULL ) + { + + UInt8 apmLevel = number->unsigned8BitValue ( ); + + if ( ( apmLevel == 0 ) || ( apmLevel == 0xFF ) ) + { + return kIOReturnBadArgument; + } + + IOLog( "apmLevel = %d\n", apmLevel ); + + status = fProvider->setAdvancedPowerManagementLevel ( apmLevel, true ); + + } + + else + status = kIOReturnBadArgument; + + IOLog( "org_mklinux_iokit_swim3_device::leave setProperties\n" ); + + return status; + +#endif + + return kIOReturnSuccess; + // return kIOReturnUnsupported; +} + + + +IOReturn org_mklinux_iokit_swim3_device::setProperties ( OSObject * properties ) { @@ -741,7 +815,7 @@ OSDictionary *dict = OSDynamicCast(OSDictionary, properties); OSNumber *debugProp = NULL; - dIOLog( "org_mklinux_iokit_swim3_device::setProperties called\n"); + IOLog( "org_mklinux_iokit_swim3_device::setProperties called\n"); if (dict) { debugProp = OSDynamicCast(OSNumber,