hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/include/linux/usb/cdc_ncm.h
....@@ -46,8 +46,11 @@
4646 #define CDC_NCM_DATA_ALTSETTING_NCM 1
4747 #define CDC_NCM_DATA_ALTSETTING_MBIM 2
4848
49
-/* CDC NCM subclass 3.2.1 */
49
+/* CDC NCM subclass 3.3.1 */
5050 #define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10
51
+
52
+/* CDC NCM subclass 3.3.2 */
53
+#define USB_CDC_NCM_NDP32_LENGTH_MIN 0x20
5154
5255 /* Maximum NTB length */
5356 #define CDC_NCM_NTB_MAX_SIZE_TX 32768 /* bytes */
....@@ -84,7 +87,7 @@
8487 /* Driver flags */
8588 #define CDC_NCM_FLAG_NDP_TO_END 0x02 /* NDP is placed at end of frame */
8689 #define CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE 0x04 /* Avoid altsetting toggle during init */
87
-#define CDC_NCM_FLAG_RESET_NTB16 0x08 /* set NDP16 one more time after altsetting switch */
90
+#define CDC_NCM_FLAG_PREFER_NTB32 0x08 /* prefer NDP32 over NDP16 */
8891
8992 #define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \
9093 (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE)
....@@ -113,7 +116,11 @@
113116
114117 u32 timer_interval;
115118 u32 max_ndp_size;
116
- struct usb_cdc_ncm_ndp16 *delayed_ndp16;
119
+ u8 is_ndp16;
120
+ union {
121
+ struct usb_cdc_ncm_ndp16 *delayed_ndp16;
122
+ struct usb_cdc_ncm_ndp32 *delayed_ndp32;
123
+ };
117124
118125 u32 tx_timer_pending;
119126 u32 tx_curr_frame_num;
....@@ -150,6 +157,8 @@
150157 struct sk_buff *cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign);
151158 int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in);
152159 int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset);
160
+int cdc_ncm_rx_verify_nth32(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in);
161
+int cdc_ncm_rx_verify_ndp32(struct sk_buff *skb_in, int ndpoffset);
153162 struct sk_buff *
154163 cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags);
155164 int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in);