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 *board_name[] = {"None", "274x", "284x", "7870", "7850", "7872"};
86 static char *bus_name[] = {"Single", "Twin", "Wide"};
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_TWIN_SUPPORT
142 size += sprintf(BLS, " AIC7XXX_TWIN_SUPPORT : Enabled\n");
143 #else
144 size += sprintf(BLS, " AIC7XXX_TWIN_SUPPORT : Disabled\n");
145 #endif
146 #ifdef AIC7XXX_TAGGED_QUEUEING
147 size += sprintf(BLS, " AIC7XXX_TAGGED_QUEUEING: Enabled\n");
148 #else
149 size += sprintf(BLS, " AIC7XXX_TAGGED_QUEUEING: Disabled\n");
150 #endif
151 #ifdef AIC7XXX_SHARE_IRQS
152 size += sprintf(BLS, " AIC7XXX_SHARE_IRQS : Enabled\n");
153 #else
154 size += sprintf(BLS, " AIC7XXX_SHARE_IRQS : Disabled\n");
155 #endif
156 #ifdef AIC7XXX_PROC_STATS
157 size += sprintf(BLS, " AIC7XXX_PROC_STATS : Enabled\n");
158 #else
159 size += sprintf(BLS, " AIC7XXX_PROC_STATS : Disabled\n");
160 #endif
161 #ifdef AIC7XXX_POLL
162 size += sprintf(BLS, " AIC7XXX_POLL : Enabled\n");
163 #else
164 size += sprintf(BLS, " AIC7XXX_POLL : Disabled\n");
165 #endif
166 len += size; pos = begin + len; size = 0;
167
168 size += sprintf(BLS, "\n");
169 size += sprintf(BLS, "Adapter Configuration:\n");
170 size += sprintf(BLS, " SCSI Adapter: %s\n", board_name[p->type]);
171 size += sprintf(BLS, " Host Bus: %s\n", bus_name[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->type == AIC_274x) || (p->type == AIC_284x))
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, " Pause/Unpause: %#.2x/%#.2x\n", p->pause,
188 p->unpause);
189 size += sprintf(BLS, " Extended Translation: %sabled\n",
190 p->extended ? "En" : "Dis");
191 size += sprintf(BLS, " SCSI Bus Reset: %sabled\n",
192 aic7xxx_no_reset ? "Dis" : "En");
193 len += size; pos = begin + len; size = 0;
194
195 #ifdef AIC7XXX_PROC_STATS
196 {
197 struct aic7xxx_xferstats *sp;
198 int channel, target, lun;
199
200
201
202
203 size += sprintf(BLS, "\n");
204 size += sprintf(BLS, "Statistics:\n");
205 for (channel = 0; channel < 2; channel++)
206 {
207 for (target = 0; target < 16; target++)
208 {
209 for (lun = 0; lun < 8; lun++)
210 {
211 sp = &p->stats[channel][target][lun];
212 if (sp->xfers == 0)
213 {
214 continue;
215 }
216 size += sprintf(BLS, "CHAN#%c (TGT %d LUN %d):\n",
217 'A' + channel, target, lun);
218 size += sprintf(BLS, "nxfers %ld (%ld read;%ld written)\n",
219 sp->xfers, sp->r_total, sp->w_total);
220 size += sprintf(BLS, "blks(512) rd=%ld; blks(512) wr=%ld\n",
221 sp->r_total512, sp->w_total512);
222 size += sprintf(BLS, "%s\n", HDRB);
223 size += sprintf(BLS, " Reads:");
224 size += sprintf(BLS, "%6ld %6ld %6ld %6ld ", sp->r_bins[0],
225 sp->r_bins[1], sp->r_bins[2], sp->r_bins[3]);
226 size += sprintf(BLS, "%6ld %6ld %6ld %6ld ", sp->r_bins[4],
227 sp->r_bins[5], sp->r_bins[6], sp->r_bins[7]);
228 size += sprintf(BLS, "%6ld %6ld\n", sp->r_bins[8],
229 sp->r_bins[9]);
230 size += sprintf(BLS, "Writes:");
231 size += sprintf(BLS, "%6ld %6ld %6ld %6ld ", sp->w_bins[0],
232 sp->w_bins[1], sp->w_bins[2], sp->w_bins[3]);
233 size += sprintf(BLS, "%6ld %6ld %6ld %6ld ", sp->w_bins[4],
234 sp->w_bins[5], sp->w_bins[6], sp->w_bins[7]);
235 size += sprintf(BLS, "%6ld %6ld\n", sp->w_bins[8],
236 sp->w_bins[9]);
237 size += sprintf(BLS, "\n");
238 }
239 }
240 }
241 len += size; pos = begin + len; size = 0;
242 }
243 #endif
244
245 stop_output:
246 proc_debug("2pos: %ld offset: %ld len: %d\n", pos, offset, len);
247 *start = buffer + (offset - begin);
248 len -= (offset - begin);
249 if (len > length)
250 {
251 len = length;
252 }
253 proc_debug("3pos: %ld offset: %ld len: %d\n", pos, offset, len);
254
255 return (len);
256 }
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275