[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    probe(9E) manual page Table of Contents

Name

probe - determine if a non-self-identifying device is present

Synopsis


#include <sys/conf.h>

#include <sys/ddi.h>

#include <sys/sunddi.h>

static int prefixprobe(dev_info_t *dip);

Interface Level

Solaris DDI specific (Solaris DDI). This entry point is required for non-self-identifying devices. You must write it for such devices. For self-identifying devices, nulldev(9F) should be specified in the dev_ops(9S) structure if a probe routine is not necessary.

Arguments

dip
Pointer to the device’s dev_info structure.

Description

probe() determines whether the device corresponding to dip actually exists and is a valid device for this driver. probe() is called after identify(9E) and before attach(9E) for a given dip. For example, the probe() routine can map the device registers using ddi_map_regs(9F) then attempt to access the hardware using ddi_peek(9F) and/or ddi_poke(9F) and determine if the device exists. Then the device registers should be unmapped using ddi_unmap_regs(9F) .

probe() should only probe the device - it should not create or change any software state. Device initialization should be done in attach(9E) .

For a self-identifying device, this entry point is not necessary. However, if a device exists in both self-identifying and non-self-identifying forms, a probe() routine can be provided to simplify the driver. ddi_dev_is_sid(9F) can then be used to determine whether probe() needs to do any work. See ddi_dev_is_sid(9F) for an example.

Return Values

DDI_PROBE_SUCCESS
if the probe was successful.
DDI_PROBE_FAILURE
if the probe failed.
DDI_PROBE_DONTCARE
if the probe was unsuccessful, yet attach(9E) should still be called.
DDI_PROBE_PARTIAL
if the instance is not present now, but may be present in the future.

See Also

attach(9E) , identify(9E) , ddi_dev_is_sid(9F) , ddi_map_regs(9F) , ddi_peek(9F) , ddi_poke(9F) , nulldev(9F) , dev_ops(9S)


Table of Contents