From: Douglas Gilbert <dougg@torque.net>
To: Pat LaVarre <p.lavarre@ieee.org>
Cc: linux-scsi@vger.kernel.org
Subject: Re: /dev/hd* in sg_scan
Date: Tue, 28 Oct 2003 23:35:31 -0500 [thread overview]
Message-ID: <3F9F4393.5060602@torque.net> (raw)
In-Reply-To: <1067299763.3469.6.camel@patehci2>
Pat LaVarre wrote:
>>http://tldp.org/HOWTO/SCSI-Generic-HOWTO/open.html
>>... O_NONBLOCK ... ignored by ioctl(SG_IO)
>
>
> As of 2.6, in fact we now need O_NONBLOCK if we want open O_RDONLY to
> let us talk SG_IO to a DVD/CD with no disk present? Also we discard the
> history of passing thru less commands for O_RDONLY than for O_RDWR?
>
> Reaching those conclusions inspired me to try the following trivial
> inline patch for sg3_utils-1.05/sg_scan.c. I see this patch brings much
> of /dev/hd* to the notice of sg utils sg_scan. However, this patch may
> not be ready for prime-time, some of the code I flowed around I do not
> understand.
>
> Do we intend to make /dev/hd[a-z] available for passing ioctl SG_IO thru
> to ATAPI DVD/CD, in 2.6? Or for 2.6 do we recommend ab/using some other
> device name?
>
> Patched sg_scan success here looks like:
>
> $ sudo sg_scan -i
> /dev/hda: scsi0 channel=0 id=0 lun=0
> /dev/hdc: scsi0 channel=0 id=0 lun=0 [em]
> LITE-ON COMBO LTC-48161H KH0K [wide=0 sync=0 cmdq=0 sftre=0 pq=0x0]
> /dev/sg0: scsi0 channel=0 id=0 lun=0 [em] type=5
> Iomega RRD 01.U [wide=0 sync=0 cmdq=0 sftre=0 pq=0x0]
> $
>
> Perhaps the soft bridge from SCSI to ATA HDD in Linux, like some
> FireWire HDD, is an apparently SCSI device that does not support op x12
> Inquiry.
Pat,
Sg3_utils' sg_map and sg_scan for lk 2.6 still have me
thinking (and waiting). Currently sg devices have no
sysfs presence (yes Christoph, I'm still waiting). My
patch to the sg driver to use cdevs (char devices with
sysfs visibility and > 256 minors) seems to fallen foul
of the latest freeze. So scsi tape robots and enclosures
won't have any sysfs visibility.
Now as for /dev/hd and /dev/sd the situation is complex
and probably going to get worse before it get better.
With either /dev/hd and /dev/sd you may soon want to find
out (or probe) before making any assumptions:
- what protocol are you using (e.g. ATA, ATAPI, SCSI)
- what transport (e.g. pATA, sATA, SPI, FC, USB, SAS)
Anyways your patch looks interesting and hope to add it
soon (currently I'm rewriting sginfo).
Doug Gilbert
next prev parent reply other threads:[~2003-10-29 4:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-28 0:09 /dev/hd* in sg_scan Pat LaVarre
2003-10-29 4:35 ` Douglas Gilbert [this message]
2003-10-29 17:16 ` Pat LaVarre
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=3F9F4393.5060602@torque.net \
--to=dougg@torque.net \
--cc=linux-scsi@vger.kernel.org \
--cc=p.lavarre@ieee.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