From: Markus Lidel <Markus.Lidel@shadowconnect.com>
To: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: request for comments on sg_request changes (again)
Date: Wed, 11 May 2005 00:51:16 +0200 [thread overview]
Message-ID: <42813AE4.6050601@shadowconnect.com> (raw)
Hello,
for some time i asked for comments on moving sg_request into a own header
file into include/scsi/sg_request.h. Now this time i also have a real
implementation :-)
OK, this is a part of the queuecommand function, which uses the
sg_request to change some flags for the request:
#ifdef CONFIG_I2O_EXT_ADAPTEC
if (c->adaptec) {
u32 adpt_flags = 0;
if (SCpnt->sc_request && SCpnt->sc_request->upper_private_data) {
i2o_sg_io_hdr_t __user *usr_ptr =
((Sg_request *) (SCpnt->sc_request->
upper_private_data))->header.
usr_ptr;
if (usr_ptr)
get_user(adpt_flags, &usr_ptr->flags);
}
switch (i2o_dev->lct_data.class_id) {
case I2O_CLASS_EXECUTIVE:
case I2O_CLASS_RANDOM_BLOCK_STORAGE:
/* interpret flag has to be set for executive */
adpt_flags ^= I2O_DPT_SG_FLAG_INTERPRET;
break;
default:
break;
}
/*
* for Adaptec controllers we use the PRIVATE command, because
* the normal SCSI EXEC doesn't support all SCSI commands on
* all controllers (for example READ CAPACITY).
*/
if (sgl_offset == SGL_OFFSET_10)
sgl_offset = SGL_OFFSET_12;
cmd = I2O_CMD_PRIVATE << 24;
writel(I2O_VENDOR_DPT << 16 | I2O_CMD_SCSI_EXEC, mptr++);
writel(adpt_flags | tid, mptr++);
}
#endif
and here is the sg_request.h header:
static Scsi_Request *dummy_cmdp;
typedef struct sg_scatter_hold {
unsigned short k_use_sg;
unsigned short sglist_len;
unsigned bufflen;
unsigned b_malloc_len;
void *buffer;
char dio_in_use;
unsigned char cmd_opcode;
} Sg_scatter_hold;
typedef struct sg_request {
Scsi_Request *my_cmdp;
struct sg_request *nextrp;
struct sg_fd *parentfp;
Sg_scatter_hold data;
sg_io_hdr_t header;
unsigned char sense_b[sizeof (dummy_cmdp->sr_sense_buffer)];
char res_used;
char orphan;
char sg_io_owned;
volatile char done;
} Sg_request;
So please if you have anything against it, or know a better solution how
a program could get some information to the LLD (at least 2 bits so far),
please let me know...
Thank you very much in advance.
Best regards,
Markus Lidel
------------------------------------------
Markus Lidel (Senior IT Consultant)
Shadow Connect GmbH
Carl-Reisch-Weg 12
D-86381 Krumbach
Germany
Phone: +49 82 82/99 51-0
Fax: +49 82 82/99 51-11
E-Mail: Markus.Lidel@shadowconnect.com
URL: http://www.shadowconnect.com
reply other threads:[~2005-05-10 22:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=42813AE4.6050601@shadowconnect.com \
--to=markus.lidel@shadowconnect.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