1 /*+M*************************************************************************
2 * Adaptec AIC7xxx device driver proc support for Linux.
4 * Copyright (c) 1995, 1996 Dean W. Gehnert
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 * ----------------------------------------------------------------
21 * o Modified from the EATA-DMA /proc support.
22 * o Additional support for device block statistics provided by
24 * o Correction of overflow by Heinz Mauelshagen
25 * o Adittional corrections by Doug Ledford
27 * Dean W. Gehnert, deang@teleport.com, 05/01/96
29 * $Id: aic7xxx_proc.c,v 4.1 1997/06/97 08:23:42 deang Exp $
30 *-M*************************************************************************/
34 " 0 - 4K 4 - 16K 16 - 64K 64 - 256K 256K - 1M 1M+"
37 /*+F*************************************************************************
42 * Return information to handle /proc support for the driver.
43 *-F*************************************************************************/
45 aic7xxx_show_info(struct seq_file
*m
, struct Scsi_Host
*HBAptr
)
47 struct aic7xxx_host
*p
;
48 struct aic_dev_data
*aic_dev
;
49 struct scsi_device
*sdptr
;
53 for(p
=first_aic7xxx
; p
&& p
->host
!= HBAptr
; p
=p
->next
)
58 seq_printf(m
, "Can't find adapter for host number %d\n", HBAptr
->host_no
);
62 p
= (struct aic7xxx_host
*) HBAptr
->hostdata
;
64 seq_printf(m
, "Adaptec AIC7xxx driver version: ");
65 seq_printf(m
, "%s/", AIC7XXX_C_VERSION
);
66 seq_printf(m
, "%s", AIC7XXX_H_VERSION
);
68 seq_printf(m
, "Adapter Configuration:\n");
69 seq_printf(m
, " SCSI Adapter: %s\n",
70 board_names
[p
->board_name_index
]);
71 if (p
->flags
& AHC_TWIN
)
72 seq_printf(m
, " Twin Channel Controller ");
77 char *wide
= "Narrow ";
78 if (p
->flags
& AHC_MULTI_CHANNEL
)
80 channel
= " Channel A";
81 if (p
->flags
& (AHC_CHNLB
|AHC_CHNLC
))
82 channel
= (p
->flags
& AHC_CHNLB
) ? " Channel B" : " Channel C";
84 if (p
->features
& AHC_WIDE
)
86 if (p
->features
& AHC_ULTRA3
)
88 switch(p
->chip
& AHC_CHIPID_MASK
)
92 ultra
= "Ultra-160/m LVD/SE ";
95 ultra
= "Ultra-3 LVD/SE ";
99 else if (p
->features
& AHC_ULTRA2
)
100 ultra
= "Ultra-2 LVD/SE ";
101 else if (p
->features
& AHC_ULTRA
)
103 seq_printf(m
, " %s%sController%s ",
104 ultra
, wide
, channel
);
106 switch(p
->chip
& ~AHC_CHIPID_MASK
)
109 seq_printf(m
, "at VLB slot %d\n", p
->pci_device_fn
);
112 seq_printf(m
, "at EISA slot %d\n", p
->pci_device_fn
);
115 seq_printf(m
, "at PCI %d/%d/%d\n", p
->pci_bus
,
116 PCI_SLOT(p
->pci_device_fn
), PCI_FUNC(p
->pci_device_fn
));
121 seq_printf(m
, " Programmed I/O Base: %lx\n", p
->base
);
125 seq_printf(m
, " PCI MMAPed I/O Base: 0x%lx\n", p
->mbase
);
127 if( (p
->chip
& (AHC_VL
| AHC_EISA
)) )
129 seq_printf(m
, " BIOS Memory Address: 0x%08x\n", p
->bios_address
);
131 seq_printf(m
, " Adapter SEEPROM Config: %s\n",
132 (p
->flags
& AHC_SEEPROM_FOUND
) ? "SEEPROM found and used." :
133 ((p
->flags
& AHC_USEDEFAULTS
) ? "SEEPROM not found, using defaults." :
134 "SEEPROM not found, using leftover BIOS values.") );
135 seq_printf(m
, " Adaptec SCSI BIOS: %s\n",
136 (p
->flags
& AHC_BIOS_ENABLED
) ? "Enabled" : "Disabled");
137 seq_printf(m
, " IRQ: %d\n", HBAptr
->irq
);
138 seq_printf(m
, " SCBs: Active %d, Max Active %d,\n",
139 p
->activescbs
, p
->max_activescbs
);
140 seq_printf(m
, " Allocated %d, HW %d, "
141 "Page %d\n", p
->scb_data
->numscbs
, p
->scb_data
->maxhscbs
,
142 p
->scb_data
->maxscbs
);
143 if (p
->flags
& AHC_EXTERNAL_SRAM
)
144 seq_printf(m
, " Using External SCB SRAM\n");
145 seq_printf(m
, " Interrupts: %ld", p
->isr_count
);
146 if (p
->chip
& AHC_EISA
)
148 seq_printf(m
, " %s\n",
149 (p
->pause
& IRQMS
) ? "(Level Sensitive)" : "(Edge Triggered)");
155 seq_printf(m
, " BIOS Control Word: 0x%04x\n",
157 seq_printf(m
, " Adapter Control Word: 0x%04x\n",
159 seq_printf(m
, " Extended Translation: %sabled\n",
160 (p
->flags
& AHC_EXTEND_TRANS_A
) ? "En" : "Dis");
161 seq_printf(m
, "Disconnect Enable Flags: 0x%04x\n", p
->discenable
);
162 if (p
->features
& (AHC_ULTRA
| AHC_ULTRA2
))
164 seq_printf(m
, " Ultra Enable Flags: 0x%04x\n", p
->ultraenb
);
166 seq_printf(m
, "Default Tag Queue Depth: %d\n", aic7xxx_default_queue_depth
);
167 seq_printf(m
, " Tagged Queue By Device array for aic7xxx host "
168 "instance %d:\n", p
->instance
);
170 for(i
=0; i
< (MAX_TARGETS
- 1); i
++)
171 seq_printf(m
, "%d,",aic7xxx_tag_info
[p
->instance
].tag_commands
[i
]);
172 seq_printf(m
, "%d}\n",aic7xxx_tag_info
[p
->instance
].tag_commands
[i
]);
175 seq_printf(m
, "Statistics:\n\n");
176 list_for_each_entry(aic_dev
, &p
->aic_devs
, list
)
178 sdptr
= aic_dev
->SDptr
;
179 tindex
= sdptr
->channel
<< 3 | sdptr
->id
;
180 seq_printf(m
, "(scsi%d:%d:%d:%d)\n",
181 p
->host_no
, sdptr
->channel
, sdptr
->id
, sdptr
->lun
);
182 seq_printf(m
, " Device using %s/%s",
183 (aic_dev
->cur
.width
== MSG_EXT_WDTR_BUS_16_BIT
) ?
185 (aic_dev
->cur
.offset
!= 0) ?
186 "Sync transfers at " : "Async transfers.\n" );
187 if (aic_dev
->cur
.offset
!= 0)
189 struct aic7xxx_syncrate
*sync_rate
;
190 unsigned char options
= aic_dev
->cur
.options
;
191 int period
= aic_dev
->cur
.period
;
192 int rate
= (aic_dev
->cur
.width
==
193 MSG_EXT_WDTR_BUS_16_BIT
) ? 1 : 0;
195 sync_rate
= aic7xxx_find_syncrate(p
, &period
, 0, &options
);
196 if (sync_rate
!= NULL
)
198 seq_printf(m
, "%s MByte/sec, offset %d\n",
199 sync_rate
->rate
[rate
],
200 aic_dev
->cur
.offset
);
204 seq_printf(m
, "3.3 MByte/sec, offset %d\n",
205 aic_dev
->cur
.offset
);
208 seq_printf(m
, " Transinfo settings: ");
209 seq_printf(m
, "current(%d/%d/%d/%d), ",
213 aic_dev
->cur
.options
);
214 seq_printf(m
, "goal(%d/%d/%d/%d), ",
215 aic_dev
->goal
.period
,
216 aic_dev
->goal
.offset
,
218 aic_dev
->goal
.options
);
219 seq_printf(m
, "user(%d/%d/%d/%d)\n",
220 p
->user
[tindex
].period
,
221 p
->user
[tindex
].offset
,
222 p
->user
[tindex
].width
,
223 p
->user
[tindex
].options
);
224 if(sdptr
->simple_tags
)
226 seq_printf(m
, " Tagged Command Queueing Enabled, Ordered Tags %s, Depth %d/%d\n", sdptr
->ordered_tags
? "Enabled" : "Disabled", sdptr
->queue_depth
, aic_dev
->max_q_depth
);
228 if(aic_dev
->barrier_total
)
229 seq_printf(m
, " Total transfers %ld:\n (%ld/%ld/%ld/%ld reads/writes/REQ_BARRIER/Ordered Tags)\n",
230 aic_dev
->r_total
+aic_dev
->w_total
, aic_dev
->r_total
, aic_dev
->w_total
,
231 aic_dev
->barrier_total
, aic_dev
->ordered_total
);
233 seq_printf(m
, " Total transfers %ld:\n (%ld/%ld reads/writes)\n",
234 aic_dev
->r_total
+aic_dev
->w_total
, aic_dev
->r_total
, aic_dev
->w_total
);
235 seq_printf(m
, "%s\n", HDRB
);
236 seq_printf(m
, " Reads:");
237 for (i
= 0; i
< ARRAY_SIZE(aic_dev
->r_bins
); i
++)
239 seq_printf(m
, " %10ld", aic_dev
->r_bins
[i
]);
242 seq_printf(m
, " Writes:");
243 for (i
= 0; i
< ARRAY_SIZE(aic_dev
->w_bins
); i
++)
245 seq_printf(m
, " %10ld", aic_dev
->w_bins
[i
]);
248 seq_printf(m
, "\n\n");
254 * Overrides for Emacs so that we follow Linus's tabbing style.
255 * Emacs will notice this stuff at the end of the file and automatically
256 * adjust the settings for this buffer only. This must remain at the end
258 * ---------------------------------------------------------------------------
261 * c-brace-imaginary-offset: 0
263 * c-argdecl-indent: 2
265 * c-continued-statement-offset: 2
266 * c-continued-brace-offset: 0
267 * indent-tabs-mode: nil