firmware: fix drtio_dbg module syntax

This commit is contained in:
Sebastien Bourdeauducq 2018-01-10 12:15:23 +08:00
parent dc593ec0f0
commit 94d51d1364
1 changed files with 14 additions and 15 deletions

View File

@ -193,23 +193,22 @@ mod imp {
pub use self::imp::*; pub use self::imp::*;
pub mod drtio_dbg { pub mod drtio_dbg {
use ::send; use ::send;
use ::recv; use ::recv;
use kernel_proto::*; use kernel_proto::*;
#[repr(C)] #[repr(C)]
pub struct PacketCounts(i32, i32); pub struct PacketCounts(i32, i32);
pub extern fn get_packet_counts(linkno: i32) -> PacketCounts { pub extern fn get_packet_counts(linkno: i32) -> PacketCounts {
send(&DrtioPacketCountRequest { linkno: linkno as u8 }); send(&DrtioPacketCountRequest { linkno: linkno as u8 });
recv!(&DrtioPacketCountReply { tx_cnt, rx_cnt } recv!(&DrtioPacketCountReply { tx_cnt, rx_cnt }
=> PacketCounts(tx_cnt as i32, rx_cnt as i32)) => PacketCounts(tx_cnt as i32, rx_cnt as i32))
} }
pub extern fn get_buffer_space_req_count(linkno: i32) -> i32 { pub extern fn get_buffer_space_req_count(linkno: i32) -> i32 {
send(&DrtioBufferSpaceReqCountRequest { linkno: linkno as u8 }); send(&DrtioBufferSpaceReqCountRequest { linkno: linkno as u8 });
recv!(&DrtioBufferSpaceReqCountReply { cnt } recv!(&DrtioBufferSpaceReqCountReply { cnt }
=> cnt as i32) => cnt as i32)
}
} }
} }