This source file includes following definitions.
- proc_debug
- aic7xxx_set_info
- aic7xxx_proc_info
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 #define BLS buffer + len + size
31 #define HDRB \
32 " < 512 512-1K 1-2K 2-4K 4-8K 8-16K 16-32K 32-64K 64-128K >128K"
33
34 #ifdef PROC_DEBUG
35 extern int vsprintf(char *, const char *, va_list);
36
37 static void
38 proc_debug(const char *fmt, ...)
39 {
40 va_list ap;
41 char buf[256];
42
43 va_start(ap, fmt);
44 vsprintf(buf, fmt, ap);
45 printk(buf);
46 va_end(ap);
47 }
48 #else
49 # define proc_debug(fmt, args...)
50 #endif
51
52
53
54
55
56
57
58
59 int
60 aic7xxx_set_info(char *buffer, int length, struct Scsi_Host *HBAptr)
61 {
62 proc_debug("aic7xxx_set_info(): %s\n", buffer);
63 return (-ENOSYS);
64 }
65
66
67
68
69
70
71
72
73 int
74 aic7xxx_proc_info(char *buffer, char **start, off_t offset, int length,
75 int hostno, int inout)
76 {
77 struct Scsi_Host *HBAptr;
78 struct aic7xxx_host *p;
79 static u8 buff[512];
80 int i;
81 int size = 0;
82 int len = 0;
83 off_t begin = 0;
84 off_t pos = 0;
85 static char *bus_names[] = { "Single", "Twin", "Wide" };
86 static char *chip_names[] = { "AIC-777x", "AIC-785x", "AIC-787x", "AIC-788x" };
87
88 HBAptr = NULL;
89 for (i = 0; i < NUMBER(aic7xxx_boards); i++)
90 {
91 if ((HBAptr = aic7xxx_boards[i]) != NULL)
92 {
93 if (HBAptr->host_no == hostno)
94 {
95 break;
96 }
97
98 while ((HBAptr->hostdata != NULL) &&
99 ((HBAptr = ((struct aic7xxx_host *) HBAptr->hostdata)->next) != NULL))
100 {
101 if (HBAptr->host_no == hostno)
102 {
103 break; break;
104 }
105 }
106
107 HBAptr = NULL;
108 }
109 }
110
111 if (HBAptr == NULL)
112 {
113 size += sprintf(BLS, "Can't find adapter for host number %d\n", hostno);
114 len += size; pos = begin + len; size = 0;
115 goto stop_output;
116 }
117
118 if (inout == TRUE)
119 {
120 return (aic7xxx_set_info(buffer, length, HBAptr));
121 }
122
123 if (offset == 0)
124 {
125 memset(buff, 0, sizeof(buff));
126 }
127
128 p = (struct aic7xxx_host *) HBAptr->hostdata;
129
130 size += sprintf(BLS, "Adaptec AIC7xxx driver version: ");
131 size += sprintf(BLS, "%s/", rcs_version(AIC7XXX_C_VERSION));
132 size += sprintf(BLS, "%s/", rcs_version(AIC7XXX_H_VERSION));
133 size += sprintf(BLS, "%s\n", rcs_version(AIC7XXX_SEQ_VER));
134 len += size; pos = begin + len; size = 0;
135
136 size += sprintf(BLS, "\n");
137 size += sprintf(BLS, "Compile Options:\n");
138 #ifdef AIC7XXX_RESET_DELAY
139 size += sprintf(BLS, " AIC7XXX_RESET_DELAY : %d\n", AIC7XXX_RESET_DELAY);
140 #endif
141 #ifdef AIC7XXX_CMDS_PER_LUN
142 size += sprintf(BLS, " AIC7XXX_CMDS_PER_LUN : %d\n", AIC7XXX_CMDS_PER_LUN);
143 #endif
144 #ifdef AIC7XXX_TWIN_SUPPORT
145 size += sprintf(BLS, " AIC7XXX_TWIN_SUPPORT : Enabled\n");
146 #else
147 size += sprintf(BLS, " AIC7XXX_TWIN_SUPPORT : Disabled\n");
148 #endif
149 #ifdef AIC7XXX_TAGGED_QUEUEING
150 size += sprintf(BLS, " AIC7XXX_TAGGED_QUEUEING: Enabled\n");
151 #else
152 size += sprintf(BLS, " AIC7XXX_TAGGED_QUEUEING: Disabled\n");
153 #endif
154 #ifdef AIC7XXX_SHARE_IRQS
155 size += sprintf(BLS, " AIC7XXX_SHARE_IRQS : Enabled\n");
156 #else
157 size += sprintf(BLS, " AIC7XXX_SHARE_IRQS : Disabled\n");
158 #endif
159 #ifdef AIC7XXX_PROC_STATS
160 size += sprintf(BLS, " AIC7XXX_PROC_STATS : Enabled\n");
161 #else
162 size += sprintf(BLS, " AIC7XXX_PROC_STATS : Disabled\n");
163 #endif
164 len += size; pos = begin + len; size = 0;
165
166 size += sprintf(BLS, "\n");
167 size += sprintf(BLS, "Adapter Configuration:\n");
168 size += sprintf(BLS, " SCSI Adapter: %s\n", board_names[p->type]);
169 size += sprintf(BLS, " (%s chipset)\n",
170 chip_names[p->chip_type]);
171 size += sprintf(BLS, " Host Bus: %s\n", bus_names[p->bus_type]);
172 size += sprintf(BLS, " Base IO: %#.4x\n", p->base);
173 size += sprintf(BLS, " IRQ: %d\n", HBAptr->irq);
174 size += sprintf(BLS, " SCB: %d (%d)\n", p->numscb, p->maxscb);
175 size += sprintf(BLS, " Interrupts: %d", p->isr_count);
176 if (p->chip_type == AIC_777x)
177 {
178 size += sprintf(BLS, " %s\n",
179 (p->pause & IRQMS) ? "(Level Sensitive)" : "(Edge Triggered)");
180 }
181 else
182 {
183 size += sprintf(BLS, "\n");
184 }
185 size += sprintf(BLS, " Serial EEPROM: %s\n",
186 p->have_seeprom ? "True" : "False");
187 size += sprintf(BLS, " Extended Translation: %sabled\n",
188 p->extended ? "En" : "Dis");
189 size += sprintf(BLS, " SCSI Bus Reset: %sabled\n",
190 aic7xxx_no_reset ? "Dis" : "En");
191 size += sprintf(BLS, " Ultra SCSI: %sabled\n",
192 p->ultra_enabled ? "En" : "Dis");
193 size += sprintf(BLS, " Target Disconnect: %sabled\n",
194 p->discenable ? "En" : "Dis");
195 len += size; pos = begin + len; size = 0;
196
197 #ifdef AIC7XXX_PROC_STATS
198 {
199 struct aic7xxx_xferstats *sp;
200 int channel, target, lun;
201
202
203
204
205 size += sprintf(BLS, "\n");
206 size += sprintf(BLS, "Statistics:\n");
207 for (channel = 0; channel < 2; channel++)
208 {
209 for (target = 0; target < 16; target++)
210 {
211 for (lun = 0; lun < 8; lun++)
212 {
213 sp = &p->stats[channel][target][lun];
214 if (sp->xfers == 0)
215 {
216 continue;
217 }
218 size += sprintf(BLS, "CHAN#%c (TGT %d LUN %d):\n",
219 'A' + channel, target, lun);
220 size += sprintf(BLS, "nxfers %ld (%ld read;%ld written)\n",
221 sp->xfers, sp->r_total, sp->w_total);
222 size += sprintf(BLS, "blks(512) rd=%ld; blks(512) wr=%ld\n",
223 sp->r_total512, sp->w_total512);
224 size += sprintf(BLS, "%s\n", HDRB);
225 size += sprintf(BLS, " Reads:");
226 size += sprintf(BLS, "%6ld %6ld %6ld %6ld ", sp->r_bins[0],
227 sp->r_bins[1], sp->r_bins[2], sp->r_bins[3]);
228 size += sprintf(BLS, "%6ld %6ld %6ld %6ld ", sp->r_bins[4],
229 sp->r_bins[5], sp->r_bins[6], sp->r_bins[7]);
230 size += sprintf(BLS, "%6ld %6ld\n", sp->r_bins[8],
231 sp->r_bins[9]);
232 size += sprintf(BLS, "Writes:");
233 size += sprintf(BLS, "%6ld %6ld %6ld %6ld ", sp->w_bins[0],
234 sp->w_bins[1], sp->w_bins[2], sp->w_bins[3]);
235 size += sprintf(BLS, "%6ld %6ld %6ld %6ld ", sp->w_bins[4],
236 sp->w_bins[5], sp->w_bins[6], sp->w_bins[7]);
237 size += sprintf(BLS, "%6ld %6ld\n", sp->w_bins[8],
238 sp->w_bins[9]);
239 size += sprintf(BLS, "\n");
240 }
241 }
242 }
243 len += size; pos = begin + len; size = 0;
244 }
245 #endif
246
247 stop_output:
248 proc_debug("2pos: %ld offset: %ld len: %d\n", pos, offset, len);
249 *start = buffer + (offset - begin);
250 len -= (offset - begin);
251 if (len > length)
252 {
253 len = length;
254 }
255 proc_debug("3pos: %ld offset: %ld len: %d\n", pos, offset, len);
256
257 return (len);
258 }
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277