home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
MISC
/
scsiutil.lzh
/
SCSIUTIL
/
aux.c
next >
Wrap
Text File
|
1996-10-12
|
2KB
|
64 lines
#asm
** _gs_dcmd()
** _ss_dcmd()
**
** 'C' bindings for direct command to a device.
**
*
* Function: _gs_dcmd - get information from a device via direct command
* _ss_dcmd - send information to a device via direct command
*
* Syntax: int _gs_dcmd( pn, cmd )
* int pn; /* path number to the device as returned by open() */
* void *cmd; /* the direct command to be performed */
*
* int _ss_dcmd( pn, cmd )
* int pn; /* path number to the device as returned by open() */
* void *cmd; /* the direct command to be performed */
*
* Returns: 0 if all went well
* -1 on error, errno set to error number from driver
*
* Description:
* This is a mechanism where by a direct command can be issued to
* a device. The type of device of course determines the requirements of the
* command being sent. Refer to the documentation concerning the driver
* for the device to be communicated with.
*
* Caveats:
* Garbage in.... Garbage (possibly crash) out
*
_ss_dcmd:
link a5,#0
move.l a0,-(sp)
move.l d1,a0 the command pointer
move.l #SS_DCmd,d1 direct command code
os9 I$SetStt
bcs.s _gs_dcmderr
clr.l d0 return all ok
bra.s _gs_dcmdex
_gs_dcmd:
link a5,#0
move.l a0,-(sp)
move.l d1,a0 the command pointer
move.l #SS_DCmd,d1 direct command code
os9 I$GetStt
bcs.s _gs_dcmderr
clr.l d0 return all ok
bra.s _gs_dcmdex
* common code for both calls
_gs_dcmderr
move.l #-1,d0 set error flag for return
move.l d1,errno(a6) set errno to value from driver
_gs_dcmdex
move.l (sp)+,a0
unlk a5
rts
#endasm