Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2000-2001 Adaptec Inc. |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 8 | * 1. Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions, and the following disclaimer, |
| 10 | * without modification. |
| 11 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer |
| 12 | * substantially similar to the "NO WARRANTY" disclaimer below |
| 13 | * ("Disclaimer") and any redistribution must be conditioned upon |
| 14 | * including a substantially similar Disclaimer requirement for further |
| 15 | * binary redistribution. |
| 16 | * 3. Neither the names of the above-listed copyright holders nor the names |
| 17 | * of any contributors may be used to endorse or promote products derived |
| 18 | * from this software without specific prior written permission. |
| 19 | * |
| 20 | * Alternatively, this software may be distributed under the terms of the |
| 21 | * GNU General Public License ("GPL") version 2 as published by the Free |
| 22 | * Software Foundation. |
| 23 | * |
| 24 | * NO WARRANTY |
| 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 26 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 27 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR |
| 28 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 29 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 31 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 32 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 33 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 34 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 35 | * POSSIBILITY OF SUCH DAMAGES. |
| 36 | * |
| 37 | * String handling code courtesy of Gerard Roudier's <groudier@club-internet.fr> |
| 38 | * sym driver. |
| 39 | * |
| 40 | * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_proc.c#19 $ |
| 41 | */ |
| 42 | #include "aic79xx_osm.h" |
| 43 | #include "aic79xx_inline.h" |
| 44 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | static void ahd_dump_target_state(struct ahd_softc *ahd, |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 46 | struct seq_file *m, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | u_int our_id, char channel, |
Hannes Reinecke | f89d0a4 | 2006-06-22 11:45:00 +0200 | [diff] [blame] | 48 | u_int target_id); |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 49 | static void ahd_dump_device_state(struct seq_file *m, |
Hannes Reinecke | 73a2546 | 2005-07-22 16:44:04 +0200 | [diff] [blame] | 50 | struct scsi_device *sdev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | |
Christoph Hellwig | 1ff9273 | 2005-08-19 18:57:13 +0200 | [diff] [blame] | 52 | /* |
| 53 | * Table of syncrates that don't follow the "divisible by 4" |
| 54 | * rule. This table will be expanded in future SCSI specs. |
| 55 | */ |
Denys Vlasenko | 980b306 | 2008-04-25 04:36:01 +0200 | [diff] [blame] | 56 | static const struct { |
Christoph Hellwig | 1ff9273 | 2005-08-19 18:57:13 +0200 | [diff] [blame] | 57 | u_int period_factor; |
| 58 | u_int period; /* in 100ths of ns */ |
| 59 | } scsi_syncrates[] = { |
| 60 | { 0x08, 625 }, /* FAST-160 */ |
| 61 | { 0x09, 1250 }, /* FAST-80 */ |
| 62 | { 0x0a, 2500 }, /* FAST-40 40MHz */ |
| 63 | { 0x0b, 3030 }, /* FAST-40 33MHz */ |
| 64 | { 0x0c, 5000 } /* FAST-20 */ |
| 65 | }; |
| 66 | |
| 67 | /* |
| 68 | * Return the frequency in kHz corresponding to the given |
| 69 | * sync period factor. |
| 70 | */ |
| 71 | static u_int |
| 72 | ahd_calc_syncsrate(u_int period_factor) |
| 73 | { |
| 74 | int i; |
Christoph Hellwig | 1ff9273 | 2005-08-19 18:57:13 +0200 | [diff] [blame] | 75 | |
Christoph Hellwig | 1ff9273 | 2005-08-19 18:57:13 +0200 | [diff] [blame] | 76 | /* See if the period is in the "exception" table */ |
Tobias Klauser | 6391a11 | 2006-06-08 22:23:48 -0700 | [diff] [blame] | 77 | for (i = 0; i < ARRAY_SIZE(scsi_syncrates); i++) { |
Christoph Hellwig | 1ff9273 | 2005-08-19 18:57:13 +0200 | [diff] [blame] | 78 | |
| 79 | if (period_factor == scsi_syncrates[i].period_factor) { |
| 80 | /* Period in kHz */ |
| 81 | return (100000000 / scsi_syncrates[i].period); |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | /* |
| 86 | * Wasn't in the table, so use the standard |
| 87 | * 4 times conversion. |
| 88 | */ |
| 89 | return (10000000 / (period_factor * 4 * 10)); |
| 90 | } |
| 91 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | static void |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 93 | ahd_format_transinfo(struct seq_file *m, struct ahd_transinfo *tinfo) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | { |
| 95 | u_int speed; |
| 96 | u_int freq; |
| 97 | u_int mb; |
| 98 | |
| 99 | if (tinfo->period == AHD_PERIOD_UNKNOWN) { |
Rasmus Villemoes | 91c40f2 | 2014-12-03 00:10:52 +0100 | [diff] [blame] | 100 | seq_puts(m, "Renegotiation Pending\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | return; |
| 102 | } |
| 103 | speed = 3300; |
| 104 | freq = 0; |
| 105 | if (tinfo->offset != 0) { |
Christoph Hellwig | 1ff9273 | 2005-08-19 18:57:13 +0200 | [diff] [blame] | 106 | freq = ahd_calc_syncsrate(tinfo->period); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | speed = freq; |
| 108 | } |
| 109 | speed *= (0x01 << tinfo->width); |
| 110 | mb = speed / 1000; |
| 111 | if (mb > 0) |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 112 | seq_printf(m, "%d.%03dMB/s transfers", mb, speed % 1000); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 113 | else |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 114 | seq_printf(m, "%dKB/s transfers", speed); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | |
| 116 | if (freq != 0) { |
| 117 | int printed_options; |
| 118 | |
| 119 | printed_options = 0; |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 120 | seq_printf(m, " (%d.%03dMHz", freq / 1000, freq % 1000); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 121 | if ((tinfo->ppr_options & MSG_EXT_PPR_RD_STRM) != 0) { |
Rasmus Villemoes | 91c40f2 | 2014-12-03 00:10:52 +0100 | [diff] [blame] | 122 | seq_puts(m, " RDSTRM"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 123 | printed_options++; |
| 124 | } |
| 125 | if ((tinfo->ppr_options & MSG_EXT_PPR_DT_REQ) != 0) { |
Rasmus Villemoes | 91c40f2 | 2014-12-03 00:10:52 +0100 | [diff] [blame] | 126 | seq_puts(m, printed_options ? "|DT" : " DT"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 127 | printed_options++; |
| 128 | } |
| 129 | if ((tinfo->ppr_options & MSG_EXT_PPR_IU_REQ) != 0) { |
Rasmus Villemoes | 91c40f2 | 2014-12-03 00:10:52 +0100 | [diff] [blame] | 130 | seq_puts(m, printed_options ? "|IU" : " IU"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 131 | printed_options++; |
| 132 | } |
| 133 | if ((tinfo->ppr_options & MSG_EXT_PPR_RTI) != 0) { |
Rasmus Villemoes | 91c40f2 | 2014-12-03 00:10:52 +0100 | [diff] [blame] | 134 | seq_puts(m, printed_options ? "|RTI" : " RTI"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 135 | printed_options++; |
| 136 | } |
| 137 | if ((tinfo->ppr_options & MSG_EXT_PPR_QAS_REQ) != 0) { |
Rasmus Villemoes | 91c40f2 | 2014-12-03 00:10:52 +0100 | [diff] [blame] | 138 | seq_puts(m, printed_options ? "|QAS" : " QAS"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 139 | printed_options++; |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | if (tinfo->width > 0) { |
| 144 | if (freq != 0) { |
Rasmus Villemoes | 91c40f2 | 2014-12-03 00:10:52 +0100 | [diff] [blame] | 145 | seq_puts(m, ", "); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | } else { |
Rasmus Villemoes | 91c40f2 | 2014-12-03 00:10:52 +0100 | [diff] [blame] | 147 | seq_puts(m, " ("); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 148 | } |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 149 | seq_printf(m, "%dbit)", 8 * (0x01 << tinfo->width)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 150 | } else if (freq != 0) { |
Rasmus Villemoes | f50332f | 2014-12-03 00:10:54 +0100 | [diff] [blame] | 151 | seq_putc(m, ')'); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | } |
Rasmus Villemoes | f50332f | 2014-12-03 00:10:54 +0100 | [diff] [blame] | 153 | seq_putc(m, '\n'); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | } |
| 155 | |
| 156 | static void |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 157 | ahd_dump_target_state(struct ahd_softc *ahd, struct seq_file *m, |
Hannes Reinecke | f89d0a4 | 2006-06-22 11:45:00 +0200 | [diff] [blame] | 158 | u_int our_id, char channel, u_int target_id) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 159 | { |
Hannes Reinecke | 73a2546 | 2005-07-22 16:44:04 +0200 | [diff] [blame] | 160 | struct scsi_target *starget; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 161 | struct ahd_initiator_tinfo *tinfo; |
| 162 | struct ahd_tmode_tstate *tstate; |
| 163 | int lun; |
| 164 | |
| 165 | tinfo = ahd_fetch_transinfo(ahd, channel, our_id, |
| 166 | target_id, &tstate); |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 167 | seq_printf(m, "Target %d Negotiation Settings\n", target_id); |
Rasmus Villemoes | 91c40f2 | 2014-12-03 00:10:52 +0100 | [diff] [blame] | 168 | seq_puts(m, "\tUser: "); |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 169 | ahd_format_transinfo(m, &tinfo->user); |
Hannes Reinecke | f89d0a4 | 2006-06-22 11:45:00 +0200 | [diff] [blame] | 170 | starget = ahd->platform_data->starget[target_id]; |
James Bottomley | 3f40d7d | 2005-08-03 13:25:10 -0500 | [diff] [blame] | 171 | if (starget == NULL) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 172 | return; |
| 173 | |
Rasmus Villemoes | 91c40f2 | 2014-12-03 00:10:52 +0100 | [diff] [blame] | 174 | seq_puts(m, "\tGoal: "); |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 175 | ahd_format_transinfo(m, &tinfo->goal); |
Rasmus Villemoes | 91c40f2 | 2014-12-03 00:10:52 +0100 | [diff] [blame] | 176 | seq_puts(m, "\tCurr: "); |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 177 | ahd_format_transinfo(m, &tinfo->curr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | |
| 179 | for (lun = 0; lun < AHD_NUM_LUNS; lun++) { |
Hannes Reinecke | 73a2546 | 2005-07-22 16:44:04 +0200 | [diff] [blame] | 180 | struct scsi_device *dev; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 181 | |
Hannes Reinecke | f89d0a4 | 2006-06-22 11:45:00 +0200 | [diff] [blame] | 182 | dev = scsi_device_lookup_by_target(starget, lun); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 183 | |
| 184 | if (dev == NULL) |
| 185 | continue; |
| 186 | |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 187 | ahd_dump_device_state(m, dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | } |
| 189 | } |
| 190 | |
| 191 | static void |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 192 | ahd_dump_device_state(struct seq_file *m, struct scsi_device *sdev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | { |
Hannes Reinecke | 73a2546 | 2005-07-22 16:44:04 +0200 | [diff] [blame] | 194 | struct ahd_linux_device *dev = scsi_transport_device_data(sdev); |
| 195 | |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 196 | seq_printf(m, "\tChannel %c Target %d Lun %d Settings\n", |
Hannes Reinecke | 73a2546 | 2005-07-22 16:44:04 +0200 | [diff] [blame] | 197 | sdev->sdev_target->channel + 'A', |
Hannes Reinecke | 9cb78c1 | 2014-06-25 15:27:36 +0200 | [diff] [blame] | 198 | sdev->sdev_target->id, (u8)sdev->lun); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 199 | |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 200 | seq_printf(m, "\t\tCommands Queued %ld\n", dev->commands_issued); |
| 201 | seq_printf(m, "\t\tCommands Active %d\n", dev->active); |
| 202 | seq_printf(m, "\t\tCommand Openings %d\n", dev->openings); |
| 203 | seq_printf(m, "\t\tMax Tagged Openings %d\n", dev->maxtags); |
| 204 | seq_printf(m, "\t\tDevice Queue Frozen Count %d\n", dev->qfrozen); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 205 | } |
| 206 | |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 207 | int |
| 208 | ahd_proc_write_seeprom(struct Scsi_Host *shost, char *buffer, int length) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 209 | { |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 210 | struct ahd_softc *ahd = *(struct ahd_softc **)shost->hostdata; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 211 | ahd_mode_state saved_modes; |
| 212 | int have_seeprom; |
| 213 | u_long s; |
| 214 | int paused; |
| 215 | int written; |
| 216 | |
| 217 | /* Default to failure. */ |
| 218 | written = -EINVAL; |
| 219 | ahd_lock(ahd, &s); |
| 220 | paused = ahd_is_paused(ahd); |
| 221 | if (!paused) |
| 222 | ahd_pause(ahd); |
| 223 | |
| 224 | saved_modes = ahd_save_modes(ahd); |
| 225 | ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); |
| 226 | if (length != sizeof(struct seeprom_config)) { |
Pekka Enberg | 48813cf | 2010-07-14 13:12:57 +0300 | [diff] [blame] | 227 | printk("ahd_proc_write_seeprom: incorrect buffer size\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | goto done; |
| 229 | } |
| 230 | |
| 231 | have_seeprom = ahd_verify_cksum((struct seeprom_config*)buffer); |
| 232 | if (have_seeprom == 0) { |
Pekka Enberg | 48813cf | 2010-07-14 13:12:57 +0300 | [diff] [blame] | 233 | printk("ahd_proc_write_seeprom: cksum verification failed\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 234 | goto done; |
| 235 | } |
| 236 | |
| 237 | have_seeprom = ahd_acquire_seeprom(ahd); |
| 238 | if (!have_seeprom) { |
Pekka Enberg | 48813cf | 2010-07-14 13:12:57 +0300 | [diff] [blame] | 239 | printk("ahd_proc_write_seeprom: No Serial EEPROM\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 240 | goto done; |
| 241 | } else { |
| 242 | u_int start_addr; |
| 243 | |
| 244 | if (ahd->seep_config == NULL) { |
Pekka Enberg | 48813cf | 2010-07-14 13:12:57 +0300 | [diff] [blame] | 245 | ahd->seep_config = kmalloc(sizeof(*ahd->seep_config), GFP_ATOMIC); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 246 | if (ahd->seep_config == NULL) { |
Pekka Enberg | 48813cf | 2010-07-14 13:12:57 +0300 | [diff] [blame] | 247 | printk("aic79xx: Unable to allocate serial " |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 248 | "eeprom buffer. Write failing\n"); |
| 249 | goto done; |
| 250 | } |
| 251 | } |
Pekka Enberg | 48813cf | 2010-07-14 13:12:57 +0300 | [diff] [blame] | 252 | printk("aic79xx: Writing Serial EEPROM\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 253 | start_addr = 32 * (ahd->channel - 'A'); |
| 254 | ahd_write_seeprom(ahd, (u_int16_t *)buffer, start_addr, |
| 255 | sizeof(struct seeprom_config)/2); |
| 256 | ahd_read_seeprom(ahd, (uint16_t *)ahd->seep_config, |
| 257 | start_addr, sizeof(struct seeprom_config)/2, |
| 258 | /*ByteStream*/FALSE); |
| 259 | ahd_release_seeprom(ahd); |
| 260 | written = length; |
| 261 | } |
| 262 | |
| 263 | done: |
| 264 | ahd_restore_modes(ahd, saved_modes); |
| 265 | if (!paused) |
| 266 | ahd_unpause(ahd); |
| 267 | ahd_unlock(ahd, &s); |
| 268 | return (written); |
| 269 | } |
| 270 | /* |
| 271 | * Return information to handle /proc support for the driver. |
| 272 | */ |
| 273 | int |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 274 | ahd_linux_show_info(struct seq_file *m, struct Scsi_Host *shost) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 275 | { |
Christoph Hellwig | 85a4652 | 2005-08-15 13:28:46 +0200 | [diff] [blame] | 276 | struct ahd_softc *ahd = *(struct ahd_softc **)shost->hostdata; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | char ahd_info[256]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 278 | u_int max_targ; |
| 279 | u_int i; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 280 | |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 281 | seq_printf(m, "Adaptec AIC79xx driver version: %s\n", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 282 | AIC79XX_DRIVER_VERSION); |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 283 | seq_printf(m, "%s\n", ahd->description); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 284 | ahd_controller_info(ahd, ahd_info); |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 285 | seq_printf(m, "%s\n", ahd_info); |
| 286 | seq_printf(m, "Allocated SCBs: %d, SG List Length: %d\n\n", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 287 | ahd->scb_data.numscbs, AHD_NSEG); |
| 288 | |
Hannes Reinecke | f89d0a4 | 2006-06-22 11:45:00 +0200 | [diff] [blame] | 289 | max_targ = 16; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 290 | |
| 291 | if (ahd->seep_config == NULL) |
Rasmus Villemoes | 91c40f2 | 2014-12-03 00:10:52 +0100 | [diff] [blame] | 292 | seq_puts(m, "No Serial EEPROM\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | else { |
Rasmus Villemoes | 91c40f2 | 2014-12-03 00:10:52 +0100 | [diff] [blame] | 294 | seq_puts(m, "Serial EEPROM:\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 295 | for (i = 0; i < sizeof(*ahd->seep_config)/2; i++) { |
| 296 | if (((i % 8) == 0) && (i != 0)) { |
Rasmus Villemoes | f50332f | 2014-12-03 00:10:54 +0100 | [diff] [blame] | 297 | seq_putc(m, '\n'); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 298 | } |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 299 | seq_printf(m, "0x%.4x ", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 300 | ((uint16_t*)ahd->seep_config)[i]); |
| 301 | } |
Rasmus Villemoes | f50332f | 2014-12-03 00:10:54 +0100 | [diff] [blame] | 302 | seq_putc(m, '\n'); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 303 | } |
Rasmus Villemoes | f50332f | 2014-12-03 00:10:54 +0100 | [diff] [blame] | 304 | seq_putc(m, '\n'); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 | |
| 306 | if ((ahd->features & AHD_WIDE) == 0) |
Hannes Reinecke | f89d0a4 | 2006-06-22 11:45:00 +0200 | [diff] [blame] | 307 | max_targ = 8; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 308 | |
Hannes Reinecke | f89d0a4 | 2006-06-22 11:45:00 +0200 | [diff] [blame] | 309 | for (i = 0; i < max_targ; i++) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 310 | |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 311 | ahd_dump_target_state(ahd, m, ahd->our_id, 'A', |
Hannes Reinecke | f89d0a4 | 2006-06-22 11:45:00 +0200 | [diff] [blame] | 312 | /*target_id*/i); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 313 | } |
Al Viro | f6f83a6 | 2013-03-31 03:59:17 -0400 | [diff] [blame] | 314 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 315 | } |