Add PnP IDs from Giuseppe Bilotta:
[pnputils] / pnp_resource.h
1 #ifndef LINUX_PNP_RESOURCE
2 #define LINUX_PNP_RESOURCE
3
4 /* ISA Plug and Play Resource Definitions */
5
6 #define PNP_RES_LARGE_ITEM              0x80
7
8 /* Small resource items */
9 #define PNP_RES_SMTAG_VERSION           0x01
10 #define PNP_RES_SMTAG_LDID              0x02
11 #define PNP_RES_SMTAG_CDID              0x03
12 #define PNP_RES_SMTAG_IRQ               0x04
13 #define PNP_RES_SMTAG_DMA               0x05
14 #define PNP_RES_SMTAG_DEP_START         0x06
15 #define PNP_RES_SMTAG_DEP_END           0x07
16 #define PNP_RES_SMTAG_IO                0x08
17 #define PNP_RES_SMTAG_IO_FIXED          0x09
18 #define PNP_RES_SMTAG_VENDOR            0x0e
19 #define PNP_RES_SMTAG_END               0x0f
20
21 /* Large resource items */
22 #define PNP_RES_LGTAG_MEM               0x01
23 #define PNP_RES_LGTAG_ID_ANSI           0x02
24 #define PNP_RES_LGTAG_ID_UNICODE        0x03
25 #define PNP_RES_LGTAG_VENDOR            0x04
26 #define PNP_RES_LGTAG_MEM32             0x05
27 #define PNP_RES_LGTAG_MEM32_FIXED       0x06
28
29 /* Logical device ID flags */
30 #define PNP_RES_LDID_BOOT               0x01
31
32 /* IRQ information */
33 #define PNP_RES_IRQ_HIGH_EDGE           0x01
34 #define PNP_RES_IRQ_LOW_EDGE            0x02
35 #define PNP_RES_IRQ_HIGH_LEVEL          0x04
36 #define PNP_RES_IRQ_LOW_LEVEL           0x08
37
38 /* DMA information */
39 #define PNP_RES_DMA_WIDTH_MASK          0x03
40 #define PNP_RES_DMA_WIDTH_8             0x00
41 #define PNP_RES_DMA_WIDTH_8_16          0x01
42 #define PNP_RES_DMA_WIDTH_16            0x02
43 #define PNP_RES_DMA_BUSMASTER           0x04
44 #define PNP_RES_DMA_COUNT_BYTE          0x08
45 #define PNP_RES_DMA_COUNT_WORD          0x10
46 #define PNP_RES_DMA_SPEED_MASK          0x60
47 #define PNP_RES_DMA_SPEED_COMPAT        0x00
48 #define PNP_RES_DMA_SPEED_TYPEA         0x20
49 #define PNP_RES_DMA_SPEED_TYPEB         0x40
50 #define PNP_RES_DMA_SPEED_TYPEF         0x60
51
52 /* Resource group priority */
53 #define PNP_RES_CONFIG_GOOD             0x00
54 #define PNP_RES_CONFIG_ACCEPTABLE       0x01
55 #define PNP_RES_CONFIG_SUBOPTIMAL       0x02
56
57 /* IO information */
58 #define PNP_RES_IO_DECODE_16            0x01
59
60 /* Memory information */
61 #define PNP_RES_MEM_WRITEABLE           0x01
62 #define PNP_RES_MEM_CACHEABLE           0x02
63 #define PNP_RES_MEM_HIGH_ADDRESS        0x04
64 #define PNP_RES_MEM_WIDTH_MASK          0x18
65 #define PNP_RES_MEM_WIDTH_8             0x00
66 #define PNP_RES_MEM_WIDTH_16            0x08
67 #define PNP_RES_MEM_WIDTH_8_16          0x10
68 #define PNP_RES_MEM_WIDTH_32            0x18
69 #define PNP_RES_MEM_SHADOWABLE          0x20
70 #define PNP_RES_MEM_EXPANSION_ROM       0x40
71
72 /*
73   note: multi-byte data types in these structures are little endian,
74   and have to be byte swapped before use on big endian platforms.
75 */
76
77 #pragma pack(1)
78 union pnp_small_resource {
79         struct {
80                 __u8    pnp, vendor;
81         } version;
82         struct {
83                 __u32   id;
84                 __u8    flag0, flag1;
85         } ldid;
86         struct {
87                 __u32   id;
88         } gdid;
89         struct {
90                 __u16   mask;
91                 __u8    info;
92         } irq;
93         struct {
94                 __u8    mask, info;
95         } dma;
96         struct {
97                 __u8    priority;
98         } dep_start;
99         struct {
100                 __u8    info;
101                 __u16   min, max;
102                 __u8    align, len;
103         } io;
104         struct {
105                 __u16   base;
106                 __u8    len;
107         } io_fixed;
108         struct {
109                 __u8    checksum;
110         } end;
111 };
112
113 union pnp_large_resource {
114         struct {
115                 __u8    info;
116                 __u16   min, max, align, len;
117         } mem;
118         struct {
119                 __u8    str[0];
120         } ansi;
121         struct {
122                 __u16   country;
123                 __u8    str[0];
124         } unicode;
125         struct {
126                 __u8    info;
127                 __u32   min, max, align, len;
128         } mem32;
129         struct {
130                 __u8    info;
131                 __u32   base, len;
132         } mem32_fixed;
133 };
134
135 union pnp_resource {
136         struct {
137                 __u8    tag;
138                 union pnp_small_resource d;
139         } sm;
140         struct {
141                 __u8    tag;
142                 __u16   sz;
143                 union pnp_large_resource d;
144         } lg;
145 };
146 #pragma pack()
147
148 #endif /* LINUX_PNP_RESOURCE */