MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Kernel Functions for Drivers                       scsireset(9F)



NAME
     scsireset - reset a SCSI bus or target

SYNOPSIS
     #include 



     int scsireset(struct scsiaddress *ap, int level);


INTERFACE LEVEL
     Solaris DI specific (Solaris DI).

PARAMETERS
     ap       Pointer to the scsiaddress structure.


     level    The level of reset required.


DESCRIPTION
     The scsireset() function asks the host  adapter  driver  to
     reset  the  SCSI bus or a SCSI target as specified by level.
     If level equals RESETAL, the SCSI  bus  is  reset.  If  it
     equals  RESETARGET,  ap is used to determine the target to
     be reset. If it equals RESETLUN, ap is  used  to  determine
     the logical unit to be reset.


     When given the  RESETLUN  level,  scsireset()  can  return
     failure  if  the LOGICAL UNIT RESET message is not supported
     by the target device, or if the underlying HBA  driver  does
     not implement the ability to issue a LOGICAL UNIT RESET mes-
     sage.


     Note that, at the point when scsireset() resets the logical
     unit (case RESETLUN), or the target (case RESETARGET), or
     the bus (case RESETAL), there might be one or more command
     packets  outstanding.  That  is, packets have been passed to
     scsitransport(), and queued or  possibly  transported,  but
     the  commands have not been completed and the target comple-
     tion routine has not been called for those packets.


     The successful call to scsireset() has the side effect that
     any  such  commands  currently  outstanding  are aborted, at
     which point the packets are marked with  pktreason  set  to
     CMDRESET,  and the appropriate bit -- either STATBUSRESET
     or STATDEVRESET -- is set  in  pktstatistics.  Once  thus
     appropriately marked, the aborted command packets are passed



SunOS 5.11          Last change: 16 Jan 2006                    1






Kernel Functions for Drivers                       scsireset(9F)



     to the target driver command completion routine.


     Also note that,  at  the  moment  that  a  thread  executing
     scsireset()  actually  resets  the target or the bus, it is
     possible that  a  second  thread  may  have  already  called
     scsitransport(), but not yet queued or transported its com-
     mand. In this case the HBA will not yet  have  received  the
     second thread's packet and this packet will not be aborted.

RETURN VALUES
     The scsireset() function returns:

     1    Upon success.


     0    Upon failure.


CONTEXT
     The scsireset() function can be called  from  user,  inter-
     rupt, or kernel context.

SEE ALSO
     tranreset(9E), tranresetnotify(9E), scsiabort(9F)


     Writing Device Drivers



























SunOS 5.11          Last change: 16 Jan 2006                    2



OpenSolaris man pages main menu

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