Upcoming changes will add a USB host (and later gadget) driver for the MCTP-over-USB protocol. Add a header that provides common definitions for protocol support: the packet header format and a few framing definitions. Add a define for the MCTP class code, as per https://usb.org/defined-class-codes.
Unified · Split
| @@ -13896,6 +13896,7 @@ L: netdev@vger.kernel.org · 13895 unmodified lines | ||
| 13896 | 13896 | S: Maintained |
| 13897 | 13897 | F: Documentation/networking/mctp.rst |
| 13898 | 13898 | F: drivers/net/mctp/ |
| 13899 | +F: include/linux/usb/mctp-usb.h | |
| 13899 | 13900 | F: include/net/mctp.h |
| 13900 | 13901 | F: include/net/mctpdevice.h |
| 13901 | 13902 | F: include/net/netns/mctp.h |
| @@ -0,0 +1,30 @@ | ||
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ | |
| 2 | +/* | |
| 3 | + * mctp-usb.h - MCTP USB transport binding: common definitions, | |
| 4 | + * based on DMTF0283 specification: | |
| 5 | + * https://www.dmtf.org/sites/default/files/standards/documents/DSP0283_1.0.1.pdf | |
| 6 | + * | |
| 7 | + * These are protocol-level definitions, that may be shared between host | |
| 8 | + * and gadget drivers. | |
| 9 | + * | |
| 10 | + * Copyright (C) 2024-2025 Code Construct Pty Ltd | |
| 11 | + */ | |
| 12 | + | |
| 13 | +#ifndef __LINUX_USB_MCTP_USB_H | |
| 14 | +#define __LINUX_USB_MCTP_USB_H | |
| 15 | + | |
| 16 | +#include <linux/types.h> | |
| 17 | + | |
| 18 | +struct mctp_usb_hdr { | |
| 19 | + __be16 id; | |
| 20 | + u8 rsvd; | |
| 21 | + u8 len; | |
| 22 | +} __packed; | |
| 23 | + | |
| 24 | +#define MCTP_USB_XFER_SIZE 512 | |
| 25 | +#define MCTP_USB_BTU 68 | |
| 26 | +#define MCTP_USB_MTU_MIN MCTP_USB_BTU | |
| 27 | +#define MCTP_USB_MTU_MAX (U8_MAX - sizeof(struct mctp_usb_hdr)) | |
| 28 | +#define MCTP_USB_DMTF_ID 0x1ab4 | |
| 29 | + | |
| 30 | +#endif /* __LINUX_USB_MCTP_USB_H */ | |
| @@ -330,6 +330,7 @@ struct usb_device_descriptor { · 329 unmodified lines | ||
| 330 | 330 | #define USB_CLASS_AUDIO_VIDEO 0x10 |
| 331 | 331 | #define USB_CLASS_BILLBOARD 0x11 |
| 332 | 332 | #define USB_CLASS_USB_TYPE_C_BRIDGE 0x12 |
| 333 | +#define USB_CLASS_MCTP 0x14 | |
| 333 | 334 | #define USB_CLASS_MISC 0xef |
| 334 | 335 | #define USB_CLASS_APP_SPEC 0xfe |
| 335 | 336 | #define USB_SUBCLASS_DFU 0x01 |