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_name[] = {"Single", "Twin", "Wide"};
86
87 HBAptr = NULL;
88 for (i = 0; i < NUMBER(aic7xxx_boards); i++)
89 {
90 if ((HBAptr = aic7xxx_boards[i]) != NULL)
91 {
92 if (HBAptr->host_no == hostno)
93 {
94 break;
95 }
96
97 while ((HBAptr->hostdata != NULL) &&
98 ((HBAptr = ((struct aic7xxx_host *) HBAptr->hostdata)->next) != NULL))
99 {
100 if (HBAptr->host_no == hostno)
101 {
102 break; break;
103 }
104 }
105
106 HBAptr = NULL;
107 }
108 }
109
110 if (HBAptr == NULL)
111 {
112 size += sprintf(BLS, "Can't find adapter for host number %d\n", hostno);
113 len += size; pos = begin + len; size = 0;
114 goto stop_output;
115 }
116
117 if (inout == TRUE)
118 {
119 return (aic7xxx_set_info(buffer, length, HBAptr));
120 }
121
122 if (offset == 0)
123 {
124 memset(buff, 0, sizeof(buff));
125 }
126
127 p = (struct aic7xxx_host *) HBAptr->hostdata;
128
129 size += sprintf(BLS, "Adaptec AIC7xxx driver version: ");
130 size += sprintf(BLS, "%s/", rcs_version(AIC7XXX_C_VERSION));
131 size += sprintf(BLS, "%s/", rcs_version(AIC7XXX_H_VERSION));
132 size += sprintf(BLS, "%s\n", rcs_version(AIC7XXX_SEQ_VER));
133 len += size; pos = begin + len; size = 0;
134
135 size += sprintf(BLS, "\n");
136 size += sprintf(BLS, "Compile Options:\n");
137 #ifdef AIC7XXX_RESET_DELAY
138 size += sprintf(BLS, " AIC7XXX_RESET_DELAY : %d\n", AIC7XXX_RESET_DELAY);
139 #endif
140 #ifdef AIC7XXX_TWIN_SUPPORT
141 size += sprintf(BLS, " AIC7XXX_TWIN_SUPPORT : Enabled\n");
142 #else
143 size += sprintf(BLS, " AIC7XXX_TWIN_SUPPORT : Disabled\n");
144 #endif
145 #ifdef AIC7XXX_TAGGED_QUEUEING
146 size += sprintf(BLS, " AIC7XXX_TAGGED_QUEUEING: Enabled\n");
147 #else
148 size += sprintf(BLS, " AIC7XXX_TAGGED_QUEUEING: Disabled\n");
149 #endif
150 #ifdef AIC7XXX_SHARE_IRQS
151 size += sprintf(BLS, " AIC7XXX_SHARE_IRQS : Enabled\n");
152 #else
153 size += sprintf(BLS, " AIC7XXX_SHARE_IRQS : Disabled\n");
154 #endif
155 #ifdef AIC7XXX_PROC_STATS
156 size += sprintf(BLS, " AIC7XXX_PROC_STATS : Enabled\n");
157 #else
158 size += sprintf(BLS, " AIC7XXX_PROC_STATS : Disabled\n");
159 #endif
160 len += size; pos = begin + len; size = 0;
161
162 size += sprintf(BLS, "\n");
163 size += sprintf(BLS, "Adapter Configuration:\n");
164 size += sprintf(BLS, " SCSI Adapter: %s\n", board_names[p->type]);
165 size += sprintf(BLS, " Host Bus: %s\n", bus_name[p->bus_type]);
166 size += sprintf(BLS, " Base IO: %#.4x\n", p->base);
167 size += sprintf(BLS, " IRQ: %d\n", HBAptr->irq);
168 size += sprintf(BLS, " SCB: %d (%d)\n", p->numscb, p->maxscb);
169 size += sprintf(BLS, " Interrupts: %d", p->isr_count);
170 if (p->chip_type == AIC_777x)
171 {
172 size += sprintf(BLS, " %s\n",
173 (p->pause & IRQMS) ? "(Level Sensitive)" : "(Edge Triggered)");
174 }
175 else
176 {
177 size += sprintf(BLS, "\n");
178 }
179 size += sprintf(BLS, " Serial EEPROM: %s\n",
180 p->have_seeprom ? "True" : "False");
181 size += sprintf(BLS, " Pause/Unpause: %#.2x/%#.2x\n", p->pause,
182 p->unpause);
183 size += sprintf(BLS, " Extended Translation: %sabled\n",
184 p->extended ? "En" : "Dis");
185 size += sprintf(BLS, " SCSI Bus Reset: %sabled\n",
186 aic7xxx_no_reset ? "Dis" : "En");
187 size += sprintf(BLS, " Ultra SCSI: %sabled\n",
188 p->ultra_enabled ? "En" : "Dis");
189 len += size; pos = begin + len; size = 0;
190
191 #ifdef AIC7XXX_PROC_STATS
192 {
193 struct aic7xxx_xferstats *sp;
194 int channel, target, lun;
195
196
197
198
199 size += sprintf(BLS, "\n");
200 size += sprintf(BLS, "Statistics:\n");
201 for (channel = 0; channel < 2; channel++)
202 {
203 for (target = 0; target < 16; target++)
204 {
205 for (lun = 0; lun < 8; lun++)
206 {
207 sp = &p->stats[channel][target][lun];
208 if (sp->xfers == 0)
209 {
210 continue;
211 }
212 size += sprintf(BLS, "CHAN#%c (TGT %d LUN %d):\n",
213 'A' + channel, target, lun);
214 size += sprintf(BLS, "nxfers %ld (%ld read;%ld written)\n",
215 sp->xfers, sp->r_total, sp->w_total);
216 size += sprintf(BLS, "blks(512) rd=%ld; blks(512) wr=%ld\n",
217 sp->r_total512, sp->w_total512);
218 size += sprintf(BLS, "%s\n", HDRB);
219 size += sprintf(BLS, " Reads:");
220 size += sprintf(BLS, "%6ld %6ld %6ld %6ld ", sp->r_bins[0],
221 sp->r_bins[1], sp->r_bins[2], sp->r_bins[3]);
222 size += sprintf(BLS, "%6ld %6ld %6ld %6ld ", sp->r_bins[4],
223 sp->r_bins[5], sp->r_bins[6], sp->r_bins[7]);
224 size += sprintf(BLS, "%6ld %6ld\n", sp->r_bins[8],
225 sp->r_bins[9]);
226 size += sprintf(BLS, "Writes:");
227 size += sprintf(BLS, "%6ld %6ld %6ld %6ld ", sp->w_bins[0],
228 sp->w_bins[1], sp->w_bins[2], sp->w_bins[3]);
229 size += sprintf(BLS, "%6ld %6ld %6ld %6ld ", sp->w_bins[4],
230 sp->w_bins[5], sp->w_bins[6], sp->w_bins[7]);
231 size += sprintf(BLS, "%6ld %6ld\n", sp->w_bins[8],
232 sp->w_bins[9]);
233 size += sprintf(BLS, "\n");
234 }
235 }
236 }
237 len += size; pos = begin + len; size = 0;
238 }
239 #endif
240
241 stop_output:
242 proc_debug("2pos: %ld offset: %ld len: %d\n", pos, offset, len);
243 *start = buffer + (offset - begin);
244 len -= (offset - begin);
245 if (len > length)
246 {
247 len = length;
248 }
249 proc_debug("3pos: %ld offset: %ld len: %d\n", pos, offset, len);
250
251 return (len);
252 }
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271