MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Driver Entry Points                                     probe(9E)



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

SYNOPSIS
     #include 
     #include 
     #include 



     static intprefixprobe(devinfot *dip);


INTERFACE LEVEL
     Solaris DI specific (Solaris  DI).  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 devops(9S) structure
     if a probe routine is not necessary.

ARGUMENTS
     dip     Pointer to the device's  devinfo 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 ddimapregs(9F) then attempt  to
     access  the  hardware using ddipeek(9F) or ddipoke(9F) and
     determine if the device exists.  Then the  device  registers
     should be unmapped using ddiunmapregs(9F).


     To probe a device that was left powered off after  the  last
     detach(),  it  might be necessary to power it up. If so, the
     driver must power up the device by accessing  device  regis-
     ters  directly.  pmraisepower(9F) will be not be available
     until attach(9E). The framework ensures that  the  ancestors
     of  the node being probed and all relevant platform-specific
     power management hardware is at full power at the time  that
     probe() is called.


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






SunOS 5.11          Last change: 18 Nov 1992                    1






Driver Entry Points                                     probe(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()  rou-
     tine    can    be   provided   to   simplify   the   driver.
     ddidevissid(9F) can then be  used  to  determine  whether
     probe()  needs to do any work. See ddidevissid(9F) for an
     example.

RETURN VALUES
     DIPROBESUCES      If the probe was successful.


     DIPROBEFAILURE      If the probe failed.


     DIPROBEDONTCARE     If the probe  was  unsuccessful,  yet
                            attach(9E) should still be called.


     DIPROBEPARTIAL      If the instance is not  present  now,
                            but may be present in the future.


SEE ALSO
     attach(9E),        identify(9E),         ddidevissid(9F),
     ddimapregs(9F),  ddipeek(9F),  ddipoke(9F), nulldev(9F),
     devops(9S)


     Writing Device Drivers

























SunOS 5.11          Last change: 18 Nov 1992                    2



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™