···5454static void cmd_free(ctlr_info_t *h, CommandList_struct *c);5555static void cmd_special_free(ctlr_info_t *h, CommandList_struct *c);56565757-static int cciss_scsi_proc_info(5858- struct Scsi_Host *sh,5757+static int cciss_scsi_write_info(struct Scsi_Host *sh,5958 char *buffer, /* data buffer */6060- char **start, /* where data in buffer starts */6161- off_t offset, /* offset from start of imaginary file */6262- int length, /* length of data in buffer */6363- int func); /* 0 == read, 1 == write */5959+ int length); /* length of data in buffer */6060+static int cciss_scsi_show_info(struct seq_file *m,6161+ struct Scsi_Host *sh);64626563static int cciss_scsi_queue_command (struct Scsi_Host *h,6664 struct scsi_cmnd *cmd);···8082 .module = THIS_MODULE,8183 .name = "cciss",8284 .proc_name = "cciss",8383- .proc_info = cciss_scsi_proc_info,8585+ .write_info = cciss_scsi_write_info,8686+ .show_info = cciss_scsi_show_info,8487 .queuecommand = cciss_scsi_queue_command,8588 .this_id = 7,8689 .cmd_per_lun = 1,···13011302 return length;13021303}1303130413041304-13051305static int13061306-cciss_scsi_proc_info(struct Scsi_Host *sh,13061306+cciss_scsi_write_info(struct Scsi_Host *sh,13071307 char *buffer, /* data buffer */13081308- char **start, /* where data in buffer starts */13091309- off_t offset, /* offset from start of imaginary file */13101310- int length, /* length of data in buffer */13111311- int func) /* 0 == read, 1 == write */13081308+ int length) /* length of data in buffer */13121309{13131313-13141314- int buflen, datalen;13151315- ctlr_info_t *h;13161316- int i;13171317-13181318- h = (ctlr_info_t *) sh->hostdata[0];13101310+ ctlr_info_t *h = (ctlr_info_t *) sh->hostdata[0];13191311 if (h == NULL) /* This really shouldn't ever happen. */13201312 return -EINVAL;1321131313221322- if (func == 0) { /* User is reading from /proc/scsi/ciss*?/?* */13231323- buflen = sprintf(buffer, "cciss%d: SCSI host: %d\n",13241324- h->ctlr, sh->host_no);13251325-13261326- /* this information is needed by apps to know which cciss13271327- device corresponds to which scsi host number without13281328- having to open a scsi target device node. The device13291329- information is not a duplicate of /proc/scsi/scsi because13301330- the two may be out of sync due to scsi hotplug, rather13311331- this info is for an app to be able to use to know how to13321332- get them back in sync. */13331333-13341334- for (i = 0; i < ccissscsi[h->ctlr].ndevices; i++) {13351335- struct cciss_scsi_dev_t *sd =13361336- &ccissscsi[h->ctlr].dev[i];13371337- buflen += sprintf(&buffer[buflen], "c%db%dt%dl%d %02d "13381338- "0x%02x%02x%02x%02x%02x%02x%02x%02x\n",13391339- sh->host_no, sd->bus, sd->target, sd->lun,13401340- sd->devtype,13411341- sd->scsi3addr[0], sd->scsi3addr[1],13421342- sd->scsi3addr[2], sd->scsi3addr[3],13431343- sd->scsi3addr[4], sd->scsi3addr[5],13441344- sd->scsi3addr[6], sd->scsi3addr[7]);13451345- }13461346- datalen = buflen - offset;13471347- if (datalen < 0) { /* they're reading past EOF. */13481348- datalen = 0;13491349- *start = buffer+buflen; 13501350- } else13511351- *start = buffer + offset;13521352- return(datalen);13531353- } else /* User is writing to /proc/scsi/cciss*?/?* ... */13541354- return cciss_scsi_user_command(h, sh->host_no,13141314+ return cciss_scsi_user_command(h, sh->host_no,13551315 buffer, length); 13561316} 13171317+13181318+static int13191319+cciss_scsi_show_info(struct seq_file *m, struct Scsi_Host *sh)13201320+{13211321+13221322+ ctlr_info_t *h = (ctlr_info_t *) sh->hostdata[0];13231323+ int i;13241324+13251325+ if (h == NULL) /* This really shouldn't ever happen. */13261326+ return -EINVAL;13271327+13281328+ seq_printf(m, "cciss%d: SCSI host: %d\n",13291329+ h->ctlr, sh->host_no);13301330+13311331+ /* this information is needed by apps to know which cciss13321332+ device corresponds to which scsi host number without13331333+ having to open a scsi target device node. The device13341334+ information is not a duplicate of /proc/scsi/scsi because13351335+ the two may be out of sync due to scsi hotplug, rather13361336+ this info is for an app to be able to use to know how to13371337+ get them back in sync. */13381338+13391339+ for (i = 0; i < ccissscsi[h->ctlr].ndevices; i++) {13401340+ struct cciss_scsi_dev_t *sd =13411341+ &ccissscsi[h->ctlr].dev[i];13421342+ seq_printf(m, "c%db%dt%dl%d %02d "13431343+ "0x%02x%02x%02x%02x%02x%02x%02x%02x\n",13441344+ sh->host_no, sd->bus, sd->target, sd->lun,13451345+ sd->devtype,13461346+ sd->scsi3addr[0], sd->scsi3addr[1],13471347+ sd->scsi3addr[2], sd->scsi3addr[3],13481348+ sd->scsi3addr[4], sd->scsi3addr[5],13491349+ sd->scsi3addr[6], sd->scsi3addr[7]);13501350+ }13511351+ return 0;13521352+}1357135313581354/* cciss_scatter_gather takes a struct scsi_cmnd, (cmd), and does the pci 13591355 dma mapping and fills in the scatter gather entries of the