aboutsummaryrefslogtreecommitdiff
path: root/src/ioctl.rs
diff options
context:
space:
mode:
authorkbleeke <[email protected]>2023-04-02 20:19:47 +0200
committerkbleeke <[email protected]>2023-04-25 19:14:00 +0200
commit2d7ba44621fa35abad07d2ddb8b253e815ce2c1f (patch)
tree999561ce27e3662a22ee2590c79eaa0791099953 /src/ioctl.rs
parent6a1a3e6877053b1b72adb3c1446f4f077ad3b03e (diff)
rework event handling to allow sending data
Diffstat (limited to 'src/ioctl.rs')
-rw-r--r--src/ioctl.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ioctl.rs b/src/ioctl.rs
index 89b20a2d6..803934cf9 100644
--- a/src/ioctl.rs
+++ b/src/ioctl.rs
@@ -4,6 +4,8 @@ use core::task::{Poll, Waker};
4 4
5use embassy_sync::waitqueue::WakerRegistration; 5use embassy_sync::waitqueue::WakerRegistration;
6 6
7use crate::fmt::Bytes;
8
7#[derive(Clone, Copy)] 9#[derive(Clone, Copy)]
8pub enum IoctlType { 10pub enum IoctlType {
9 Get = 0, 11 Get = 0,
@@ -100,6 +102,8 @@ impl IoctlState {
100 102
101 pub fn ioctl_done(&self, response: &[u8]) { 103 pub fn ioctl_done(&self, response: &[u8]) {
102 if let IoctlStateInner::Sent { buf } = self.state.get() { 104 if let IoctlStateInner::Sent { buf } = self.state.get() {
105 info!("IOCTL Response: {:02x}", Bytes(response));
106
103 // TODO fix this 107 // TODO fix this
104 (unsafe { &mut *buf }[..response.len()]).copy_from_slice(response); 108 (unsafe { &mut *buf }[..response.len()]).copy_from_slice(response);
105 109
@@ -107,6 +111,8 @@ impl IoctlState {
107 resp_len: response.len(), 111 resp_len: response.len(),
108 }); 112 });
109 self.wake_control(); 113 self.wake_control();
114 } else {
115 warn!("IOCTL Response but no pending Ioctl");
110 } 116 }
111 } 117 }
112} 118}