From f0b26ff70f9f5f49c3d820e2f2b9adc241b74ed6 Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Fri, 16 Oct 2020 04:20:47 +0200 Subject: [PATCH] Update DTX IOCTL interface --- src/sys/latch.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/sys/latch.rs b/src/sys/latch.rs index 2f423a3..a1f814c 100644 --- a/src/sys/latch.rs +++ b/src/sys/latch.rs @@ -75,9 +75,9 @@ impl Device { } pub fn get_opmode(&self) -> Result { - let mut opmode: u32 = 0; + let mut opmode: u16 = 0; unsafe { - dtx_get_opmode(self.file.as_raw_fd(), &mut opmode as *mut u32) + dtx_get_opmode(self.file.as_raw_fd(), &mut opmode as *mut u16) .context(ErrorKind::Io)?; } @@ -91,8 +91,7 @@ impl Device { } -ioctl_none!(dtx_latch_lock, 0x11, 0x01); -ioctl_none!(dtx_latch_unlock, 0x11, 0x02); -ioctl_none!(dtx_latch_request, 0x11, 0x03); -ioctl_none!(dtx_latch_open, 0x11, 0x04); -ioctl_read!(dtx_get_opmode, 0x11, 0x05, u32); +ioctl_none!(dtx_latch_lock, 0xa5, 0x23); +ioctl_none!(dtx_latch_unlock, 0xa5, 0x24); +ioctl_none!(dtx_latch_request, 0xa5, 0x25); +ioctl_read!(dtx_get_opmode, 0xa5, 0x2a, u16);