mirror of
https://github.com/marciot/mac-tip.git
synced 2024-09-27 05:54:37 +00:00
c719c8d7dd
- Added command to spin down cartridges to command line - Improved console diagnostics - Report SCSI short reads - Report last error - Report media change - Report disk at speed - Report spare sectors - Report detailed testing steps - Supress unsuported commands on Jaz drive while: - Enabling early recovery - Reading defects list - Fix short reads on Jaz drives during: - Cartridge status - Set error recovery
64 lines
1.5 KiB
C++
64 lines
1.5 KiB
C++
#include "mac_scsi.h"
|
|
#include "iomega_cmds.h"
|
|
|
|
// Iomega commands
|
|
|
|
OSErr iomega_spin_up_cartridge( int id ) {
|
|
// issue an Asynchronous START command to induce spinup
|
|
char cmd[6] = {
|
|
SCSI_Cmd_StartStopUnit,
|
|
1, // set the IMMED bit for offline
|
|
0,
|
|
0,
|
|
1, // start the disk spinning
|
|
0
|
|
};
|
|
return scsi_cmd(id, cmd, sizeof(cmd), 0, 0, 0, 0);
|
|
}
|
|
|
|
OSErr iomega_spin_down_and_eject( int id ) {
|
|
// issue an Asynchronous STOP command to induce spindown and ejection
|
|
char cmd[6] = {
|
|
SCSI_Cmd_StartStopUnit,
|
|
1, // set the IMMED bit for offline
|
|
0,
|
|
0,
|
|
2, // eject a Jaz disk after stopping
|
|
0
|
|
};
|
|
return scsi_cmd(id, cmd, sizeof(cmd), 0, 0, 0, 0);
|
|
}
|
|
|
|
OSErr iomega_spin_down_cartridge( int id ) {
|
|
// issue an Asynchronous STOP command to induce spindown
|
|
char cmd[6] = {
|
|
SCSI_Cmd_StartStopUnit,
|
|
1, // set the IMMED bit for offline
|
|
0,
|
|
0,
|
|
0,
|
|
0
|
|
};
|
|
return scsi_cmd(id, cmd, sizeof(cmd), 0, 0, 0, 0);
|
|
}
|
|
|
|
OSErr iomega_set_prevent_removal( int id, bool lock) {
|
|
OSErr err;
|
|
char cmd[6] = {
|
|
SCSI_Cmd_PreventAllow,
|
|
0,
|
|
0,
|
|
0,
|
|
lock ? 1 : 0,
|
|
0
|
|
};
|
|
return scsi_cmd(id, cmd, sizeof(cmd), 0, 0, 0, 0);
|
|
}
|
|
|
|
OSErr iomega_eject_cartridge( int id ) {
|
|
OSErr err;
|
|
err = iomega_set_prevent_removal(id, false);
|
|
if (err != noErr) return err;
|
|
return iomega_spin_down_and_eject(id);
|
|
}
|