dm: calculate queue limits during resume not load
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / linux / usb / irda.h
blobe345ceaf72d690de32fa7e495406d8ec04fb5437
1 /*
2 * USB IrDA Bridge Device Definition
3 */
5 #ifndef __LINUX_USB_IRDA_H
6 #define __LINUX_USB_IRDA_H
8 /* This device should use Application-specific class */
10 #define USB_SUBCLASS_IRDA 0x02
12 /*-------------------------------------------------------------------------*/
14 /* Class-Specific requests (bRequest field) */
16 #define USB_REQ_CS_IRDA_RECEIVING 1
17 #define USB_REQ_CS_IRDA_CHECK_MEDIA_BUSY 3
18 #define USB_REQ_CS_IRDA_RATE_SNIFF 4
19 #define USB_REQ_CS_IRDA_UNICAST_LIST 5
20 #define USB_REQ_CS_IRDA_GET_CLASS_DESC 6
22 /*-------------------------------------------------------------------------*/
24 /* Class-Specific descriptor */
26 #define USB_DT_CS_IRDA 0x21
28 /*-------------------------------------------------------------------------*/
30 /* Data sizes */
32 #define USB_IRDA_DS_2048 (1 << 5)
33 #define USB_IRDA_DS_1024 (1 << 4)
34 #define USB_IRDA_DS_512 (1 << 3)
35 #define USB_IRDA_DS_256 (1 << 2)
36 #define USB_IRDA_DS_128 (1 << 1)
37 #define USB_IRDA_DS_64 (1 << 0)
39 /* Window sizes */
41 #define USB_IRDA_WS_7 (1 << 6)
42 #define USB_IRDA_WS_6 (1 << 5)
43 #define USB_IRDA_WS_5 (1 << 4)
44 #define USB_IRDA_WS_4 (1 << 3)
45 #define USB_IRDA_WS_3 (1 << 2)
46 #define USB_IRDA_WS_2 (1 << 1)
47 #define USB_IRDA_WS_1 (1 << 0)
49 /* Min turnaround times in usecs */
51 #define USB_IRDA_MTT_0 (1 << 7)
52 #define USB_IRDA_MTT_10 (1 << 6)
53 #define USB_IRDA_MTT_50 (1 << 5)
54 #define USB_IRDA_MTT_100 (1 << 4)
55 #define USB_IRDA_MTT_500 (1 << 3)
56 #define USB_IRDA_MTT_1000 (1 << 2)
57 #define USB_IRDA_MTT_5000 (1 << 1)
58 #define USB_IRDA_MTT_10000 (1 << 0)
60 /* Baud rates */
62 #define USB_IRDA_BR_4000000 (1 << 8)
63 #define USB_IRDA_BR_1152000 (1 << 7)
64 #define USB_IRDA_BR_576000 (1 << 6)
65 #define USB_IRDA_BR_115200 (1 << 5)
66 #define USB_IRDA_BR_57600 (1 << 4)
67 #define USB_IRDA_BR_38400 (1 << 3)
68 #define USB_IRDA_BR_19200 (1 << 2)
69 #define USB_IRDA_BR_9600 (1 << 1)
70 #define USB_IRDA_BR_2400 (1 << 0)
72 /* Additional BOFs */
74 #define USB_IRDA_AB_0 (1 << 7)
75 #define USB_IRDA_AB_1 (1 << 6)
76 #define USB_IRDA_AB_2 (1 << 5)
77 #define USB_IRDA_AB_3 (1 << 4)
78 #define USB_IRDA_AB_6 (1 << 3)
79 #define USB_IRDA_AB_12 (1 << 2)
80 #define USB_IRDA_AB_24 (1 << 1)
81 #define USB_IRDA_AB_48 (1 << 0)
83 /* IRDA Rate Sniff */
85 #define USB_IRDA_RATE_SNIFF 1
87 /*-------------------------------------------------------------------------*/
89 struct usb_irda_cs_descriptor {
90 __u8 bLength;
91 __u8 bDescriptorType;
93 __le16 bcdSpecRevision;
94 __u8 bmDataSize;
95 __u8 bmWindowSize;
96 __u8 bmMinTurnaroundTime;
97 __le16 wBaudRate;
98 __u8 bmAdditionalBOFs;
99 __u8 bIrdaRateSniff;
100 __u8 bMaxUnicastList;
101 } __attribute__ ((packed));
103 /*-------------------------------------------------------------------------*/
105 /* Data Format */
107 #define USB_IRDA_STATUS_MEDIA_BUSY (1 << 7)
109 /* The following is a 4-bit value used for both
110 * inbound and outbound headers:
112 * 0 - speed ignored
113 * 1 - 2400 bps
114 * 2 - 9600 bps
115 * 3 - 19200 bps
116 * 4 - 38400 bps
117 * 5 - 57600 bps
118 * 6 - 115200 bps
119 * 7 - 576000 bps
120 * 8 - 1.152 Mbps
121 * 9 - 5 mbps
122 * 10..15 - Reserved
124 #define USB_IRDA_STATUS_LINK_SPEED 0x0f
126 /* The following is a 4-bit value used only for
127 * outbound header:
129 * 0 - No change (BOF ignored)
130 * 1 - 48 BOFs
131 * 2 - 24 BOFs
132 * 3 - 12 BOFs
133 * 4 - 6 BOFs
134 * 5 - 3 BOFs
135 * 6 - 2 BOFs
136 * 7 - 1 BOFs
137 * 8 - 0 BOFs
138 * 9..15 - Reserved
140 #define USB_IRDA_EXTRA_BOFS 0xf0
142 struct usb_irda_inbound_header {
143 __u8 bmStatus;
146 struct usb_irda_outbound_header {
147 __u8 bmChange;
150 #endif /* __LINUX_USB_IRDA_H */