Any necessary driver initialization should be done by the port scanner before registering the driver. This insures that a device that is not usable does not get registered. For systems using the native driver architecture, Open Transport's port scanner will call ValidateHardware before registering your port.
OTResult ValidateHardware (RegEntryIDPtr)
The parameter passed to the ValidateHardware function depends on the port scanner being used. If the driver is able to change the power level of the device, it must use the ValidateHardware function, setting the device to either low power or no power.
Open Transport requires that ValidateHardware be exported. When this function is called, it should validate that the hardware is correct for the driver and is in good working order. If the function returns kENOENTErr, then the hardware is probably not the hardware for the driver and Open Transport will continue scanning for another driver. This is especially important for cards that do not have Open Firmware ROMs, because multiple vendors' drivers may end up with the same name and appear to be usable with each other's hardware.
For information about Mac OS services available to support ValidateHardware, see Driver Initialization and Resource Verification.
ValidateHardware should return one of the following values:
If the ValidateHardware function is not exported, Open Transport will proceed as if the function returned kOTNoError.