summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/show-gadgets.c4
-rw-r--r--src/usbg.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/examples/show-gadgets.c b/examples/show-gadgets.c
index aa4275c..7ff71d5 100644
--- a/examples/show-gadgets.c
+++ b/examples/show-gadgets.c
@@ -104,6 +104,7 @@ void show_function(usbg_function *f)
fprintf(stdout, " Function, type: %s instance: %s\n",
usbg_get_function_type_str(type), instance);
+
switch (f_attrs.header.attrs_type) {
case USBG_F_ATTRS_SERIAL:
fprintf(stdout, " port_num\t\t%d\n",
@@ -122,6 +123,7 @@ void show_function(usbg_function *f)
fprintf(stdout, " qmult\t\t%d\n", f_net_attrs->qmult);
break;
}
+
case USBG_F_ATTRS_PHONET:
fprintf(stdout, " ifname\t\t%s\n", f_attrs.attrs.phonet.ifname);
break;
@@ -129,6 +131,7 @@ 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;
@@ -146,6 +149,7 @@ void show_function(usbg_function *f)
}
break;
}
+
default:
fprintf(stdout, " UNKNOWN\n");
}
diff --git a/src/usbg.c b/src/usbg.c
index 4d0beed..385a862 100644
--- a/src/usbg.c
+++ b/src/usbg.c
@@ -1093,6 +1093,7 @@ static int usbg_parse_function_attrs(usbg_function *f,
ret = USBG_SUCCESS;
break;
}
+
case USBG_F_ATTRS_MS:
f_attrs->header.attrs_type = USBG_F_ATTRS_MS;
ret = usbg_parse_function_ms_attrs(f, &(f_attrs->attrs.ms));
@@ -2898,6 +2899,7 @@ void usbg_cleanup_function_attrs(usbg_function_attrs *f_attrs)
free(attrs->ffs.dev_name);
attrs->ffs.dev_name = NULL;
break;
+
case USBG_F_ATTRS_MS:
{
int i;
@@ -2919,6 +2921,7 @@ void usbg_cleanup_function_attrs(usbg_function_attrs *f_attrs)
ms_break:
break;
}
+
default:
ERROR("Unsupported attrs type\n");
break;
@@ -3162,9 +3165,11 @@ int usbg_set_function_attrs(usbg_function *f,
ret = f_attrs->attrs.ffs.dev_name && f_attrs->attrs.ffs.dev_name[0] ?
USBG_ERROR_INVALID_PARAM : USBG_SUCCESS;
break;
+
case USBG_F_ATTRS_MS:
ret = usbg_set_function_ms_attrs(f, &f_attrs->attrs.ms);
break;
+
default:
ERROR("Unsupported function type\n");
ret = USBG_ERROR_NOT_SUPPORTED;