aboutsummaryrefslogtreecommitdiff
path: root/lib/usb/usb_private.h
diff options
context:
space:
mode:
authorAndrey Smirnov2012-11-06 16:46:55 -0800
committerAndrey Smirnov2012-11-06 16:46:55 -0800
commit7a5da60e2669c57d7b615aabe16ab851606f8bf1 (patch)
treebd28597a5b20d7f21379cd3640898ac58a57d3a3 /lib/usb/usb_private.h
parent74405de4a5a1beab4023731de41c9f6e1c7f69a4 (diff)
Change USB strings handling code
This commit add an extra field to the _usbd_device, that allows to keep track of the number of USB strings which allows simplify boundaries checking code in usb_standard_get_descriptor. This commit also changes the index base for strings in usb_standard_get_descriptor which allows to get rid of necessity to have a dummy one-character string in a strings array.
Diffstat (limited to 'lib/usb/usb_private.h')
-rw-r--r--lib/usb/usb_private.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/usb/usb_private.h b/lib/usb/usb_private.h
index a1e5e4c..238f14f 100644
--- a/lib/usb/usb_private.h
+++ b/lib/usb/usb_private.h
@@ -29,6 +29,7 @@ extern struct _usbd_device {
const struct usb_device_descriptor *desc;
const struct usb_config_descriptor *config;
const char **strings;
+ int num_strings;
u8 *ctrl_buf; /**< Internal buffer used for control transfers */
u16 ctrl_buf_len;