Add scsi_stop_unit(), from Mac code. Other minor nits.

This commit is contained in:
mycroft 1994-02-01 20:05:19 +00:00
parent acf7eb2bc1
commit 4ecdacf90d
4 changed files with 62 additions and 18 deletions

View File

@ -1,6 +1,6 @@
/*
* Written by Julian Elischer (julian@dialix.oz.au)
* $Id: scsi_base.c,v 1.5 1993/12/13 11:50:13 mycroft Exp $
* $Id: scsi_base.c,v 1.6 1994/02/01 20:05:19 mycroft Exp $
*/
#include <sys/types.h>
@ -232,6 +232,28 @@ scsi_start_unit(sc_link, flags)
sizeof(scsi_cmd), 0, 0, 2, 2000, NULL, flags);
}
/*
* Get scsi driver to send a "stop" command
*/
int
scsi_stop_unit(sc_link, eject, flags)
struct scsi_link *sc_link;
u_int32 eject;
u_int32 flags;
{
struct scsi_start_stop scsi_cmd;
bzero(&scsi_cmd, sizeof(scsi_cmd));
scsi_cmd.op_code = START_STOP;
if (eject)
scsi_cmd.how = SSS_LOEJ;
else
scsi_cmd.how = SSS_STOP;
return scsi_scsi_cmd(sc_link, (struct scsi_generic *) &scsi_cmd,
sizeof(scsi_cmd), 0, 0, 2, 2000, NULL, flags);
}
/*
* This routine is called by the scsi interrupt when the transfer is complete.
*/

View File

@ -3,7 +3,7 @@
* Dummy driver for a device we can't identify.
* by Julian Elischer (julian@tfs.com)
*
* $Id: uk.c,v 1.2 1993/12/17 08:51:13 mycroft Exp $
* $Id: uk.c,v 1.3 1994/02/01 20:05:26 mycroft Exp $
*/
@ -22,13 +22,13 @@
*/
struct scsi_device uk_switch =
{
NULL,
NULL,
NULL,
NULL,
"uk",
0,
0, 0
NULL,
NULL,
NULL,
NULL,
"uk",
0,
0, 0
};
struct uk_data {

View File

@ -1,6 +1,6 @@
/*
* Written by Julian Elischer (julian@dialix.oz.au)
* $Id: scsi_base.c,v 1.5 1993/12/13 11:50:13 mycroft Exp $
* $Id: scsi_base.c,v 1.6 1994/02/01 20:05:19 mycroft Exp $
*/
#include <sys/types.h>
@ -232,6 +232,28 @@ scsi_start_unit(sc_link, flags)
sizeof(scsi_cmd), 0, 0, 2, 2000, NULL, flags);
}
/*
* Get scsi driver to send a "stop" command
*/
int
scsi_stop_unit(sc_link, eject, flags)
struct scsi_link *sc_link;
u_int32 eject;
u_int32 flags;
{
struct scsi_start_stop scsi_cmd;
bzero(&scsi_cmd, sizeof(scsi_cmd));
scsi_cmd.op_code = START_STOP;
if (eject)
scsi_cmd.how = SSS_LOEJ;
else
scsi_cmd.how = SSS_STOP;
return scsi_scsi_cmd(sc_link, (struct scsi_generic *) &scsi_cmd,
sizeof(scsi_cmd), 0, 0, 2, 2000, NULL, flags);
}
/*
* This routine is called by the scsi interrupt when the transfer is complete.
*/

View File

@ -3,7 +3,7 @@
* Dummy driver for a device we can't identify.
* by Julian Elischer (julian@tfs.com)
*
* $Id: uk.c,v 1.2 1993/12/17 08:51:13 mycroft Exp $
* $Id: uk.c,v 1.3 1994/02/01 20:05:26 mycroft Exp $
*/
@ -22,13 +22,13 @@
*/
struct scsi_device uk_switch =
{
NULL,
NULL,
NULL,
NULL,
"uk",
0,
0, 0
NULL,
NULL,
NULL,
NULL,
"uk",
0,
0, 0
};
struct uk_data {