* doubts about sg driver
@ 2007-06-14 17:47 Parav Pandit
2007-06-14 19:51 ` Andrew Patterson
2007-06-14 20:02 ` Douglas Gilbert
0 siblings, 2 replies; 3+ messages in thread
From: Parav Pandit @ 2007-06-14 17:47 UTC (permalink / raw)
To: linux-scsi
Hi,
Few basic questions on sg driver:
1. Are there any hooks that low level HBA driver needs
to implement - for providing support for SG (SCSI
generic) driver?
Or SG always interacts with scsi_mod and it is
transparent to the HBA drivers?
>From the tldp How-to and sg.c it looks like it doesn't
directly talk with Low level HBA driver, but want to
confirm.
2. Can applications talk with SCSI RAID controller
device (some targets exposes LUN-0 as controller)
through sg interface or it is only for storage
devices?
3. How is the mapping between /dev/sda /dev/sdb etc to
/dev/sg0 /dev/sg1 etc?
Is this information is accessible via procfs or sysfs
interface?
Regards,
Parav Pandit
____________________________________________________________________________________
Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: doubts about sg driver
2007-06-14 17:47 doubts about sg driver Parav Pandit
@ 2007-06-14 19:51 ` Andrew Patterson
2007-06-14 20:02 ` Douglas Gilbert
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Patterson @ 2007-06-14 19:51 UTC (permalink / raw)
To: Parav Pandit; +Cc: linux-scsi
Hi Parav,
On Thu, 2007-06-14 at 10:47 -0700, Parav Pandit wrote:
> Hi,
>
> Few basic questions on sg driver:
>
> 1. Are there any hooks that low level HBA driver needs
> to implement - for providing support for SG (SCSI
> generic) driver?
No. This is all done in the sg/scsi-midlayer.
> Or SG always interacts with scsi_mod and it is
> transparent to the HBA drivers?
Yes.
> From the tldp How-to and sg.c it looks like it doesn't
> directly talk with Low level HBA driver, but want to
> confirm.
Correct.
>
> 2. Can applications talk with SCSI RAID controller
> device (some targets exposes LUN-0 as controller)
> through sg interface or it is only for storage
> devices?
Any SCSI device.
>
> 3. How is the mapping between /dev/sda /dev/sdb etc to
> /dev/sg0 /dev/sg1 etc?
> Is this information is accessible via procfs or sysfs
> interface?
>
In 2.6 kernels, you can looks at:
/sys/class/scsi_device/h:c:t:l/scsi_generic:sg#
in 2.4 and 2.6 you can look at /proc/scsi/sg/devices. Where the
contents is:
seq_printf(s, "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n",
scsidp->host->host_no, scsidp->channel,
scsidp->id, scsidp->lun, (int) scsidp->type,
1,
(int) scsidp->queue_depth,
(int) scsidp->device_busy,
(int) scsi_device_online(scsidp));
> Regards,
> Parav Pandit
>
>
>
>
> ____________________________________________________________________________________
> Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
> http://answers.yahoo.com/dir/?link=list&sid=396545469
> -
> 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
--
Andrew Patterson
Hewlett-Packard Company
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: doubts about sg driver
2007-06-14 17:47 doubts about sg driver Parav Pandit
2007-06-14 19:51 ` Andrew Patterson
@ 2007-06-14 20:02 ` Douglas Gilbert
1 sibling, 0 replies; 3+ messages in thread
From: Douglas Gilbert @ 2007-06-14 20:02 UTC (permalink / raw)
To: Parav Pandit; +Cc: linux-scsi
Parav Pandit wrote:
> Hi,
>
> Few basic questions on sg driver:
>
> 1. Are there any hooks that low level HBA driver needs
> to implement - for providing support for SG (SCSI
> generic) driver?
> Or SG always interacts with scsi_mod and it is
> transparent to the HBA drivers?
>>From the tldp How-to and sg.c it looks like it doesn't
> directly talk with Low level HBA driver, but want to
> confirm.
The sg driver talks to the scsi mid level (and the
block layer strangely enough) but not directly to
LLDs.
> 2. Can applications talk with SCSI RAID controller
> device (some targets exposes LUN-0 as controller)
> through sg interface or it is only for storage
> devices?
The sg driver is useful for any SCSI device (logical
unit) that is exposed by the scsi mid level. Apart
from direct access (i.e. disk) devices that might
include cd/dvd drives, tape drives, scsi enclosures,
saf-te controllers (which have processor peripheral
device type) and well known logical units.
> 3. How is the mapping between /dev/sda /dev/sdb etc to
> /dev/sg0 /dev/sg1 etc?
> Is this information is accessible via procfs or sysfs
> interface?
In the lk 2.6 series the mapping can be found in sysfs
(see lsscsi, specifically 'lsscsi -g'). In the sg3_utils
package the sg_map utility shows the mapping. That may
be helpful in the lk 2.4 series since there is no sysfs.
Doug Gilbert
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-06-14 20:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-14 17:47 doubts about sg driver Parav Pandit
2007-06-14 19:51 ` Andrew Patterson
2007-06-14 20:02 ` Douglas Gilbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).