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