|
|
1.1 ! root 1: #include "scsi.h" ! 2: ! 3: s_diskset(shelf, side, drive, complain) ! 4: { ! 5: struct scsi_i input; ! 6: struct scsi_o output; ! 7: ! 8: input.bus_id = scsi_id; ! 9: input.cmd[0] = 0xD6; ! 10: input.cmd[1] = drive<<5; ! 11: input.cmd[2] = 0; ! 12: input.cmd[3] = (shelf<<1)|side; ! 13: input.cmd[4] = 0; ! 14: input.cmd[5] = 0; ! 15: if(scsiio(&input, 0, &output, 0, "set") < 0) ! 16: return(1); ! 17: if(CHECK(output)){ ! 18: if(complain) ! 19: prcheck(1, &output); ! 20: return(1); ! 21: } ! 22: return(0); ! 23: } ! 24: ! 25: s_diskrelease(shelf, side, drive, complain) ! 26: { ! 27: struct scsi_i input; ! 28: struct scsi_o output; ! 29: ! 30: input.bus_id = scsi_id; ! 31: input.cmd[0] = 0xD7; ! 32: input.cmd[1] = (drive<<5)|(shelf >= 0); ! 33: input.cmd[2] = 0; ! 34: input.cmd[3] = (shelf<<1)|side; ! 35: input.cmd[4] = 0; ! 36: input.cmd[5] = 0; ! 37: if(scsiio(&input, 0, &output, 0, "release") < 0) ! 38: return(1); ! 39: if(CHECK(output)){ ! 40: if(complain) ! 41: prcheck(1, &output); ! 42: return(1); ! 43: } ! 44: return(0); ! 45: } ! 46: ! 47: s_diskeject(drive) ! 48: { ! 49: struct scsi_i input; ! 50: struct scsi_o output; ! 51: ! 52: input.bus_id = scsi_id; ! 53: input.cmd[0] = 0xC0; ! 54: input.cmd[1] = drive<<5; ! 55: input.cmd[2] = 0; ! 56: input.cmd[3] = 0; ! 57: input.cmd[4] = 0; ! 58: input.cmd[5] = 0; ! 59: if(scsiio(&input, 0, &output, 0, "eject") < 0) ! 60: return(1); ! 61: if(CHECK(output)){ ! 62: prcheck(1, &output); ! 63: return(1); ! 64: } ! 65: return(0); ! 66: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.