|
|
1.1 root 1: #include <stdio.h>
2: #include "../scsi.h"
3: #include "../scsish.h"
4: #include "fns.h"
5:
6: static int gen_id(int, int *, int, char **, char *);
7:
8: static Function fns[] = {
9: { "capacity", "capacity [lun=0]", "L?", gen_capacity },
10: { "copy", "copy srclun start n destlun dest", "LIILII?", gen_copy },
11: { "display", "display", "", gen_display },
12: { "dev", "dev [type] # dev ? for list", "S?", gen_dev },
13: { "help", "help [cmd]", "S?", gen_help },
14: { "id", "id [target=0]", "L?", gen_id },
15: { "inq", "inq [lun=0]", "L?", gen_inq },
16: { "readt", "readt count [lun=0]", "IL?", gen_readt },
17: { "reset", "reset", "", gen_reset },
18: { "scsi", "scsi bytes... # 6 or 10", "I?I?I?I?I?I?I?I?I?I?", gen_scsi },
19: { "sense", "sense [lun=0]", "L?", gen_sense },
20: { "start", "start [lun=0]", "L?", gen_start },
21: { "stop", "stop [lun=0]", "L?", gen_stop },
22: { "testunit", "testunit [lun=0", "L?", gen_tur },
23: { 0 }
24: };
25:
26: Device genericdev = {
27: "scsi", "generic scsi",
28: gen_extsense,
29: fns
30: };
31:
32: static int
33: gen_id(int niargs, int *iargs, int ncargs, char **cargs, char *err)
34: {
35: #pragma ref ncargs
36: #pragma ref cargs
37: #pragma ref err
38:
39: if(niargs == 0)
40: printf("current SCSI id = %d\n", s_id);
41: else
42: scsi_target(iargs[0]);
43: return(0);
44: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.