INQUIRY additional length question

Chuck Tuffli chuck at tuffli.net
Fri Mar 23 21:47:37 UTC 2012


I'm staring at a trace in which an array is sending back inquiry data
with the additional length set to 0xBC, but CAM is sending a
subsequent inquiry with length 0xC2. My expectation was the length
should have been (additional length + 4) or 0xC0.

Poking around, it looks like the SID_ADDITIONAL_LENGTH() macro is
calculating this as:
  additional_length + __offsetof(additional_length) + 1 == 0xBC + 4 + 1 = 0xC1

This value is then round up to 0xC2 in probestart() with a comment
about some SPI devices not liking odd lengths. All of this seems fine
to me except the '+ 1' in the macro. Should that really be there?

---chuck


More information about the freebsd-scsi mailing list