15#ifndef ZEPHYR_INCLUDE_PMCI_MCTP_MCTP_USB_H_
16#define ZEPHYR_INCLUDE_PMCI_MCTP_MCTP_USB_H_
28#define USBD_MCTP_SUBCLASS_MANAGEMENT_CONTROLLER 0
30#define USBD_MCTP_SUBCLASS_MANAGED_DEVICE_ENDPOINT 0
32#define USBD_MCTP_SUBCLASS_HOST_INTERFACE_ENDPOINT 1
42#define USBD_MCTP_PROTOCOL_1_X 1
44#define USBD_MCTP_PROTOCOL_2_X 2
49#define MCTP_USB_HEADER_SIZE 4
50#define MCTP_USB_MAX_PACKET_LENGTH 255
58 struct mctp_binding binding;
60 uint8_t tx_buf[MCTP_USB_HEADER_SIZE + MCTP_USB_MAX_PACKET_LENGTH];
62 struct mctp_pktbuf *rx_pkt;
71 uint8_t tx_storage[MCTP_PKTBUF_SIZE(MCTP_PACKET_SIZE(MCTP_USB_MAX_PACKET_LENGTH))]
92int mctp_usb_start(
struct mctp_binding *binding);
93int mctp_usb_tx(
struct mctp_binding *binding,
struct mctp_pktbuf *pkt);
103#define MCTP_USB_DEFINE(_name, _subclass, _protocol) \
104 struct mctp_binding_usb _name = { \
106 .name = STRINGIFY(_name), \
108 .pkt_size = MCTP_PACKET_SIZE(MCTP_USB_MAX_PACKET_LENGTH), \
111 .tx_storage = _name.tx_storage, \
112 .start = mctp_usb_start, \
115 .usb_class_data = NULL, \
118 .rx_state = STATE_WAIT_HDR_DMTF0 \
121 const STRUCT_SECTION_ITERABLE(mctp_usb_class_inst, mctp_usb_class_inst_##_name) = { \
122 .subclass = _subclass, \
123 .mctp_protocol = _protocol, \
124 .mctp_binding = &_name, \
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Semaphore structure.
Definition kernel.h:3798
INTERNAL_HIDDEN.
Definition mctp_usb.h:56
MCTP USB class instance configuration.
Definition mctp_usb.h:82
uint8_t subclass
MCTP subclass used in the USB interface descriptor.
Definition mctp_usb.h:84
uint8_t mctp_protocol
MCTP protocol version used in the USB interface descriptor.
Definition mctp_usb.h:86
struct mctp_binding_usb * mctp_binding
Pointer to the associated MCTP USB bus binding.
Definition mctp_usb.h:88
USB device support class data.
Definition usbd.h:396
Iterable sections helpers.