diff options
Diffstat (limited to 'drivers/scsi/aic7xxx/aic79xx_proc.c')
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_proc.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/scsi/aic7xxx/aic79xx_proc.c b/drivers/scsi/aic7xxx/aic79xx_proc.c index 24fd59a230bf..c5f0ee591509 100644 --- a/drivers/scsi/aic7xxx/aic79xx_proc.c +++ b/drivers/scsi/aic7xxx/aic79xx_proc.c | |||
@@ -47,7 +47,7 @@ static int copy_info(struct info_str *info, char *fmt, ...); | |||
47 | static void ahd_dump_target_state(struct ahd_softc *ahd, | 47 | static void ahd_dump_target_state(struct ahd_softc *ahd, |
48 | struct info_str *info, | 48 | struct info_str *info, |
49 | u_int our_id, char channel, | 49 | u_int our_id, char channel, |
50 | u_int target_id, u_int target_offset); | 50 | u_int target_id); |
51 | static void ahd_dump_device_state(struct info_str *info, | 51 | static void ahd_dump_device_state(struct info_str *info, |
52 | struct scsi_device *sdev); | 52 | struct scsi_device *sdev); |
53 | static int ahd_proc_write_seeprom(struct ahd_softc *ahd, | 53 | static int ahd_proc_write_seeprom(struct ahd_softc *ahd, |
@@ -204,10 +204,8 @@ ahd_format_transinfo(struct info_str *info, struct ahd_transinfo *tinfo) | |||
204 | 204 | ||
205 | static void | 205 | static void |
206 | ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info, | 206 | ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info, |
207 | u_int our_id, char channel, u_int target_id, | 207 | u_int our_id, char channel, u_int target_id) |
208 | u_int target_offset) | ||
209 | { | 208 | { |
210 | struct ahd_linux_target *targ; | ||
211 | struct scsi_target *starget; | 209 | struct scsi_target *starget; |
212 | struct ahd_initiator_tinfo *tinfo; | 210 | struct ahd_initiator_tinfo *tinfo; |
213 | struct ahd_tmode_tstate *tstate; | 211 | struct ahd_tmode_tstate *tstate; |
@@ -218,10 +216,9 @@ ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info, | |||
218 | copy_info(info, "Target %d Negotiation Settings\n", target_id); | 216 | copy_info(info, "Target %d Negotiation Settings\n", target_id); |
219 | copy_info(info, "\tUser: "); | 217 | copy_info(info, "\tUser: "); |
220 | ahd_format_transinfo(info, &tinfo->user); | 218 | ahd_format_transinfo(info, &tinfo->user); |
221 | starget = ahd->platform_data->starget[target_offset]; | 219 | starget = ahd->platform_data->starget[target_id]; |
222 | if (starget == NULL) | 220 | if (starget == NULL) |
223 | return; | 221 | return; |
224 | targ = scsi_transport_target_data(starget); | ||
225 | 222 | ||
226 | copy_info(info, "\tGoal: "); | 223 | copy_info(info, "\tGoal: "); |
227 | ahd_format_transinfo(info, &tinfo->goal); | 224 | ahd_format_transinfo(info, &tinfo->goal); |
@@ -231,7 +228,7 @@ ahd_dump_target_state(struct ahd_softc *ahd, struct info_str *info, | |||
231 | for (lun = 0; lun < AHD_NUM_LUNS; lun++) { | 228 | for (lun = 0; lun < AHD_NUM_LUNS; lun++) { |
232 | struct scsi_device *dev; | 229 | struct scsi_device *dev; |
233 | 230 | ||
234 | dev = targ->sdev[lun]; | 231 | dev = scsi_device_lookup_by_target(starget, lun); |
235 | 232 | ||
236 | if (dev == NULL) | 233 | if (dev == NULL) |
237 | continue; | 234 | continue; |
@@ -355,7 +352,7 @@ ahd_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start, | |||
355 | copy_info(&info, "Allocated SCBs: %d, SG List Length: %d\n\n", | 352 | copy_info(&info, "Allocated SCBs: %d, SG List Length: %d\n\n", |
356 | ahd->scb_data.numscbs, AHD_NSEG); | 353 | ahd->scb_data.numscbs, AHD_NSEG); |
357 | 354 | ||
358 | max_targ = 15; | 355 | max_targ = 16; |
359 | 356 | ||
360 | if (ahd->seep_config == NULL) | 357 | if (ahd->seep_config == NULL) |
361 | copy_info(&info, "No Serial EEPROM\n"); | 358 | copy_info(&info, "No Serial EEPROM\n"); |
@@ -373,12 +370,12 @@ ahd_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start, | |||
373 | copy_info(&info, "\n"); | 370 | copy_info(&info, "\n"); |
374 | 371 | ||
375 | if ((ahd->features & AHD_WIDE) == 0) | 372 | if ((ahd->features & AHD_WIDE) == 0) |
376 | max_targ = 7; | 373 | max_targ = 8; |
377 | 374 | ||
378 | for (i = 0; i <= max_targ; i++) { | 375 | for (i = 0; i < max_targ; i++) { |
379 | 376 | ||
380 | ahd_dump_target_state(ahd, &info, ahd->our_id, 'A', | 377 | ahd_dump_target_state(ahd, &info, ahd->our_id, 'A', |
381 | /*target_id*/i, /*target_offset*/i); | 378 | /*target_id*/i); |
382 | } | 379 | } |
383 | retval = info.pos > info.offset ? info.pos - info.offset : 0; | 380 | retval = info.pos > info.offset ? info.pos - info.offset : 0; |
384 | done: | 381 | done: |