diff options
author | Krzysztof Opasiak <k.opasiak@samsung.com> | 2015-04-14 11:57:44 +0200 |
---|---|---|
committer | Krzysztof Opasiak <k.opasiak@samsung.com> | 2015-04-27 10:14:35 +0200 |
commit | 50b6201178d6ebc04874bb220c85dbe29d736f5a (patch) | |
tree | a4d76e58f99b465833ae19e047f592e372dadf84 /examples | |
parent | 6ec3444145226aa7145b1930a587dbbf892f919c (diff) | |
download | libusbg-50b6201178d6ebc04874bb220c85dbe29d736f5a.tar.gz libusbg-50b6201178d6ebc04874bb220c85dbe29d736f5a.tar.bz2 libusbg-50b6201178d6ebc04874bb220c85dbe29d736f5a.zip |
libusbg: Update example to show also mass storage function
Mass storage functions has been recently added to libusbg
so update show-gadgets example to show also attributes of
mass storage function.
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Reviewed-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/show-gadgets.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/show-gadgets.c b/examples/show-gadgets.c index f8bad33..aa4275c 100644 --- a/examples/show-gadgets.c +++ b/examples/show-gadgets.c @@ -129,6 +129,23 @@ void show_function(usbg_function *f) case USBG_F_ATTRS_FFS: fprintf(stdout, " dev_name\t\t%s\n", f_attrs.attrs.ffs.dev_name); break; + case USBG_F_ATTRS_MS: + { + usbg_f_ms_attrs *attrs = &f_attrs.attrs.ms; + int i; + + fprintf(stdout, " stall\t\t%d\n", attrs->stall); + fprintf(stdout, " nluns\t\t%d\n", attrs->nluns); + for (i = 0; i < attrs->nluns; ++i) { + fprintf(stdout, " lun %d:\n", attrs->luns[i]->id); + fprintf(stdout, " cdrom\t\t%d\n", attrs->luns[i]->cdrom); + fprintf(stdout, " ro\t\t%d\n", attrs->luns[i]->ro); + fprintf(stdout, " nofua\t\t%d\n", attrs->luns[i]->nofua); + fprintf(stdout, " removable\t\t%d\n", attrs->luns[i]->removable); + fprintf(stdout, " file\t\t%s\n", attrs->luns[i]->filename); + } + break; + } default: fprintf(stdout, " UNKNOWN\n"); } |