* Interleave sending and receiving of packets to reduce latency in receiving of packets * Add patch to CtapUsbSyscallDriver * Minor tweaks from review * Log when overwritting an existing reply * Only log when 'debug_ctap' is enabled * Make ctap mod public, as per review * Rename send_or_recv to send_and_maybe_recv * fix typo * Don't process packets on other transport while doing keepalive * Don't process packets on other transport while doing keepalive * More accurately determine if reply has finished * Move comment closer to appropriate location * Add tests for canceling keepalive packets * Added a TODO for kaczmarczyck re ctap module being public * remove the unnecessary sleep()s * undo messed up commit * address pylint warnings * Fix merge mess up, and patch fido2 Usage Page * Fix up completely borked merge * Remove patch to FIDO usage, after #523. * remove obsolete aspects to diff Co-authored-by: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com>
33 lines
1.7 KiB
Diff
33 lines
1.7 KiB
Diff
diff --git a/capsules/src/usb/usb_ctap.rs b/capsules/src/usb/usb_ctap.rs
|
|
index 2c91c0968..ea8111069 100644
|
|
--- a/capsules/src/usb/usb_ctap.rs
|
|
+++ b/capsules/src/usb/usb_ctap.rs
|
|
@@ -253,18 +253,19 @@ impl<'a, 'b, C: hil::usb::UsbController<'a>> Driver for CtapUsbSyscallDriver<'a,
|
|
if app.waiting {
|
|
ReturnCode::EALREADY
|
|
} else {
|
|
+ // Indicates to the driver that we have a packet to send.
|
|
+ let r = self
|
|
+ .usb_client
|
|
+ .transmit_packet(app.buffer.as_ref().unwrap().as_ref(), endpoint);
|
|
+ if r != ReturnCode::SUCCESS {
|
|
+ return r;
|
|
+ }
|
|
// Indicates to the driver that we can receive any pending packet.
|
|
app.waiting = true;
|
|
self.usb_client.receive_packet(app);
|
|
|
|
- if !app.waiting {
|
|
- // The call to receive_packet() collected a pending packet.
|
|
- ReturnCode::SUCCESS
|
|
- } else {
|
|
- // Indicates to the driver that we have a packet to send.
|
|
- self.usb_client
|
|
- .transmit_packet(app.buffer.as_ref().unwrap().as_ref(), endpoint)
|
|
- }
|
|
+ ReturnCode::SUCCESS
|
|
+
|
|
}
|
|
} else {
|
|
ReturnCode::EINVAL
|