Commit Graph

161 Commits

Author SHA1 Message Date
Ha Thach d6a8d42bd6
Merge pull request #254 from majbthrd/multi-setconfig
gracefully handle multiple SET_CONFIGURATION requests
2020-01-05 17:48:55 +07:00
Jeremy Herbert db24b2f372 Let device respond to endpoint requests on EP0 (#251)
Since endpoint 0 is used for control requests, it doesn't have a class driver attached to it. As such, the corresponding `_usbd_dev.ep2drv` entry points to driver `0xFF`, which is invalid and this makes the `TU_ASSERT(drvid < USBD_CLASS_DRIVER_COUNT);` line fail, and eventually causes an endpoint stall. So as-is the stack cannot respond to any endpoint requests on endpoint 0.

However, standard requests on endpoint 0 do not need a class driver to produce a valid response. This commit changes the order of execution so that the assert is only checked if the endpoint is not 0.
2019-12-30 10:58:06 +07:00
Peter Lawrence e7bf66b29e gracefully handle multiple SET_CONFIGURATION requests 2019-12-28 16:49:52 -06:00
hathach bbada1d3e6 adding lookup table for debugging
add msc scsi command list
2019-12-23 18:54:06 +07:00
hathach 050fa2fd39
able to response to scsi inquiry, but failed to response to test unit ready 2019-12-21 19:33:41 +07:00
hathach d7558e8a0f use dcd_edpt0_status_complete() to set address without blocking for samd21/samd51/stm32_fsdev 2019-11-28 13:39:29 +07:00
hathach 5dc04887e2 get passed set address 2019-11-28 11:48:08 +07:00
hathach 40b454cf28 get passed first get device descriptor 2019-11-27 23:20:48 +07:00
hathach 8a1b6327ba extract code to invoke_class_control()
- also rename usbd_class_drivers to _usbd_driver
2019-11-27 12:12:52 +07:00
hathach 3c49ff153e
Merge pull request #149 from pigrew/ZLP_Request2
Zlp request2
2019-11-05 00:05:21 +07:00
Nathan Conrad 8d0fa158d7 Change one more TU_ASSERT to TU_VERIFY in usbd. 2019-11-04 11:33:14 -05:00
hathach 2727983a2d fix #211 2019-11-04 22:52:29 +07:00
Nathan Conrad a94fe05ecb usbd: Change TU_ASSERT to TU_VERIFY as the assertion can be hit when bad data is sent from host. 2019-11-04 08:59:29 -05:00
hathach 62f8c14fae add a bit of log1 for debugging 2019-11-03 14:08:38 +07:00
hathach cacbb80a90
zlp should work with control in, tested with Unity framework 2019-10-31 21:14:06 +07:00
hathach 6de9eb4b1a
add more tests, fix an issue with tud_descriptor_configuration_cb() return NULL 2019-10-31 13:06:57 +07:00
hathach 4d329d46cc
Merge pull request #206 from hathach/develop
Added a couple of unit testing with Ceedling/Cmock/Unity
2019-10-31 08:29:11 +07:00
hathach a0002cc709
rename usbd_init() to tud_init() 2019-10-30 23:26:34 +07:00
hathach 880ac1e398 move dcd event helper to be dcd.h as inline function 2019-10-30 11:35:25 +07:00
hathach 78523301bb
Merge pull request #202 from smunaut/dfu-rt
Add support for DFU Runtime class for devices
2019-10-28 22:56:14 +07:00
Sylvain Munaut ec4ecfa817 Add support for DFU Runtime class for devices
This is really just a few descriptors and then answering to the
request from the host to reboot into DFU mode.

That latter part is delegated to the app since this is platform
specific.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2019-10-28 16:11:08 +01:00
hathach 6ab0663c1a adding more log 2019-10-24 12:00:06 +07:00
hathach 661515a807 adding debug log function 2019-10-23 21:18:46 +07:00
hathach 204791b3e7 2nd attempt to fix #161 2019-10-01 22:19:04 +07:00
hathach 12609f818b fix #161 added volatile for ep_busy_map/ep_stall_map 2019-10-01 14:43:34 +07:00
Nathan Conrad 2aa10daf26 Merge branch 'clear_feature_ordering' into usbtmc 2019-09-21 21:39:25 -04:00
Nathan Conrad 9498adef71 Changing the bitwise to a logical OR created a huge hard to find bug. It shortcutted the call to the class function,
so, lets use shortcutting anyway?
2019-09-21 19:29:57 -04:00
Nathan Conrad fbb8520acd logical or. 2019-09-21 14:34:29 -04:00
Nathan Conrad 37b52e354f Correct wording of comment on handling EP requests. 2019-09-21 12:17:17 -04:00
Nathan Conrad a187f0268c When unstalling, EP must be marked as not busy. Also, mark EP as busy when stalling as xfer requests should fail. 2019-09-21 12:05:57 -04:00
Nathan Conrad be28a05409 Make type casting explicit 2019-09-21 12:05:46 -04:00
Nathan Conrad 55abb3d717 Calling EP open with bad parameters should be considered a bug. 2019-09-21 12:02:52 -04:00
Nathan Conrad aebecf169a Reorder handling of EP control requests, 2019-09-21 12:02:06 -04:00
Nathan Conrad 2a7ca15e2c Rename functions to include tud_ and _cb 2019-09-19 20:43:49 -04:00
Nathan Conrad 7e0490bbf3 Move descriptors to usbd.h 2019-09-19 19:51:37 -04:00
Nathan Conrad ac2c9ff02f Merge branch 'master' into usbtmc 2019-09-17 13:31:53 -04:00
hathach 9c5ae0369b follow up to suggestion to pr 155 2019-09-16 11:13:17 +07:00
Nathan Conrad 1cae96951f Add usbtmc class driver. 2019-09-14 13:35:08 -04:00
hathach ac8c343fef fix #154 forward all endpoint recipeint request to class driver
fix typo
remove magic number 0xff of driver id
2019-09-13 22:16:24 +07:00
hathach 064adebbd0 fix #152, potential memory issue 2019-09-13 14:03:59 +07:00
hathach c3598f0301 fix #139, correct usbd request intepreting, Non-STD request to Interface must be forward to class driver 2019-09-13 13:03:11 +07:00
hathach cdaf455461 fix stall response with SET_INTERFACE/GET_INTERFACE
webusb work with linux & macos
2019-07-26 20:14:56 +07:00
hathach d2b60b6755 webusb work great with linux 2019-07-26 11:36:30 +07:00
hathach 2a543c0e79 update vendor device similar to cdc read/write
maybe refactor later
2019-07-24 23:07:30 +07:00
hathach c63f2b30cb rename tud_control_vendor_request_cb/complete_cb to tud_vendor_control_request_cb/complete_cb 2019-07-24 09:45:32 +07:00
hathach 33de35504a more house keeping 2019-07-19 20:20:13 +07:00
hathach ae5dc435cb house keeping 2019-07-19 16:49:04 +07:00
hathach b0678e1050 rename CFG_TUD_CUSTOM_CLASS to CFG_TUD_VENDOR 2019-07-19 16:23:56 +07:00
hathach 036e858543 add tud_control_vendor_request_cb()/tud_control_vendor_complete_cb(), expose usbd control transfer
rename usbd_control_transfer/status to tud_control_transfer/status
2019-07-16 18:14:47 +07:00
hathach cb4e6837e9 clean up, rename internal driver control_request_complete to simply control_complete 2019-07-12 22:03:40 +07:00