This source file includes following definitions.
- eata_pio_set_info
- eata_pio_proc_info
1
2 #define MAX_SCSI_DEVICE_CODE 10
3 const char *const pio_scsi_dev_types[MAX_SCSI_DEVICE_CODE] =
4 {
5 "Direct-Access ",
6 "Sequential-Access",
7 "Printer ",
8 "Processor ",
9 "WORM ",
10 "CD-ROM ",
11 "Scanner ",
12 "Optical Device ",
13 "Medium Changer ",
14 "Communications "
15 };
16
17
18
19
20
21
22
23 int eata_pio_set_info(char *buffer, int length, struct Scsi_Host *HBA_ptr)
24 {
25 DBG(DBG_PROC_WRITE, printk("%s\n", buffer));
26 return(-ENOSYS);
27 }
28
29
30
31
32
33
34
35
36
37
38
39
40 int eata_pio_proc_info(char *buffer, char **start, off_t offset, int length,
41 int hostno, int inout)
42 {
43
44 Scsi_Device *scd;
45 struct Scsi_Host *HBA_ptr;
46 static u8 buff[512];
47 int i;
48 int size, len = 0;
49 off_t begin = 0;
50 off_t pos = 0;
51
52 HBA_ptr = first_HBA;
53 for (i = 1; i <= registered_HBAs; i++) {
54 if (HBA_ptr->host_no == hostno)
55 break;
56 HBA_ptr = SD(HBA_ptr)->next;
57 }
58
59 if(inout == TRUE)
60 return(eata_pio_set_info(buffer, length, HBA_ptr));
61
62 if (offset == 0)
63 memset(buff, 0, sizeof(buff));
64
65 size = sprintf(buffer+len, "EATA (Extended Attachment) PIO driver version: "
66 "%d.%d%s\n",VER_MAJOR, VER_MINOR, VER_SUB);
67 len += size; pos = begin + len;
68 size = sprintf(buffer + len, "queued commands: %10ld\n"
69 "processed interrupts:%10ld\n", queue_counter, int_counter);
70 len += size; pos = begin + len;
71
72 size = sprintf(buffer + len, "\nscsi%-2d: HBA %.10s\n",
73 HBA_ptr->host_no, SD(HBA_ptr)->name);
74 len += size;
75 pos = begin + len;
76 size = sprintf(buffer + len, "Firmware revision: v%s\n",
77 SD(HBA_ptr)->revision);
78 len += size;
79 pos = begin + len;
80 size = sprintf(buffer + len, "IO: PIO\n");
81 len += size;
82 pos = begin + len;
83 size = sprintf(buffer + len, "Base IO : %#.4x\n", (u32) HBA_ptr->base);
84 len += size;
85 pos = begin + len;
86 size = sprintf(buffer + len, "Host Bus: %s\n",
87 (SD(HBA_ptr)->bustype == 'P')?"PCI ":
88 (SD(HBA_ptr)->bustype == 'E')?"EISA":"ISA ");
89
90 len += size;
91 pos = begin + len;
92
93 if (pos < offset) {
94 len = 0;
95 begin = pos;
96 }
97 if (pos > offset + length)
98 goto stop_output;
99
100 scd = scsi_devices;
101
102 size = sprintf(buffer+len,"Attached devices: %s\n", (scd)?"":"none");
103 len += size;
104 pos = begin + len;
105
106 while (scd) {
107 if (scd->host == HBA_ptr) {
108 proc_print_scsidevice(scd, buffer, &size, len);
109 len += size;
110 pos = begin + len;
111
112 if (pos < offset) {
113 len = 0;
114 begin = pos;
115 }
116 if (pos > offset + length)
117 goto stop_output;
118 }
119 scd = scd->next;
120 }
121
122 stop_output:
123 DBG(DBG_PROC, printk("2pos: %ld offset: %ld len: %d\n", pos, offset, len));
124 *start=buffer+(offset-begin);
125 len-=(offset-begin);
126 if(len>length)
127 len = length;
128 DBG(DBG_PROC, printk("3pos: %ld offset: %ld len: %d\n", pos, offset, len));
129
130 return (len);
131 }
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150