aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorYauheni Kaliuta <yauheni.kaliuta@nokia.com>2010-04-16 09:13:34 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:39 -0400
commit01154aa714240a9be12a0ed69b047e53d258f5b1 (patch)
tree51b80ba7ab47b34744291b55668a8ccca492cb07 /include/linux/usb
parent9ff68c7ad8910426495be36e2b568ac623adc226 (diff)
usb: cdc: ncm constants and structures added
Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/cdc.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h
index c24124a42ce5..c117a68d04a7 100644
--- a/include/linux/usb/cdc.h
+++ b/include/linux/usb/cdc.h
@@ -18,6 +18,7 @@
18#define USB_CDC_SUBCLASS_MDLM 0x0a 18#define USB_CDC_SUBCLASS_MDLM 0x0a
19#define USB_CDC_SUBCLASS_OBEX 0x0b 19#define USB_CDC_SUBCLASS_OBEX 0x0b
20#define USB_CDC_SUBCLASS_EEM 0x0c 20#define USB_CDC_SUBCLASS_EEM 0x0c
21#define USB_CDC_SUBCLASS_NCM 0x0d
21 22
22#define USB_CDC_PROTO_NONE 0 23#define USB_CDC_PROTO_NONE 0
23 24
@@ -49,6 +50,7 @@
49#define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */ 50#define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */
50#define USB_CDC_DMM_TYPE 0x14 51#define USB_CDC_DMM_TYPE 0x14
51#define USB_CDC_OBEX_TYPE 0x15 52#define USB_CDC_OBEX_TYPE 0x15
53#define USB_CDC_NCM_TYPE 0x1a
52 54
53/* "Header Functional Descriptor" from CDC spec 5.2.3.1 */ 55/* "Header Functional Descriptor" from CDC spec 5.2.3.1 */
54struct usb_cdc_header_desc { 56struct usb_cdc_header_desc {
@@ -174,6 +176,15 @@ struct usb_cdc_obex_desc {
174 __le16 bcdVersion; 176 __le16 bcdVersion;
175} __attribute__ ((packed)); 177} __attribute__ ((packed));
176 178
179/* "NCM Control Model Functional Descriptor" */
180struct usb_cdc_ncm_desc {
181 __u8 bLength;
182 __u8 bDescriptorType;
183 __u8 bDescriptorSubType;
184
185 __le16 bcdNcmVersion;
186 __u8 bmNetworkCapabilities;
187} __attribute__ ((packed));
177/*-------------------------------------------------------------------------*/ 188/*-------------------------------------------------------------------------*/
178 189
179/* 190/*
@@ -197,6 +208,17 @@ struct usb_cdc_obex_desc {
197#define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42 208#define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42
198#define USB_CDC_SET_ETHERNET_PACKET_FILTER 0x43 209#define USB_CDC_SET_ETHERNET_PACKET_FILTER 0x43
199#define USB_CDC_GET_ETHERNET_STATISTIC 0x44 210#define USB_CDC_GET_ETHERNET_STATISTIC 0x44
211#define USB_CDC_GET_NTB_PARAMETERS 0x80
212#define USB_CDC_GET_NET_ADDRESS 0x81
213#define USB_CDC_SET_NET_ADDRESS 0x82
214#define USB_CDC_GET_NTB_FORMAT 0x83
215#define USB_CDC_SET_NTB_FORMAT 0x84
216#define USB_CDC_GET_NTB_INPUT_SIZE 0x85
217#define USB_CDC_SET_NTB_INPUT_SIZE 0x86
218#define USB_CDC_GET_MAX_DATAGRAM_SIZE 0x87
219#define USB_CDC_SET_MAX_DATAGRAM_SIZE 0x88
220#define USB_CDC_GET_CRC_MODE 0x89
221#define USB_CDC_SET_CRC_MODE 0x8a
200 222
201/* Line Coding Structure from CDC spec 6.2.13 */ 223/* Line Coding Structure from CDC spec 6.2.13 */
202struct usb_cdc_line_coding { 224struct usb_cdc_line_coding {
@@ -247,4 +269,76 @@ struct usb_cdc_notification {
247 __le16 wLength; 269 __le16 wLength;
248} __attribute__ ((packed)); 270} __attribute__ ((packed));
249 271
272/*-------------------------------------------------------------------------*/
273
274/*
275 * Class Specific structures and constants
276 *
277 * CDC NCM parameter structure, CDC NCM subclass 6.2.1
278 *
279 */
280
281struct usb_cdc_ncm_ntb_parameter {
282 __le16 wLength;
283 __le16 bmNtbFormatSupported;
284 __le32 dwNtbInMaxSize;
285 __le16 wNdpInDivisor;
286 __le16 wNdpInPayloadRemainder;
287 __le16 wNdpInAlignment;
288 __le16 wPadding1;
289 __le32 dwNtbOutMaxSize;
290 __le16 wNdpOutDivisor;
291 __le16 wNdpOutPayloadRemainder;
292 __le16 wNdpOutAlignment;
293 __le16 wPadding2;
294} __attribute__ ((packed));
295
296/*
297 * CDC NCM transfer headers, CDC NCM subclass 3.2
298 */
299
300#define NCM_NTH16_SIGN 0x484D434E /* NCMH */
301#define NCM_NTH32_SIGN 0x686D636E /* ncmh */
302
303struct usb_cdc_ncm_nth16 {
304 __le32 dwSignature;
305 __le16 wHeaderLength;
306 __le16 wSequence;
307 __le16 wBlockLength;
308 __le16 wFpIndex;
309} __attribute__ ((packed));
310
311struct usb_cdc_ncm_nth32 {
312 __le32 dwSignature;
313 __le16 wHeaderLength;
314 __le16 wSequence;
315 __le32 dwBlockLength;
316 __le32 dwFpIndex;
317} __attribute__ ((packed));
318
319/*
320 * CDC NCM datagram pointers, CDC NCM subclass 3.3
321 */
322
323#define NCM_NDP16_CRC_SIGN 0x314D434E /* NCM1 */
324#define NCM_NDP16_NOCRC_SIGN 0x304D434E /* NCM0 */
325#define NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */
326#define NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */
327
328struct usb_cdc_ncm_ndp16 {
329 __le32 dwSignature;
330 __le16 wLength;
331 __le16 wNextFpIndex;
332 __u8 data[0];
333} __attribute__ ((packed));
334
335struct usb_cdc_ncm_ndp32 {
336 __le32 dwSignature;
337 __le16 wLength;
338 __le16 wReserved6;
339 __le32 dwNextFpIndex;
340 __le32 dwReserved12;
341 __u8 data[0];
342} __attribute__ ((packed));
343
250#endif /* __LINUX_USB_CDC_H */ 344#endif /* __LINUX_USB_CDC_H */