diff options
Diffstat (limited to 'src/ioctl.rs')
| -rw-r--r-- | src/ioctl.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ioctl.rs b/src/ioctl.rs index 0fee1ad19..66c6a10e5 100644 --- a/src/ioctl.rs +++ b/src/ioctl.rs | |||
| @@ -4,6 +4,8 @@ use core::task::{Poll, Waker}; | |||
| 4 | 4 | ||
| 5 | use embassy_sync::waitqueue::WakerRegistration; | 5 | use embassy_sync::waitqueue::WakerRegistration; |
| 6 | 6 | ||
| 7 | use crate::fmt::Bytes; | ||
| 8 | |||
| 7 | #[derive(Clone, Copy)] | 9 | #[derive(Clone, Copy)] |
| 8 | pub enum IoctlType { | 10 | pub enum IoctlType { |
| 9 | Get = 0, | 11 | Get = 0, |
| @@ -108,6 +110,8 @@ impl IoctlState { | |||
| 108 | 110 | ||
| 109 | pub fn ioctl_done(&self, response: &[u8]) { | 111 | pub fn ioctl_done(&self, response: &[u8]) { |
| 110 | if let IoctlStateInner::Sent { buf } = self.state.get() { | 112 | if let IoctlStateInner::Sent { buf } = self.state.get() { |
| 113 | info!("IOCTL Response: {:02x}", Bytes(response)); | ||
| 114 | |||
| 111 | // TODO fix this | 115 | // TODO fix this |
| 112 | (unsafe { &mut *buf }[..response.len()]).copy_from_slice(response); | 116 | (unsafe { &mut *buf }[..response.len()]).copy_from_slice(response); |
| 113 | 117 | ||
| @@ -115,6 +119,8 @@ impl IoctlState { | |||
| 115 | resp_len: response.len(), | 119 | resp_len: response.len(), |
| 116 | }); | 120 | }); |
| 117 | self.wake_control(); | 121 | self.wake_control(); |
| 122 | } else { | ||
| 123 | warn!("IOCTL Response but no pending Ioctl"); | ||
| 118 | } | 124 | } |
| 119 | } | 125 | } |
| 120 | } | 126 | } |
