/* * Return information to handle /proc support for the driver. */ int ahd_linux_show_info(struct seq_file *m, struct Scsi_Host *shost) { struct ahd_softc *ahd = *(struct ahd_softc **)shost->hostdata; char ahd_info[256]; u_int max_targ; u_int i; seq_printf(m, "Adaptec AIC79xx driver version: %s\n", AIC79XX_DRIVER_VERSION); seq_printf(m, "%s\n", ahd->description); ahd_controller_info(ahd, ahd_info); seq_printf(m, "%s\n", ahd_info); seq_printf(m, "Allocated SCBs: %d, SG List Length: %d\n\n", ahd->scb_data.numscbs, AHD_NSEG); max_targ = 16; if (ahd->seep_config == NULL) seq_puts(m, "No Serial EEPROM\n"); else { seq_puts(m, "Serial EEPROM:\n"); for (i = 0; i < sizeof(*ahd->seep_config)/2; i++) { if (((i % 8) == 0) && (i != 0)) { seq_putc(m, '\n'); } seq_printf(m, "0x%.4x ", ((uint16_t*)ahd->seep_config)[i]); } seq_putc(m, '\n'); } seq_putc(m, '\n'); if ((ahd->features & AHD_WIDE) == 0) max_targ = 8; for (i = 0; i < max_targ; i++) { ahd_dump_target_state(ahd, m, ahd->our_id, 'A', /*target_id*/i); } return 0; }
/* * Return information to handle /proc support for the driver. */ int ahd_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start, off_t offset, int length, int inout) { struct ahd_softc *ahd = *(struct ahd_softc **)shost->hostdata; struct info_str info; char ahd_info[256]; u_int max_targ; u_int i; int retval; /* Has data been written to the file? */ if (inout == TRUE) { retval = ahd_proc_write_seeprom(ahd, buffer, length); goto done; } if (start) *start = buffer; info.buffer = buffer; info.length = length; info.offset = offset; info.pos = 0; copy_info(&info, "Adaptec AIC79xx driver version: %s\n", AIC79XX_DRIVER_VERSION); copy_info(&info, "%s\n", ahd->description); ahd_controller_info(ahd, ahd_info); copy_info(&info, "%s\n", ahd_info); copy_info(&info, "Allocated SCBs: %d, SG List Length: %d\n\n", ahd->scb_data.numscbs, AHD_NSEG); max_targ = 15; if (ahd->seep_config == NULL) copy_info(&info, "No Serial EEPROM\n"); else { copy_info(&info, "Serial EEPROM:\n"); for (i = 0; i < sizeof(*ahd->seep_config)/2; i++) { if (((i % 8) == 0) && (i != 0)) { copy_info(&info, "\n"); } copy_info(&info, "0x%.4x ", ((uint16_t*)ahd->seep_config)[i]); } copy_info(&info, "\n"); } copy_info(&info, "\n"); if ((ahd->features & AHD_WIDE) == 0) max_targ = 7; for (i = 0; i <= max_targ; i++) { ahd_dump_target_state(ahd, &info, ahd->our_id, 'A', /*target_id*/i, /*target_offset*/i); } retval = info.pos > info.offset ? info.pos - info.offset : 0; done: return (retval); }