|
|
1.1 ! root 1: #include "scsi.h" ! 2: ! 3: s_reset() ! 4: { ! 5: struct scsi_i input; ! 6: struct scsi_o output; ! 7: register i, n; ! 8: ! 9: input.bus_id = -1; ! 10: input.cmd[0] = 0x12; ! 11: input.cmd[1] = 0<<5; ! 12: input.cmd[2] = 0; ! 13: input.cmd[3] = 0; ! 14: input.cmd[4] = 36; ! 15: input.cmd[5] = 0; ! 16: if(scsiio(&input, &output, 36, "reset") < 0) ! 17: return(1); ! 18: sleep(5); ! 19: for(i = 0; i < 60; i++){ ! 20: sleep(2); ! 21: n = s_sensei(&input, 0, 0); ! 22: if(scsiio(&input, &output, n, "reset sense") < 0) ! 23: return(1); ! 24: if(output.status[0] == 0){ ! 25: print("done\n"); ! 26: s_sense(0, 0); ! 27: return(0); ! 28: } ! 29: print("."); ! 30: } ! 31: return(0); ! 32: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.