Proposed CAM changes

Bill Dallas dallas at zk3.dec.com
Thu Oct 20 10:34:11 PDT 1994



CAM Revision 10 to Revision 11 Changes
Accredited Standards Committee
X3, Information Processing Systems
                                         Doc. No.: X3T10/94-213r0
                                         Date: Oct 20, 1994
                                         Project: CAM
                                         Ref. Doc.: X3T9.2/792D-r10

To:         Membership of X3T10
From:       William Dallas

Subject:  CAM Revision 10 to Revision 11 Changes

Due to some valid comments received on the CAM Revision 10 document
contained in the September 1994 mailings, I have revised the CAM
document to Revision 11.

The reason for this posting is to advise the membership of X3T10 of
these changes. This is because the CAM working group would like a vote
to forward the document to public review at the November 1994 meeting.

It is hoped that the changes detailed below will be sufficient to the
X3T10 membership to allow a vote to forward to public review the
revision 11 of the CAM document.  If the membership feels that this
posting is not sufficient notice then the CAM working group would like
a vote to forward to public review revision 10 of the CAM document.  If
the membership forwards to public revision 10 of the document the
comments received will be resolved as public review comments.

I would appreciate any comments you have in this matter and I thank you for
your understanding.


Regards,
William D. Dallas
X3T10 CAM Editor
Digital Equipment Corporation



Revision 10 to Revision 11 Changes

Reasons for the changes.
1.   The document did not detail actions by the SIM/HBA and peripheral
     driver when an HBA crashes in Host Target Mode.
2.   Possible resource depletion condition during event handling in Host
     Target Mode.

Legend - In the first column details action:

+    Indicates addition to addition to the document
-    Indicates deletion from the document
#    Indicates a comment to describe the change to help the membership
     understand the change.


    9.2.3  Path Inquiry 
    
    This function shall return information on the installed addressed HBA
    hardware, or the number of HBAs installed.  To obtain further
    information on any other HBAs attached, this function can be issued
    for each HBA.  
    
    If the Path ID field of the CCB has a value of FFh (the XPT Path ID),
    then the only fields that shall be valid upon return to the caller is the
    highest Path ID Assigned field and the Version Number field.  The
    highest Path ID assigned field shall not be valid if the Path ID field in
    the CCB contains a value other than FFh.
    
    In some operating system environments it may be possible to
    dynamically load and unload SIMs, so Path IDs may not be
    consecutive from 0 to the highest Path ID assigned.  
    
    
    
    If no Path IDs exist (i.e., no SCSI buses are registered), then the
    highest Path ID Assigned field shall be FFh, the ID of the XPT.
    
      NOTE: For CCB's other than PATH INQUIRY CCB with a Path ID of the XPT
            the CCB shall be returned with a CAM Status of Invalid Path ID.
    
    The Version Number field shall identify the revision number of the
    CAM specification the SIM/HBA or the XPT  conforms to.  PATH
    INQUIRY CCBs addressed to a valid SIM/HBA or the XPT shall
    respectively place in the Version Number field the CAM specification
    revision number it conforms to.  A version number of 00 to 07h
    represents revisions prior to revision 1.7 (i.e., 01h represents revision
    1.0 and 07h represents revision 1.6).  A version number of 08h
    represents revision number 1.7 and version numbers 09h to 39h
    represents the CAM specification revision numbers 1.9 to 3.9 (i.e., a
    version number of 20h represents revision 2.0 and a version number
    of 31h represents revision 3.1).  Starting with the CAM specification
    revision 4 the version number is based on a 40h plus the revision
    number (i.e., a version number of 44h represents the CAM revision
    number of 4 ( 40h + decimal rev number converted to hex) and a
    version number of 47h represents CAM revision 7).
    
    The SCSI Capabilities field is a duplicate of byte 7 field in inquiry data.
    
    The OSD Usage Pointer field is provided for OS-specific or
    platform-specific functions to be executed by the SIM.  The contents
    of this field are vendor-specific and are not defined in this International
    Standard.
    
    In some environments, the Size of Private Data Area field value
    returned may be zero because the OSD has central allocation of
    private data requirements, or it is a fixed size as defined by the OSD
    vendor.  See the vendor specification for the definition of vendor
    unique HBA capabilities peculiar to a particular HBA implementation. 
    
    
    The Asynchronous Event Capabilities field indicate what reasons can
    cause the XPT/SIM to generate an asynchronous event callback.
    
    This function shall return a CAM Status other than Request in
    Progress.  The CAM Status shall be one of the following: 
      - Request Completed without Error indicates, that the other
        returned fields are valid.
+     - No HBA Detected indicates, that the HBA is nolonger
+       responding to the SIM.  
      - Invalid Path ID indicates, that the specified Path ID is not
        installed.  
    


    
    11.3.3.1.1 Sense Data preservation where no nexus has been
    established   

    There are certain events that require or optionally provide for sense
    data preservation by the target.  These events are specified in the
    SCSI-2 specification.  If one of these events is detected by the
    SIM/HBA, the SIM/HBA shall respond as follows for each enabled
    Host Target Mode LUN:
    
      A)  Set the pathid of an IMMEDIATE NOTIFY CCB to the bus
          number of this bus and target id of the SIM/HBA. 
    
      B)  The SIM/HBA shall form the SCSI-2 required 18 bytes of
          correct sense data for the event and place the sense data in
          the sense buffer provided in the IMMEDIATE NOTIFY CCB. 
          It shall not be considered an error if the sense buffer bytes are
          zero, indicating NOSENSE.  However the Host Target Mode
          peripheral driver shall not be required to preserve NOSENSE
          data.
    
      C)  The SIM/HBA shall set the CAM Status to Nexus Not
          Established in the IMMEDIATE NOTIFY CCB indicating that a
          nexus was not yet established.  
    
      D)  The SIM/HBA shall indicate in the CAM Status field of the
          IMMEDIATE NOTIFY CCB that Autosense is valid.  Autosense
          valid indicates to the Host Target Mode peripheral driver that
          the sense buffer data is valid and can be copied.  The Host
          Target Mode peripheral driver shall save the copied sense data
          for use if the next received command is request sense.
    
      E)  The SIM/HBA shall form an unique sequence identifier and
          place it in the IMMEDIATE NOTIFY CCBs Sequence Identifier
          field.
    
      F)  The SIM/HBA shall transition the SCSI Bus to BUS FREE. 
          The SIM/HBA shall callback the Host Target Mode peripheral
          driver using the callback notify field in the available
          IMMEDIATE NOTIFY CCB.  The exact order of these two
          operations is not specified.
    
      G)  For all initial connections, the SIM/HBA for this enabled Host
          Target Mode LUN shall transparently respond with a SCSI
          Status of BUSY until all events are acknowledged  by the Host
          Target Mode peripheral driver.
    
+     H)  All CONTINUE TARGET I/O CCBs received by the SIM/HBA
+         for this enabled Host Target Mode LUN shall be rejected until all
+         events are acknowledged by the Host Target Mode Peripheral driver.
+         The rejected CCBs shall have:
    
-     H)  All ACCEPT TARGET I/O and CONTINUE TARGET I/O CCBs
-         received by the SIM/HBA for this enabled Host Target Mode
-         shall be rejected until all events are acknowledged by the Host
-         Target Mode Peripheral driver.  The rejected CCBs shall have:
    
        1)  A CAM Status field set to Unacknowledged Event by Host
    
        2)  A return status of Unacknowledged Event by Host.
    
    Acknowledgment of this event by the Host Target Mode peripheral
    driver shall be accomplished when the SIM/HBA receives an NOTIFY
    ACKNOWLEDGE CCB for this LUN with the Sequence Identifier field
    equal to the sequence identifier of the IMMEDIATE NOTIFY CCB for
    this event.
    
    The Host Target Mode peripheral driver shall be responsible for
    preserving Contingent Allegiance conditions.
    
    
    11.3.3.1.2.1 ABORT message
    
    When an ABORT message is received for an enabled Host Target
    Mode LUN by the SIM/HBA, the SIM/HBA  shall:
    
      A)  Accept the message.  
    
      B)  Set the Path ID of an IMMEDIATE NOTIFY CCB to the bus
          number of this bus.  Set the Target ID of the SIM/HBA, and
          LUN ID from the IDENTIFY message.  Set the Initiator ID field
          of the IMMEDIATE NOTIFY CCB to the ID of the Initiator that
          selected this SIM/HBA.
    
      C)  Set the IMMEDIATE NOTIFY CCB CAM Status to
          Message Received.
    
      D)  Form an unique sequence identifier and place it in the
          IMMEDIATE NOTIFY CCBs Sequence Identifier field.
    
      E)  Set the IMMEDIATE NOTIFY CCB Message Code field to the
          ABORT Message code.
    
      F)  All CONTINUE TARGET I/O CCBs for this I_T_L or I_T_L_Q
          nexus shall have the CAM Status set to Request Aborted by
          Host and shall be returned to the Host Target Mode peripheral
          driver by the CONTINUE TARGET I/O CCB callback
          mechanism.
    
      G)  The SIM/HBA shall transition the SCSI Bus to BUS FREE. 
          The SIM/HBA shall callback the Host Target Mode peripheral
          driver using the callback notify field in the available
          IMMEDIATE NOTIFY CCB.  The exact order of these two
          operations is not specified.
    
      H)  For all initial connections the SIM/HBA for this I_T_L or
          I_T_L_Q shall transparently respond with a SCSI Status of
          BUSY until all events are acknowledged by the Host Target
          Mode peripheral driver.
    
+     I)  All CONTINUE TARGET I/O CCBs received by the SIM/HBA
+         for this I_T_L or I_T_L_Q shall be rejected until all events are
+         acknowledged by the Host Target Mode Peripheral driver.
+         The rejected CCBs shall have:
    
-     I)  All ACCEPT TARGET I/O and CONTINUE TARGET I/O CCBs
-         received by the SIM/HBA for this I_T_L or I_T_L_Q shall be
-         rejected until all events are acknowledged by the Host Target
-         Mode Peripheral driver.  The rejected CCBs shall have:
    
        1)  A CAM Status field set to Unacknowledged Event by Host
    
        2)  A return status of Unacknowledged Event by Host.
    
    Acknowledgment of this event by the Host Target Mode peripheral
    driver shall be accomplished when the SIM/HBA receives an NOTIFY
    ACKNOWLEDGE CCB for this I_T_L or I_T_L_Q with the Sequence
    Identifier field equal to the sequence identifier of the IMMEDIATE
    NOTIFY CCB for this event.
     
    
    11.3.3.1.3.2 ABORT TAG message
    
    The ABORT TAG message shall be supported if Tagged Queue
    Operation is active for this LUN.  When an ABORT TAG message is
    received for an enabled Host Target Mode LUN by the SIM/HBA, the
    SIM/HBA  shall:
    
      A)  Accept the message.
    
      B)  If the current I/O process is not fully identified (e.g., no Queue
          Tag message) then the SIM/HBA shall:
        
        1)  Go to BUS FREE phase.
    
        2)  No other processing is required (see SCSI-2 ABORT TAG
            message for further information).
    
      C)  Set the Path ID of an IMMEDIATE NOTIFY CCB to the bus
          number of this bus.  Set the Target ID of the SIM/HBA, and
          LUN ID from the IDENTIFY message.  Set the Initiator ID field
          of the IMMEDIATE NOTIFY CCB to the ID of the initiator that
          selected this SIM/HBA.
    
      D)  Set the IMMEDIATE NOTIFY CCB CAM Status to Message
          Received.
    
      E)  Set the IMMEDIATE NOTIFY CCB Message Code field to the
          ABORT TAG Message code.  Place the Additional Arguments
          to the message (Queue Tag) in the Message arguments array
          of the IMMEDIATE NOTIFY CCB.
    
      F)  The SIM/HBA shall form an unique sequence identifier and
          place it in the IMMEDIATE NOTIFY CCBs Sequence Identifier
          field.
    
      G)  The SIM/HBA shall search the list of CONTINUE TARGET I/O
          CCB(s) for this I_T_L_Q nexus looking for a match between
          the TAG ID field of the CCB and the Queue Tag of the
          I_T_L_Q nexus.  For each match is found, that CONTINUE
          TARGET I/O CCBs CAM Status shall be set to Request
          Aborted by Host and shall be returned to the Host Target Mode
          peripheral driver by the CONTINUE TARGET I/O CCB callback
          mechanism.
    
      H)  The SIM/HBA shall transition the SCSI Bus to BUS FREE. 
          The SIM/HBA shall callback the Host Target Mode peripheral
          driver using the callback notify field in the available
          IMMEDIATE NOTIFY CCB.  The exact order of these two
          operations is not specified.
    
      I)  For all initial connections, the SIM/HBA for this I_T_L or
          I_T_L_Q shall transparently respond with a SCSI Status of
          BUSY until all events are acknowledged by the Host Target
          Mode peripheral driver.
    
+     J)  All CONTINUE TARGET I/O CCBs received by the SIM/HBA
+         for this I_T_L or I_T_L_Q shall be rejected until all events are
+         acknowledged by the Host Target Mode peripheral driver.
+         The rejected CCBs shall have:
    
-     J)  All ACCEPT TARGET I/O and CONTINUE TARGET I/O CCBs
-         received by the SIM/HBA for this I_T_L or I_T_L_Q shall be
-         rejected until all events are acknowledged by the Host Target
-         Mode peripheral driver. The rejected CCBs shall have:
    
        1)  A CAM Status field set to Unacknowledged Event by Host
    
        2)  A return status of Unacknowledged Event by Host.
    
    Acknowledgment of this event by the Host Target Mode peripheral
    driver shall be accomplished when the SIM/HBA receives a NOTIFY
    ACKNOWLEDGE CCB for this I_T_L or I_T_L_Q nexus with the
    Sequence Identifier field equal to the sequence identifier of the
    IMMEDIATE NOTIFY CCB for this event.
    
    11.3.3.1.3.3 CLEAR QUEUE message
     
    The CLEAR QUEUE message shall be supported if Tagged Queue
    Operation is active for this LUN.  When an CLEAR QUEUE message
    is received for an enabled Host Target Mode LUN by the SIM/HBA,
    the SIM/HBA  shall:
    
      A)  Accept the message.
    
      B)  Set the Path ID of an IMMEDIATE NOTIFY CCB to the bus
          number of this bus.  Set the Target ID of the SIM/HBA, and
          LUN ID from the IDENTIFY message.  Set the Initiator ID
          field of the IMMEDIATE NOTIFY CCB to the ID of the
          initiator that selected this SIM/HBA.
    
      C)  Set the IMMEDIATE NOTIFY CCB CAM Status to Message
          Received.
    
      D)  Set the IMMEDIATE NOTIFY CCB Message Code field to the 
          CLEAR QUEUE Message code.
    
      E)  The SIM/HBA shall form an unique sequence identifier and
          place it in the IMMEDIATE NOTIFY CCBs sequence identifier
          field.
    
      F)  All CONTINUE TARGET I/O CCB(s) for this enabled Host
          Target Mode LUN, shall have the CAM Status set to Request
          Aborted by Host and shall be returned to the Host Target Mode
          peripheral driver by the CONTINUE TARGET I/O CCB callback
          mechanism.  Refer to the SCSI-2 specification clause 5.6.4 for
          any further clarification.
    
      G)  The SIM/HBA shall transition the SCSI Bus to BUS FREE. 
          The SIM/HBA shall callback the Host Target Mode peripheral
          driver using the callback notify field in the available
          IMMEDIATE NOTIFY CCB.  The exact order of these two
          operations is not specified.
    
      H)  For all initial connections the SIM/HBA for this LUN shall
          transparently respond with a SCSI Status of BUSY until all
          events are acknowledged by the Host Target  Mode peripheral
          driver.
    
+     I)  All CONTINUE TARGET I/O CCBs received by the SIM/HBA
+         for this LUN shall be rejected until all events are acknowledged
+         by the Host Target Mode Peripheral driver.
+         The rejected CCBs shall have:
    
-     I)  All ACCEPT TARGET I/O and CONTINUE TARGET I/O CCBs
-         received by the SIM/HBA for this LUN shall be rejected until all
-         events are acknowledged by the Host Target Mode Peripheral
-         driver.  The rejected CCBs shall have:
    
        1)  A CAM Status field set to Unacknowledged Event by Host.
    
        2)  A return status of Unacknowledged Event by Host.
    
    Acknowledgment of this event by the Host Target Mode peripheral
    driver shall be accomplished when the SIM/HBA receives a NOTIFY
    ACKNOWLEDGE CCB for this LUN with the Sequence Identifier field
    equal to the sequence identifier of the IMMEDIATE NOTIFY CCB for
    this event.
    
    
    11.3.3.1.3.5 TERMINATE I/O PROCESS message
     
    When the supported TERMINATE I/O PROCESS message is received
    for an enabled Host Target Mode LUN by the SIM/HBA, the SIM/HBA 
    shall:
      
      A)  If there is no matching I/O process, the SIM/HBA shall reject
          the message, and no further processing is required.
    
      B)  If there is a matching I/O process, accept the message.
    
      C)  If disconnects are mandatory the SIM/HBA shall disconnect
          from the bus.  If disconnects are allowed the SIM/HBA should
          disconnect from the bus.
    
      D)  Set the Path ID of an IMMEDIATE NOTIFY CCB to the bus
          number of this bus.  Set the Target ID of the SIM/HBA, and
          LUN ID from the IDENTIFY message.  Set the Initiator ID field
          of the IMMEDIATE NOTIFY CCB to the ID of the initiator that
          selected this SIM/HBA.
    
      E)  The SIM/HBA shall form an unique sequence identifier and
          place it in the IMMEDIATE NOTIFY CCBs Sequence Identifier
          field.
    
      F)  Set the IMMEDIATE NOTIFY CCB CAM Status to Message
          Received.
    
      G)  Set the IMMEDIATE NOTIFY CCB Message Code field to the
          TERMINATE I/O PROCESS message code.
    
      H)  Each CONTINUE TARGET I/O CCB for this I_T_L or I_T_L_Q
          nexus shall have the CAM Status set to  Terminate I/O
          Process, The Residual Length field shall be set to valid 
          number of bytes not transferred for this CCB.  The CCB(s)
          shall be returned to the Host Target Mode peripheral driver by
          the CONTINUE TARGET I/O CCB callback mechanism.
    
      I)  Call back the Host Target Mode peripheral driver by the
          mechanism provided by the IMMEDIATE NOTIFY CCB.
    
      J)  For all initial connections the SIM/HBA for this I_T_L or
          I_T_L_Q shall transparently respond with a SCSI Status of
          BUSY until all events are acknowledged by the Host Target
          Mode peripheral driver.
    
+     K)  All CONTINUE TARGET I/O CCBs received by the SIM/HBA
+         for this I_T_L or I_T_L_Q shall be rejected until all events are
+         acknowledged by the Host Target Mode peripheral driver.
+         The rejected CCBs shall have:
    
-     K)  All Accept Target I/O and CONTINUE TARGET I/O CCBs
-         received by the SIM/HBA for this I_T_L or I_T_L_Q shall be
-         rejected until all events are acknowledged by the Host Target
-         Mode peripheral driver.  The rejected CCBs shall have:
    
        1)  A CAM Status field set to Unacknowledged Event by
            Host
    
        2)  A return status of Unacknowledged Event by Host.
    
      L)  Acknowledgment of this event by the Host Target Mode
          peripheral driver shall be accomplished when the SIM/HBA
          receives an NOTIFY ACKNOWLEDGE CCB for this I_T_L
          nexus with the Sequence Identifier field equal to the Sequence
          Identifier of the IMMEDIATE NOTIFY CCB for this event.
    
    The Host Target Mode peripheral driver shall acknowledge the event
    and properly terminate the I/O process as specified by SCSI-2.
    
    
+   11.3.3.1.5 HBA Faults
+   
+   If a controlling SIM detects that a HBA has faulted/failed in a way that
+   causes the HBA to be not usable in its current state (e.g., has ceased
+   responding, declared itself insane, needs to be initialized/restarted), it
+   shall do the following for each Host Target Mode enabled LUN for the
+   faulted/failed HBA:
+   
+     A)  Set the Path ID of an IMMEDIATE NOTIFY CCB to the bus
+         number of this HBA.  Set the Target ID of the HBA, and the
+         LUN ID to the LUN number being reported.
+   
+     B)  Set the IMMEDIATE NOTIFY CCB CAM Status to No HBA Detected.
+   
+     C)  The SIM/HBA shall form an unique sequence identifier and
+         place it in the IMMEDIATE NOTIFY CCBs sequence identifier
+         field.
+   
+     D)  All CONTINUE TARGET I/O CCBs for this Host Target Mode
+         LUN shall have the CAM Status set to No HBA Detected and
+         shall be returned to the Host Target Mode peripheral driver by
+         the CONTINUE TARGET I/O CCB callback mechanism.
+   
+     E)  The SIM shall clear the unacknowledged event list of all other
+         unacknowledged events for this LUN (e.g., the only
+         unacknowledged event for this LUN is this event).
+   
+     F)  The SIM shall callback the Host Target Mode peripheral driver
+         using the callback notify field in the available IMMEDIATE
+         NOTIFY CCB.
+   
+     G)  All CONTINUE TARGET I/O CCBs received by the SIM for this
+         LUN until all events are acknowledged by the Host Target
+         Mode peripheral driver shall be rejected with:
+   
+       1)  A CAM Status field set to Unacknowledged Event by
+           Host
+   
+       2)  A return status of Unacknowledged Event by Host.
+   
+     H)  The SIM may rectify fault/failure for the HBA and bring the
+         HBA to a usable state once again.  The recovery actions that
+         the SIM employs are vendor specific but the SIM/HBA
+         responses to connects are specified for the fault/failure
+         recovery period.  The term "fault/failure recovery period" shall
+         mean from the SIMs initial recovery action (e.g., the first step
+         done by the SIM to correct the HBA fault/failure) to the
+         SIM/HBA being able to comply to this standard for an enabled
+         Host Target Mode LUN.
+   
+       During the fault/failure recovery period the SIM/HBA shall
+       respond to connects in one of the following ways:
+   
+       1)  No response to selections (selection timeout) until the
+           recovery period ends.  
+   
+       2)  SCSI-2 BUSY status in response to connections until the
+           recovery period ends.
+   
+       3)  No response to selections (selection timeout) for a period
+           of time then SCSI-2 BUSY status in response to
+           connections until the recovery period ends. 
+     
+   
+     I)  The state of the SIM/HBA shall be reflected in the response to
+         PATH INQUIRY CCBs (see Clause 9.2.3 Path Inquiry for
+         further details).
+    
+     Note: The Host Target Mode LUN is not disabled unless the Host Target Mode
+           peripheral driver explicitly does a disable LUN function. 
+   
+   Acknowledgment of this event by the Host Target Mode peripheral
+   driver shall be accomplished when the SIM receives a NOTIFY
+   ACKNOWLEDGE CCB for this LUN with the Sequence Identifier field
+   equal to the sequence identifier of the IMMEDIATE NOTIFY CCB for
+   this event.
+   
+   The Host Target Mode peripheral driver shall recognize that this event
+   is analogous to a power off of the HBA. The Host Target Mode
+   peripheral driver may disable the LUN or may try to continue
+   processing (e.g., determine if the SIM has brought the HBA to a
+   usable state) or may try to continue processing and then disable the
+   LUN.  
+   
+   The Host Target Mode peripheral driver shall determine through the
+   Path Inquiry function if the SIM has brought the HBA to a usable state. 
+   If the SIM has brought the HBA to  usable state again the Host Target
+   Mode peripheral driver shall treat this condition as a power on/reset
+   of the I_T_L or I_T_L_Q.
+   
+   Note: The Host Target Mode peripheral driver should respond with CHECK
+         CONDITION status and UNIT ATTENTION sense key in response to
+         REQUEST SENSE command for the first command received except for
+         INQUIRY and REQUEST SENSE commands for this I_T_L or I_T_L_Q.  The
+         Host Target Mode peripheral driver should ensure that there are 
+         ACCEPT TARGET I/O CCBs available to the SIM/HBA before 
+         acknowledging the event if processing with the SIM/HBA is to 
+         be resumed.
    
    11.3.4 IMMEDIATE NOTIFY CCB
    
    The following lists the fields of the IMMEDIATE NOTIFY CCB.  No
    entry under the "Dir" heading indicates that this  field is not being used
    for the IMMEDIATE NOTIFY CCB.                                             
                    
# TABLE NOT SHOWN    
    
    
    The following are the only possible CAM Status values for the
    IMMEDIATE NOTIFY CCB passed to the SIM/HBA from the Host
    Target Mode peripheral driver:
      - Invalid Request - Indicates that the CCB has invalid field(s).
      - Invalid Path ID - Indicates the Path ID is not known.
      - Invalid Target ID - Indicates the Target ID is not that of the
        target device.
      - Invalid LUN ID - Indicates the Target LUN is not in the valid
        range for LUNs.
    
    The following are the only possible CAM Status values for the
    IMMEDIATE NOTIFY CCB passed from the SIM/HBA to the Host
    Target Mode peripheral driver:
+     - No HBA Detected
      - Nexus Not Established
      - Message Received 
      - Unavailable Resource
    
    Fields Described:
    The Pointer to Sense Buffer field shall contain a pointer to a buffer
    having minimum of 18 bytes. 
    
    The Sense Buffer Length field shall be the length of the sense buffer. 
    The length shall be at least 18.
    
    Initiator ID field is the SCSI BUS ID of the Initiator that selected the
    SIM/HBA.
    
    The Message Code field is used to store the SCSI message code for
    received messages.
    
    The Message Arguments field is used to store SCSI message
    arguments received.  
    
    11.3.8.1 SIM/HBA ACCEPT TARGET I/O CCB Acceptance
    
    When the SIM/HBA receives an ACCEPT TARGET I/O CCB from a
    Host Target Mode peripheral driver, it shall do the following:

# Bullet A DELETED and clause re-lettered.    

-     A)  Check whether there are outstanding unacknowledged events for 
-         this LUN or I_T_L nexus or I_T_L_Q nexus, if there
-         are any the SIM/HBA shall  set the CAM Status and the
-         xpt_action() return status to Unacknowledged Event by Host
-         and return.

# What is now Bullet A was Bullet B    
+     A)  Check that the path id, target id, and target LUN specified in
          the ACCEPT TARGET I/O CCB is that of an enabled LUN.  If
          the LUN is not enabled, the CCB CAM Status and xpt_action()
          return status shall be Path Invalid.
    
+     B)  Check that the CDB completion function is set in the ACCEPT
          TARGET I/O CCB.  If it is not set, the CCB CAM Status and
          xpt_action() return status shall be Request Completed with
          Error.
    
+     C)  Check that the pointer to the sense buffer is set, and that the
          sense buffer length is a minimum of 18 bytes.   If not correct,
          the CCB CAM Status and xpt_action() return status shall be
          Request Completed with Error.
    
+     D)  Otherwise the xpt_action() return status shall be Request in
          Progress. 
    
    11.3.9 ACCEPT TARGET I/O CCB
    
    The following lists the fields of the ACCEPT TARGET I/O CCB.  No
    entry under the "Dir" heading indicates that this field is not being used
    for the Accept Target I/O function.

# Table not shown
    
    The following lists the possible CAM Status values of the ACCEPT
    TARGET I/O CCB:
      - Invalid Request - Indicates that the CCB was sent to a
        disabled LUN.
      - CDB Received - Indicates that the CCB contains a CDB
        received from an initiator.
      - Invalid CDB - Target Mode CDB error
      - Request Aborted by Host 
      - SCSI Bus Reset Sent/Received - This SIM/HBA is recovering
        from a bus reset.
      - Bus Device Reset Sent - This SIM/HBA is recovering from a
        BUS DEVICE RESET message.
      - Command Timeout - Time period specified expired 
      - Path Invalid 
      - Unexpected Bus Free
-     - Unacknowledged Event by Host - An event has not been
-       acknowledged by the Host Target Mode peripheral driver.
    
    The only valid bits for the CAM Flags field are the following:
      - CDB is a Pointer - Indicates the CDB contained in the
        ACCEPT TARGET I/O CCB is a pointer.  The CDB Length
        field shall indicate the size of the CDB buffer.
      - CDB Physical - Indicates whether the pointer address is virtual
        or physical. 
      - Sense Buffer - Indicates whether the pointer address is virtual
        or physical. 
      - Callback on Comp. 
    
    11.3.10 CONTINUE TARGET I/O CCB
    
    The following lists the fields of the CONTINUE TARGET I/O CCB.  No
    entry under the "Dir" heading indicates that this field is not being used
    for the Continue Target I/O function.
                                             
# Table not shown

    The following lists the possible CAM Status values of the CONTINUE
    TARGET I/O CCB:
      - Invalid Request - Indicates that the CCB was sent to a
        disabled LUN.
      - Request in Progress - Request accepted by SIM/HBA. 
      - Request Completed with Error - Indicates that the CCB is not
        properly setup.
      - Request Aborted by Host.  
      - Request Completed without Error - Request completed
        successfully.  
      - SCSI Bus Reset Sent/Received - This SIM/HBA is recovering
        from a bus reset.
+     - No HBA Detected - The HBA is nolonger responding.  
      - Bus Device Reset Sent - This SIM is recovering from a BUS
        DEVICE RESET message.  
      - Target Bus Phase Sequence Failure 
      - Uncorrectable Parity Error Detected
      - Initiator Detected Error
      - Unexpected Bus Free
      - Target Selection Timeout - Initiator failed to response to selection
      - Command Timeout - Time period specified expired 
      - Path Invalid 
      - Unacknowledged Event by Host - An event has not been
        acknowledged by the Host Target Mode peripheral driver.
    
    The following bits are valid for the CAM Flags field of the CONTINUE
    TARGET I/O CCB:
      - Direction Out - Sending data from the target peripheral device
        to the initiator.
        + SG List/Data Buffer Pointer and Data Transfer Length fields
          shall be filled in.
      -   Direction In - Receiving data from the initiator to the target 
          peripheral device.
        + SG List/Data Buffer Pointer and Data Transfer Length fields
        shall be filled in.
      - No Direction - No data phase required.
      - Scatter/Gather - Indicates that the Data Buffer Pointer is a pointer
      to a scatter/gather list.
      - Tagged Queue Action Enable - Indicates this is a tagged request
      and the Tag ID shall be filled in.
      - Sense Buffer - Indicates whether the pointer address is virtual or
      physical. 
      - Callback on Completion. 
    
    11.3.12.1 BUS RESET
    
    When a bus reset (hard reset) is sent or received, the following
    sequence of events shall occur: 
    
      A)  The SIM/HBA shall:
    
        1)  Clear any outstanding target I/O's owned by the SIM/HBA
            for the bus that suffered the reset by calling the callback
            completion function with a CAM Status of SCSI Bus Reset
            Sent/Received.  Requests owned by the SIM/HBA are:
    
          a)  Any I/O currently on the bus.
    
          b)  Any Continue Target I/O requests which are currently
              queued in the SIM/HBA.
        
        2)  Cause the Host Target Mode peripheral driver asynch
            callback function to be called as part of the normal asynch
            callback notification.
    
        3)  All initial connections shall complete with a SCSI status of
            BUSY, until the SIM/HBA receives an applicable NOTIFY
            ACKNOWLEDGE CCB.
    
+       4)  All CONTINUE TARGET I/O CCBs that are received by the
+           SIM while the reset recovery is in progress shall be returned
+           with a CAM Status of SCSI Bus Reset Sent/Received.    
    
-       4)  Any Continue Target I/O or ACCEPT TARGET I/O CCBs that are 
-           received by the SIM while the reset recovery is in progress
-           shall be returned with a CAM Status of SCSI Bus Reset 
-           Sent/Received.
    
        5)  Reset recovery shall be complete when the Host Target
            Mode peripheral driver issues a NOTIFY ACKNOWLEDGE
            CCB with  the Reset Cleared field set, and the Sequence
            Identifier equal to zero.
    
        6)  The SIM/HBA unacknowledged event list shall be cleared
            for all registered LUNs on the bus which experienced the
            bus reset.
        
      B)  The Host Target Mode peripheral driver asynch callback
          routine shall:
    
        1)  Clear all pending sense data.
    
        2)  Cease processing on any outstanding requests owned by
            the Host Target Mode peripheral driver.  These are
            ACCEPT TARGET I/O or CONTINUE TARGET I/O CCBs
            being processed by the Host Target Mode peripheral driver.
    
        3)  For all initiators, sense data shall be formed and saved
            indicating the UNIT ATTENTION condition caused as a
            result of the bus reset.  See SCSI-2 for further details on
            forming and clearing the contingent allegiance condition.
    
        4)  Issue a NOTIFY ACKNOWLEDGE CCB with the Reset
            Cleared field set and the Sequence Identifier equal to zero. 
    
        5)  If necessary, the Host Target Mode peripheral driver shall
            issue/reissue ACCEPT TARGET I/O CCB(s) so that the
            SIM/HBA can resume normal processing.
    
    11.3.12.2 BUS DEVICE RESET message
    
    When a BUS DEVICE RESET message is sent/received, the following
    sequence of events shall occur: 
    
      A)  The SIM/HBA shall:
    
        1)  Clear any outstanding target I/O's owned by the SIM/HBA
            for the target that received the BUS DEVICE RESET
            message by calling the callback completion function with a
            CAM Status of Bus Device Reset.  Requests owned by the
            SIM/HBA are:
    
          a)  Any I/O currently on the bus.
    
          b)  Any Continue Target I/O requests which are currently
              queued in the SIM.
    
        2)  Cause the Host Target Mode peripheral driver asynch
            callback function to be called as part of the normal asynch
            callback notification.
    
        3)  All initial connections shall complete with a SCSI status of
            BUSY, until the SIM/HBA receives an applicable NOTIFY
            ACKNOWLEDGE CCB.
    
+       4)  All CONTINUE TARGET I/O CCBs that are received by the
+           SIM while the reset recovery is in progress shall be returned
+           with a CAM Status of Bus Device Reset.    
    
-       4)  Any Continue Target I/O or ACCEPT TARGET I/O CCBs that are 
-           received by the SIM while the reset recovery is in progress 
-           shall be returned with a CAM Status of Bus Device Reset.  
    
        5)  Reset recovery shall be complete when the Host Target
            Mode peripheral driver issues an NOTIFY ACKNOWLEDGE
            CCB with the Reset Cleared field set and the Sequence
            Identifier equal to zero.
    
        6)  The SIM/HBA unacknowledged event lists shall cleared for
            all enabled LUNs on the target that received the BUS
            DEVICE RESET message.
    
      B)  The Host Target Mode peripheral driver asynch callback
          routine shall:
    
        1)  Clear all pending sense data.
    
        2)  Cease processing on any outstanding requests owned by
            the Host Target Mode peripheral driver.  These are
            ACCEPT TARGET I/O or CONTINUE TARGET I/O CCBs
            being processed by the Host Target Mode peripheral driver.
    
        3)  For all initiators, sense data shall be formed and saved
            indicating the UNIT ATTENTION condition caused as a
            result of the bus reset.  See SCSI-2 for further details on
            forming and clearing the contingent allegiance condition.
    
        4)  Issue a NOTIFY ACKNOWLEDGE CCB with the Reset
            Cleared field set and the Sequence Identifier equal to zero. 
    
        5)  If necessary, the Host Target Mode peripheral driver shall
            issue/reissue ACCEPT TARGET I/O CCB(s) so that the
            SIM/HBA can resume normal processing.
    




More information about the T10 mailing list