diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-02-15 02:15:32 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-02-15 02:15:32 +0000 |
commit | 86464aed71025541805e7b1515541aee89879e33 (patch) | |
tree | e01a457a4912a8553bc65524aa3125d51f29f810 /drivers/scsi/aic7xxx_proc.c | |
parent | 88f99939ecc6a95a79614574cb7d95ffccfc3466 (diff) |
Merge with Linux 2.2.1.
Diffstat (limited to 'drivers/scsi/aic7xxx_proc.c')
-rw-r--r-- | drivers/scsi/aic7xxx_proc.c | 149 |
1 files changed, 72 insertions, 77 deletions
diff --git a/drivers/scsi/aic7xxx_proc.c b/drivers/scsi/aic7xxx_proc.c index d3d1b1ea3..6e5eca864 100644 --- a/drivers/scsi/aic7xxx_proc.c +++ b/drivers/scsi/aic7xxx_proc.c @@ -31,7 +31,7 @@ #define BLS (&aic7xxx_buffer[size]) #define HDRB \ -" < 512 512-1K 1-2K 2-4K 4-8K 8-16K 16-32K 32-64K 64-128K >128K" +" < 2K 2K+ 4K+ 8K+ 16K+ 32K+ 64K+ 128K+" #ifdef PROC_DEBUG extern int vsprintf(char *, const char *, va_list); @@ -86,7 +86,7 @@ aic7xxx_proc_info ( char *buffer, char **start, off_t offset, int length, int size = 0; unsigned char i; struct aic7xxx_xferstats *sp; - unsigned char target, lun; + unsigned char target; HBAptr = NULL; @@ -130,15 +130,12 @@ aic7xxx_proc_info ( char *buffer, char **start, off_t offset, int length, size = 4096; for (target = 0; target < MAX_TARGETS; target++) { - for (lun = 0; lun < MAX_LUNS; lun++) - { - if (p->stats[target][lun].xfers != 0) + if (p->dev_flags[target] & DEVICE_PRESENT) #ifdef AIC7XXX_PROC_STATS - size += 512; + size += 512; #else - size += 256; + size += 256; #endif - } } if (aic7xxx_buffer_size != size) { @@ -272,85 +269,83 @@ aic7xxx_proc_info ( char *buffer, char **start, off_t offset, int length, size += sprintf(BLS, "%d}\n", p->dev_max_queue_depth[i]); size += sprintf(BLS, "\n"); - size += sprintf(BLS, "Statistics:\n"); + size += sprintf(BLS, "Statistics:\n\n"); for (target = 0; target < MAX_TARGETS; target++) { - for (lun = 0; lun < MAX_LUNS; lun++) + sp = &p->stats[target]; + if ((p->dev_flags[target] & DEVICE_PRESENT) == 0) { - sp = &p->stats[target][lun]; - if (sp->xfers == 0) - { - continue; - } - if (p->features & AHC_TWIN) + continue; + } + if (p->features & AHC_TWIN) + { + size += sprintf(BLS, "(scsi%d:%d:%d:%d)\n", + p->host_no, (target >> 3), (target & 0x7), 0); + } + else + { + size += sprintf(BLS, "(scsi%d:%d:%d:%d)\n", + p->host_no, 0, target, 0); + } + size += sprintf(BLS, " Device using %s/%s", + (p->transinfo[target].cur_width == MSG_EXT_WDTR_BUS_16_BIT) ? + "Wide" : "Narrow", + (p->transinfo[target].cur_offset != 0) ? + "Sync transfers at " : "Async transfers.\n" ); + if (p->transinfo[target].cur_offset != 0) + { + struct aic7xxx_syncrate *sync_rate; + int period = p->transinfo[target].cur_period; + int rate = (p->transinfo[target].cur_width == + MSG_EXT_WDTR_BUS_16_BIT) ? 1 : 0; + + sync_rate = aic7xxx_find_syncrate(p, &period, AHC_SYNCRATE_ULTRA2); + if (sync_rate != NULL) { - size += sprintf(BLS, "(scsi%d:%d:%d:%d)\n", - p->host_no, (target >> 3), (target & 0x7), lun); + size += sprintf(BLS, "%s MByte/sec, offset %d\n", + sync_rate->rate[rate], + p->transinfo[target].cur_offset ); } else { - size += sprintf(BLS, "(scsi%d:%d:%d:%d)\n", - p->host_no, 0, target, lun); - } - size += sprintf(BLS, " Device using %s/%s\n", - (p->transinfo[target].cur_width == MSG_EXT_WDTR_BUS_16_BIT) ? - "Wide" : "Narrow", - (p->transinfo[target].cur_offset != 0) ? - "Sync transfers at" : "Async transfers." ); - if (p->transinfo[target].cur_offset != 0) - { - struct aic7xxx_syncrate *sync_rate; - int period = p->transinfo[target].cur_period; - int rate = (p->transinfo[target].cur_width == - MSG_EXT_WDTR_BUS_16_BIT) ? 1 : 0; - - sync_rate = aic7xxx_find_syncrate(p, &period, AHC_SYNCRATE_ULTRA2); - if (sync_rate != NULL) - { - size += sprintf(BLS, " %s MByte/sec, offset %d\n", - sync_rate->rate[rate], - p->transinfo[target].cur_offset ); - } - else - { - size += sprintf(BLS, " 3.3 MByte/sec, offset %d\n", - p->transinfo[target].cur_offset ); - } + size += sprintf(BLS, "3.3 MByte/sec, offset %d\n", + p->transinfo[target].cur_offset ); } - size += sprintf(BLS, " Device Negotiation Settings\n"); - size += sprintf(BLS, " Period Offset Bus Width\n"); - size += sprintf(BLS, "User %03d %03d %d\n", - p->transinfo[target].user_period, - p->transinfo[target].user_offset, - p->transinfo[target].user_width); - size += sprintf(BLS, "Goal %03d %03d %d\n", - p->transinfo[target].goal_period, - p->transinfo[target].goal_offset, - p->transinfo[target].goal_width); - size += sprintf(BLS, "Current %03d %03d %d\n", - p->transinfo[target].cur_period, - p->transinfo[target].cur_offset, - p->transinfo[target].cur_width); - size += sprintf(BLS, " Total transfers %ld (%ld read;%ld written)\n", - sp->xfers, sp->r_total, sp->w_total); - size += sprintf(BLS, " blks(512) rd=%ld; blks(512) wr=%ld\n", - sp->r_total512, sp->w_total512); + } + size += sprintf(BLS, " Transinfo settings: "); + size += sprintf(BLS, "current(%d/%d/%d), ", + p->transinfo[target].cur_period, + p->transinfo[target].cur_offset, + p->transinfo[target].cur_width); + size += sprintf(BLS, "goal(%d/%d/%d), ", + p->transinfo[target].goal_period, + p->transinfo[target].goal_offset, + p->transinfo[target].goal_width); + size += sprintf(BLS, "user(%d/%d/%d)\n", + p->transinfo[target].user_period, + p->transinfo[target].user_offset, + p->transinfo[target].user_width); #ifdef AIC7XXX_PROC_STATS - size += sprintf(BLS, "%s\n", HDRB); - size += sprintf(BLS, " Reads:"); - for (i = 0; i < NUMBER(sp->r_bins); i++) - { - size += sprintf(BLS, "%6ld ", sp->r_bins[i]); - } - size += sprintf(BLS, "\n"); - size += sprintf(BLS, "Writes:"); - for (i = 0; i < NUMBER(sp->w_bins); i++) - { - size += sprintf(BLS, "%6ld ", sp->w_bins[i]); - } -#endif /* AIC7XXX_PROC_STATS */ - size += sprintf(BLS, "\n\n"); + size += sprintf(BLS, " Total transfers %ld (%ld reads and %ld writes)\n", + sp->r_total + sp->w_total, sp->r_total, sp->w_total); + size += sprintf(BLS, "%s\n", HDRB); + size += sprintf(BLS, " Reads:"); + for (i = 0; i < NUMBER(sp->r_bins); i++) + { + size += sprintf(BLS, " %7ld", sp->r_bins[i]); + } + size += sprintf(BLS, "\n"); + size += sprintf(BLS, " Writes:"); + for (i = 0; i < NUMBER(sp->w_bins); i++) + { + size += sprintf(BLS, " %7ld", sp->w_bins[i]); } + size += sprintf(BLS, "\n"); +#else + size += sprintf(BLS, " Total transfers %ld (%ld reads and %ld writes)\n", + sp->r_total + sp->w_total, sp->r_total, sp->w_total); +#endif /* AIC7XXX_PROC_STATS */ + size += sprintf(BLS, "\n\n"); } if (size >= aic7xxx_buffer_size) |