MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Kernel Functions for Drivers                pciereportsetup(9F)



NAME
     pciereportsetup, pciereportteardown, pciereportpost  -
     post  error reports for the generic PCI errors logged in the
     PCI Configuration Status register.

SYNOPSIS
     #include 

     void pciereportsetup(devinfot *dip, int);


     void pciereportteardown(devinfot *dip);


     void pciereportpost(devinfot *dip, ddifmerrort *dep,
          uin16t *status);


INTERFACE LEVEL
     Solaris DI specific (Solaris DI)

PARAMETERS
     dip       Pointer to the devinfo structure of the devices


     dep       Pointer to DI error status


     status    Pointer to status bit storage location


DESCRIPTION
     The pciereportsetup()  function  initializes  support  for
     error report generation and sets up the resources for subse-
     quent access to PCI,  PCI/X  or  PCI  Express  Configuration
     space.  The  caller must have established a fault management
     capability level of at least DIFMEREPORTCAPABLE  with  a
     previous call to ddifminit() for dip.


     The pciereportteardown() function releases  any  resources
     allocated  and  set up by pciereportsetup() and associated
     with dip.


     The pciereportpost() function is called to  scan  for  and
     post any PCI, PCI/X or PCI Express Bus errors. On a PCI bus,
     for example, the errors detected include:

         o    Detected Parity Error

         o    Master Data Parity Error



SunOS 5.11          Last change: 10 May 2007                    1






Kernel Functions for Drivers                pciereportsetup(9F)



         o    Target Abort

         o    Master Abort

         o    System Error

         o    Discard Timeout


     The pciereportpost() function must be called only  from  a
     driver's    error    handler    callback    function.    See
     ddifmhandlerregister(9F). The  errorstatus  argument  to
     the error handler callback function should be passed through
     as the dep argument to pciereportpost() as it may  contain
     bus  specific  information that might be useful for handling
     any errors that are discovered.


     The fmeflag in  the  errorstatus  argument  to  the  error
     handler callback function will contain one of the following:

     DIFMERUNEXPECTED()    Any errors discovered  are  unex-
                                pected.


     DIFMEREXPECTED()    Errors discovered were  the  result
                              of a DIACAUTIOUS operation.


     DIFMERPOKE()        Errors discovered are the result of
                              a ddipoke(9F) operation.


     DIFMERPEK()        Errors discovered are the result of
                              a ddipeek(9F) operation.



     Error report events are generated automatically if  fmeflag
     is  set to DIFMERUNEXPECTED and the corresponding error
     bits are set in the various PCI, PCI/X or  PCI  Express  Bus
     error  registers of the device associated with dip. The gen-
     erated error report events are posted to the  Solaris  Fault
     Manager, fmd(1M), for diagnosis.


     If the status argument is non-null, pciereportpost() saves
     the  contents  of  the  PCI Configuration Status Register to
     *status. If it is not possible to read the PCI Configuration
     Status Register, -1 is returned in *status instead.





SunOS 5.11          Last change: 10 May 2007                    2






Kernel Functions for Drivers                pciereportsetup(9F)



     On  return  from  the  call   to   pciereportpost(),   the
     ddifmerrort  structure  pointed  at by dep will have been
     updated, and the fmestatus field contains one of  the  fol-
     lowing values:

     DIFMOK          No  errors  were  detected  which   might
                        affect this device instance.


     DIFMFATAL       An error which is considered fatal to the
                        operational   state  of  the  system  was
                        detected.


     DIFMNONFATAL    An error which is not considered fatal to
                        the  operational  state of the system was
                        detected.    The    fmeacchandle     or
                        fmedmahandle  fields  in  the  returned
                        ddifmerrort structure  will  typically
                        reference  a  handle  that belongs to the
                        device instance that has been affected.


     DIFMUNKNOWN     An error was detected, but the  call  was
                        unable  to  determine  the  impact of the
                        error on the  operational  state  of  the
                        system.  This  is treated the same way as
                        DIFMFATAL unless some other device  is
                        able   to   evaluate   the  fault  to  be
                        DIFMNONFATAL.


CONTEXT
     The pciereportsetup() and pciereportteardown() functions
     must be called from user or kernel context.


     The pciereportpost() function can be called  in  any  con-
     text.

EXAMPLES
       int xxxfmcap = DIFMEREPORTCAPABLE  DIFMERCBCAPABLE;

       xxxattach(devinfot *dip, ddiattachcmdt cmd) {

             ddifminit(dip, &xxxfmcap, &xxxibc);
                 if (xxxfmcap & DIFMERCBCAPABLE)
             ddifmhandlerregister(dip, xxxerrcb);
                 if (xxxfmcap & DIFMEREPORTCAPABLE)
                     pciereportsetup(dip);

       }



SunOS 5.11          Last change: 10 May 2007                    3






Kernel Functions for Drivers                pciereportsetup(9F)



       xxxerrcb(devinfot *dip, ddifmerrort *errp) {
       uint16t status;

            pciereportpost(dip, errp, &status);
       return (errp->fmestatus);
       }

       xxxdetach(devinfot *dip, ddiattachcmdt cmd) {

            if (xxxfmcap & DIFMEREPORTCAPABLE)
                pciereportteardown(dip);
            if (xxxfmcap & DIFMERCBCAPABLE)
                ddifmhandlerunregister(dip);
       ddifmfini(dip);

       }


ATRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     Interface Stability          Committed                   
    


SEE ALSO
     fmd(1M),     attributes(5),     ddifmhandlerregister(9F),
     ddifminit(9F),         ddipeek(9F),         ddipoke(9F),
     ddifmerror(9S)




















SunOS 5.11          Last change: 10 May 2007                    4



OpenSolaris man pages main menu

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