The SCSI reference manual defines two types of sense data formats - fixed and variable descriptor-based ones (chapter 2.4). The "Control Mode Page (0Ah)" (4.3.8), which is supposed to be returned as a response to the MODE SENSE SCSI command, contains a D_SENSE bit, which is defined as:
D_SENSE (DESCRIPTOR FORMAT SENSE DATA) bit
0 A descriptor format sense data (D_SENSE) bit set to zero specifies that the device server shall return the fixed format sense data when returning sense data in the same I_T_L_Q nexus transaction as a CHECK CONDITION status.
1 A D_SENSE bit set to one specifies that the device server shall return descriptor format sense data when returning sense data in the same I_T_L_Q nexus transaction as a CHECK CONDITION status, except as defined in 2.4.1.
My question is about this bit interpretation on the SCSI target side - is the target server obligated to return sense data in the descriptor format if this bit is 1? Or it's just a possibility to return this data in any format it wants?
The first byte of the sense data can be used to determine its format, so the SCSI initiator doesn't actually need the D_SENSE bit value to decide how to decode the received sense data.
I'm asking this question cause I'm working on some piece of software which is supposed to simulate a SCSI target, so I need to digest multiple SCSI documents to make it right.