|
|
1.1 ! root 1: #include <stdio.h> ! 2: #include "../scsi.h" ! 3: #include "../scsish.h" ! 4: #include "../tcl.h" ! 5: #include "fns.h" ! 6: ! 7: int ! 8: gen_capacity(ClientData cd, Tcl_Interp *it, int argc, char **argv) ! 9: { ! 10: struct scsi_cmd cmd; ! 11: struct scsi_return ret; ! 12: int i, unit; ! 13: unsigned long ns, ss; ! 14: ! 15: if(argc <= 1) ! 16: argv[i = 0] = "0"; ! 17: else ! 18: i = 1; ! 19: for(; i < argc; i++){ ! 20: unit = atoi(argv[i]); ! 21: set10(cmd, 0x25, unit<<5, 0, 0, 0, 0, 0, 0, 0, 0); ! 22: if(s_io(0, &cmd, 0, &ret, 8, cd->err)) ! 23: ERR_RETURN ! 24: ns = longat(&ret.data[0]); ! 25: ss = longat(&ret.data[4]); ! 26: printf("capacity(%d,%d): %ld blocks of %ld bytes (#%xx#%x)\n", ! 27: s_id, unit, ns, ss, ns, ss); ! 28: } ! 29: return(TCL_OK); ! 30: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.