Subject: Re: scsipi woes: can't call scsi command from kernel by ioctl?
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 08/30/2005 19:29:21
--6J7GEvtanOfV9oXA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Aug 30, 2005 at 10:07:09PM +0200, Manuel Bouyer wrote:
>=20
> On Tue, Aug 30, 2005 at 08:16:47PM +0200, Reinoud Zandijk wrote:
>=20
> Note that we already have IOCTLs for synchronise cache. Maybe you could
> reuse that ?

Yes, but that's only one call.

> > needs to be done regulary. In my userland code i used a disc abstractio=
n=20
> > that inquired the drive and handled all the specifics on=20
> > SCSI/ATAPI/disc/file devices. I could try to generalise it and to offer=
 the=20
> > information in a IOCTL with the modification in the cd strategy that if=
 a=20
> > certain type of media is found (CD recordables f.e.) the synchronise ca=
ches=20
> > call is made on each switch from write to read. Without the sync the de=
vice=20
> > won't accept read attempts (and certain other calls) possibly leading t=
o a=20
> > device lockout in situations where a cd writing program crases. If one =
is=20
> > lucky the timeout is less than 5-10 minutes :-S but some devices just w=
ait=20
> > till bus/device reset.
>=20
> Yes; I think we should also allow writing though the raw or block device;
> so we could allow writing using e.g. dd (instead of writing only though
> the UDF filesystem).

Are you sure that these devices will support that? Perhaps I'm=20
overly-conditioned, but I have never looked to dd as a way to write CDs,=20
so I don't see why it should be a way to write UDF disks.

> > I've thought about implementing a /dev/mmc* device that is specific for=
=20
> > cd/dvd/bd recordables/rewritables since they are a special breed of=20
> > critters quite different from normal cd-rom/dvd-rom. Seperating mmc dev=
ices=20
> > from the generic `cd' devices also enables more targeted code to be=20
> > written. Code could also be simplified. How to use the detection framew=
ork=20
> > i haven't figured out yet though. What i've read indicates that Linux a=
lso=20
> > split off mmc devices from the older legacy CD driver.
>=20
> How much code would this represent ? I don't know if it's really
> worth it, and /dev/mmc vs /dev/cd could be confusing for users (not count=
ing
> the third-party packages that would need to be adapted to use both :)

Can't say here.

However my understanding is that UDF is designed to work with MMC devices.=
=20
As such, I don't think it's unusual to expect it to know about SCSI=20
commands, and to not work so well with non-SCSI/ATAPI devices.

Take care,

Bill

--6J7GEvtanOfV9oXA
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFDFRYBWz+3JHUci9cRAtnfAKCQ3FUTVrg9QBVzO2VOUDi/7j5rJwCfakbg
0z6bfm4z86f0BSuJqhqKVLM=
=f4Mg
-----END PGP SIGNATURE-----

--6J7GEvtanOfV9oXA--