aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Clear error count register on entry to `dispatch_packet`.Brian Cully2019-10-081-11/+14
|
* Remove logging when allocating pipe.Brian Cully2019-10-081-6/+0
|
* Cache buffer length on entry to `in_transfer` and `out_transfer`.Brian Cully2019-10-081-34/+31
| | | | Use `ptr.offset()` in `in_transfer`, rather than hand calculations.
* Refactor `dispatch_retries`.Brian Cully2019-10-081-15/+24
| | | | | | * Use `USB_XFER_TIMEOUT` for single transaction timeouts. * Ensure pipe is frozen on return. * Reset timeout on data toggle error before retry.
* More messing around with data toggle error handling.Brian Cully2019-10-081-51/+39
| | | | I will not pretend that I know this to be correct, but it seems to work.
* Handle all known transfer/pipe errors.Brian Cully2019-10-082-61/+81
| | | | | | | | | | * Remove `PipeErr::Other`. * Add more variants to `PipeErr`. * Integrate `is_transfer_complete` into `dispatch_result` and simplify. * Cache volatile `intflag` on entry to `dispatch_result` to ensure consistent handling. * Clear fail/perr `intflag` bits in `dispatch_result`.
* Don't `assume_init` when allocating device descriptor buffer.Brian Cully2019-10-081-3/+5
| | | | Unwrap after `assert` of transfer length.
* Log everything in one statement in `log_regs`.Brian Cully2019-09-241-9/+5
|
* Log when a driver wants a device.Brian Cully2019-09-241-1/+2
|
* Use endpoint's max packet size in transfers.Brian Cully2019-09-241-2/+1
|
* Reset the USB host driver if an unrecoverable error is found.Brian Cully2019-09-241-3/+18
|
* Mark pipe descriptor register memory as volatile.Brian Cully2019-09-248-324/+184
| | | | | | | Most of the values in the descriptor memory can be modified by the hardware, so we need to tell Rust that. Also, refactor the common register setup code into `register.rs`.
* Minor refactor.Brian Cully2019-09-151-16/+29
| | | | Remove let bindings and use `Option.map` instead.
* Clippy.Brian Cully2019-09-098-50/+51
|
* Remove warnings for unconstructed variants of PipeErr.Brian Cully2019-08-171-0/+1
|
* Update for starb 0.2Brian Cully2019-08-171-1/+1
|
* A bunch of cleanup and fixes.Brian Cully2019-08-103-72/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify the code a bunch to reduce it to states we actually care about. This will now probe my Logitech G105, NIZ Plum 85EC, and Keyboard.io Model 01. * Don't listen for wakeup interrupts. Only listen for device connection and disconnection, which wakeups sometimes mean. * Remove the SETTLE_DELAY stuff on device connection, as this appears to be handled in hardware, and prevents over-delay which was causing the Model 01 to reset, since it wasn't getting a SOF in time. * Set initial max packet size for address 0 endpoint 0 based on whether the connection is Full Speed or Low Speed. * Remove all intflag checks from USB handler that we don't explicitly set up. * Always listen dor dconn/ddisc in handler. Since we're using a ring buffer for event storage, we shouldn't miss these and always handle them in order. * Don't freeze pipes on errors. Let the hardware do it. * Don't retransmit packets on errors, just keep polling hardware. * Move trfail check to the end, since it's either dependent on previous, more specific checks, or it's just a NAK (but, for some reason, not ERRORFLOW). * Add `modify` method to control pipe register.
* Use ring buffer for USB events.Brian Cully2019-08-101-56/+24
| | | | | Get rid of the static mut that can drop intermediate events and cause innumerable race conditions.
* Use endpoint's max packet size for pipe.Brian Cully2019-08-102-4/+34
|
* Remove device from driver on error.Brian Cully2019-08-101-0/+1
|
* Simplify data toggle handling.Brian Cully2019-08-082-5/+10
| | | | | Only use the data toggle from hardware if we get a data toggle error. Otherwise, use computed toggle values based on endpoint.
* Initial commitBrian Cully2019-08-048-0/+2830