diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-06-01 03:16:17 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1997-06-01 03:16:17 +0000 |
commit | d8d9b8f76f22b7a16a83e261e64f89ee611f49df (patch) | |
tree | 3067bc130b80d52808e6390c9fc7fc087ec1e33c /drivers/scsi/scsi_proc.c | |
parent | 19c9bba94152148523ba0f7ef7cffe3d45656b11 (diff) |
Initial revision
Diffstat (limited to 'drivers/scsi/scsi_proc.c')
-rw-r--r-- | drivers/scsi/scsi_proc.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c index aca31e7c7..83c21c20b 100644 --- a/drivers/scsi/scsi_proc.c +++ b/drivers/scsi/scsi_proc.c @@ -11,6 +11,9 @@ * * generic command parser provided by: * Andreas Heilwagen <crashcar@informatik.uni-koblenz.de> + * + * generic_proc_info() support of xxxx_info() by: + * Michael A. Griffith <grif@acm.org> */ /* @@ -48,7 +51,9 @@ struct scsi_dir { * Used if the driver currently has no own support for /proc/scsi */ int generic_proc_info(char *buffer, char **start, off_t offset, - int length, int inode, int inout) + int length, int inode, int inout, + const char *(*info)(struct Scsi_Host *), + struct Scsi_Host *sh) { int len, pos, begin; @@ -56,8 +61,13 @@ int generic_proc_info(char *buffer, char **start, off_t offset, return(-ENOSYS); /* This is a no-op */ begin = 0; - pos = len = sprintf(buffer, - "The driver does not yet support the proc-fs\n"); + if (info && sh) { + pos = len = sprintf(buffer, "%s\n", info(sh)); + } + else { + pos = len = sprintf(buffer, + "The driver does not yet support the proc-fs\n"); + } if(pos < offset) { len = 0; begin = pos; @@ -91,7 +101,9 @@ extern int dispatch_scsi_info(int ino, char *buffer, char **start, if (ino == (hpnt->host_no + PROC_SCSI_FILE)) { if(hpnt->hostt->proc_info == NULL) return generic_proc_info(buffer, start, offset, length, - hpnt->host_no, func); + hpnt->host_no, func, + hpnt->hostt->info, + hpnt); else return(hpnt->hostt->proc_info(buffer, start, offset, length, hpnt->host_no, func)); |