diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-03-27 16:08:22 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-03-27 16:08:22 +0000 |
| commit | 273e6f5b835afe9883a37814a76caba2084d6dc2 (patch) | |
| tree | 3c13c61ab4bb28e6b14bba1157df01ad335fe9ea /src/ioctl.rs | |
| parent | 07fe37b5ee5d5643eca4bc8db13d8bed5399cefa (diff) | |
| parent | 8926397f4592f22a5ed54f772a979578ca36628f (diff) | |
Merge pull request #47 from kbleeke/pio-irq
Use IRQ instead of polling the status register
Diffstat (limited to 'src/ioctl.rs')
| -rw-r--r-- | src/ioctl.rs | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/ioctl.rs b/src/ioctl.rs index f5ab410db..89b20a2d6 100644 --- a/src/ioctl.rs +++ b/src/ioctl.rs | |||
| @@ -75,7 +75,6 @@ impl IoctlState { | |||
| 75 | pub async fn wait_pending(&self) -> PendingIoctl { | 75 | pub async fn wait_pending(&self) -> PendingIoctl { |
| 76 | let pending = poll_fn(|cx| { | 76 | let pending = poll_fn(|cx| { |
| 77 | if let IoctlStateInner::Pending(pending) = self.state.get() { | 77 | if let IoctlStateInner::Pending(pending) = self.state.get() { |
| 78 | warn!("found pending ioctl"); | ||
| 79 | Poll::Ready(pending) | 78 | Poll::Ready(pending) |
| 80 | } else { | 79 | } else { |
| 81 | self.register_runner(cx.waker()); | 80 | self.register_runner(cx.waker()); |
| @@ -93,7 +92,6 @@ impl IoctlState { | |||
| 93 | } | 92 | } |
| 94 | 93 | ||
| 95 | pub async fn do_ioctl(&self, kind: IoctlType, cmd: u32, iface: u32, buf: &mut [u8]) -> usize { | 94 | pub async fn do_ioctl(&self, kind: IoctlType, cmd: u32, iface: u32, buf: &mut [u8]) -> usize { |
| 96 | warn!("doing ioctl"); | ||
| 97 | self.state | 95 | self.state |
| 98 | .set(IoctlStateInner::Pending(PendingIoctl { buf, kind, cmd, iface })); | 96 | .set(IoctlStateInner::Pending(PendingIoctl { buf, kind, cmd, iface })); |
| 99 | self.wake_runner(); | 97 | self.wake_runner(); |
| @@ -102,7 +100,6 @@ impl IoctlState { | |||
| 102 | 100 | ||
| 103 | pub fn ioctl_done(&self, response: &[u8]) { | 101 | pub fn ioctl_done(&self, response: &[u8]) { |
| 104 | if let IoctlStateInner::Sent { buf } = self.state.get() { | 102 | if let IoctlStateInner::Sent { buf } = self.state.get() { |
| 105 | warn!("ioctl complete"); | ||
| 106 | // TODO fix this | 103 | // TODO fix this |
| 107 | (unsafe { &mut *buf }[..response.len()]).copy_from_slice(response); | 104 | (unsafe { &mut *buf }[..response.len()]).copy_from_slice(response); |
| 108 | 105 | ||
