usb:tools: usb unittests framework
Subsystems (2)
PATCH 1/5 usb:tools: usb unittests framework
This patch introduces a user-space framework for developing unit tests in order to test the USB functionality of a connected device. These tests communicate with the USB device via libusb interface. They are meant to run with the g_zero and dummy_hcd module since several proprietary control messages were added to those modules. But a smaller subset of the tests can be run on any USB device and on real UDCs.
Implemented tests:
1. Test device descriptors - this test is applicable both for HS and SS devices
2. Test the SET_FEATURE requests
3. Test bulk in
4. Test bulk out
5. Test connect/disconnect
6. Streams capability testing
7. UAS test suite
This patch also includes patches that should be applied to libusb. Some of them were already sent upstream for approval but not yet accepted. Other will be sent in the near future.
For more info please read the files under Documentation.
--- .../usb/unittests/Documentation/autoconfig_readme | 20 + .../usb/unittests/Documentation/create-gadget-img | 47 + tools/usb/unittests/Documentation/unittests-info | 526 +++++ tools/usb/unittests/Documentation/unittests-setup | 127 ++ .../0001-Add-support-to-USB3-descriptors.patch | 420 ++++ ...2-Add-support-for-libusb_get_device_speed.patch | 172 ++ .../libusb_patches/0003-Add-UAS-defines.patch | 56 + .../0004-libusb-Add-stream-support-to-LIBUSB.patch | 314 +++ tools/usb/unittests/make/Makefile | 132 ++ tools/usb/unittests/make/autoconfig.sh | 118 ++ tools/usb/unittests/usb/UASP_CMD_tests.cc | 2140 ++++++++++++++++++++ tools/usb/unittests/usb/UASP_TM_tests.cc | 1207 +++++++++++ tools/usb/unittests/usb/UASP_tests.h | 434 ++++ tools/usb/unittests/usb/composite_tests.cc | 1645 +++++++++++++++ tools/usb/unittests/usb/composite_tests.h | 293 +++ tools/usb/unittests/usb/g_serial_tests.cc | 198 ++ tools/usb/unittests/usb/g_serial_tests.h | 68 + tools/usb/unittests/usb/hs_expected_desc.h | 164 ++ tools/usb/unittests/usb/libusb_utils.cc | 358 ++++ tools/usb/unittests/usb/libusb_utils.h | 149 ++ tools/usb/unittests/usb/ss_expected_desc.h | 291 +++ tools/usb/unittests/usb/streams_tests.cc | 243 +++ tools/usb/unittests/usb/streams_tests.h | 51 + tools/usb/unittests/usb/usb_devel_mode.cc | 185 ++ tools/usb/unittests/usb/usb_devel_mode.h | 50 + tools/usb/unittests/usb/usb_tests.cc | 651 ++++++ tools/usb/unittests/usb/usb_tests.h | 146 ++ tools/usb/unittests/usb/usb_tests_main.cc | 83 + tools/usb/unittests/usb/ut_config.h | 89 + 29 files changed, 10377 insertions(+), 0 deletions(-) create mode 100644 tools/usb/unittests/Documentation/autoconfig_readme create mode 100644 tools/usb/unittests/Documentation/create-gadget-img create mode 100644 tools/usb/unittests/Documentation/unittests-info create mode 100644 tools/usb/unittests/Documentation/unittests-setup create mode 100644 tools/usb/unittests/libusb_patches/0001-Add-support-to-USB3-descriptors.patch create mode 100644 tools/usb/unittests/libusb_patches/0002-Add-support-for-libusb_get_device_speed.patch create mode 100644 tools/usb/unittests/libusb_patches/0003-Add-UAS-defines.patch create mode 100644 tools/usb/unittests/libusb_patches/0004-libusb-Add-stream-support-to-LIBUSB.patch create mode 100644 tools/usb/unittests/make/Makefile create mode 100644 tools/usb/unittests/make/autoconfig.sh create mode 100644 tools/usb/unittests/usb/UASP_CMD_tests.cc create mode 100644 tools/usb/unittests/usb/UASP_TM_tests.cc create mode 100644 tools/usb/unittests/usb/UASP_tests.h create mode 100644 tools/usb/unittests/usb/composite_tests.cc create mode 100644 tools/usb/unittests/usb/composite_tests.h create mode 100644 tools/usb/unittests/usb/g_serial_tests.cc create mode 100644 tools/usb/unittests/usb/g_serial_tests.h create mode 100644 tools/usb/unittests/usb/hs_expected_desc.h create mode 100644 tools/usb/unittests/usb/libusb_utils.cc create mode 100644 tools/usb/unittests/usb/libusb_utils.h create mode 100644 tools/usb/unittests/usb/ss_expected_desc.h create mode 100644 tools/usb/unittests/usb/streams_tests.cc create mode 100644 tools/usb/unittests/usb/streams_tests.h create mode 100644 tools/usb/unittests/usb/usb_devel_mode.cc create mode 100644 tools/usb/unittests/usb/usb_devel_mode.h create mode 100644 tools/usb/unittests/usb/usb_tests.cc create mode 100644 tools/usb/unittests/usb/usb_tests.h create mode 100644 tools/usb/unittests/usb/usb_tests_main.cc create mode 100644 tools/usb/unittests/usb/ut_config.h
tools/usb/unittests/Documentation/autoconfig_readme new file +20 -0
@@ -0,0 +1,20 @@ + +Questions can be refereed to [email protected]. +Copyright (C) 2011 Code Aurora Forum. All rights reserved + +Description +----------- +This script is used to automatically configure the kernel .config file +(instead of using menuconfig). +This script should be ran after using defconfig. + +Please note that the script modifies the .config file under out-32 (and +should be executed in the out-32 directory). + +The script activates the dummy_HCD controller and configures the gadget +to operate in a SS mode. + +-- +Created by a consultant of the Qualcomm Innovation Center, Inc. +The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. +
tools/usb/unittests/Documentation/create-gadget-img new file +47 -0
48 lines not on this page · raw message
tools/usb/unittests/Documentation/unittests-info new file +526 -0
527 lines not on this page · raw message
tools/usb/unittests/Documentation/unittests-setup new file +127 -0
127 lines not on this page · raw message
tools/usb/unittests/libusb_patches/0001-Add-support-to-USB3-descriptors.patch new file +420 -0
421 lines not on this page · raw message
tools/usb/unittests/libusb_patches/0002-Add-support-for-libusb_get_device_speed.patch new file +172 -0
173 lines not on this page · raw message
tools/usb/unittests/libusb_patches/0003-Add-UAS-defines.patch new file +56 -0
57 lines not on this page · raw message
tools/usb/unittests/libusb_patches/0004-libusb-Add-stream-support-to-LIBUSB.patch new file +314 -0
315 lines not on this page · raw message
tools/usb/unittests/make/Makefile new file +132 -0
132 lines not on this page · raw message
tools/usb/unittests/make/autoconfig.sh new file +118 -0
119 lines not on this page · raw message
tools/usb/unittests/usb/UASP_CMD_tests.cc new file +2140 -0
1,061 lines not on this page · raw message
tools/usb/unittests/usb/UASP_TM_tests.cc new file +1207 -0
1,207 lines not on this page · raw message
tools/usb/unittests/usb/UASP_tests.h new file +434 -0
434 lines not on this page · raw message
tools/usb/unittests/usb/composite_tests.cc new file +1645 -0
1,645 lines not on this page · raw message
tools/usb/unittests/usb/composite_tests.h new file +293 -0
293 lines not on this page · raw message
tools/usb/unittests/usb/g_serial_tests.cc new file +198 -0
198 lines not on this page · raw message
tools/usb/unittests/usb/g_serial_tests.h new file +68 -0
68 lines not on this page · raw message
tools/usb/unittests/usb/hs_expected_desc.h new file +164 -0
164 lines not on this page · raw message
tools/usb/unittests/usb/libusb_utils.cc new file +358 -0
358 lines not on this page · raw message
tools/usb/unittests/usb/libusb_utils.h new file +149 -0
149 lines not on this page · raw message
tools/usb/unittests/usb/ss_expected_desc.h new file +291 -0
291 lines not on this page · raw message
tools/usb/unittests/usb/streams_tests.cc new file +243 -0
243 lines not on this page · raw message
tools/usb/unittests/usb/streams_tests.h new file +51 -0
51 lines not on this page · raw message
tools/usb/unittests/usb/usb_devel_mode.cc new file +185 -0
185 lines not on this page · raw message
tools/usb/unittests/usb/usb_devel_mode.h new file +50 -0
50 lines not on this page · raw message
tools/usb/unittests/usb/usb_tests.cc new file +651 -0
651 lines not on this page · raw message
tools/usb/unittests/usb/usb_tests.h new file +146 -0
146 lines not on this page · raw message
tools/usb/unittests/usb/usb_tests_main.cc new file +83 -0
83 lines not on this page · raw message
tools/usb/unittests/usb/ut_config.h new file +89 -0
89 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 5 lines
1.7.3.3 -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Part of the diff is not shown here. View the raw message.
PATCH 2/5 usb:dummy_hcd: connect/disconnect test support
This implementation adds a new proprietary device control requests (to be handled by the dummy_hcd) that initiates a connect/disconnect sequence. The bRequest value of the new control request is 0x52.
It is used by the user-space Unit testing application.
--- drivers/usb/gadget/dummy_hcd.c | 48 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 48 insertions(+), 0 deletions(-)
drivers/usb/gadget/dummy_hcd.c +48 -0
@@ -179,6 +179,7 @@ struct dummy_hcd { unsigned active:1; unsigned old_active:1; unsigned resuming:1; +struct work_struct conn_disc_work; };struct dummy {
@@ -1362,6 +1363,43 @@ static struct dummy_ep *find_endpoint (struct dummy *dum, u8 address)#define Ep_Request (USB_TYPE_STANDARD | USB_RECIP_ENDPOINT)#define Ep_InRequest (Ep_Request | USB_DIR_IN) +/** +* dummy_hcd_conn_disc_work() - performs a disconnect/connect sequence. +* @data: pointer to the sceduled work_struct +*/ +static void dummy_hcd_conn_disc_work (struct work_struct *data) +{ +struct dummy_hcd *dum_hcd = + container_of(data, struct dummy_hcd, conn_disc_work); +int ret_val; + +if (!dum_hcd->dum->driver) { +dev_err (dummy_dev (dum_hcd), +"dummy_hcd_conn_disc_work called without connected " +"device\n" ); +return ; + } + +dev_info (dummy_dev (dum_hcd),"disconnecting device...\n" ); + ret_val =dummy_pullup (&dum_hcd->dum->gadget,0 ); +if (ret_val) { +dev_err (dummy_dev (dum_hcd),"dummy_hcd_conn_disc_work:" +" couldn't disconnect device:" +" ret_val=%d\n" , + ret_val); +return ; + } + +dev_info (dummy_dev (dum_hcd),"re-connecting device...\n" ); +/* We have to let the hub task to update the device disconnect state */ +msleep_interruptible (1000 ); + ret_val =dummy_pullup (&dum_hcd->dum->gadget,1 ); +if (ret_val) +dev_err (dummy_dev (dum_hcd),"dummy_hcd_conn_disc_work:" +" couldn't re-connect device:" +" ret_val=%d\n" , + ret_val); +}/** * handle_control_request() - handles all control transfers
@@ -1534,6 +1572,10 @@ static int handle_control_request(struct dummy_hcd *dum_hcd, struct urb *urb, *status =0 ; }break ; +case 0x52 :/* UT: Connect/disconnect the device */ +schedule_work (&dum_hcd->conn_disc_work); + ret_val =0 ; +break ; }return ret_val; }
@@ -2249,6 +2291,8 @@ static int dummy_setup(struct usb_hcd *hcd)if (usb_hcd_is_primary_hcd (hcd)) { the_controller.hs_hcd =hcd_to_dummy_hcd (hcd); the_controller.hs_hcd->dum = &the_controller; +INIT_WORK (&the_controller.hs_hcd->conn_disc_work, + dummy_hcd_conn_disc_work);/* * Mark the first roothub as being USB 2.0. * The USB 3.0 roothub will be registered later by
@@ -2259,6 +2303,8 @@ static int dummy_setup(struct usb_hcd *hcd) }else { the_controller.ss_hcd =hcd_to_dummy_hcd (hcd); the_controller.ss_hcd->dum = &the_controller; +INIT_WORK (&the_controller.ss_hcd->conn_disc_work, + dummy_hcd_conn_disc_work); hcd->speed =HCD_USB3 ; hcd->self.root_hub->speed =USB_SPEED_SUPER ; }
@@ -2364,9 +2410,11 @@ static int dummy_hcd_remove (struct platform_device *pdev)if (dum->ss_hcd) {usb_remove_hcd (dummy_hcd_to_hcd (dum->ss_hcd));usb_put_hcd (dummy_hcd_to_hcd (dum->ss_hcd)); +cancel_work_sync (&dum->ss_hcd->conn_disc_work); }usb_remove_hcd (dummy_hcd_to_hcd (dum->hs_hcd));usb_put_hcd (dummy_hcd_to_hcd (dum->hs_hcd)); +cancel_work_sync (&dum->hs_hcd->conn_disc_work); the_controller.ss_hcd = the_controller.hs_hcd =NULL ;return 0 ; }
Signature · 9 lines
1.7.3.3 -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH/RFC 2/5] usb:dummy_hcd: connect/disconnect test support
Quoted 4 lines · Tatyana Brokhman
This implementation adds a new proprietary device control requests (to be handled by the
dummy_hcd) that initiates a connect/disconnect sequence. The bRequest value of the new control request is0x52.
It is used by the user-space Unit testing application.
This is not a bad idea. On the other hand, it is slightly peculiar -- it you're testing with real UDC hardware, you would do the disconnect/reconnect sequence by hand (unplug and replug the USB cable), not in software.
Quoted 19 lines
Signed-off-by Tatyana Linder <[email protected]>--- drivers/usb/gadget/dummy_hcd.c | 48 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 48 insertions(+), 0 deletions(-)drivers/usb/gadget/dummy_hcd.c +1
-0@@ -179,6 +179,7 @@ struct dummy_hcd { unsigned active:1; unsigned old_active:1; unsigned resuming:1; +struct work_struct conn_disc_work; };struct dummy {
drivers/usb/gadget/dummy_hcd.c static struct dummy_ep *find_endpoint (struct dummy *dum, u8 address) · line 1368
Quoted 6 lines
drivers/usb/gadget/dummy_hcd.c +3
-0@@ -1362,6 +1363,43 @@ static struct dummy_ep *find_endpoint (struct dummy *dum, u8 address)#define Ep_Request (USB_TYPE_STANDARD | USB_RECIP_ENDPOINT)#define Ep_InRequest (Ep_Request | USB_DIR_IN) +/** +* dummy_hcd_conn_disc_work() - performs a disconnect/connect sequence. +* @data: pointer to the sceduled work_struct
Spelling error.
Quoted 17 lines
drivers/usb/gadget/dummy_hcd.c +17
-0+*/ +static void dummy_hcd_conn_disc_work (struct work_struct *data) +{ +struct dummy_hcd *dum_hcd = + container_of(data, struct dummy_hcd, conn_disc_work); +int ret_val; + +if (!dum_hcd->dum->driver) { +dev_err (dummy_dev (dum_hcd), +"dummy_hcd_conn_disc_work called without connected " +"device\n" ); +return ; + } + +dev_info (dummy_dev (dum_hcd),"disconnecting device...\n" ); + ret_val =dummy_pullup (&dum_hcd->dum->gadget,0 ); +if (ret_val) {
drivers/usb/gadget/dummy_hcd.c static struct dummy_ep *find_endpoint (struct dummy *dum, u8 address) · line 1395
Quoted 10 lines
drivers/usb/gadget/dummy_hcd.c +10
-0+dev_err (dummy_dev (dum_hcd),"dummy_hcd_conn_disc_work:" +" couldn't disconnect device:" +" ret_val=%d\n" , + ret_val); +return ; + } + +dev_info (dummy_dev (dum_hcd),"re-connecting device...\n" ); +/* We have to let the hub task to update the device disconnect state */ +msleep_interruptible (1000 );
These two lines should come before the "re-connecting" message.
Quoted 11 lines
drivers/usb/gadget/dummy_hcd.c +7
-0+ ret_val =dummy_pullup (&dum_hcd->dum->gadget,1 ); +if (ret_val) +dev_err (dummy_dev (dum_hcd),"dummy_hcd_conn_disc_work:" +" couldn't re-connect device:" +" ret_val=%d\n" , + ret_val); +}/** * handle_control_request() - handles all control transfers
drivers/usb/gadget/dummy_hcd.c static int handle_control_request(struct dummy_hcd *dum_hcd, struct urb *urb, · line 1575
Quoted 4 lines
drivers/usb/gadget/dummy_hcd.c +1
-0@@ -1534,6 +1572,10 @@ static int handle_control_request(struct dummy_hcd *dum_hcd, struct urb *urb, *status =0 ; }break ; +case 0x52 :/* UT: Connect/disconnect the device */
Please define a symbolic constant for this. Also, nobody is going to know what "UT:" is supposed to mean.
The rest is okay.
Alan Stern
Re: [PATCH/RFC 2/5] usb:dummy_hcd: connect/disconnect test support
Hi,
Quoted 11 lines · Alan Stern
Quoted 4 lines · Tatyana Brokhman
This implementation adds a new proprietary device control requests (to be handled by the
dummy_hcd) that initiates a connect/disconnect sequence. The bRequest value of the new control request is0x52.
It is used by the user-space Unit testing application.This is not a bad idea. On the other hand, it is slightly peculiar -- it you're testing with real UDC hardware, you would do the disconnect/reconnect sequence by hand (unplug and replug the USB cable), not in software.
actually, this is quite useful. Specially for the controllers which _can_ do soft-connect by toggling data pullups. I would rather have these sort of thing maybe in composite.c, so that we can build tests with all gadget drivers/controllers, not only dummy_hcd.
That said, I think now it's not the time to fiddle too much with these details right now. So best to keep this in dummy_hcd until we know the test tools are actually good.
Signature · 1 line
balbi
Re: [PATCH/RFC 2/5] usb:dummy_hcd: connect/disconnect test support
Quoted 15 lines · Felipe Balbi
Hi,
Quoted 11 lines · Alan Stern
Quoted 4 lines · Tatyana Brokhman
This implementation adds a new proprietary device control requests (to be handled by the
dummy_hcd) that initiates a connect/disconnect sequence. The bRequest value of the new control request is0x52.
It is used by the user-space Unit testing application.This is not a bad idea. On the other hand, it is slightly peculiar -- it you're testing with real UDC hardware, you would do the disconnect/reconnect sequence by hand (unplug and replug the USB cable), not in software.
Quoted 4 lines
actually, this is quite useful. Specially for the controllers which _can_ do soft-connect by toggling data pullups. I would rather have these sort of thing maybe in
composite.c, so that we can build tests with all gadgetdrivers/controllers, not onlydummy_hcd.
It sounds like you don't understand the point of this patch. It allows the _host_ to control the pullup settings.
Alan Stern
Re: [PATCH/RFC 2/5] usb:dummy_hcd: connect/disconnect test support
Quoted 17 lines · Alan Stern
Quoted 15 lines · Felipe Balbi
Hi,
Quoted 11 lines · Alan Stern
Quoted 4 lines · Tatyana Brokhman
This implementation adds a new proprietary device control requests (to be handled by the
dummy_hcd) that initiates a connect/disconnect sequence. The bRequest value of the new control request is0x52.
It is used by the user-space Unit testing application.This is not a bad idea. On the other hand, it is slightly peculiar -- it you're testing with real UDC hardware, you would do the disconnect/reconnect sequence by hand (unplug and replug the USB cable), not in software.
Quoted 7 lines
Quoted 4 lines
actually, this is quite useful. Specially for the controllers which _can_ do soft-connect by toggling data pullups. I would rather have these sort of thing maybe in
composite.c, so that we can build tests with all gadgetdrivers/controllers, not onlydummy_hcd.It sounds like you don't understand the point of this patch. It allows the _host_ to control the pullup settings.
Sorry, the misunderstanding was mine -- I didn't grasp what you were suggesting.
Yes, something like this could be useful in composite.c. It could be defined as a vendor-specific request with the device as the recipient.
One problem with making it special for dummy-hcd is that it would prevent people from testing gadget drivers that want to use the same bRequest value to mean something different. Putting it in composite.c would force all function drivers to know about it.
Alan Stern
Re: [PATCH/RFC 2/5] usb:dummy_hcd: connect/disconnect test support
In reply to Tatyana BrokhmanQuoted 8 lines · Tatyana Brokhman
This implementation adds a new proprietary device control requests (to be handled by the
dummy_hcd) that initiates a connect/disconnect sequence. The bRequest value of the new control request is0x52.
It is used by the user-space Unit testing application.Signed-off-by Tatyana Linder <[email protected]>
drivers/usb/gadget/dummy_hcd.c static int handle_control_request(struct dummy_hcd *dum_hcd, struct urb *urb, · line 1581
Quoted 10 lines
drivers/usb/gadget/dummy_hcd.c +4
-0@@ -1534,6 +1572,10 @@ static int handle_control_request(struct dummy_hcd *dum_hcd, struct urb *urb, *status =0 ; }break ; +case 0x52 :/* UT: Connect/disconnect the device */ +schedule_work (&dum_hcd->conn_disc_work); + ret_val =0 ; +break ; }return ret_val; }
I forgot to mention... You need to test setup->bRequestType.
Alan Stern
Re: [PATCH/RFC 2/5] usb:dummy_hcd: connect/disconnect test support
In reply to Tatyana BrokhmanHi,
Quoted 30 lines · Tatyana Brokhman
drivers/usb/gadget/dummy_hcd.c +26
-0@@ -1362,6 +1363,43 @@ static struct dummy_ep *find_endpoint (struct dummy *dum, u8 address)#define Ep_Request (USB_TYPE_STANDARD | USB_RECIP_ENDPOINT)#define Ep_InRequest (Ep_Request | USB_DIR_IN) +/** +* dummy_hcd_conn_disc_work() - performs a disconnect/connect sequence. +* @data: pointer to the sceduled work_struct +*/ +static void dummy_hcd_conn_disc_work (struct work_struct *data) +{ +struct dummy_hcd *dum_hcd = + container_of(data, struct dummy_hcd, conn_disc_work); +int ret_val; + +if (!dum_hcd->dum->driver) { +dev_err (dummy_dev (dum_hcd), +"dummy_hcd_conn_disc_work called without connected " +"device\n" ); +return ; + } + +dev_info (dummy_dev (dum_hcd),"disconnecting device...\n" ); + ret_val =dummy_pullup (&dum_hcd->dum->gadget,0 ); +if (ret_val) { +dev_err (dummy_dev (dum_hcd),"dummy_hcd_conn_disc_work:" +" couldn't disconnect device:" +" ret_val=%d\n" , + ret_val); +return ; + }
drivers/usb/gadget/dummy_hcd.c static struct dummy_ep *find_endpoint (struct dummy *dum, u8 address) · line 1401
Quoted 10 lines
drivers/usb/gadget/dummy_hcd.c +10
-0+ +dev_info (dummy_dev (dum_hcd),"re-connecting device...\n" ); +/* We have to let the hub task to update the device disconnect state */ +msleep_interruptible (1000 ); + ret_val =dummy_pullup (&dum_hcd->dum->gadget,1 ); +if (ret_val) +dev_err (dummy_dev (dum_hcd),"dummy_hcd_conn_disc_work:" +" couldn't re-connect device:" +" ret_val=%d\n" , + ret_val);
this print is quite ugly. How about something like:
dev_err(dummy_dev(dum_hcd), "%s: couldn't re-connect --> %d\n", __func__, ret_val);
???
Signature · 1 line
balbi
PATCH 3/5 usb:g_zero: bulk in/out unittest support
In reply to Tatyana BrokhmanThis commit adds a new vendor specific request to be handled by the g_zero module in it's sourcesink configuration. The purpose if this request is to update the length of the BULK transfer to a given value. The bRequest value of the new control request is 0x5e.
It is used by the user-space Unit testing application for bulk in/out tests.
--- drivers/usb/gadget/f_sourcesink.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
drivers/usb/gadget/f_sourcesink.c +12 -0
@@ -70,6 +70,7 @@ static unsigned pattern;module_param (pattern, uint,0 );MODULE_PARM_DESC (pattern,"0 = all zeroes, 1 = mod63 " ); +static struct f_sourcesink *the_sourcesink;/*-------------------------------------------------------------------------*/ static struct usb_interface_descriptor source_sink_intf = {
@@ -197,6 +198,7 @@ static void sourcesink_unbind(struct usb_configuration *c, struct usb_function *f) {kfree (func_to_ss(f )); + the_sourcesink =NULL ; }/* optionally require specific source/sink data patterns */
@@ -425,6 +427,7 @@ static int __init sourcesink_bind_config(struct usb_configuration *c) status =usb_add_function (c, &ss->function);if (status)kfree (ss); + the_sourcesink = ss;return status; }
@@ -472,6 +475,15 @@ static int sourcesink_setup(struct usb_configuration *c, value = w_length;break ; +case 0x5e : +/* +* Change bulk ep buffer size. buflen is the length of +* the BULK transfer (req->length=buflen). Defined in g_zero.h +*/ +disable_source_sink (the_sourcesink); + buflen = w_value; + value =enable_source_sink (c->cdev, the_sourcesink); +break ;default : unknown: VDBG(c->cdev,
Signature · 5 lines
1.7.3.3 -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Re: [PATCH/RFC 3/5] usb:g_zero: bulk in/out unittest support
Hi,
Quoted 18 lines · Tatyana Brokhman
This commit adds a new vendor specific request to be handled by the
g_zeromodule in it's sourcesink configuration. The purpose if this request is to update the length of the BULK transfer to a given value. The bRequest value of the new control request is0x5e.
It is used by the user-space Unit testing application for bulk in/out tests.Signed-off-by Tatyana Brokhman <[email protected]>--- drivers/usb/gadget/f_sourcesink.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)drivers/usb/gadget/f_sourcesink.c +0
-0
drivers/usb/gadget/f_sourcesink.c static unsigned pattern; · line 73
Quoted 4 lines
drivers/usb/gadget/f_sourcesink.c +1
-0@@ -70,6 +70,7 @@ static unsigned pattern;module_param (pattern, uint,0 );MODULE_PARM_DESC (pattern,"0 = all zeroes, 1 = mod63 " ); +static struct f_sourcesink *the_sourcesink;
this is a big no-no. f_*.c should always be able to be instantiated as many times as we need.
Quoted 23 lines
drivers/usb/gadget/f_sourcesink.c +2
-0/*-------------------------------------------------------------------------*/ static struct usb_interface_descriptor source_sink_intf = {@@ -197,6 +198,7 @@ static void sourcesink_unbind(struct usb_configuration *c, struct usb_function *f) {kfree (func_to_ss(f )); + the_sourcesink =NULL ; }/* optionally require specific source/sink data patterns */ @@ -425,6 +427,7 @@ static int __init sourcesink_bind_config(struct usb_configuration *c) status =usb_add_function (c, &ss->function);if (status)kfree (ss); + the_sourcesink = ss;return status; }@@ -472,6 +475,15 @@ static int sourcesink_setup(struct usb_configuration *c, value = w_length;break ;
drivers/usb/gadget/f_sourcesink.c static int sourcesink_setup(struct usb_configuration *c, · line 487
Quoted 10 lines
drivers/usb/gadget/f_sourcesink.c +9
-0+case 0x5e : +/* +* Change bulk ep buffer size. buflen is the length of +* the BULK transfer (req->length=buflen). Defined in g_zero.h +*/ +disable_source_sink (the_sourcesink); + buflen = w_value; + value =enable_source_sink (c->cdev, the_sourcesink); +break ;default :
I think this request, should be handled by the f_sourcesink interface. Meaning you'd need to introduce another f_sourcesink_setup(); to be added to the function, rather then the configuration.
Please change that.
Signature · 1 line
balbi
PATCH 4/5 usb:dummy_hcd: Disable single-request fifo in dummy hcd
In reply to Tatyana BrokhmanThis is not the actual behavior of the udc, thus it's removed.
This patch is needed for several of UAS test to pass.
--- drivers/usb/gadget/dummy_hcd.c | 26 +------------------------- 1 files changed, 1 insertions(+), 25 deletions(-)
drivers/usb/gadget/dummy_hcd.c +0 -16
@@ -608,11 +608,6 @@ dummy_free_request (struct usb_ep *_ep, struct usb_request *_req)kfree (req); } -static void -fifo_complete (struct usb_ep *ep,struct usb_request *req) -{ -} -static int dummy_queue (struct usb_ep *_ep,struct usb_request *_req,gfp_t mem_flags)
@@ -648,26 +643,7 @@ dummy_queue (struct usb_ep *_ep, struct usb_request *_req, _req->actual =0 ;spin_lock_irqsave (&dum->lock, flags); -/* implement an emulated single-request FIFO */ -if (ep->desc && (ep->desc->bEndpointAddress &USB_DIR_IN ) && -list_empty (&dum->fifo_req.queue) && -list_empty (&ep->queue) && - _req->length <=FIFO_SIZE ) { - req = &dum->fifo_req; - req->req = *_req; - req->req.buf = dum->fifo_buf; -memcpy (dum->fifo_buf, _req->buf, _req->length); - req->req.context = dum; - req->req.complete = fifo_complete;
Re: [PATCH/RFC 4/5] usb:dummy_hcd: Disable single-request fifo in dummy hcd
Quoted 1 line · Tatyana Brokhman
This is not the actual behavior of the udc, thus it's removed.
I don't understand. What UDC are you talking about? This _is_ the actual behavior of the net2280 (depending on which endpoint you're looking at and how the device is configured).
Quoted 1 line
This patch is needed for several of UAS test to pass.
Then the tests are broken. NAK.
Alan Stern
PATCH 5/5 usb: Add support for streams alloc/dealloc to devio.c
In reply to Tatyana BrokhmanAllow user space applications such as LIBUSB, to request streams alloc/dealloc from HCD that implements XHCI.
--- drivers/usb/core/devio.c | 128 +++++++++++++++++++++++++++++++++++++++++- include/linux/usbdevice_fs.h | 5 ++ 2 files changed, 132 insertions(+), 1 deletions(-)
drivers/usb/core/devio.c +127 -1
@@ -943,6 +943,115 @@ static int proc_clearhalt(struct dev_state *ps, void __user *arg)return usb_clear_halt (ps->dev, pipe); } +static int proc_allocstreams (struct dev_state *ps,void __user *arg) +{ +unsigned int ep_map; +int ret; +int intf_num; +struct usb_interface *intf =NULL ; +const int max_eps =32 ; +int max_streams =0 ; +struct usb_host_endpoint *eps[max_eps]; +int num_eps =0 ; +int i; +unsigned int ep; + +if (get_user (ep_map, (unsigned int __user *)arg)) +return -EFAULT ; + +for (i =0 ; i < max_eps; i++) { +if (ep_map & (0x1 << i)) { +/* Convert from i to ep address */ +if (i <16 )/* IN EP */ + ep = i |USB_ENDPOINT_DIR_MASK ; +else /* OUT EP */ + ep = (i -16 ); + + intf_num =findintfep (ps->dev, ep); +if (intf_num <0 ) +return intf_num; + ret =checkintf (ps, intf_num); +if (ret) +return ret; + intf =usb_ifnum_to_if (ps->dev, intf_num); +if (!intf) +return -ENOENT ; + +if (ep &USB_ENDPOINT_DIR_MASK ) + eps[num_eps] = ps->dev->ep_in[ep & +USB_ENDPOINT_NUMBER_MASK ]; +else + eps[num_eps] = ps->dev->ep_out[ep & +USB_ENDPOINT_NUMBER_MASK ]; + +if (!max_streams) + max_streams =USB_SS_MAX_STREAMS ( + eps[num_eps]->ss_ep_comp.bmAttributes); + + num_eps++; + } + } + +if (!intf || !max_streams) +return -ENOENT ; + + ret =usb_alloc_streams (intf, eps, num_eps, max_streams,GFP_KERNEL ); +if (ret >0 ) +return 0 ; +return ret; +} + +static int proc_freestreams (struct dev_state *ps,void __user *arg) +{ +unsigned int ep_map; +int ret; +int intf_num; +struct usb_interface *intf =NULL ; +const int max_eps =32 ; +struct usb_host_endpoint *eps[max_eps]; +int num_eps =0 ; +int i; +unsigned int ep; + +if (get_user (ep_map, (unsigned int __user *)arg)) +return -EFAULT ; + +for (i =0 ; i < max_eps; i++) { +if (ep_map & (0x1 << i)) { +/* Convert from i to ep address */ +if (i <16 )/* IN EP */ + ep = i |USB_ENDPOINT_DIR_MASK ; +else /* OUT EP */ + ep = (i -16 ); + + intf_num =findintfep (ps->dev, ep); +if (intf_num <0 ) +return intf_num; + ret =checkintf (ps, intf_num); +if (ret) +return ret; + intf =usb_ifnum_to_if (ps->dev, intf_num); +if (!intf) +return -ENOENT ; + +if (ep &USB_ENDPOINT_DIR_MASK ) + eps[num_eps] = ps->dev->ep_in[ep & +USB_ENDPOINT_NUMBER_MASK ]; +else + eps[num_eps] = ps->dev->ep_out[ep & +USB_ENDPOINT_NUMBER_MASK ]; + + num_eps++; + } + } + +if (!intf) +return -ENOENT ; + +usb_free_streams (intf, eps, num_eps,GFP_KERNEL ); +return 0 ; +} +static int proc_getdriver (struct dev_state *ps,void __user *arg) {struct usbdevfs_getdriver gd;
@@ -1236,6 +1345,8 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, u |=URB_NO_INTERRUPT ; as->urb->transfer_flags = u; + as->urb->stream_id = (uurb->type ==USBDEVFS_URB_TYPE_BULK ) ? + uurb->stream_id :0 ; as->urb->transfer_buffer_length = uurb->buffer_length; as->urb->setup_packet = (unsigned char *)dr; as->urb->start_frame = uurb->start_frame;
@@ -1491,7 +1602,8 @@ static int get_urb32(struct usbdevfs_urb *kurb,__get_user (kurb->start_frame, &uurb->start_frame) ||__get_user (kurb->number_of_packets, &uurb->number_of_packets) ||__get_user (kurb->error_count, &uurb->error_count) || - __get_user(kurb->signr, &uurb->signr)) +__get_user (kurb->signr, &uurb->signr) || + __get_user(kurb->stream_id, &uurb->stream_id)) return -EFAULT;if (__get_user (uptr, &uurb->buffer))
@@ -1795,6 +1907,20 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, inode->i_mtime =CURRENT_TIME ;break ; +case USBDEVFS_ALLOC_STREAMS : +snoop (&dev->dev,"%s: ALLOC_STREAMS\n" , __func__); + ret =proc_allocstreams (ps, p); +if (ret >=0 ) + inode->i_mtime =CURRENT_TIME ; +break ; + +case USBDEVFS_FREE_STREAMS : +snoop (&dev->dev,"%s: FREE_STREAMS\n" , __func__); + ret =proc_freestreams (ps, p); +if (ret >=0 ) + inode->i_mtime =CURRENT_TIME ; +break ; +case USBDEVFS_GETDRIVER :snoop (&dev->dev,"%s: GETDRIVER\n" , __func__); ret =proc_getdriver (ps, p);
include/linux/usbdevice_fs.h +5 -0
@@ -108,6 +108,7 @@ struct usbdevfs_urb {or 0 if none should be sent. */ void __user *usercontext;struct usbdevfs_iso_packet_desc iso_frame_desc[0 ]; +unsigned int stream_id; };/* ioctls for talking directly to drivers */
@@ -165,6 +166,7 @@ struct usbdevfs_urb32 {compat_uint_t signr;compat_caddr_t usercontext;/* unused */ struct usbdevfs_iso_packet_desc iso_frame_desc[0 ]; +compat_uint_t stream_id; };struct usbdevfs_ioctl32 {
@@ -204,4 +206,7 @@ struct usbdevfs_ioctl32 {#define USBDEVFS_CONNECT _IO('U', 23)#define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int)#define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int) +#define USBDEVFS_ALLOC_STREAMS _IOR('U', 26, unsigned int) +#define USBDEVFS_FREE_STREAMS _IOR('U', 27, unsigned int) +#endif /* _LINUX_USBDEVICE_FS_H */
Signature · 5 lines
1.7.3.3 -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
Quoted 5 lines · Tatyana Brokhman
Allow user space applications such as LIBUSB, to request streams alloc/dealloc from HCD that implements XHCI.
Signed-off-by Amit Blay <ablay-zC7DfRvBq/JWk0Htik3J/[email protected]>Signed-off-by Tatyana Brokhman <[email protected]>
...
Quoted 13 lines
include/linux/usbdevice_fs.h +1
-0@@ -108,6 +108,7 @@ struct usbdevfs_urb {or 0 if none should be sent. */ void __user *usercontext;struct usbdevfs_iso_packet_desc iso_frame_desc[0 ]; +unsigned int stream_id; };/* ioctls for talking directly to drivers */
include/linux/usbdevice_fs.h struct usbdevfs_urb32 { · line 170
Quoted 5 lines
include/linux/usbdevice_fs.h +1
-0@@ -165,6 +166,7 @@ struct usbdevfs_urb32 {compat_uint_t signr;compat_caddr_t usercontext;/* unused */ struct usbdevfs_iso_packet_desc iso_frame_desc[0 ]; +compat_uint_t stream_id; };
It would be nice if we could do this, but we can't. We are not allowed to change an established ABI. Every copy of libusb would have to be rebuilt.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
In reply to Tatyana BrokhmanQuoted 5 lines · Tatyana Brokhman
Allow user space applications such as LIBUSB, to request streams alloc/dealloc from HCD that implements XHCI.
Signed-off-by Amit Blay <[email protected]>Signed-off-by Tatyana Brokhman <[email protected]>
other than what Alan said, this needs major splitting. This patch is too big. First we need to discuss the ABI details with the guys at libusb-devel, then we implement.
Signature · 1 line
balbi
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
Quoted 10 lines · Felipe Balbi
Quoted 5 lines · Tatyana Brokhman
Allow user space applications such as LIBUSB, to request streams alloc/dealloc from HCD that implements XHCI.
Signed-off-by Amit Blay <[email protected]>Signed-off-by Tatyana Brokhman <[email protected]>other than what Alan said, this needs major splitting. This patch is too big. First we need to discuss the ABI details with the guys at libusb-devel, then we implement.
No, we don't break the abi, but rather, create a new one for streams, and then we can work on adding them to libusb, which should be quite easy when done.
thanks,
greg k-h
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
Quoted 12 lines · Felipe Balbi
Quoted 10 lines · Tatyana Brokhman
Quoted 5 lines
Allow user space applications such as LIBUSB, to request streams alloc/dealloc from HCD that implements XHCI.
Signed-off-by Amit Blay <[email protected]>Signed-off-by Tatyana Brokhman <[email protected]>other than what Alan said, this needs major splitting. This patch is too big. First we need to discuss the ABI details with the guys at libusb-devel, then we implement.
Quoted 8 lines
No, we don't break the abi, but rather, create a new one for streams, and then we can work on adding them to libusb, which should be quite easy when done.
thanks,
greg k-h
My name is Amit Blay, I'm working with Tatyana Brokhman, I originally created this patch. I want to make sure I understand the solution:
We will create a new IOCTL, i.e., USBDEVFS_SUBMITURB_SS. This IOCTL will pass new URB structure, usbdevfs_urb_ss, which will hold the "legacy" URB and in addition the stream_id. libusb will be able to use the new ABI whenever SuperSpeed streams are required.
Is this correct?
Thanks,
Amit Blay,
---
Sent by an consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
Quoted 9 lines · On Fri, 17 Jun 2011 [email protected] wrote:
My name is Amit Blay, I'm working with Tatyana Brokhman, I originally created this patch. I want to make sure I understand the solution:
We will create a new IOCTL, i.e.,
USBDEVFS_SUBMITURB_SS. This IOCTL will pass new URB structure,usbdevfs_urb_ss, which will hold the "legacy" URB and in addition thestream_id. libusb will be able to use the new ABI whenever SuperSpeed streams are required.Is this correct?
This probably should be USBDEVFS_SUBMITURB_STREAM, since it is necesary only for URBs that use bulk streaming rather than for all SuperSpeed URBs.
Alan Stern
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
In reply to Tatyana BrokhmanQuoted 2 lines · Tatyana Brokhman
Allow user space applications such as LIBUSB, to request streams alloc/dealloc from HCD that implements XHCI.
Hi Tatyana,
Will this patch be used to create a userspace UAS driver, or are you envisioning other ways userspace might use streams? I ask because I can't think of another usage of streams in currently available devices.
This patch is good to have, but I can't imagine that you'll get good performance if you're trying to create a userspace UAS device. After all, usbfs does some fairly stupid things, performance wise, like using kmalloc to allocate its URB buffers instead of usb_alloc_coherent, which may cause the userspace buffer to be copied twice if the kmalloc memory is not DMA'able.
usbfs probably could be changed to pin the user pages and the scatter gather URB interface to try and avoid even one copy, but that's a performance enhancement I haven't had time to play around with. :)
Quoted 13 lines
Signed-off-by Amit Blay <ablay-zC7DfRvBq/JWk0Htik3J/[email protected]>Signed-off-by Tatyana Brokhman <[email protected]>--- drivers/usb/core/devio.c | 128 +++++++++++++++++++++++++++++++++++++++++- include/linux/usbdevice_fs.h | 5 ++ 2 files changed, 132 insertions(+), 1 deletions(-)drivers/usb/core/devio.c +0
-0
drivers/usb/core/devio.c static int proc_clearhalt(struct dev_state *ps, void __user *arg) · line 946
Quoted 4 lines
drivers/usb/core/devio.c +1
-0@@ -943,6 +943,115 @@ static int proc_clearhalt(struct dev_state *ps, void __user *arg)return usb_clear_halt (ps->dev, pipe); } +static int proc_allocstreams (struct dev_state *ps,void __user *arg)
It looks like userspace doesn't have a way to specify the number of streams USBFS needs to allocate. Not all userspace applications are going to want to use all available streams (especially if the device advertises the max of 65533).
You probably also need a way to communicate back to userspace how many streams were actually allocated. The program could choose to free streams if it doesn't get the amount it expected. (Also, it needs to know how many streams are available, so it can set the stream ID.)
Quoted 34 lines
drivers/usb/core/devio.c +34
-0+{ +unsigned int ep_map; +int ret; +int intf_num; +struct usb_interface *intf =NULL ; +const int max_eps =32 ; +int max_streams =0 ; +struct usb_host_endpoint *eps[max_eps]; +int num_eps =0 ; +int i; +unsigned int ep; + +if (get_user (ep_map, (unsigned int __user *)arg)) +return -EFAULT ; + +for (i =0 ; i < max_eps; i++) { +if (ep_map & (0x1 << i)) { +/* Convert from i to ep address */ +if (i <16 )/* IN EP */ + ep = i |USB_ENDPOINT_DIR_MASK ; +else /* OUT EP */ + ep = (i -16 ); + + intf_num =findintfep (ps->dev, ep); +if (intf_num <0 ) +return intf_num; + ret =checkintf (ps, intf_num); +if (ret) +return ret; + intf =usb_ifnum_to_if (ps->dev, intf_num); +if (!intf) +return -ENOENT ; + +if (ep &USB_ENDPOINT_DIR_MASK )
drivers/usb/core/devio.c static int proc_clearhalt(struct dev_state *ps, void __user *arg) · line 990
Quoted 10 lines
drivers/usb/core/devio.c +10
-0+ eps[num_eps] = ps->dev->ep_in[ep & +USB_ENDPOINT_NUMBER_MASK ]; + else + eps[num_eps] = ps->dev->ep_out[ep & +USB_ENDPOINT_NUMBER_MASK ]; + +if (!max_streams) + max_streams =USB_SS_MAX_STREAMS ( + eps[num_eps]->ss_ep_comp.bmAttributes); +
So you're just taking the max_streams from the first endpoint that has streams? What if other endpoints have varying numbers of max streams? (A well-designed device probably wouldn't, but the spec doesn't disallow it.)
All this checking is a bit redundant anyway. The xHCI driver already loops over the endpoints that you give it, checking for the minimum number of reported maximum streams. It will also make sure that isn't more than the host controller supports. So you might as well just ask for the maximum possible number of streams (65533).
drivers/usb/core/devio.c static int proc_clearhalt(struct dev_state *ps, void __user *arg) · line 1003
Quoted 13 lines
drivers/usb/core/devio.c +13
-0+ num_eps++; + } + } + +if (!intf || !max_streams) +return -ENOENT ; + + ret =usb_alloc_streams (intf, eps, num_eps, max_streams,GFP_KERNEL ); +if (ret >0 ) +return 0 ; +return ret; +} +
What if you have endpoints on an interface that don't support streams? It looks like you're passing the xHCI driver all endpoints on a particular interface. The call to usb_alloc_streams() will fail if any of those endpoints don't support streams.
So it seems like you also need a way for userspace to specify which endpoints get streams, and which endpoints have streams freed. I will have to check, but I think the call to usb_free_streams() will fail if any of the endpoints don't actually have streams enabled.
Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
I haven't had a chance to really look into this yet, but we use usbfs and will want to use streams from userspace (from a VM we've connected a USB3 device to).
William
----- Original Message -----
From: "Sarah Sharp" <[email protected]>
To: "Tatyana Brokhman" <[email protected]>
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], "Amit Blay" <[email protected]>, "open list" <[email protected]>
Sent: Thursday, June 30, 2011 10:45:38 AM
Subject: Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
Quoted 2 lines · Tatyana Brokhman
Allow user space applications such as LIBUSB, to request streams alloc/dealloc from HCD that implements XHCI.
Hi Tatyana,
Will this patch be used to create a userspace UAS driver, or are you envisioning other ways userspace might use streams? I ask because I can't think of another usage of streams in currently available devices.
This patch is good to have, but I can't imagine that you'll get good performance if you're trying to create a userspace UAS device. After all, usbfs does some fairly stupid things, performance wise, like using kmalloc to allocate its URB buffers instead of usb_alloc_coherent, which may cause the userspace buffer to be copied twice if the kmalloc memory is not DMA'able.
usbfs probably could be changed to pin the user pages and the scatter gather URB interface to try and avoid even one copy, but that's a performance enhancement I haven't had time to play around with. :)
Quoted 13 lines
Signed-off-by Amit Blay <[email protected]>Signed-off-by Tatyana Brokhman <[email protected]>--- drivers/usb/core/devio.c | 128 +++++++++++++++++++++++++++++++++++++++++- include/linux/usbdevice_fs.h | 5 ++ 2 files changed, 132 insertions(+), 1 deletions(-)drivers/usb/core/devio.c +0
-0
drivers/usb/core/devio.c static int proc_clearhalt(struct dev_state *ps, void __user *arg) · line 946
Quoted 4 lines
drivers/usb/core/devio.c +1
-0@@ -943,6 +943,115 @@ static int proc_clearhalt(struct dev_state *ps, void __user *arg)return usb_clear_halt (ps->dev, pipe); } +static int proc_allocstreams (struct dev_state *ps,void __user *arg)
It looks like userspace doesn't have a way to specify the number of streams USBFS needs to allocate. Not all userspace applications are going to want to use all available streams (especially if the device advertises the max of 65533).
You probably also need a way to communicate back to userspace how many streams were actually allocated. The program could choose to free streams if it doesn't get the amount it expected. (Also, it needs to know how many streams are available, so it can set the stream ID.)
Quoted 34 lines
drivers/usb/core/devio.c +34
-0+{ +unsigned int ep_map; +int ret; +int intf_num; +struct usb_interface *intf =NULL ; +const int max_eps =32 ; +int max_streams =0 ; +struct usb_host_endpoint *eps[max_eps]; +int num_eps =0 ; +int i; +unsigned int ep; + +if (get_user (ep_map, (unsigned int __user *)arg)) +return -EFAULT ; + +for (i =0 ; i < max_eps; i++) { +if (ep_map & (0x1 << i)) { +/* Convert from i to ep address */ +if (i <16 )/* IN EP */ + ep = i |USB_ENDPOINT_DIR_MASK ; +else /* OUT EP */ + ep = (i -16 ); + + intf_num =findintfep (ps->dev, ep); +if (intf_num <0 ) +return intf_num; + ret =checkintf (ps, intf_num); +if (ret) +return ret; + intf =usb_ifnum_to_if (ps->dev, intf_num); +if (!intf) +return -ENOENT ; + +if (ep &USB_ENDPOINT_DIR_MASK )
drivers/usb/core/devio.c static int proc_clearhalt(struct dev_state *ps, void __user *arg) · line 990
Quoted 10 lines
drivers/usb/core/devio.c +10
-0+ eps[num_eps] = ps->dev->ep_in[ep & +USB_ENDPOINT_NUMBER_MASK ]; + else + eps[num_eps] = ps->dev->ep_out[ep & +USB_ENDPOINT_NUMBER_MASK ]; + +if (!max_streams) + max_streams =USB_SS_MAX_STREAMS ( + eps[num_eps]->ss_ep_comp.bmAttributes); +
So you're just taking the max_streams from the first endpoint that has streams? What if other endpoints have varying numbers of max streams? (A well-designed device probably wouldn't, but the spec doesn't disallow it.)
All this checking is a bit redundant anyway. The xHCI driver already loops over the endpoints that you give it, checking for the minimum number of reported maximum streams. It will also make sure that isn't more than the host controller supports. So you might as well just ask for the maximum possible number of streams (65533).
drivers/usb/core/devio.c static int proc_clearhalt(struct dev_state *ps, void __user *arg) · line 1003
Quoted 13 lines
drivers/usb/core/devio.c +13
-0+ num_eps++; + } + } + +if (!intf || !max_streams) +return -ENOENT ; + + ret =usb_alloc_streams (intf, eps, num_eps, max_streams,GFP_KERNEL ); +if (ret >0 ) +return 0 ; +return ret; +} +
What if you have endpoints on an interface that don't support streams? It looks like you're passing the xHCI driver all endpoints on a particular interface. The call to usb_alloc_streams() will fail if any of those endpoints don't support streams.
So it seems like you also need a way for userspace to specify which endpoints get streams, and which endpoints have streams freed. I will have to check, but I think the call to usb_free_streams() will fail if any of the endpoints don't actually have streams enabled.
Sarah Sharp
RE: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
In reply to Sarah SharpHi Sarah,
Quoted 4 lines
Will this patch be used to create a userspace UAS driver, or are you envisioning other ways userspace might use streams? I ask because I can't think of another usage of streams in currently available devices.
No, this patch isn't used for UAS driver. It's used by us only for several tests that we implemented in the user space unittests framework we released with this patch. We used this FW to test our superspeed support implementation and the UAS gadget driver. It's a userspace application that uses Google test and libusb.
That's the only reason we need this patch at the moment.
But in any case, due to the comments we got on it from Greg/Alan/Felipe this patch is rewritten at the moment by its original author Amit Blay ([email protected]). He'll post a new version of it once he's done.
Thanks,
Tanya Brokhman
---
Sent by an consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
In reply to Sarah SharpHi Sarah,
I apologize for the delay responding to the thread. Thanks for your comments. I would like to continue and fix the previous patch according to the comments.
Also, I would like to split this patch, and implement the actual usage of streams for bulk EP transfers (passing the stream ID with the URB) to a different patch.
Quoted 7 lines
It looks like userspace doesn't have a way to specify the number of streams USBFS needs to allocate. Not all userspace applications are
You probably also need a way to communicate back to userspace how many streams were actually allocated. The program could choose to free
Quoted 7 lines
So you're just taking the
max_streamsfrom the first endpoint that has streams? What if other endpoints have varying numbers of max streams?What if you have endpoints on an interface that don't support streams?
So it seems like you also need a way for userspace to specify which endpoints get streams, and which endpoints have streams freed. I will
What I have in mind is user space passing a structure holding:
1. Interface number [IN]
2. Bitmap indicating which EP to allocate streams for [IN]
3. Number of streams to allocate, one number [IN}
4. Number of streams actually allocated, one number [OUT]
The devio alloc function will double check if all EPs belong to the interface passed by the user space.
Then it will call the HCI alloc function with the required number of streams. It will return the number of streams actually allocated by the HCD. Items 3 & 4 can be merged to one IN/OUT parameter.
No error checking will be done in devio for number of required streams (i.e, comparing it with the reported max streams). This kind of error checking is already done by the xHCI driver.
Please let me know if the solution is acceptable.
Thanks,
Amit.
Signature · 7 lines
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
Am Dienstag, 19. Juli 2011, 11:12:39 schrieb Amit Blay:
Quoted 7 lines
Quoted 2 lines
So it seems like you also need a way for userspace to specify which endpoints get streams, and which endpoints have streams freed. I will
What I have in mind is user space passing a structure holding:
1. Interface number [IN]
2. Bitmap indicating which EP to allocate streams for [IN]
If this is a bitmap,
Quoted 2 lines
3. Number of streams to allocate, one number [IN}
4. Number of streams actually allocated, one number [OUT]
how can those be scalars?
Regards
Oliver
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
Hi Oliver,
Quoted 10 lines
Quoted 2 lines
1. Interface number [IN]
2. Bitmap indicating which EP to allocate streams for [IN]If this is a bitmap,
Quoted 2 lines
3. Number of streams to allocate, one number [IN}
4. Number of streams actually allocated, one number [OUT]how can those be scalars?
The bitmap only indicates which EP the user space requests to allocate streams for. The actual number is taken from #3.
Thanks,
Amit.
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
Am Dienstag, 19. Juli 2011, 12:07:39 schrieben Sie:
Hi,
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
1. Interface number [IN]
2. Bitmap indicating which EP to allocate streams for [IN]If this is a bitmap,
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
3. Number of streams to allocate, one number [IN}
4. Number of streams actually allocated, one number [OUT]how can those be scalars?
The bitmap only indicates which EP the user space requests to allocate streams for. The actual number is taken from #3.
Exactly. If you specify EP with a bitmap, what do you do if multiple bits are set in the map?
Regards
Oliver
Signature · 6 lines
- - - SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5 90409 Nürnberg Germany - - -
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
Hi Oliver,
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
1. Interface number [IN]
2. Bitmap indicating which EP to allocate streams for [IN]If this is a bitmap,
Quoted 2 lines
3. Number of streams to allocate, one number [IN}
4. Number of streams actually allocated, one number [OUT]
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
how can those be scalars?
The bitmap only indicates which EP the user space requests to allocate streams for. The actual number is taken from #3.
Exactly. If you specify EP with a bitmap, what do you do if multiple bits are set in the map?
The user space can pass multiple EPs to allocate streams for. This is aligned with the HCD API which expects an array of EPs and number of streams to allocate. Please have a look in xhci.c.
I suggest to pass a bitmap from user space to represent the list of EPs. An alternative is to pass an array, but I didn't find any real advantage for this.
Thanks,
Amit.
--
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
In reply to Amit BlayHi Sarah,
A gentle reminder, can you please take a look at the proposed solution below for stream alloc/dealloc in devio.c? I responded to your comments about the original patch.
Quoted 45 lines · Amit Blay
Hi Sarah,
I apologize for the delay responding to the thread. Thanks for your comments. I would like to continue and fix the previous patch according to the comments.
Also, I would like to split this patch, and implement the actual usage of streams for bulk EP transfers (passing the stream ID with the URB) to a different patch.Quoted 7 lines
It looks like userspace doesn't have a way to specify the number of streams USBFS needs to allocate. Not all userspace applications are
You probably also need a way to communicate back to userspace how many streams were actually allocated. The program could choose to free
Quoted 7 lines
So you're just taking the
max_streamsfrom the first endpoint that has streams? What if other endpoints have varying numbers of max streams?What if you have endpoints on an interface that don't support streams?
So it seems like you also need a way for userspace to specify which endpoints get streams, and which endpoints have streams freed. I will
What I have in mind is user space passing a structure holding:
1. Interface number [IN]
2. Bitmap indicating which EP to allocate streams for [IN]
3. Number of streams to allocate, one number [IN}
4. Number of streams actually allocated, one number [OUT]The devio alloc function will double check if all EPs belong to the interface passed by the user space.
Then it will call the HCI alloc function with the required number of streams. It will return the number of streams actually allocated by the HCD. Items 3 & 4 can be merged to one IN/OUT parameter.No error checking will be done in devio for number of required streams (i.e, comparing it with the reported max streams). This kind of error checking is already done by the xHCI driver.
Please let me know if the solution is acceptable.
Thanks,
Amit.
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
Quoted 5 lines · On Wednesday 27 July 2011 08:21:35 Amit Blay wrote:
Hi Sarah,
A gentle reminder, can you please take a look at the proposed solution below for stream alloc/dealloc in
devio.c? I responded to your comments about the original patch.
Hi,
I'm looking into implementing USB 3.0 streams support for FreeBSD and would like to have a solution in Linux which is not too far apart, also regarding API's for userspace.
I would suggest overloading the "unsigned int pipe", instead of breaking existing API's by adding a new stream ID value. Also for LibUSB.
./linux/usb.h: unsigned int pipe; /* (in) pipe information */
As per definition there are 15 bits available for "pipe". I think it is not important to support more than 255 streams in the first go, hence I see no real applications that would benefit from that many streams yet.
#define usb_pipeendpoint(pipe) (((pipe) >> 15) & 0xf)
Then I suggest a new function/IOCTL in libusb which can be used to switch on/off streams on a given endpoint. This is something which would need to be done before submitting any URB's on that endpoint. And would be similar to the clear-stall case.
If an URB is submitted on a stream when streams are disabled then it should just fail and vice versa.
--HPS
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
Quoted 14 lines · Amit Blay
Quoted 13 lines · Amit Blay
What I have in mind is user space passing a structure holding:
1. Interface number [IN]
2. Bitmap indicating which EP to allocate streams for [IN]
3. Number of streams to allocate, one number [IN}
4. Number of streams actually allocated, one number [OUT]The devio alloc function will double check if all EPs belong to the interface passed by the user space.
Then it will call the HCI alloc function with the required number of streams. It will return the number of streams actually allocated by the HCD. Items 3 & 4 can be merged to one IN/OUT parameter.
Quoted 5 lines
Quoted 5 lines
No error checking will be done in devio for number of required streams (i.e, comparing it with the reported max streams). This kind of error checking is already done by the xHCI driver.
Please let me know if the solution is acceptable.
Yes, I think this is the correct solution. Sorry for taking so long to get back to you.
Quoted 8 lines · Hans Petter Selasky
I'm looking into implementing USB 3.0 streams support for FreeBSD and would like to have a solution in Linux which is not too far apart, also regarding API's for userspace.
I would suggest overloading the "unsigned int pipe", instead of breaking existing API's by adding a new stream ID value. Also for LibUSB.
./linux/usb.h: unsigned int pipe; /* (in) pipe information */
I think this gets very close to breaking current API for usbfs. What happens if some application is putting garbage in the upper bits of the pipe? A libusb application that worked before will break because the USB core will reject the endpoint as not having streams enabled. So I think it's better to have a new IOCTL for submitting URBs to endpoints with streams enabled, as Alan suggested:
http://marc.info/?l=linux-kernel&m=130832352124932&w=2
Quoted 3 lines
As per definition there are 15 bits available for "pipe". I think it is not important to support more than 255 streams in the first go, hence I see no real applications that would benefit from that many streams yet.
I don't see this as a strong argument why we should arbitrarily limit a new API. It's very hard to deprecate kernel to userspace API, so I think we should do it right the first time. There are current applications (like an SSD behind a UAS device) that need as many concurrent streams in flight as possible, so I don't buy the argument that there aren't current applications that need that many streams.
I don't want to limit future applications of streams without a very good reason. I would like to see the new API allow userspace to submit URBs for stream IDs up to the maximum limit specified by the USB 3.0 spec (65,533 streams).
Why do you think reusing the pipe variable would be a better solution? You're going to need a new IOCTL to enable streams anyway, so why not also have a new IOCTL for submitting an URB to an endpoint with streams enabled?
Quoted 6 lines
#define
usb_pipeendpoint(pipe)(((pipe) >> 15) &0xf)Then I suggest a new function/IOCTL in libusb which can be used to switch on/off streams on a given endpoint. This is something which would need to be done before submitting any URB's on that endpoint. And would be similar to the clear-stall case.
Amit was discussing such an IOCTL. The problem is you just can't turn streams "on and off". The xHCI driver has to have an indication of how many streams your application will need. That's why Amit's proposal included a way for the application to pass in the number of streams to allocate.
Quoted 2 lines
If an URB is submitted on a stream when streams are disabled then it should just fail and vice versa.
That code is already included in the xHCI driver, and usbfs shouldn't do any checking of the stream ID for the URB, since it's already in the lower level driver.
Sarah Sharp
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
Thanks Sarah, Hans for your comments,
Quoted 2 lines · Sarah Sharp
Yes, I think this is the correct solution. Sorry for taking so long to get back to you.
OK, so I will go ahead with implementing this solution.
Quoted 3 lines · Hans Petter Selasky
Quoted 2 lines
I would suggest overloading the "unsigned int pipe", instead of breaking existing API's by adding a new stream ID value. Also for LibUSB.
The purposed solution will not break any existing API, by doing the following:
a. Adding a new API for streams alloc/dealloc
b. Adding a new API for submitting a URB which is stream capable (I will implement this in a separate patch).
Quoted 6 lines
I don't see this as a strong argument why we should arbitrarily limit a new API. It's very hard to deprecate kernel to userspace API, so I think we should do it right the first time. There are current applications (like an SSD behind a UAS device) that need as many concurrent streams in flight as possible, so I don't buy the argument that there aren't current applications that need that many streams.
I agree with Sarah.
Hans, I appreciate your inputs. Please let me know if you see a good reason why not implementing the new APIs purposed above for streams allocation and usage. Otherwise I will go ahead with the implementation.
Thanks,
Amit.
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
Quoted 25 lines · On Sunday 21 August 2011 12:18:34 Amit Blay wrote:
Thanks Sarah, Hans for your comments,
Quoted 2 lines · Sarah Sharp
Yes, I think this is the correct solution. Sorry for taking so long to get back to you.
OK, so I will go ahead with implementing this solution.
Quoted 3 lines · Hans Petter Selasky
Quoted 2 lines
I would suggest overloading the "unsigned int pipe", instead of breaking existing API's by adding a new stream ID value. Also for LibUSB.
The purposed solution will not break any existing API, by doing the following:
a. Adding a new API for streams alloc/dealloc
b. Adding a new API for submitting a URB which is stream capable (I will implement this in a separate patch).Quoted 6 lines
I don't see this as a strong argument why we should arbitrarily limit a new API. It's very hard to deprecate kernel to userspace API, so I think we should do it right the first time. There are current applications (like an SSD behind a UAS device) that need as many concurrent streams in flight as possible, so I don't buy the argument that there aren't current applications that need that many streams.
Quoted 4 lines
I agree with Sarah.
Hans, I appreciate your inputs. Please let me know if you see a good reason why not implementing the new APIs purposed above for streams allocation and usage. Otherwise I will go ahead with the implementation.
Hi Amit,
I think your suggestion is OK.
--HPS
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
In reply to Sarah SharpHi,
Quoted 9 lines · Hans Petter Selasky
Quoted 7 lines
I'm looking into implementing USB 3.0 streams support for FreeBSD and would like to have a solution in Linux which is not too far apart, also regarding API's for userspace.
I would suggest overloading the "unsigned int pipe", instead of breaking existing API's by adding a new stream ID value. Also for LibUSB.
Quoted 6 lines
Quoted 2 lines
./linux/usb.h: unsigned int pipe; /* (in) pipe information
*/I think this gets very close to breaking current API for usbfs. What happens if some application is putting garbage in the upper bits of the pipe?
I think this will never happen, because all USB applications I know about are taught to use a set of macros to create the "pipe" value, which by default zero these bits.
Quoted 23 lines
A libusb application that worked before will break because the USB core will reject the endpoint as not having streams enabled. So I think it's better to have a new IOCTL for submitting URBs to endpoints with streams enabled, as Alan suggested:
http://marc.info/?l=linux-kernel&m=130832352124932&w=2
Quoted 3 lines
As per definition there are 15 bits available for "pipe". I think it is not important to support more than 255 streams in the first go, hence I see no real applications that would benefit from that many streams yet.
I don't see this as a strong argument why we should arbitrarily limit a new API. It's very hard to deprecate kernel to userspace API, so I think we should do it right the first time. There are current applications (like an SSD behind a UAS device) that need as many concurrent streams in flight as possible, so I don't buy the argument that there aren't current applications that need that many streams.
I don't want to limit future applications of streams without a very good reason. I would like to see the new API allow userspace to submit URBs for stream IDs up to the maximum limit specified by the USB 3.0 spec (65,533 streams).
Quoted 4 lines
Why do you think reusing the pipe variable would be a better solution? You're going to need a new IOCTL to enable streams anyway, so why not also have a new IOCTL for submitting an URB to an endpoint with streams enabled?
What I'm thinking is that you should try to integrate the streams functionality as much as possible, with existing API's, so that API's that do roughly the same are not duplicated. In FreeBSD 8/9 we have more free bits in the pipe variable, and I'll probably use that for the stream ID. It's like IPv4 and IPv6, that you extend fields when required and not duplicate them. I'm just worried that intel will come up with yet-another way to transfer data in a few years, and then we'll have to wreck API's again. So why not foresee that now and make 128-bits available for endpoint/stream/XXX addressing?
Quoted 8 lines
Quoted 7 lines
#define
usb_pipeendpoint(pipe)(((pipe) >> 15) &0xf)Then I suggest a new function/IOCTL in libusb which can be used to switch on/off streams on a given endpoint. This is something which would need to be done before submitting any URB's on that endpoint. And would be similar to the clear-stall case.
Quoted 5 lines
Amit was discussing such an IOCTL. The problem is you just can't turn streams "on and off". The xHCI driver has to have an indication of how many streams your application will need. That's why Amit's proposal included a way for the application to pass in the number of streams to allocate.
Ok.
Quoted 7 lines
Quoted 3 lines
If an URB is submitted on a stream when streams are disabled then it should just fail and vice versa.
That code is already included in the xHCI driver, and usbfs shouldn't do any checking of the stream ID for the URB, since it's already in the lower level driver.
Ok.
--HPS
Re: [PATCH/RFC 5/5] usb: Add support for streams alloc/dealloc to devio.c
Quoted 14 lines · Hans Petter Selasky
Hi,
Quoted 12 lines · Hans Petter Selasky
Quoted 9 lines
I'm looking into implementing USB 3.0 streams support for FreeBSD and would like to have a solution in Linux which is not too far apart, also regarding API's for userspace.
I would suggest overloading the "unsigned int pipe", instead of breaking existing API's by adding a new stream ID value. Also for LibUSB.
./linux/usb.h: unsigned int pipe; /* (in) pipe information
*/
Quoted 7 lines
Quoted 3 lines
I think this gets very close to breaking current API for usbfs. What happens if some application is putting garbage in the upper bits of the pipe?
I think this will never happen, because all USB applications I know about are taught to use a set of macros to create the "pipe" value, which by default zero these bits.
Userspace programs aren't required to use the macros, so there is always a possibility that some program out there will be passing garbage. If your argument had been "the kernel checks for garbage, and returns an error code if there is garbage, so therefore there can't be any programs that put garbage in the upper bits", then that would be a different story.
Quoted 9 lines
Quoted 4 lines
Why do you think reusing the pipe variable would be a better solution? You're going to need a new IOCTL to enable streams anyway, so why not also have a new IOCTL for submitting an URB to an endpoint with streams enabled?
What I'm thinking is that you should try to integrate the streams functionality as much as possible, with existing API's, so that API's that do roughly the same are not duplicated. In FreeBSD 8/9 we have more free bits in the pipe variable, and I'll probably use that for the stream ID.
We'll try to coalesce the streams and non-streams functions in the kernel so they share as much code as possible. I see adding a new call parameter in a new usbfs ioctl as the right way to share new functionality in KAPI, rather than overloading currently free bits. However, if you come from a hardware background, I can see where adding new functionality in "reserved" bits seems normal.
Quoted 4 lines
It's like
IPv4 and IPv6, that you extend fields when required and not duplicate them. I'm just worried that intel will come up with yet-another way to transfer data in a few years, and then we'll have to wreck API's again.
We're not wrecking APIs, we're just creating new ones. New programs will have to do something different for streams (especially since they'll have to deal with out-of-order completions), so it's reasonable to ask them to call a different function in order to ensure we can use the full stream ID range.
Quoted 2 lines
So why not foresee
that now and make 128-bits available for endpoint/stream/XXX addressing?
We can't predict the future here. Who knows whether they will come up with some completely different mechanism that doesn't involve streams?
Besides, it would take a major rev of the USB spec (or at least a very careful errata) to add more stream ID bits, since the upper bits are reserved for specific host and device states. Intel is not the only company behind USB, and it takes time to get spec changes through the USB-IF working groups. Considering that it took them eight years to update the USB 2.0 spec to USB 3.0, I think it's safe to say the current stream ID range limitations will be around for several years.
Sarah Sharp