Commit 224896aa authored by Doug Ledford's avatar Doug Ledford Committed by Linus Torvalds

[PATCH] aic7xxx_old update and a compile warning fix in scsi.c

Rework lots of cruft in the aic7xxx_old driver so that it can be more
easily read and understood by other people and so it starts on the road
to giving a clearer picture of how to interact with the scsi mid layer.
parent e02b943b
......@@ -57,11 +57,6 @@ fi
source drivers/scsi/aic7xxx/Config.in
if [ "$CONFIG_SCSI_AIC7XXX" != "y" ]; then
dep_tristate 'Old Adaptec AIC7xxx support' CONFIG_SCSI_AIC7XXX_OLD $CONFIG_SCSI
if [ "$CONFIG_SCSI_AIC7XXX_OLD" != "n" ]; then
bool ' Enable Tagged Command Queueing (TCQ) by default' CONFIG_AIC7XXX_OLD_TCQ_ON_BY_DEFAULT
int ' Maximum number of TCQ commands per device' CONFIG_AIC7XXX_OLD_CMDS_PER_DEVICE 8
bool ' Collect statistics to report in /proc' CONFIG_AIC7XXX_OLD_PROC_STATS
fi
fi
# All the I2O code and drivers do not seem to be 64bit safe.
if [ "$CONFIG_X86_64" != "y" ]; then
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -46,7 +46,6 @@
eh_host_reset_handler: NULL, \
abort: aic7xxx_abort, \
reset: aic7xxx_reset, \
select_queue_depths: NULL, \
slave_attach: aic7xxx_slave_attach, \
slave_detach: aic7xxx_slave_detach, \
bios_param: aic7xxx_biosparam, \
......
......@@ -33,7 +33,7 @@
#define BLS (&aic7xxx_buffer[size])
#define HDRB \
" < 2K 2K+ 4K+ 8K+ 16K+ 32K+ 64K+ 128K+"
" 0 - 4K 4 - 16K 16 - 64K 64 - 256K 256K - 1M 1M+"
#ifdef PROC_DEBUG
extern int vsprintf(char *, const char *, va_list);
......@@ -85,10 +85,12 @@ aic7xxx_proc_info ( char *buffer, char **start, off_t offset, int length,
{
struct Scsi_Host *HBAptr;
struct aic7xxx_host *p;
struct aic_dev_data *aic_dev;
struct scsi_device *sdptr;
int size = 0;
unsigned char i;
struct aic7xxx_xferstats *sp;
unsigned char target;
unsigned char tindex;
struct list_head *list_item;
HBAptr = NULL;
......@@ -130,14 +132,9 @@ aic7xxx_proc_info ( char *buffer, char **start, off_t offset, int length,
*/
size = 4096;
for (target = 0; target < MAX_TARGETS; target++)
list_for_each(list_item, &p->aic_devs)
{
if (p->dev_flags[target] & DEVICE_PRESENT)
#ifdef AIC7XXX_PROC_STATS
size += 512;
#else
size += 256;
#endif
size += 512;
}
if (aic7xxx_buffer_size != size)
{
......@@ -166,11 +163,6 @@ aic7xxx_proc_info ( char *buffer, char **start, off_t offset, int length,
size += sprintf(BLS, " TCQ Enabled By Default : Enabled\n");
#else
size += sprintf(BLS, " TCQ Enabled By Default : Disabled\n");
#endif
#ifdef AIC7XXX_PROC_STATS
size += sprintf(BLS, " AIC7XXX_PROC_STATS : Enabled\n");
#else
size += sprintf(BLS, " AIC7XXX_PROC_STATS : Disabled\n");
#endif
size += sprintf(BLS, "\n");
size += sprintf(BLS, "Adapter Configuration:\n");
......@@ -271,8 +263,6 @@ aic7xxx_proc_info ( char *buffer, char **start, off_t offset, int length,
{
size += sprintf(BLS, " Ultra Enable Flags: 0x%04x\n", p->ultraenb);
}
size += sprintf(BLS, " Tag Queue Enable Flags: 0x%04x\n", p->tagenable);
size += sprintf(BLS, "Ordered Queue Tag Flags: 0x%04x\n", p->orderedtag);
size += sprintf(BLS, "Default Tag Queue Depth: %d\n", AIC7XXX_CMDS_PER_DEVICE);
size += sprintf(BLS, " Tagged Queue By Device array for aic7xxx host "
"instance %d:\n", p->instance);
......@@ -280,43 +270,27 @@ aic7xxx_proc_info ( char *buffer, char **start, off_t offset, int length,
for(i=0; i < (MAX_TARGETS - 1); i++)
size += sprintf(BLS, "%d,",aic7xxx_tag_info[p->instance].tag_commands[i]);
size += sprintf(BLS, "%d}\n",aic7xxx_tag_info[p->instance].tag_commands[i]);
size += sprintf(BLS, " Actual queue depth per device for aic7xxx host "
"instance %d:\n", p->instance);
size += sprintf(BLS, " {");
for(i=0; i < (MAX_TARGETS - 1); i++)
size += sprintf(BLS, "%d,", p->dev_max_queue_depth[i]);
size += sprintf(BLS, "%d}\n", p->dev_max_queue_depth[i]);
size += sprintf(BLS, "\n");
size += sprintf(BLS, "Statistics:\n\n");
for (target = 0; target < MAX_TARGETS; target++)
list_for_each(list_item, &p->aic_devs)
{
sp = &p->stats[target];
if ((p->dev_flags[target] & DEVICE_PRESENT) == 0)
{
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);
}
aic_dev = list_entry(list_item, struct aic_dev_data, list);
sdptr = aic_dev->SDptr;
tindex = sdptr->channel << 3 | sdptr->id;
size += sprintf(BLS, "(scsi%d:%d:%d:%d)\n",
p->host_no, sdptr->channel, sdptr->id, sdptr->lun);
size += sprintf(BLS, " Device using %s/%s",
(p->transinfo[target].cur_width == MSG_EXT_WDTR_BUS_16_BIT) ?
(aic_dev->cur.width == MSG_EXT_WDTR_BUS_16_BIT) ?
"Wide" : "Narrow",
(p->transinfo[target].cur_offset != 0) ?
(aic_dev->cur.offset != 0) ?
"Sync transfers at " : "Async transfers.\n" );
if (p->transinfo[target].cur_offset != 0)
if (aic_dev->cur.offset != 0)
{
struct aic7xxx_syncrate *sync_rate;
unsigned char options = p->transinfo[target].cur_options;
int period = p->transinfo[target].cur_period;
int rate = (p->transinfo[target].cur_width ==
unsigned char options = aic_dev->cur.options;
int period = aic_dev->cur.period;
int rate = (aic_dev->cur.width ==
MSG_EXT_WDTR_BUS_16_BIT) ? 1 : 0;
sync_rate = aic7xxx_find_syncrate(p, &period, 0, &options);
......@@ -324,50 +298,45 @@ aic7xxx_proc_info ( char *buffer, char **start, off_t offset, int length,
{
size += sprintf(BLS, "%s MByte/sec, offset %d\n",
sync_rate->rate[rate],
p->transinfo[target].cur_offset );
aic_dev->cur.offset );
}
else
{
size += sprintf(BLS, "3.3 MByte/sec, offset %d\n",
p->transinfo[target].cur_offset );
aic_dev->cur.offset );
}
}
size += sprintf(BLS, " Transinfo settings: ");
size += sprintf(BLS, "current(%d/%d/%d/%d), ",
p->transinfo[target].cur_period,
p->transinfo[target].cur_offset,
p->transinfo[target].cur_width,
p->transinfo[target].cur_options);
aic_dev->cur.period,
aic_dev->cur.offset,
aic_dev->cur.width,
aic_dev->cur.options);
size += sprintf(BLS, "goal(%d/%d/%d/%d), ",
p->transinfo[target].goal_period,
p->transinfo[target].goal_offset,
p->transinfo[target].goal_width,
p->transinfo[target].goal_options);
aic_dev->goal.period,
aic_dev->goal.offset,
aic_dev->goal.width,
aic_dev->goal.options);
size += sprintf(BLS, "user(%d/%d/%d/%d)\n",
p->transinfo[target].user_period,
p->transinfo[target].user_offset,
p->transinfo[target].user_width,
p->transinfo[target].user_options);
#ifdef AIC7XXX_PROC_STATS
p->user[tindex].period,
p->user[tindex].offset,
p->user[tindex].width,
p->user[tindex].options);
size += sprintf(BLS, " Total transfers %ld (%ld reads and %ld writes)\n",
sp->r_total + sp->w_total, sp->r_total, sp->w_total);
aic_dev->r_total + aic_dev->w_total, aic_dev->r_total, aic_dev->w_total);
size += sprintf(BLS, "%s\n", HDRB);
size += sprintf(BLS, " Reads:");
for (i = 0; i < NUMBER(sp->r_bins); i++)
for (i = 0; i < NUMBER(aic_dev->r_bins); i++)
{
size += sprintf(BLS, " %7ld", sp->r_bins[i]);
size += sprintf(BLS, " %7ld", aic_dev->r_bins[i]);
}
size += sprintf(BLS, "\n");
size += sprintf(BLS, " Writes:");
for (i = 0; i < NUMBER(sp->w_bins); i++)
for (i = 0; i < NUMBER(aic_dev->w_bins); i++)
{
size += sprintf(BLS, " %7ld", sp->w_bins[i]);
size += sprintf(BLS, " %7ld", aic_dev->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");
}
......
......@@ -1649,7 +1649,7 @@ void scsi_adjust_queue_depth(Scsi_Device *SDpnt, int tagged, int tags)
printk(KERN_WARNING "(scsi%d:%d:%d:%d) "
"scsi_adjust_queue_depth, bad queue type, "
"disabled\n", SDpnt->host->host_no,
SDpnt->channel, SDpnt->id, SDpnt->lun, tagged);
SDpnt->channel, SDpnt->id, SDpnt->lun);
case 0:
SDpnt->ordered_tags = SDpnt->simple_tags = 0;
if(SDpnt->host->cmd_per_lun)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment