summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJeremy Kerr <jk@codeconstruct.com.au>2026-07-24 13:15:23 +0800
committerJakub Kicinski <kuba@kernel.org>2026-07-30 16:54:58 -0700
commit05b1a3a5eeaa64a5d412688e682a3b13acd99e8b (patch)
treeadb777bdf16d8c08b18f6dd1dab9056d44ecf9df /include/linux
parent2f2e974f8fbe8a19311842afaf66394f4caa0ae4 (diff)
net: mctp: usb: Use packet-length max for maximum packet-size check
The max packet size is smaller than the max transfer size, as we only have a u8 length field in the transport header. Add a define for the maximum representable length, and use that for our check. Use this for the MTU maximum calculation too. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://patch.msgid.link/20260724-dev-mctp-usb-1-1-v5-2-e66bbba0dbdc@codeconstruct.com.au Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/usb/mctp-usb.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/usb/mctp-usb.h b/include/linux/usb/mctp-usb.h
index 47e2e3931d63..2bece8afd1c7 100644
--- a/include/linux/usb/mctp-usb.h
+++ b/include/linux/usb/mctp-usb.h
@@ -25,7 +25,8 @@ struct mctp_usb_hdr {
#define MCTP_USB_1_0_XFER_SIZE 512
#define MCTP_USB_BTU 68
#define MCTP_USB_MTU_MIN MCTP_USB_BTU
-#define MCTP_USB_1_0_MTU_MAX (U8_MAX - sizeof(struct mctp_usb_hdr))
+#define MCTP_USB_1_0_PKTLEN_MAX U8_MAX
+#define MCTP_USB_1_0_MTU_MAX (MCTP_USB_1_0_PKTLEN_MAX - sizeof(struct mctp_usb_hdr))
#define MCTP_USB_DMTF_ID 0x1ab4
#endif /* __LINUX_USB_MCTP_USB_H */