From 29b1c1aa0dcc63202bfb2662746a881bf124dba3 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 16 Apr 2024 09:13:44 -0600 Subject: [PATCH] xhcid: fix isoch and interrupt endpoint types being swapped --- xhcid/src/driver_interface.rs | 4 ++-- xhcid/src/usb/endpoint.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xhcid/src/driver_interface.rs b/xhcid/src/driver_interface.rs index efea45b6e5..3456987fb5 100644 --- a/xhcid/src/driver_interface.rs +++ b/xhcid/src/driver_interface.rs @@ -112,9 +112,9 @@ impl EndpDesc { pub fn ty(self) -> EndpointTy { match self.attributes & ENDP_ATTR_TY_MASK { 0 => EndpointTy::Ctrl, - 1 => EndpointTy::Interrupt, + 1 => EndpointTy::Isoch, 2 => EndpointTy::Bulk, - 3 => EndpointTy::Isoch, + 3 => EndpointTy::Interrupt, _ => unreachable!(), } } diff --git a/xhcid/src/usb/endpoint.rs b/xhcid/src/usb/endpoint.rs index 42ab8b1022..39e28eb6f4 100644 --- a/xhcid/src/usb/endpoint.rs +++ b/xhcid/src/usb/endpoint.rs @@ -17,18 +17,18 @@ pub const ENDP_ATTR_TY_MASK: u8 = 0x3; #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub enum EndpointTy { Ctrl = 0, - Interrupt = 1, + Isoch = 1, Bulk = 2, - Isoch = 3, + Interrupt = 3, } impl EndpointDescriptor { fn ty(self) -> EndpointTy { match self.attributes & ENDP_ATTR_TY_MASK { 0 => EndpointTy::Ctrl, - 1 => EndpointTy::Interrupt, + 1 => EndpointTy::Isoch, 2 => EndpointTy::Bulk, - 3 => EndpointTy::Isoch, + 3 => EndpointTy::Interrupt, _ => unreachable!(), } }