···553553 return (char *) (pHba->detail);554554}555555556556-static int adpt_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset,557557- int length, int inout)556556+static int adpt_show_info(struct seq_file *m, struct Scsi_Host *host)558557{559558 struct adpt_device* d;560559 int id;561560 int chan;562562- int len = 0;563563- int begin = 0;564564- int pos = 0;565561 adpt_hba* pHba;566562 int unit;567567-568568- *start = buffer;569569- if (inout == TRUE) {570570- /*571571- * The user has done a write and wants us to take the572572- * data in the buffer and do something with it.573573- * proc_scsiwrite calls us with inout = 1574574- *575575- * Read data from buffer (writing to us) - NOT SUPPORTED576576- */577577- return -EINVAL;578578- }579579-580580- /*581581- * inout = 0 means the user has done a read and wants information582582- * returned, so we write information about the cards into the buffer583583- * proc_scsiread() calls us with inout = 0584584- */585563586564 // Find HBA (host bus adapter) we are looking for587565 mutex_lock(&adpt_configuration_lock);···574596 }575597 host = pHba->host;576598577577- len = sprintf(buffer , "Adaptec I2O RAID Driver Version: %s\n\n", DPT_I2O_VERSION);578578- len += sprintf(buffer+len, "%s\n", pHba->detail);579579- len += sprintf(buffer+len, "SCSI Host=scsi%d Control Node=/dev/%s irq=%d\n", 599599+ seq_printf(m, "Adaptec I2O RAID Driver Version: %s\n\n", DPT_I2O_VERSION);600600+ seq_printf(m, "%s\n", pHba->detail);601601+ seq_printf(m, "SCSI Host=scsi%d Control Node=/dev/%s irq=%d\n", 580602 pHba->host->host_no, pHba->name, host->irq);581581- len += sprintf(buffer+len, "\tpost fifo size = %d\n\treply fifo size = %d\n\tsg table size = %d\n\n",603603+ seq_printf(m, "\tpost fifo size = %d\n\treply fifo size = %d\n\tsg table size = %d\n\n",582604 host->can_queue, (int) pHba->reply_fifo_size , host->sg_tablesize);583605584584- pos = begin + len;585585-586586- /* CHECKPOINT */587587- if(pos > offset + length) {588588- goto stop_output;589589- }590590- if(pos <= offset) {591591- /*592592- * If we haven't even written to where we last left593593- * off (the last time we were called), reset the 594594- * beginning pointer.595595- */596596- len = 0;597597- begin = pos;598598- }599599- len += sprintf(buffer+len, "Devices:\n");606606+ seq_printf(m, "Devices:\n");600607 for(chan = 0; chan < MAX_CHANNEL; chan++) {601608 for(id = 0; id < MAX_ID; id++) {602609 d = pHba->channel[chan].device[id];603603- while(d){604604- len += sprintf(buffer+len,"\t%-24.24s", d->pScsi_dev->vendor);605605- len += sprintf(buffer+len," Rev: %-8.8s\n", d->pScsi_dev->rev);606606- pos = begin + len;607607-608608-609609- /* CHECKPOINT */610610- if(pos > offset + length) {611611- goto stop_output;612612- }613613- if(pos <= offset) {614614- len = 0;615615- begin = pos;616616- }610610+ while(d) {611611+ seq_printf(m,"\t%-24.24s", d->pScsi_dev->vendor);612612+ seq_printf(m," Rev: %-8.8s\n", d->pScsi_dev->rev);617613618614 unit = d->pI2o_dev->lct_data.tid;619619- len += sprintf(buffer+len, "\tTID=%d, (Channel=%d, Target=%d, Lun=%d) (%s)\n\n",615615+ seq_printf(m, "\tTID=%d, (Channel=%d, Target=%d, Lun=%d) (%s)\n\n",620616 unit, (int)d->scsi_channel, (int)d->scsi_id, (int)d->scsi_lun,621617 scsi_device_online(d->pScsi_dev)? "online":"offline"); 622622- pos = begin + len;623623-624624- /* CHECKPOINT */625625- if(pos > offset + length) {626626- goto stop_output;627627- }628628- if(pos <= offset) {629629- len = 0;630630- begin = pos;631631- }632632-633618 d = d->next_lun;634619 }635620 }636621 }637637-638638- /*639639- * begin is where we last checked our position with regards to offset640640- * begin is always less than offset. len is relative to begin. It641641- * is the number of bytes written past begin642642- *643643- */644644-stop_output:645645- /* stop the output and calculate the correct length */646646- *(buffer + len) = '\0';647647-648648- *start = buffer + (offset - begin); /* Start of wanted data */649649- len -= (offset - begin);650650- if(len > length) {651651- len = length;652652- } else if(len < 0){653653- len = 0;654654- **start = '\0';655655- }656656- return len;622622+ return 0;657623}658624659625/*···35613639 .module = THIS_MODULE,35623640 .name = "dpt_i2o",35633641 .proc_name = "dpt_i2o",35643564- .proc_info = adpt_proc_info,36423642+ .show_info = adpt_show_info,35653643 .info = adpt_info,35663644 .queuecommand = adpt_queue,35673645 .eh_abort_handler = adpt_abort,