Subject: Re: scsipi woes: can't call scsi command from kernel by ioctl?
To: Manuel Bouyer <firstname.lastname@example.org>
From: Reinoud Zandijk <email@example.com>
Date: 08/30/2005 18:10:46
Content-Type: text/plain; charset=us-ascii
On Mon, Aug 29, 2005 at 08:38:10PM +0200, Manuel Bouyer wrote:
> > but then i'd have to figure out the struct scsipi_periph wich is a big NONO
> > IMHO since it breaks abstraction and i'd be cleaner to use VOP_IOCTL(). I
> > could offcource encode all nessisary SCSI commands to CDIOCTL's but
> > wouldn't that explode the number of IOCTL's unnessisary?
> BTW, what command do you need to send from the kernel ? Maybe we need to
> define a new ioctl to retrieve this information ? I would expect your
> kernel code to also work for non-scsi devices.
I'm planning of at least implementing and using the following SCSI/ATAPI
TEST UNIT READY (trivial)
MODE REQUEST/MODE SELECT page 5 (CD recording parameters)
MODE REQUEST/MODE SELECT page 3 (CD-MRW/DVD+MRW address space)
SYNCHONISE CACHE (nessisary for swich r/w)
CD READ RECORDED CAPACITY
GET CONFIGURATION (0x46) (for several features)
READ DISC INFORMATION (0x51)
READ TRACK INFORMATION (0x52)
READ TOC/PMA/ATIP format 2 (nessisary for CD/DVD-ROM drives or old pre-MMC drives)
READ/WRITE (prolly/hopefully possible trough bread/bwrite)
and optional :
SET CD SPEED (0xBB)
WRITE AND VERIFY
READ/WRITE (with streaming bit)
For UDF reading/writing on non CD/DVD/BD i.e. on files, harddiscs or
floppies etc. access to bread/bwrite and a method of detecting the size of
the partion/file and *its sector size* is enough using f.e.
disklabel/wedge/stat info. UDF disc sector sizes are all multiples of 512
bytes though 2048 is very common.
Esp. `get configuration' can be lengthy if implemented by IOCTL for the
structures have to be made for most of the features for completeness though
in my implementation just being able to see if a feature is current or not
reveals normally enough. This is media type detection and accompanied
features like does it have RMW or can i only write in ECC blocks of
(normally) 32 sectors, do i have to synchronise caches before being able to
read again etc. etc.
So i'll prolly have to start coding IOCTL's for all 12+ them :-S Some of
them could also be implemented in scsipi_ioctl.c for not all are nessisary
only found on cd/mmc devices.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)
-----END PGP SIGNATURE-----