From be1f34bf7b3ca22afad01e7f67684dfd069281f4 Mon Sep 17 00:00:00 2001 From: occheung Date: Fri, 23 Aug 2024 13:10:20 +0800 Subject: [PATCH] drtio-mgmt: fix len order --- src/runtime/src/mgmt.rs | 4 ++-- src/satman/src/main.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/runtime/src/mgmt.rs b/src/runtime/src/mgmt.rs index 5e35fdd..b7323e3 100644 --- a/src/runtime/src/mgmt.rs +++ b/src/runtime/src/mgmt.rs @@ -351,7 +351,7 @@ mod remote_coremgmt { let mut buffer = Vec::::new(); loop { match reply { - Packet::CoreMgmtConfigReadReply { length, last, value } => { + Packet::CoreMgmtConfigReadReply { last, length, value } => { buffer.extend(&value[..length as usize]); if last { @@ -403,8 +403,8 @@ mod remote_coremgmt { message.get_ref(), |slice, status, len: usize| Packet::CoreMgmtConfigWriteRequest { destination: destination, - length: len as u16, last: status.is_last(), + length: len as u16, data: *slice, }, |reply| match reply { diff --git a/src/satman/src/main.rs b/src/satman/src/main.rs index cd4b485..984a085 100644 --- a/src/satman/src/main.rs +++ b/src/satman/src/main.rs @@ -1140,8 +1140,8 @@ fn process_aux_packet( drtioaux::send( 0, &drtioaux::Packet::CoreMgmtConfigReadReply { - length: meta.len as u16, last: meta.status.is_last(), + length: meta.len as u16, value: value_slice, }, ) @@ -1169,16 +1169,16 @@ fn process_aux_packet( drtioaux::send( 0, &drtioaux::Packet::CoreMgmtConfigReadReply { - length: meta.len as u16, last: meta.status.is_last(), + length: meta.len as u16, value: value_slice, }, ) } drtioaux::Packet::CoreMgmtConfigWriteRequest { destination: _destination, - length, last, + length, data, } => { forward!(