Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
mctp_usb.h File Reference

MCTP bus binding over the Zephyr USB device stack. More...

#include <zephyr/sys/iterable_sections.h>
#include <libmctp.h>

Go to the source code of this file.

Data Structures

struct  mctp_binding_usb
 INTERNAL_HIDDEN. More...
struct  mctp_usb_class_inst
 MCTP USB class instance configuration. More...

Macros

#define MCTP_USB_DEFINE(_name, _subclass, _protocol)
 INTERNAL_HIDDEN.
MCTP class subclass options

Values accepted as the subclass argument of MCTP_USB_DEFINE().

#define USBD_MCTP_SUBCLASS_MANAGEMENT_CONTROLLER   0
 Management controller.
#define USBD_MCTP_SUBCLASS_MANAGED_DEVICE_ENDPOINT   0
 Managed device endpoint.
#define USBD_MCTP_SUBCLASS_HOST_INTERFACE_ENDPOINT   1
 Host interface endpoint.
MCTP class protocol options

Values accepted as the protocol argument of MCTP_USB_DEFINE().

#define USBD_MCTP_PROTOCOL_1_X   1
 MCTP protocol version 1.x.
#define USBD_MCTP_PROTOCOL_2_X   2
 MCTP protocol version 2.x.

Detailed Description

MCTP bus binding over the Zephyr USB device stack.

Macro Definition Documentation

◆ MCTP_USB_DEFINE

#define MCTP_USB_DEFINE ( _name,
_subclass,
_protocol )
Value:
struct mctp_binding_usb _name = { \
.binding = { \
.name = STRINGIFY(_name), \
.version = 1, \
.pkt_size = MCTP_PACKET_SIZE(MCTP_USB_MAX_PACKET_LENGTH), \
.pkt_header = 0, \
.pkt_trailer = 0, \
.tx_storage = _name.tx_storage, \
.start = mctp_usb_start, \
.tx = mctp_usb_tx \
}, \
.usb_class_data = NULL, \
.rx_pkt = NULL, \
.rx_data_idx = 0, \
.rx_state = STATE_WAIT_HDR_DMTF0 \
}; \
\
const STRUCT_SECTION_ITERABLE(mctp_usb_class_inst, mctp_usb_class_inst_##_name) = { \
.subclass = _subclass, \
.mctp_protocol = _protocol, \
.mctp_binding = &_name, \
};
#define STRUCT_SECTION_ITERABLE(struct_type, varname)
Defines a new element for an iterable section.
Definition iterable_sections.h:244
#define NULL
Definition iar_missing_defs.h:20
#define STRINGIFY(s)
Definition common.h:185
INTERNAL_HIDDEN.
Definition mctp_usb.h:56

INTERNAL_HIDDEN.

Define a MCTP bus binding for USB

Parameters
_nameSymbolic name of the bus binding variable
_subclassMCTP subclass used in the USB interfce descriptor
_protocolMCTP protocol used in the USB interface descriptor

◆ USBD_MCTP_PROTOCOL_1_X

#define USBD_MCTP_PROTOCOL_1_X   1

MCTP protocol version 1.x.

◆ USBD_MCTP_PROTOCOL_2_X

#define USBD_MCTP_PROTOCOL_2_X   2

MCTP protocol version 2.x.

◆ USBD_MCTP_SUBCLASS_HOST_INTERFACE_ENDPOINT

#define USBD_MCTP_SUBCLASS_HOST_INTERFACE_ENDPOINT   1

Host interface endpoint.

◆ USBD_MCTP_SUBCLASS_MANAGED_DEVICE_ENDPOINT

#define USBD_MCTP_SUBCLASS_MANAGED_DEVICE_ENDPOINT   0

Managed device endpoint.

◆ USBD_MCTP_SUBCLASS_MANAGEMENT_CONTROLLER

#define USBD_MCTP_SUBCLASS_MANAGEMENT_CONTROLLER   0

Management controller.