aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb/cdc.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 20:30:48 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 20:30:48 -0700
commit5cc103506289de7ee0a0b526ae0381541990cad4 (patch)
treeae8a4958e70c6d1295030b40e333dcc007b3c074 /include/linux/usb/cdc.h
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 (diff)
parentUSB: mct_u232: fix broken close (diff)
downloadlinux-dev-5cc103506289de7ee0a0b526ae0381541990cad4.tar.xz
linux-dev-5cc103506289de7ee0a0b526ae0381541990cad4.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (141 commits) USB: mct_u232: fix broken close USB: gadget: amd5536udc.c: fix error path USB: imx21-hcd - fix off by one resource size calculation usb: gadget: fix Kconfig warning usb: r8a66597-udc: Add processing when USB was removed. mxc_udc: add workaround for ENGcm09152 for i.MX35 USB: ftdi_sio: add device ids for ScienceScope USB: musb: AM35x: Workaround for fifo read issue USB: musb: add musb support for AM35x USB: AM35x: Add musb support usb: Fix linker errors with CONFIG_PM=n USB: ohci-sh - use resource_size instead of defining its own resource_len macro USB: isp1362-hcd - use resource_size instead of defining its own resource_len macro USB: isp116x-hcd - use resource_size instead of defining its own resource_len macro USB: xhci: Fix compile error when CONFIG_PM=n USB: accept some invalid ep0-maxpacket values USB: xHCI: PCI power management implementation USB: xHCI: bus power management implementation USB: xHCI: port remote wakeup implementation USB: xHCI: port power management implementation ... Manually fix up (non-data) conflict: the SCSI merge gad renamed the 'hw_sector_size' member to 'physical_block_size', and the USB tree brought a new use of it.
Diffstat (limited to 'include/linux/usb/cdc.h')
-rw-r--r--include/linux/usb/cdc.h79
1 files changed, 67 insertions, 12 deletions
diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h
index c117a68d04a7..5e86dc771da4 100644
--- a/include/linux/usb/cdc.h
+++ b/include/linux/usb/cdc.h
@@ -32,6 +32,8 @@
#define USB_CDC_PROTO_EEM 7
+#define USB_CDC_NCM_PROTO_NTB 1
+
/*-------------------------------------------------------------------------*/
/*
@@ -274,13 +276,13 @@ struct usb_cdc_notification {
/*
* Class Specific structures and constants
*
- * CDC NCM parameter structure, CDC NCM subclass 6.2.1
+ * CDC NCM NTB parameters structure, CDC NCM subclass 6.2.1
*
*/
-struct usb_cdc_ncm_ntb_parameter {
+struct usb_cdc_ncm_ntb_parameters {
__le16 wLength;
- __le16 bmNtbFormatSupported;
+ __le16 bmNtbFormatsSupported;
__le32 dwNtbInMaxSize;
__le16 wNdpInDivisor;
__le16 wNdpInPayloadRemainder;
@@ -297,8 +299,8 @@ struct usb_cdc_ncm_ntb_parameter {
* CDC NCM transfer headers, CDC NCM subclass 3.2
*/
-#define NCM_NTH16_SIGN 0x484D434E /* NCMH */
-#define NCM_NTH32_SIGN 0x686D636E /* ncmh */
+#define USB_CDC_NCM_NTH16_SIGN 0x484D434E /* NCMH */
+#define USB_CDC_NCM_NTH32_SIGN 0x686D636E /* ncmh */
struct usb_cdc_ncm_nth16 {
__le32 dwSignature;
@@ -320,25 +322,78 @@ struct usb_cdc_ncm_nth32 {
* CDC NCM datagram pointers, CDC NCM subclass 3.3
*/
-#define NCM_NDP16_CRC_SIGN 0x314D434E /* NCM1 */
-#define NCM_NDP16_NOCRC_SIGN 0x304D434E /* NCM0 */
-#define NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */
-#define NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */
+#define USB_CDC_NCM_NDP16_CRC_SIGN 0x314D434E /* NCM1 */
+#define USB_CDC_NCM_NDP16_NOCRC_SIGN 0x304D434E /* NCM0 */
+#define USB_CDC_NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */
+#define USB_CDC_NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */
+
+/* 16-bit NCM Datagram Pointer Entry */
+struct usb_cdc_ncm_dpe16 {
+ __le16 wDatagramIndex;
+ __le16 wDatagramLength;
+} __attribute__((__packed__));
+/* 16-bit NCM Datagram Pointer Table */
struct usb_cdc_ncm_ndp16 {
__le32 dwSignature;
__le16 wLength;
__le16 wNextFpIndex;
- __u8 data[0];
+ struct usb_cdc_ncm_dpe16 dpe16[0];
} __attribute__ ((packed));
+/* 32-bit NCM Datagram Pointer Entry */
+struct usb_cdc_ncm_dpe32 {
+ __le32 dwDatagramIndex;
+ __le32 dwDatagramLength;
+} __attribute__((__packed__));
+
+/* 32-bit NCM Datagram Pointer Table */
struct usb_cdc_ncm_ndp32 {
__le32 dwSignature;
__le16 wLength;
__le16 wReserved6;
- __le32 dwNextFpIndex;
+ __le32 dwNextNdpIndex;
__le32 dwReserved12;
- __u8 data[0];
+ struct usb_cdc_ncm_dpe32 dpe32[0];
} __attribute__ ((packed));
+/* CDC NCM subclass 3.2.1 and 3.2.2 */
+#define USB_CDC_NCM_NDP16_INDEX_MIN 0x000C
+#define USB_CDC_NCM_NDP32_INDEX_MIN 0x0010
+
+/* CDC NCM subclass 3.3.3 Datagram Formatting */
+#define USB_CDC_NCM_DATAGRAM_FORMAT_CRC 0x30
+#define USB_CDC_NCM_DATAGRAM_FORMAT_NOCRC 0X31
+
+/* CDC NCM subclass 4.2 NCM Communications Interface Protocol Code */
+#define USB_CDC_NCM_PROTO_CODE_NO_ENCAP_COMMANDS 0x00
+#define USB_CDC_NCM_PROTO_CODE_EXTERN_PROTO 0xFE
+
+/* CDC NCM subclass 5.2.1 NCM Functional Descriptor, bmNetworkCapabilities */
+#define USB_CDC_NCM_NCAP_ETH_FILTER (1 << 0)
+#define USB_CDC_NCM_NCAP_NET_ADDRESS (1 << 1)
+#define USB_CDC_NCM_NCAP_ENCAP_COMMAND (1 << 2)
+#define USB_CDC_NCM_NCAP_MAX_DATAGRAM_SIZE (1 << 3)
+#define USB_CDC_NCM_NCAP_CRC_MODE (1 << 4)
+
+/* CDC NCM subclass Table 6-3: NTB Parameter Structure */
+#define USB_CDC_NCM_NTB16_SUPPORTED (1 << 0)
+#define USB_CDC_NCM_NTB32_SUPPORTED (1 << 1)
+
+/* CDC NCM subclass Table 6-3: NTB Parameter Structure */
+#define USB_CDC_NCM_NDP_ALIGN_MIN_SIZE 0x04
+#define USB_CDC_NCM_NTB_MAX_LENGTH 0x1C
+
+/* CDC NCM subclass 6.2.5 SetNtbFormat */
+#define USB_CDC_NCM_NTB16_FORMAT 0x00
+#define USB_CDC_NCM_NTB32_FORMAT 0x01
+
+/* CDC NCM subclass 6.2.7 SetNtbInputSize */
+#define USB_CDC_NCM_NTB_MIN_IN_SIZE 2048
+#define USB_CDC_NCM_NTB_MIN_OUT_SIZE 2048
+
+/* CDC NCM subclass 6.2.11 SetCrcMode */
+#define USB_CDC_NCM_CRC_NOT_APPENDED 0x00
+#define USB_CDC_NCM_CRC_APPENDED 0x01
+
#endif /* __LINUX_USB_CDC_H */