thanks for the 2 additional info:
Dieter Gobbers email@example.com
"Rakesh S (EPD-BLRHO-MKTG)" <firstname.lastname@example.org> have attached a file attached
Ana Yuseepi <email@example.com> wrote:
> no one have given me a valuable information.. but i think, ioctl should
> thank you..
> Ana Yuseepi <firstname.lastname@example.org> wrote:
> > Hello managers,
> > anyone have any idea what command to use? where can i gather information
> > the command? or any valuable input you can suggest? please mail me..
> > by programming, i mean sending SCSI commands...
> > -Ana
> > ____________________________________________________________________
> > Get your own FREE, personal Netscape WebMail account today at
> > S
> > U BEFORE POSTING please READ the FAQ located at
> > N ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/faq
> > . and the list POLICY statement located at
> > M ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/policy
> > A To submit questions/summaries to this list send your email message
> > N email@example.com
> > A To unsubscribe from this list please send an email message to:
> > G firstname.lastname@example.org
> > E and in the BODY type:
> > R unsubscribe sun-managers
> > S Or
> > . unsubscribe sun-managers email@example.com
> > L To view an archive of this list please visit:
> > I http://www.latech.edu/sunman.html
> > S
> > T
> Get your own FREE, personal Netscape WebMail account today at
> U BEFORE POSTING please READ the FAQ located at
> N ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/faq
> . and the list POLICY statement located at
> M ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/policy
> A To submit questions/summaries to this list send your email message to:
> N firstname.lastname@example.org
> A To unsubscribe from this list please send an email message to:
> G email@example.com
> E and in the BODY type:
> R unsubscribe sun-managers
> S Or
> . unsubscribe sun-managers firstname.lastname@example.org
> L To view an archive of this list please visit:
> I http://www.latech.edu/sunman.html
Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.
USCSI Ioctl: Application-level Access to SCSI Device Capabilities
An unsupported, undocumented feature of Sun SCSI device drivers allows users to issue SCSI requests directly to SCSI devices. This capability is intended for driver prototyping and diagnostics; it allows the developer to try out sequences of SCSI commands without recompiling and reloading a device driver. Users of this feature must be forewarned that potential side effects include system panics and putting devices into unusable states.
Documentation for most of the USCSI features is available at the end of this White Paper in manual page format. The rest of the White Paper provides a simple example of using USCSI as well as several caveats about its dangers.
The USCSICMD request, issued via the ioctl(2) call, passes a user-constructed SCSI command block directly to a SCSI device. This feature enables the user to utilize the full SCSI command set appropriate for a particular device.
The following code fragment demonstrates the use of USCSI. With a simple example of rewinding a tape, we'll compare how this is accomplished with the standard mtio(7) and then with the USCSI ioctl commands. mtio(7) describes the general magnetic tape interface supported by drivers for tape devices (e.g. st(7)) and used by commands such as mt(1).Here's a short routine using the mtio ioctl:
The two fields of the mtop structure are set to the desired operation (MTREW) and a count of how many to do (just 1). ioctl is called with the le descriptor for the device, the MTIOCTOP (do a mag tape op) again, and a pointer to the mtop structure. Within a SCSI driver, the command is translated into a SCSI command which is issued to the device. The USCSI ioctl lets the user pass his or her own SCSI rewind command to the device. First, the command must be built. The uscsi_cmd structure (scsi/impl/uscsi.h< /font>) and command description block, scsi_cdb union (scsi/general/comands.h), are zeroed using memset(3c). The scc_cmd field in the command block is set to SCMD_REWIND.
The uscsi_cmd struct is pointed
at the command block and its size is entered in the uscsi_cdblen field.
uscsi_flags is set to USCSI_SILENT
Obviously, the USCSI version requires more effort, but is much more flexible. Any appropriate SCSI command can be built and issued (see the SCSI include files in the /usr/include/sys/scsi). For our tape example, quite a variety of commands are available. For test unit ready we would simply set cdb.scc_cmd = SCMD_TEST_UNIT_READY in the above code. Likewise for erase (SCMD_ERASE). A SCSI inquiry command ( scsi/general/inquiry.h) requires a buffer to receive information. So, we add:
which specifies the buffers size and address. FORMG0COUNT is a macro (scsi/general/commands.h) which sets the g0 count in the cdb structure. Mode sense (SCMD_MODE_SENSE) is implemented this way, too. Reads and writes (SCMD_READ/SCMD_WRITE) to the device are similar, but they also use the tag (t_code) field of the cdb structure. Quite a few other tape specific commands can be issued including mode select, mode sense, request sense, and write file mark
The flexibility of the USCSI ioctl allows the device driver writer to fully exercise a SCSI device. The feature is useful for rapid prototyping of algorithms for SCSI devices and for diagnostic programs. The associated risks (system panics, unusable devices, future obsolescence of the USCSI feature) make the feature inappropriate for other uses. In particular, users should be aware of the following:
Issuing a command to a device simultaneously in use by a system driver may put that device in a state such that the system driver may no longer work with that device correctly (e.g., mode-selecting a disk to 1k sector size).
Third-party devices will not necessarily respond correctly to any SCSI-2 command.
An arbitrary SCSI-2 command issued to a device may cause that device to misbehave on the SCSI bus in some fashion that may interfere with the correct operation of other devices on the same bus in use by the system.
USCSI Man page.
U BEFORE POSTING please READ the FAQ located at
. and the list POLICY statement located at
A To submit questions/summaries to this list send your email message to:
A To unsubscribe from this list please send an email message to:
E and in the BODY type:
R unsubscribe sun-managers
. unsubscribe sun-managers email@example.com
L To view an archive of this list please visit:
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:14:14 CDT