PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

DeviceProbe

DeviceProbe is used to determine if a hardware device is present at the indicated address.

OSStatus DeviceProbe (
                     void *theSrc,
                     void *theDest,
                     UInt32 AccessType);
theSrc
The address of the device to be accessed.
theDest
The destination of the contents of theSrc.
AccessType
How theSrc is to be accessed: k8BitAccess, k16BitAccess, or k32BitAccess.
DESCRIPTION

DeviceProbe accesses the indicated address and stores the contents at theDest using AccessType to determine whether it should be an 8-bit, 16-bit or 32-bit access. Upon success it returns noErr. If the device is not present, that is, if a bus error or a machine check is generated, it returns noHardwareErr.

If a PCI card contains no FCode, and therefore is assigned a generic name of the form pci xxxx,yyyy, it is important for a driver to provide diagnostic code in its Initialize routine. When a driver is matched with a card that has a generic name property, it may be the wrong driver. In that case, diagnostic code probing for a unique characteristic of the card not only may fail a data compare operation but may also cause an unrecoverable machine check exception. DeviceProbe allows a driver to explore its hardware in a recoverable manner. It provides a safe read operation, which can gracefully recover from a machine check and return an error to the caller. If DeviceProbe fails, the driver should return an error from its Initialize command. This return may cause the DLL to continue its driver-to-device matching process until a suitable driver is found.

RESULT CODES
noErr 0 Device present
noHardwareErr -200 Device not present

© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)