From: Jeff Garzik <jgarzik@pobox.com>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] add extra inquiry byte 56 data to struct scsi_device
Date: Fri, 20 Aug 2004 23:21:48 -0400 [thread overview]
Message-ID: <4126BFCC.2000702@pobox.com> (raw)
In-Reply-To: <1093053368.3318.569.camel@mulgrave>
James Bottomley wrote:
> + if (sdev->inquiry_len > 56) {
> + if (inq_result[56] & 0x04)
> + sdev->ppr = 1;
> + if ((inq_result[56] & 0x0c) == 0x04)
> + sdev->dt_only = 1;
> + if (inq_result[56] & 0x01)
> + sdev->ius = 1;
> + if (inq_result[56] & 0x02)
> + sdev->qas = 1;
> + }
Do you forsee ever adding more feature bits like this?
It seems to me that a more maintainable approach is to cache relevant
INQUIRY data in a buffer, and then create accessor macros for
programmers' use.
That way you don't have to keep adding members (really, mnemonics) to a
data structure, and associated initialization code, each time the
mid-layer or some low-level drivers want to test a new feature bit.
Initialization via memcpy is easy and automatic.
Jeff
next prev parent reply other threads:[~2004-08-21 3:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-21 1:56 [PATCH] add extra inquiry byte 56 data to struct scsi_device James Bottomley
2004-08-21 3:21 ` Jeff Garzik [this message]
2004-08-21 3:39 ` James Bottomley
2004-08-21 4:06 ` James Bottomley
2004-08-21 4:41 ` Jeff Garzik
2004-08-21 4:38 ` Randy.Dunlap
2004-08-21 4:57 ` Jeff Garzik
2004-08-21 13:03 ` Douglas Gilbert
2004-08-21 13:51 ` James Bottomley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4126BFCC.2000702@pobox.com \
--to=jgarzik@pobox.com \
--cc=James.Bottomley@SteelEye.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox