diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-09-08 23:48:45 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-09-09 02:13:25 +0200 |
| commit | 3ac38e917cc56530fa9b3515fd28a1f576b285e8 (patch) | |
| tree | 8eb79a2fc36d9b9fc8626b90079834dd3dd983f7 /cyw43/src/ioctl.rs | |
| parent | 74e724f96869680da4893ad7024676bef1c57334 (diff) | |
cyw43: use enum for ioctl instead of consts.
Diffstat (limited to 'cyw43/src/ioctl.rs')
| -rw-r--r-- | cyw43/src/ioctl.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cyw43/src/ioctl.rs b/cyw43/src/ioctl.rs index 61524c274..3186370cc 100644 --- a/cyw43/src/ioctl.rs +++ b/cyw43/src/ioctl.rs | |||
| @@ -4,6 +4,7 @@ use core::task::{Poll, Waker}; | |||
| 4 | 4 | ||
| 5 | use embassy_sync::waitqueue::WakerRegistration; | 5 | use embassy_sync::waitqueue::WakerRegistration; |
| 6 | 6 | ||
| 7 | use crate::consts::Ioctl; | ||
| 7 | use crate::fmt::Bytes; | 8 | use crate::fmt::Bytes; |
| 8 | 9 | ||
| 9 | #[derive(Clone, Copy)] | 10 | #[derive(Clone, Copy)] |
| @@ -16,7 +17,7 @@ pub enum IoctlType { | |||
| 16 | pub struct PendingIoctl { | 17 | pub struct PendingIoctl { |
| 17 | pub buf: *mut [u8], | 18 | pub buf: *mut [u8], |
| 18 | pub kind: IoctlType, | 19 | pub kind: IoctlType, |
| 19 | pub cmd: u32, | 20 | pub cmd: Ioctl, |
| 20 | pub iface: u32, | 21 | pub iface: u32, |
| 21 | } | 22 | } |
| 22 | 23 | ||
| @@ -101,7 +102,7 @@ impl IoctlState { | |||
| 101 | self.state.set(IoctlStateInner::Done { resp_len: 0 }); | 102 | self.state.set(IoctlStateInner::Done { resp_len: 0 }); |
| 102 | } | 103 | } |
| 103 | 104 | ||
| 104 | pub async fn do_ioctl(&self, kind: IoctlType, cmd: u32, iface: u32, buf: &mut [u8]) -> usize { | 105 | pub async fn do_ioctl(&self, kind: IoctlType, cmd: Ioctl, iface: u32, buf: &mut [u8]) -> usize { |
| 105 | self.state | 106 | self.state |
| 106 | .set(IoctlStateInner::Pending(PendingIoctl { buf, kind, cmd, iface })); | 107 | .set(IoctlStateInner::Pending(PendingIoctl { buf, kind, cmd, iface })); |
| 107 | self.wake_runner(); | 108 | self.wake_runner(); |
