299 Commits (7b5884caa58b4611e9a9efcec59270fb9e22409e)

Author SHA1 Message Date
Con Kolivas 7b5884caa5 Add cancellable transfers correctly to the ct_list 11 years ago
Con Kolivas 9d8e3df0a8 Add usb transfer cancellation on shutdown and documentation regarding where cancellable transfers are suitable. 11 years ago
Con Kolivas d2feacdfb2 Cancel cancellable usb transfers on work restart messages. 11 years ago
Con Kolivas 51660838da Don't bother having a separate cancellable transfer struct for usb transfers, simply include the list in the usb_transfer struct. 11 years ago
Con Kolivas c96f096577 Add wrappers for usb_read_cancellable and usb_read_timeout_cancellable 11 years ago
Con Kolivas c2c6987784 Specifically set the cancellable state for it to not be uninitialised in the usb transfer struct. 11 years ago
Con Kolivas b52bb5c9e2 Alter the usb cancellable list only under cgusb_fd_lock write lock. 11 years ago
Con Kolivas 19ec360f7c Pass the cancellable option to _usb_read options to decide on whether to add usb transfers to the list of cancellable transfers. 11 years ago
Con Kolivas 2b075cccbf Create a linked list of potentially cancellable usb transfers. 11 years ago
Con Kolivas 824aa5cb51 Keep a global counter of how many async usb transfers are in place. 11 years ago
Con Kolivas 856471e392 Perform libusb_submit_transfer under the write variant of cgusb_fd_lock 11 years ago
Con Kolivas 269a145a70 Add usb command name to critical libusb error reporting. 11 years ago
Con Kolivas 44cc52c3d0 Drop usb buffering message to debug logging level. 11 years ago
Con Kolivas eed0afcd04 Convert libusb transfer errors to regular libusb error messages to allow for accurate message reporting. 11 years ago
Con Kolivas d77f367279 Fixing the memory leak for remaining semaphores means we can go back to using async transfers on other OSes with our own timeout management again. 11 years ago
Con Kolivas 8e9f32a81b Add a forcelog variant of applog which invalidates any console lock to force output. 11 years ago
Con Kolivas 789d448e84 Perform sync transfers on shutdown to allow final transfers to complete. 11 years ago
Con Kolivas ad8d94979f Destroy cgsems used after transfers to not leave open files on osx. 11 years ago
Con Kolivas 103bc0bafe Revert to using timeouts on !linux since libusb leaks memory without them. 11 years ago
Con Kolivas 955e971d3d Prevent further USB transfers from occurring once the shutdown signal has been sent to prevent transfers getting stuck and libusb failing to shut down. 11 years ago
Con Kolivas 4e5946d2ba Prevent further USB transfers from occurring once the shutdown signal has been sent to prevent transfers getting stuck and libusb failing to shut down. 11 years ago
Con Kolivas 7c6bd4a8fb Emulate the libusb_control_transfer sync setup in our async variant. 11 years ago
Con Kolivas e6280c85d2 Add the libusb control setup size offset for control writes. 11 years ago
Con Kolivas 8fdaeb0ac9 Differentiate send from receive in control transfers! 11 years ago
Kano 108e73763b usbutils - make all libusb_error_name messages the same 11 years ago
Con Kolivas 02a4f8df9c Convert the usb callback function to using cgsem_t timed waits to avoid race conditions with conditionals/mutexes. 11 years ago
Con Kolivas 1d9f90b256 Revert "Convert the usb callback function to use a cgsem_t using the timedwait code to avoid races with mutexes/conditionals." 11 years ago
Con Kolivas 433465bcfc Convert the usb callback function to use a cgsem_t using the timedwait code to avoid races with mutexes/conditionals. 11 years ago
Con Kolivas 9ca22ed493 Use the one LIBUSB_ERROR_TIMEOUT for cancelled transactions since this error is explicitly tested for in various drivers. 11 years ago
Con Kolivas a7580f1ff2 Do not use locking on usb callback function pthread signalling to prevent deadlock with libusb's own event lock. 11 years ago
Con Kolivas 280dc4bf01 Lock mutex before second pthread_cond_wait in usbutils to prevent a race. 11 years ago
Con Kolivas 84de52c1c6 Use a write lock when performing any USB control transfers to prevent concurrent transfers. 11 years ago
Con Kolivas c069028648 Free a libusb transfer after we have finished using it to avoid a dereference in usb_control_transfer 11 years ago
Con Kolivas 84f642f563 Although async transfers are meant to use heap memory, we never return before the transfer function has completed so stack memory will suffice for control transfers, fixing a memory leak in the process. 11 years ago
Con Kolivas 2ca8d85906 Convert all usb control transfers to asynchronous communication with our own timeout management as well. 11 years ago
Con Kolivas b537976036 Make pthread conditional timeouts handle all bulk usb transfer timeouts performing libusb_cancel_transfer, disabling timeouts within libusb itself. 11 years ago
Chris Chua b509e84376 using separate identifier for bitburner fury boards 11 years ago
Con Kolivas 03ad59f287 Add a small amount to the usb timeout before cancelling to allow for a regular usb polling interval to pass. 11 years ago
Con Kolivas 08d8612f68 Do not attempt to clear a usb halt before sending the cancel message since all transfers should normally be cancelled before attempting to clear a halt condition, and only change the return message to a timeout if it's consistent with a cancellation. 11 years ago
Con Kolivas 6d18ce4caa Retry up to USB_RETRY_MAX times to clear a halt condition before failing. 11 years ago
Con Kolivas 3a7a677f45 Show the error number as well as the description in erroring bulk transfers. 11 years ago
Con Kolivas b5dfacef24 We are always dependent on libusb handling events so use the blocking libusb_handle_events in the polling thread and use a bool to know if we should continue polling. 11 years ago
Con Kolivas 32bc746178 Check for presence of driver name in DRIVER_COUNT_FOUND to prevent strcmp on a null pointer when a driver is not built in. 11 years ago
Con Kolivas dc9c3783ec Display errors on failed usb read and write and consider sequential IO errors a permanent failure. 11 years ago
Con Kolivas a22f5bfddd Use libusb's own error name function instead of hand coding the error names. 11 years ago
Con Kolivas efd8c44182 Check for async transfer variants of error messages. 11 years ago
Con Kolivas 2806f49c01 Revert "Check for the async variants of the libusb errors and retry up to retry max when trying to clear a pipe error/stall." 11 years ago
Con Kolivas d34279b226 Remove unused variables. 11 years ago
Con Kolivas ef8efd6c48 Minimise the time between dropping the read devlock and grabbing the write devlock to avoid tons of logging spam in the interim. 11 years ago
Con Kolivas 85e0b3a50f Check for the async variants of the libusb errors and retry up to retry max when trying to clear a pipe error/stall. 11 years ago