* Executing a scsi command
@ 2002-11-07 13:44 MShetty
2002-11-08 16:22 ` MShetty
2002-11-08 17:49 ` Sumit Agarwal
0 siblings, 2 replies; 4+ messages in thread
From: MShetty @ 2002-11-07 13:44 UTC (permalink / raw)
To: linux-scsi
Hi,
I want to execute a scsi cmd from my driver. The API's that I found
(scsi_do_cmd, scsi_wait_req) require a pointer to the scsi_device or
scsi_host structure.. Any idea how I could get them.... given the major
and minor no. of the device to which the command is to be sent.
Is there an alternative way of executing a scsi_cmd ??
Would help if I could get some help on the above.
Thanks and Regards,
M Shetty
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Executing a scsi command
2002-11-07 13:44 Executing a scsi command MShetty
@ 2002-11-08 16:22 ` MShetty
2002-11-08 16:24 ` Jens Axboe
2002-11-08 17:49 ` Sumit Agarwal
1 sibling, 1 reply; 4+ messages in thread
From: MShetty @ 2002-11-08 16:22 UTC (permalink / raw)
To: linux-scsi
Hi,
Does request_queue's queuedata contain the Scsi_Device pointer ?? Saw it
done in scsi_merge.c
Scsi_Device *SDpnt;
struct Scsi_Host *SHpnt;
SDpnt = (Scsi_Device *) q->queuedata;
SHpnt = SDpnt->host;
Would help if I could get some comment on the above.
Thanks and Regards,
M Shetty
MShetty wrote:
> Hi,
>
> I want to execute a scsi cmd from my driver. The API's that I found
> (scsi_do_cmd, scsi_wait_req) require a pointer to the scsi_device or
> scsi_host structure.. Any idea how I could get them.... given the major
> and minor no. of the device to which the command is to be sent.
>
> Is there an alternative way of executing a scsi_cmd ??
>
> Would help if I could get some help on the above.
>
> Thanks and Regards,
> M Shetty
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Executing a scsi command
2002-11-08 16:22 ` MShetty
@ 2002-11-08 16:24 ` Jens Axboe
0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2002-11-08 16:24 UTC (permalink / raw)
To: MShetty; +Cc: linux-scsi
On Fri, Nov 08 2002, MShetty wrote:
> Hi,
>
> Does request_queue's queuedata contain the Scsi_Device pointer ?? Saw it
> done in scsi_merge.c
>
> Scsi_Device *SDpnt;
> struct Scsi_Host *SHpnt;
>
> SDpnt = (Scsi_Device *) q->queuedata;
> SHpnt = SDpnt->host;
>
> Would help if I could get some comment on the above.
Well what's there to comment about? Yes ->queuedata holds pointer to
SCSI device, the block layer queues are per-device.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Executing a scsi command
2002-11-07 13:44 Executing a scsi command MShetty
2002-11-08 16:22 ` MShetty
@ 2002-11-08 17:49 ` Sumit Agarwal
1 sibling, 0 replies; 4+ messages in thread
From: Sumit Agarwal @ 2002-11-08 17:49 UTC (permalink / raw)
To: MShetty; +Cc: linux-scsi
[-- Attachment #1: Type: text/plain, Size: 1513 bytes --]
The best way to go about is to use the ioctl calls. In
addition during
the Initialization or Inquiry you can use IOCTL calls to
associate
the devices with your driver and then later on use them
at your
discretion using scsi_do_cmd etc.
If you dont want to do this then an ugly way is as follows
Most of the block devices have their arrays that can be used
for this
purpose as static. you have to employ different methods
based on major
number to tackle this. However, it is better if you try not
to do this.
for e.g
for disks you need to hack sd.c to retrieve the value from
rscsi_disks.
for generic driver you can have your own inode and file
pointer created
the invoke sg_open() and get sfp pointer from filp->private
and then
use sfp->device for your purpose and so on.
Does anyone else have a better alternative?
Thanks,
Sumit
MShetty wrote:
>
> Hi,
>
> I want to execute a scsi cmd from my driver. The API's that I found
> (scsi_do_cmd, scsi_wait_req) require a pointer to the scsi_device or
> scsi_host structure.. Any idea how I could get them.... given the major
> and minor no. of the device to which the command is to be sent.
>
> Is there an alternative way of executing a scsi_cmd ??
>
> Would help if I could get some help on the above.
>
> Thanks and Regards,
> M Shetty
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: Card for Sumit Agarwal --]
[-- Type: text/x-vcard, Size: 397 bytes --]
begin:vcard
n:Agarwal;Sumit
tel;fax:(91)(80)2200196
tel;home:+919845205210
tel;work:2051126
x-mozilla-html:FALSE
url:www.hp.com
org:HP-ISO;HPUX
version:2.1
email;internet:aksumit@india.hp.com
title:Senior Software Engineer
adr;quoted-printable:;;Hewlett-Packard,=0D=0AIndia Software Operation Pvt. Ltd.,=0D=0A29, Cunningham Road,=0D=0A;Bangalore;Karnataka;560052;India
fn:Sumit Agarwal
end:vcard
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-11-08 17:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-07 13:44 Executing a scsi command MShetty
2002-11-08 16:22 ` MShetty
2002-11-08 16:24 ` Jens Axboe
2002-11-08 17:49 ` Sumit Agarwal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.