48 static void ahc_dump_target_state(
struct ahc_softc *ahc,
54 static int ahc_proc_write_seeprom(
struct ahc_softc *ahc,
64 } scsi_syncrates[] = {
82 for (i = 0; i <
ARRAY_SIZE(scsi_syncrates); i++) {
84 if (period_factor == scsi_syncrates[i].period_factor) {
86 return (100000000 / scsi_syncrates[i].
period);
94 return (10000000 / (period_factor * 4 * 10));
114 info->
pos += partial;
136 copy_mem_info(info, buf, len);
150 freq = ahc_calc_syncsrate(tinfo->
period);
153 speed *= (0x01 << tinfo->
width);
156 copy_info(info,
"%d.%03dMB/s transfers", mb, speed % 1000);
158 copy_info(info,
"%dKB/s transfers", speed);
161 copy_info(info,
" (%d.%03dMHz%s, offset %d",
162 freq / 1000, freq % 1000,
164 ?
" DT" :
"", tinfo->
offset);
167 if (tinfo->
width > 0) {
169 copy_info(info,
", ");
171 copy_info(info,
" (");
173 copy_info(info,
"%dbit)", 8 * (0x01 << tinfo->
width));
174 }
else if (freq != 0) {
175 copy_info(info,
")");
177 copy_info(info,
"\n");
193 copy_info(info,
"Channel %c ", channel);
194 copy_info(info,
"Target %d Negotiation Settings\n", target_id);
195 copy_info(info,
"\tUser: ");
196 ahc_format_transinfo(info, &tinfo->
user);
201 copy_info(info,
"\tGoal: ");
202 ahc_format_transinfo(info, &tinfo->
goal);
203 copy_info(info,
"\tCurr: ");
204 ahc_format_transinfo(info, &tinfo->
curr);
214 ahc_dump_device_state(info, sdev);
223 copy_info(info,
"\tChannel %c Target %d Lun %d Settings\n",
228 copy_info(info,
"\t\tCommands Active %d\n", dev->
active);
229 copy_info(info,
"\t\tCommand Openings %d\n", dev->
openings);
230 copy_info(info,
"\t\tMax Tagged Openings %d\n", dev->
maxtags);
231 copy_info(info,
"\t\tDevice Queue Frozen Count %d\n", dev->
qfrozen);
251 printk(
"ahc_proc_write_seeprom: incorrect buffer size\n");
256 if (have_seeprom == 0) {
257 printk(
"ahc_proc_write_seeprom: cksum verification failed\n");
262 #if AHC_PCI_CONFIG > 0
293 printk(
"ahc_proc_write_seeprom: unsupported adapter type\n");
298 printk(
"ahc_proc_write_seeprom: No Serial EEPROM\n");
306 printk(
"aic7xxx: Unable to allocate serial "
307 "eeprom buffer. Write failing\n");
311 printk(
"aic7xxx: Writing Serial EEPROM\n");
312 start_addr = 32 * (ahc->
channel -
'A');
317 #if AHC_PCI_CONFIG > 0
336 off_t offset,
int length,
int inout)
347 retval = ahc_proc_write_seeprom(ahc, buffer, length);
359 copy_info(&info,
"Adaptec AIC7xxx driver version: %s\n",
363 copy_info(&info,
"%s\n", ahc_info);
364 copy_info(&info,
"Allocated SCBs: %d, SG List Length: %d\n\n",
369 copy_info(&info,
"No Serial EEPROM\n");
371 copy_info(&info,
"Serial EEPROM:\n");
372 for (i = 0; i <
sizeof(*ahc->
seep_config)/2; i++) {
373 if (((i % 8) == 0) && (i != 0)) {
374 copy_info(&info,
"\n");
376 copy_info(&info,
"0x%.4x ",
379 copy_info(&info,
"\n");
381 copy_info(&info,
"\n");
387 for (i = 0; i < max_targ; i++) {
401 ahc_dump_target_state(ahc, &info, our_id,
402 channel, target_id, i);