|
|
1.1 ! root 1: #include "scsi.h" ! 2: ! 3: s_sense(drive, extended) ! 4: { ! 5: int n; ! 6: struct scsi_i input; ! 7: struct scsi_o output; ! 8: ! 9: n = s_sensei(&input, drive, extended); ! 10: if(scsiio(&input, &output, n, "sense") < 0) ! 11: return(1); ! 12: scsidump(&output); ! 13: return(0); ! 14: } ! 15: ! 16: s_sensei(i, drive, extended) ! 17: register struct scsi_i *i; ! 18: { ! 19: i->bus_id = 1<<scsi_id; ! 20: i->cmd[0] = 0x03; ! 21: i->cmd[1] = drive<<5; ! 22: i->cmd[2] = 0; ! 23: i->cmd[3] = 0; ! 24: i->cmd[4] = extended? ((extended<0)? 28:12):4; ! 25: i->cmd[5] = 0; ! 26: return(i->cmd[4]); ! 27: } ! 28: ! 29: char *exstab[16] = ! 30: { ! 31: "no sense", ! 32: "recovered error", ! 33: "not ready", ! 34: "medium error", ! 35: "hardware error", ! 36: "illegal request", ! 37: "unit attention", ! 38: "data protect", ! 39: "blank check", ! 40: "???", ! 41: "copy aborted", ! 42: "???", ! 43: "???", ! 44: "???", ! 45: "???", ! 46: "???", ! 47: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.