Bug #1654

Bug #1450: Illumos should be buildable with GCC4

pmcs should set (now) reserved INQUIRY device type modifier to 0

Added by Rich Lowe over 6 years ago. Updated over 6 years ago.

Status:ResolvedStart date:2011-10-15
Priority:NormalDue date:
Assignee:Rich Lowe% Done:


Category:driver - device drivers
Target version:-
Difficulty:Bite-size Tags:


pmcs(7D) contains code like this:

             inqp = (struct scsi_inquiry *)rp;
            inqp->inq_qual = (LE_16(id->word0) & 0x80) ? 0x80 : 0;

This is a no-op, as the inq_qual field is only 7 bits, and GCC4 warns about
this (GCC3 optimizes it to constant 0 silently, Studio does neither). Note
that despite being described in comments as "device type qualifier", this is
actually referred to as "device type modifier" by everyone else.

These bits of byte1 are marked reserved in draft SPC-4 6.4.2, SPC-3 6.4.2,
and SPC-2 7.3.4, they're also unused by the system, except that format(1M)
will display them if set.

As such, we should just assign a constant 0 to this field directly, rather
than via the convoluted manner we do now.

Related issues

Related to illumos gate - Bug #1655: ata erroneously treats inq_qual as DPQ New 2011-10-15


#1 Updated by Rich Lowe over 6 years ago

  • Status changed from New to In Progress

Actually, since we're claiming SPC-3 (inq_ansi = 5), and response format 2 (inq_rdf = 2) this field should be 0 in general, and its status in other standards (that is, those other than the one we are stating) are immaterial.

#2 Updated by Rich Lowe over 6 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100

Resolved in r13488 commit:87177e9d3436

Also available in: Atom