Skip to content

Commit

Permalink
Update DTX IOCTL interface
Browse files Browse the repository at this point in the history
  • Loading branch information
qzed committed Oct 16, 2020
1 parent 4e93ad4 commit f0b26ff
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/sys/latch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ impl Device {
}

pub fn get_opmode(&self) -> Result<OpMode> {
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)?;
}

Expand All @@ -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);

0 comments on commit f0b26ff

Please sign in to comment.