Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[cris-mirror.git] / include / linux / usb / irda.h
blob396d2b043e6476fe98c578eff331a36aa4d8ba61
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * USB IrDA Bridge Device Definition
4 */
6 #ifndef __LINUX_USB_IRDA_H
7 #define __LINUX_USB_IRDA_H
9 /* This device should use Application-specific class */
11 #define USB_SUBCLASS_IRDA 0x02
13 /*-------------------------------------------------------------------------*/
15 /* Class-Specific requests (bRequest field) */
17 #define USB_REQ_CS_IRDA_RECEIVING 1
18 #define USB_REQ_CS_IRDA_CHECK_MEDIA_BUSY 3
19 #define USB_REQ_CS_IRDA_RATE_SNIFF 4
20 #define USB_REQ_CS_IRDA_UNICAST_LIST 5
21 #define USB_REQ_CS_IRDA_GET_CLASS_DESC 6
23 /*-------------------------------------------------------------------------*/
25 /* Class-Specific descriptor */
27 #define USB_DT_CS_IRDA 0x21
29 /*-------------------------------------------------------------------------*/
31 /* Data sizes */
33 #define USB_IRDA_DS_2048 (1 << 5)
34 #define USB_IRDA_DS_1024 (1 << 4)
35 #define USB_IRDA_DS_512 (1 << 3)
36 #define USB_IRDA_DS_256 (1 << 2)
37 #define USB_IRDA_DS_128 (1 << 1)
38 #define USB_IRDA_DS_64 (1 << 0)
40 /* Window sizes */
42 #define USB_IRDA_WS_7 (1 << 6)
43 #define USB_IRDA_WS_6 (1 << 5)
44 #define USB_IRDA_WS_5 (1 << 4)
45 #define USB_IRDA_WS_4 (1 << 3)
46 #define USB_IRDA_WS_3 (1 << 2)
47 #define USB_IRDA_WS_2 (1 << 1)
48 #define USB_IRDA_WS_1 (1 << 0)
50 /* Min turnaround times in usecs */
52 #define USB_IRDA_MTT_0 (1 << 7)
53 #define USB_IRDA_MTT_10 (1 << 6)
54 #define USB_IRDA_MTT_50 (1 << 5)
55 #define USB_IRDA_MTT_100 (1 << 4)
56 #define USB_IRDA_MTT_500 (1 << 3)
57 #define USB_IRDA_MTT_1000 (1 << 2)
58 #define USB_IRDA_MTT_5000 (1 << 1)
59 #define USB_IRDA_MTT_10000 (1 << 0)
61 /* Baud rates */
63 #define USB_IRDA_BR_4000000 (1 << 8)
64 #define USB_IRDA_BR_1152000 (1 << 7)
65 #define USB_IRDA_BR_576000 (1 << 6)
66 #define USB_IRDA_BR_115200 (1 << 5)
67 #define USB_IRDA_BR_57600 (1 << 4)
68 #define USB_IRDA_BR_38400 (1 << 3)
69 #define USB_IRDA_BR_19200 (1 << 2)
70 #define USB_IRDA_BR_9600 (1 << 1)
71 #define USB_IRDA_BR_2400 (1 << 0)
73 /* Additional BOFs */
75 #define USB_IRDA_AB_0 (1 << 7)
76 #define USB_IRDA_AB_1 (1 << 6)
77 #define USB_IRDA_AB_2 (1 << 5)
78 #define USB_IRDA_AB_3 (1 << 4)
79 #define USB_IRDA_AB_6 (1 << 3)
80 #define USB_IRDA_AB_12 (1 << 2)
81 #define USB_IRDA_AB_24 (1 << 1)
82 #define USB_IRDA_AB_48 (1 << 0)
84 /* IRDA Rate Sniff */
86 #define USB_IRDA_RATE_SNIFF 1
88 /*-------------------------------------------------------------------------*/
90 struct usb_irda_cs_descriptor {
91 __u8 bLength;
92 __u8 bDescriptorType;
94 __le16 bcdSpecRevision;
95 __u8 bmDataSize;
96 __u8 bmWindowSize;
97 __u8 bmMinTurnaroundTime;
98 __le16 wBaudRate;
99 __u8 bmAdditionalBOFs;
100 __u8 bIrdaRateSniff;
101 __u8 bMaxUnicastList;
102 } __attribute__ ((packed));
104 /*-------------------------------------------------------------------------*/
106 /* Data Format */
108 #define USB_IRDA_STATUS_MEDIA_BUSY (1 << 7)
110 /* The following is a 4-bit value used for both
111 * inbound and outbound headers:
113 * 0 - speed ignored
114 * 1 - 2400 bps
115 * 2 - 9600 bps
116 * 3 - 19200 bps
117 * 4 - 38400 bps
118 * 5 - 57600 bps
119 * 6 - 115200 bps
120 * 7 - 576000 bps
121 * 8 - 1.152 Mbps
122 * 9 - 5 mbps
123 * 10..15 - Reserved
125 #define USB_IRDA_STATUS_LINK_SPEED 0x0f
127 /* The following is a 4-bit value used only for
128 * outbound header:
130 * 0 - No change (BOF ignored)
131 * 1 - 48 BOFs
132 * 2 - 24 BOFs
133 * 3 - 12 BOFs
134 * 4 - 6 BOFs
135 * 5 - 3 BOFs
136 * 6 - 2 BOFs
137 * 7 - 1 BOFs
138 * 8 - 0 BOFs
139 * 9..15 - Reserved
141 #define USB_IRDA_EXTRA_BOFS 0xf0
143 struct usb_irda_inbound_header {
144 __u8 bmStatus;
147 struct usb_irda_outbound_header {
148 __u8 bmChange;
151 #endif /* __LINUX_USB_IRDA_H */