Commit 3fe52eb6 authored by Matthew Dharm's avatar Matthew Dharm Committed by Greg Kroah-Hartman

[PATCH] usb-storage: add info to /proc interface

This patch adds some information about the quirks of the device to the
/proc interface.
parent bee95701
...@@ -270,6 +270,7 @@ static int usb_storage_proc_info (char *buffer, char **start, off_t offset, ...@@ -270,6 +270,7 @@ static int usb_storage_proc_info (char *buffer, char **start, off_t offset,
struct us_data *us; struct us_data *us;
char *pos = buffer; char *pos = buffer;
struct Scsi_Host *hostptr; struct Scsi_Host *hostptr;
unsigned long f;
/* if someone is sending us data, just throw it away */ /* if someone is sending us data, just throw it away */
if (inout) if (inout)
...@@ -284,6 +285,7 @@ static int usb_storage_proc_info (char *buffer, char **start, off_t offset, ...@@ -284,6 +285,7 @@ static int usb_storage_proc_info (char *buffer, char **start, off_t offset,
/* if we couldn't find it, we return an error */ /* if we couldn't find it, we return an error */
if (!us) { if (!us) {
scsi_host_put(hostptr);
return -ESRCH; return -ESRCH;
} }
...@@ -299,6 +301,24 @@ static int usb_storage_proc_info (char *buffer, char **start, off_t offset, ...@@ -299,6 +301,24 @@ static int usb_storage_proc_info (char *buffer, char **start, off_t offset,
SPRINTF(" Protocol: %s\n", us->protocol_name); SPRINTF(" Protocol: %s\n", us->protocol_name);
SPRINTF(" Transport: %s\n", us->transport_name); SPRINTF(" Transport: %s\n", us->transport_name);
/* show the device flags */
if (pos < buffer + length) {
pos += sprintf(pos, " Quirks:");
f = us->flags;
#define DO_FLAG(a) if (f & US_FL_##a) pos += sprintf(pos, " " #a)
DO_FLAG(SINGLE_LUN);
DO_FLAG(MODE_XLATE);
DO_FLAG(START_STOP);
DO_FLAG(IGNORE_SER);
DO_FLAG(SCM_MULT_TARG);
DO_FLAG(FIX_INQUIRY);
DO_FLAG(FIX_CAPACITY);
#undef DO_FLAG
*(pos++) = '\n';
}
/* release the reference count on this host */ /* release the reference count on this host */
scsi_host_put(hostptr); scsi_host_put(hostptr);
......
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