1scsi_reset(9F)           Kernel Functions for Drivers           scsi_reset(9F)
2
3
4

NAME

6       scsi_reset - reset a SCSI bus or target
7

SYNOPSIS

9       #include <sys/scsi/scsi.h>
10
11
12
13       int scsi_reset(struct scsi_address *ap, int level);
14
15

INTERFACE LEVEL

17       Solaris DDI specific (Solaris DDI).
18

PARAMETERS

20       ap       Pointer to the scsi_address structure.
21
22
23       level    The level of reset required.
24
25

DESCRIPTION

27       The  scsi_reset()  function  asks  the host adapter driver to reset the
28       SCSI bus or a SCSI target  as  specified  by  level.  If  level  equals
29       RESET_ALL, the SCSI bus is reset. If it equals RESET_TARGET, ap is used
30       to determine the target to be reset. If it equals RESET_LUN, ap is used
31       to determine the logical unit to be reset.
32
33
34       When  given the RESET_LUN level, scsi_reset() can return failure if the
35       LOGICAL UNIT RESET message is not supported by the target device, or if
36       the  underlying  HBA  driver  does not implement the ability to issue a
37       LOGICAL UNIT RESET message.
38
39
40       Note that, at the point when scsi_reset() resets the logical unit (case
41       RESET_LUN),  or  the  target  (case  RESET_TARGET),  or  the  bus (case
42       RESET_ALL), there might be one or  more  command  packets  outstanding.
43       That  is,  packets  have been passed to scsi_transport(), and queued or
44       possibly transported, but the commands have not been completed and  the
45       target completion routine has not been called for those packets.
46
47
48       The  successful  call to scsi_reset() has the side effect that any such
49       commands currently outstanding are aborted, at which point the  packets
50       are marked with pkt_reason set to CMD_RESET, and the appropriate bit --
51       either STAT_BUS_RESET or STAT_DEV_RESET -- is  set  in  pkt_statistics.
52       Once  thus appropriately marked, the aborted command packets are passed
53       to the target driver command completion routine.
54
55
56       Also note that, at the moment  that  a  thread  executing  scsi_reset()
57       actually  resets  the  target  or the bus, it is possible that a second
58       thread may have already called scsi_transport(), but not yet queued  or
59       transported  its  command.  In  this  case  the  HBA  will not yet have
60       received the second  thread's  packet  and  this  packet  will  not  be
61       aborted.
62

RETURN VALUES

64       The scsi_reset() function returns:
65
66       1    Upon success.
67
68
69       0    Upon failure.
70
71

CONTEXT

73       The scsi_reset() function can be called from user, interrupt, or kernel
74       context.
75

SEE ALSO

77       tran_reset(9E), tran_reset_notify(9E), scsi_abort(9F)
78
79
80       Writing Device Drivers
81
82
83
84SunOS 5.11                        16 Jan 2006                   scsi_reset(9F)
Impressum