This fixes the following compilation error/warning:
In file included from ../tests/header_checker.cpp:6:
../include/usbg/function/net.h: In function ‘int usbg_f_net_set_subclass(usbg_f_net*, unsigned int)’:
../include/usbg/function/net.h:278:67: error: narrowing conversion of ‘subclass’ from ‘unsigned int’ to ‘int’ [-Werror=narrowing]
278 | USBG_F_NET_INT_TO_ATTR_VAL(subclass));
| ^~~~~~~~
../include/usbg/usbg.h:61:34: note: in definition of macro ‘USBG_TO_UNION’
61 | ((union UNAME){ .FIELD = WHAT, })
| ^~~~
../include/usbg/function/net.h:278:40: note: in expansion of macro ‘USBG_F_NET_INT_TO_ATTR_VAL’
278 | USBG_F_NET_INT_TO_ATTR_VAL(subclass));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../include/usbg/function/net.h: In function ‘int usbg_f_net_set_protocol(usbg_f_net*, unsigned int)’:
../include/usbg/function/net.h:302:67: error: narrowing conversion of ‘protocol’ from ‘unsigned int’ to ‘int’ [-Werror=narrowing]
302 | USBG_F_NET_INT_TO_ATTR_VAL(protocol));
| ^~~~~~~~
../include/usbg/usbg.h:61:34: note: in definition of macro ‘USBG_TO_UNION’
61 | ((union UNAME){ .FIELD = WHAT, })
| ^~~~
../include/usbg/function/net.h:302:40: note: in expansion of macro ‘USBG_F_NET_INT_TO_ATTR_VAL’
302 | USBG_F_NET_INT_TO_ATTR_VAL(protocol));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
In the kernel qmult is also from type unsigned int which alignes with
the rest of this struct and resolves the above compile issue.
These are accessed in a way that can otherwise cause values to bleed
between members.
I suspect that this library may be completely broken on big-endian.
When using uncompressed video formats other then the default
YUYV, the user of the uvc gadget needs to set the proper GUID
format. Together with that GUID format it is needed to set
an corresponding BitsPerPixel value. This patch is adding
support to set the values via libusbgx/gadget-tool.
This patch adds the possibility to set additional configuration
parameters in configfs for uac2.
It adds the controls:
{c,p}_volume_present capture/playback volume control enable
{c,p}_mute_present capture/playback mute control enable
{c,p}_volume_min capture/playback volume control min value (in 1/256 dB)
{c,p}_volume_max capture/playback volume control max value (in 1/256 dB)
{c,p}_volume_res capture/playback volume control resolution (in 1/256 dB)
{c,p}_hs_bint capture/playback bInterval for HS/SS (1-4: fixed, 0: auto)
c_sync capture synchronization type (async/adaptive)
req_number the number of pre-allocated requests for both capture and playback
fb_max maximum extra bandwidth in async mode
(from kernel:Documentation/ABI/testing/configfs-usb-gadget-uac2)
If built with tests disabled make distclean fails.
make distclean considers all DIST_SUBDIRS for cleaning.
Therefore the Makefile in all listed directories need
to be created.
Signed-off-by: Manuel Traut <manut@mecka.net>
In commit: abf422bffc
[
Author: Stefan Agner <stefan.agner@toradex.com>
Date: Tue Jan 24 14:22:25 2017 -0800
libusbgx: Add interface name for Feature Descriptors
This adds interface name required for "Feature Descriptors". If
specified, we can assume that a Feature Descriptor with the
interface name of the specified string is understood by the
kernel (e.g. interface.rndis).
]
it only added Feature Descriptors for RNDIS, NCM also needs that, or
else it could not be recognized by Windows systems.
Add Feature Descriptors interface name for NCM.
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
This commit allows the library user to change class, subclass and
protocol values inside net derivated functions. This is needed by
Windows 10 users using RNDIS function with the native driver.
The functions config parameters like maxburst, maxpacket, interval
and function_name are possible to be set by scheme file
as well. This patch adds support to import and export
these variables.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
The return value of scandir is used in init_frames to iterate over
the elements. The iteration is done over nmb not ret. So this patch
is fixing this to fill the right variable.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
When the one of the supported formats is missing in the
configfs layout, currently the export function will run
into an error. We fix it by just passing 0 if the format
is missing to keep on parsing.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
The function init_frames is falsely checking for the negative
result from scandir on an unsigned variable. This will never
be true.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>