9#ifndef ZEPHYR_MCTP_USB_H_
10#define ZEPHYR_MCTP_USB_H_
16#define USBD_MCTP_SUBCLASS_MANAGEMENT_CONTROLLER 0
17#define USBD_MCTP_SUBCLASS_MANAGED_DEVICE_ENDPOINT 0
18#define USBD_MCTP_SUBCLASS_HOST_INTERFACE_ENDPOINT 1
21#define USBD_MCTP_PROTOCOL_1_X 1
22#define USBD_MCTP_PROTOCOL_2_X 2
25#define MCTP_USB_HEADER_SIZE 4
26#define MCTP_USB_MAX_PACKET_LENGTH 255
33 struct mctp_binding binding;
37 struct mctp_pktbuf *rx_pkt;
67int mctp_usb_start(
struct mctp_binding *binding);
68int mctp_usb_tx(
struct mctp_binding *binding,
struct mctp_pktbuf *pkt);
78#define MCTP_USB_DEFINE(_name, _subclass, _protocol) \
79 struct mctp_binding_usb _name = { \
81 .name = STRINGIFY(_name), \
83 .pkt_size = MCTP_PACKET_SIZE(MCTP_USB_MAX_PACKET_LENGTH), \
86 .tx_storage = _name.tx_storage, \
87 .start = mctp_usb_start, \
90 .usb_class_data = NULL, \
93 .rx_state = STATE_WAIT_HDR_DMTF0 \
96 const STRUCT_SECTION_ITERABLE(mctp_usb_class_inst, mctp_usb_class_inst_##_name) = { \
97 .subclass = _subclass, \
98 .mctp_protocol = _protocol, \
99 .mctp_binding = &_name, \
#define MCTP_USB_MAX_PACKET_LENGTH
Definition mctp_usb.h:26
#define MCTP_USB_HEADER_SIZE
Definition mctp_usb.h:25
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Semaphore structure.
Definition kernel.h:3667
An MCTP binding for Zephyr's USB device stack.
Definition mctp_usb.h:31
MCTP USB class instance configuration.
Definition mctp_usb.h:57
uint8_t subclass
MCTP subclass used in the USB interface descriptor.
Definition mctp_usb.h:59
uint8_t mctp_protocol
MCTP protocol version used in the USB interface descriptor.
Definition mctp_usb.h:61
struct mctp_binding_usb * mctp_binding
Pointer to the associated MCTP USB bus binding.
Definition mctp_usb.h:63
USB device support class data.
Definition usbd.h:382