Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: gadget: f_fs: Document eventfd effect on descriptor format.

When FUNCTIONFS_EVENTFD flag is set, __ffs_data_got_descs reads a 32bits,
little-endian value right after the fixed structure header, and passes it
to eventfd_ctx_fdget. Document this.

Also, rephrase a comment to be affirmative about the role of string
descriptor at index 0. Ref: USB 2.0 spec paragraph "9.6.7 String", and
also checked to still be current in USB 3.0 spec paragraph "9.6.9 String".

Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

authored by

Vincent Pelletier and committed by
Felipe Balbi
96a420d2 7e4da3fc

+3 -2
+2 -2
drivers/usb/gadget/function/f_fs.c
··· 2091 2091 2092 2092 case FFS_STRING: 2093 2093 /* 2094 - * Strings are indexed from 1 (0 is magic ;) reserved 2095 - * for languages list or some such) 2094 + * Strings are indexed from 1 (0 is reserved 2095 + * for languages list) 2096 2096 */ 2097 2097 if (*valuep > helper->ffs->strings_count) 2098 2098 helper->ffs->strings_count = *valuep;
+1
include/uapi/linux/usb/functionfs.h
··· 93 93 * | 0 | magic | LE32 | FUNCTIONFS_DESCRIPTORS_MAGIC_V2 | 94 94 * | 4 | length | LE32 | length of the whole data chunk | 95 95 * | 8 | flags | LE32 | combination of functionfs_flags | 96 + * | | eventfd | LE32 | eventfd file descriptor | 96 97 * | | fs_count | LE32 | number of full-speed descriptors | 97 98 * | | hs_count | LE32 | number of high-speed descriptors | 98 99 * | | ss_count | LE32 | number of super-speed descriptors |