This workspace repository contains a set of crates providing MCTP support, primarily for use in embedded applications.
-
mctpimplements base type and trait definitions. -
mctp-linuximplements a transport implementation, using the Linux kernel MCTP sockets support for message send/receive -
pldmprovides Platform Level Data Model (PLDM) base definitions on top of the generic MCTP support -
pldm-fwuses thepldmbase definitions to implement the PLDM for Firmware Update protocol as a library. It include a Firmware Device (fd) responder that can run on embedded devices withno_std, and an Update Agent (ua) forstdplatforms. -
pldm-fw-cliis a command-line PLDM Firmware Update utility. This targetsmctp-linuxthough could be adapted to any implementation of themctpcrate traits. -
mctp-estackis a MCTP stack suitable for embedded devices, runningno_stdwith fixed allocations. The stack handles message fragmentation/reassembly and tag tracking. The crate'sRoutercan be used by async MCTP applications to interface with multiple transport ports, and handles MCTP bridging. It includes built-in MCTP transport handling for I2C, USB, and serial.mctp-estackincludes a minimal MCTP control protocol implementation. -
mctp-usb-embassyis a MCTP over USB transport forembassy-usb. -
standaloneis amctptrait implementation that includes its ownmctp-estackinstance, allowing running a standalone MCTP-over-serial stack against a Linux TTY (or any other pipe device). This can be used for example with QEMU.
mctp
mctp-linux
pldm
pldm-fw
mctp-estack
mctp-usb-embassy
There's a small example MCTP requester in mctp-linux/examples:
// Create a new endpoint using the linux socket support
let mut ep = MctpLinuxReq::new(EID, None)?;
// for subsequent use of `ep`, we're just interacting with the
// mctp::ReqChannel trait, which is independent of the socket support
// Get Endpoint ID message: command 0x02, no data. Allow the MCTP stack
// to allocate an owned tag.
let tx_buf = vec![0x02u8];
ep.send(MCTP_TYPE_CONTROL, &tx_buf)?;
// Receive a response. We create a 16-byte vec to read into; ep.recv()
// will return the sub-slice containing just the response data.
let mut rx_buf = vec![0u8; 16];
let (typ, ic, rx_buf) = ep.recv(&mut rx_buf)?;There are also some MCTP over serial examples in standalone/examples.
If you wish to contribute, please see the contribution guidelines.