~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kinfocenter/Modules/pci/kpci_private.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Retrive information about PCI subsystem through libpci library from
 
2
   pciutils package. This should be possible on Linux, BSD and AIX.
 
3
   
 
4
   Device classes, subclasses and programming interfaces are hardcoded
 
5
   here, since there are only few of them, and they are important and
 
6
   should their names be translated.
 
7
   
 
8
   pci.cpp private header, don't include in other files.
 
9
 
 
10
   Author: Konrad Rzepecki <hannibal@megapolis.pl>
 
11
*/
 
12
#ifndef KCONTROL_KPCI_PRIVATE_H
 
13
#define KCONTROL_KPCI_PRIVATE_H
 
14
 
 
15
#include "kpci.h"
 
16
 
 
17
#include <QString>
 
18
 
 
19
#include <klocale.h>
 
20
 
 
21
//pci lookup buffer size
 
22
#define NAME_BUFFER_SIZE 256
 
23
 
 
24
//common used strings
 
25
static const char strCtxt[]="state of PCI item";
 
26
static const char strEnabled[]=I18N_NOOP2("state of PCI item", "Enabled");
 
27
static const char strDisabled[]=I18N_NOOP2("state of PCI item", "Disabled");
 
28
static const char strYes[]=I18N_NOOP2("state of PCI item", "Yes");
 
29
static const char strNo[]=I18N_NOOP2("state of PCI item", "No");
 
30
static const char strUnknown[]=I18N_NOOP2("state of PCI item", "Unknown");
 
31
 
 
32
struct id2name {
 
33
        int id;
 
34
        QString name;
 
35
};
 
36
 
 
37
struct id3name {
 
38
        int id,id2;
 
39
        QString name;
 
40
};
 
41
 
 
42
struct id4name {
 
43
        int id,id2,id3;
 
44
        QString name;
 
45
};
 
46
 
 
47
union pciInfo {
 
48
        unsigned char raw[256];
 
49
        struct {
 
50
                unsigned short vendor;
 
51
                unsigned short device;
 
52
                union {
 
53
                        unsigned short command;
 
54
                        struct {
 
55
                                unsigned comIo:1;
 
56
                                unsigned comMemory:1;
 
57
                                unsigned comMaster:1;
 
58
                                unsigned comSpecial:1;
 
59
                                unsigned comInvalidate:1;
 
60
                                unsigned comVgaPalette:1;
 
61
                                unsigned comParity:1;
 
62
                                unsigned comWait:1;
 
63
                                unsigned comSerr:1;
 
64
                                unsigned comFastBack:1;
 
65
                                unsigned comInterrupt:1;
 
66
                                unsigned comUnk:5;
 
67
                        } command_bits KDE_PACKED;
 
68
                } command KDE_PACKED;
 
69
                union {
 
70
                        unsigned short status;
 
71
                        struct {
 
72
                                unsigned statUnk:3;
 
73
                                unsigned statInterrupt:1;
 
74
                                unsigned statCapList:1;
 
75
                                unsigned stat66MHz:1;
 
76
                                unsigned statUdf:1;
 
77
                                unsigned statFastBack:1;
 
78
                                unsigned statParity:1;
 
79
                                unsigned statDevsel:2;
 
80
                                unsigned statSigTargetAbort:1;
 
81
                                unsigned statRecTargetAbort:1;
 
82
                                unsigned statRecMasterAbort:1;
 
83
                                unsigned statSigSystemError:1;
 
84
                                unsigned statDetectedParity:1;
 
85
                        } status_bits KDE_PACKED;
 
86
                } status KDE_PACKED;
 
87
                unsigned char revision;
 
88
                union {
 
89
                        unsigned char devProgIface;
 
90
                        struct {
 
91
                                unsigned progPriOperMode:1;
 
92
                                unsigned progPriProgInd:1;
 
93
                                unsigned progSecOperMode:1;
 
94
                                unsigned progSecProgInd:1;
 
95
                                unsigned progUnk:3;
 
96
                                unsigned progIdeMaster:1;
 
97
                        } devProgIface_bits KDE_PACKED;
 
98
                } devProgIface KDE_PACKED;
 
99
                unsigned char devSubClass;
 
100
                unsigned char devClass;
 
101
                unsigned char cacheLineSize;
 
102
                unsigned char latencyTimer;
 
103
                union {
 
104
                        unsigned char headerTypeFull:1;
 
105
                        struct {
 
106
                                unsigned headerType:7;
 
107
                                unsigned multifunctional:1;
 
108
                        } headerType_bits KDE_PACKED;
 
109
                } headerType KDE_PACKED;
 
110
                union {
 
111
                        unsigned char bist;
 
112
                        struct {
 
113
                                unsigned bistCode:4;
 
114
                                unsigned bistUnk:2;
 
115
                                unsigned bistStart:1;
 
116
                                unsigned bistCapable:1;
 
117
                        } bist_bits KDE_PACKED;
 
118
                } bist KDE_PACKED;
 
119
                union {
 
120
                        struct { //header0
 
121
                                union {
 
122
                                        unsigned baseAddress;
 
123
                                        struct {
 
124
                                                unsigned baseAddressMap:1;
 
125
                                                unsigned baseAddressType:2;
 
126
                                                unsigned baseAddressPref:1;
 
127
                                                unsigned baseAddressAddr:28;
 
128
                                        } baseAddress_bits KDE_PACKED;
 
129
                                } KDE_PACKED mapping[6];
 
130
                                unsigned cardbusCis;
 
131
                                unsigned short subVendor;
 
132
                                unsigned short subDevice;
 
133
                                union {
 
134
                                        unsigned romAddress;
 
135
                                        struct {
 
136
                                                unsigned romEnabled:1;
 
137
                                                unsigned romUnk:10;
 
138
                                                unsigned romAddr:21;
 
139
                                        } romAddress_bits KDE_PACKED;
 
140
                                } romAddress KDE_PACKED;
 
141
                                unsigned char capabilityList;
 
142
                                unsigned char reserved1[7];
 
143
                                unsigned char interruptLine;
 
144
                                unsigned char interruptPin;
 
145
                                unsigned char minGnt;
 
146
                                unsigned char maxLat;
 
147
                        } header0 KDE_PACKED;
 
148
                        struct { //header1
 
149
                                unsigned baseAddress0_2;
 
150
                                unsigned baseAddress1_2;
 
151
                                unsigned char primaryBus;
 
152
                                unsigned char secondaryBus;
 
153
                                unsigned char subordinateBus;
 
154
                                unsigned char secLatencyTimer;
 
155
                                union {
 
156
                                        unsigned char ioBase;
 
157
                                        struct {
 
158
                                                unsigned ioBaseType:1;
 
159
                                                unsigned ioBaseUnk:3;
 
160
                                                unsigned ioBaseAddr:4;
 
161
                                        } ioBase_bits KDE_PACKED;
 
162
                                } ioBase KDE_PACKED;
 
163
                                unsigned char ioLimit;
 
164
                                union {
 
165
                                        unsigned short secStatus;
 
166
                                        struct {
 
167
                                                unsigned secStatUnk:3;
 
168
                                                unsigned secStatInterrupt:1;
 
169
                                                unsigned secStatCapList:1;
 
170
                                                unsigned secStat66MHz:1;
 
171
                                                unsigned secStatUdf:1;
 
172
                                                unsigned secStatFastBack:1;
 
173
                                                unsigned secStatParity:1;
 
174
                                                unsigned secStatDevsel:2;
 
175
                                                unsigned secStatSigTargetAbort:1;
 
176
                                                unsigned secStatRecTargetAbort:1;
 
177
                                                unsigned secStatRecMasterAbort:1;
 
178
                                                unsigned secStatSigSystemError:1;
 
179
                                                unsigned secStatDetectedParity:1;
 
180
                                        } secStatus_bits KDE_PACKED;
 
181
                                } secStatus KDE_PACKED;
 
182
                                union {
 
183
                                        unsigned short memoryBase;
 
184
                                        struct {                                                
 
185
                                                unsigned memoryType:1;
 
186
                                                unsigned memoryUnk:3;
 
187
                                                unsigned memoryAddr:4;
 
188
                                        } memoryBase_bits KDE_PACKED;
 
189
                                } memoryBase KDE_PACKED;
 
190
                                unsigned short memoryLimit;
 
191
                                union {
 
192
                                        unsigned short prefMemoryBase;
 
193
                                        struct {                                                
 
194
                                                unsigned prefMemoryType:1;
 
195
                                                unsigned prefMemoryUnk:3;
 
196
                                                unsigned prefMemoryAddr:4;
 
197
                                        } prefMemoryBase_bits KDE_PACKED;
 
198
                                } prefMemoryBase KDE_PACKED;
 
199
                                unsigned short prefMemoryLimit;
 
200
                                unsigned prefBaseUpper32;
 
201
                                unsigned prefLimitUpper32;
 
202
                                unsigned short ioBaseUpper16;
 
203
                                unsigned short ioLimitUpper16;
 
204
                                unsigned char capabilityList_2;
 
205
                                unsigned char reserved2[3];
 
206
                                unsigned romAddress1;
 
207
                                unsigned char interruptLine_2;
 
208
                                unsigned char interruptPin_2;
 
209
                                union {
 
210
                                        unsigned short bridgeControl;
 
211
                                        struct {
 
212
                                                unsigned bridgeControlParity:1;
 
213
                                                unsigned bridgeControlSerr:1;
 
214
                                                unsigned bridgeControlIsa:1;
 
215
                                                unsigned bridgeControlVga:1;
 
216
                                                unsigned bridgeControlUnk:1;
 
217
                                                unsigned bridgeControlMasterAbort:1;
 
218
                                                unsigned bridgeControlBusReset:1;
 
219
                                                unsigned bridgeControlFastBack:1;
 
220
                                                unsigned bridgeControlPriDisTim:1;
 
221
                                                unsigned bridgeControlSecDisTim:1;
 
222
                                                unsigned bridgeControlDisTimStat:1;
 
223
                                                unsigned bridgeControlDisTimeSerr:1;
 
224
                                                unsigned bridgeControlUnk2:4;
 
225
                                        } bridgeControl_bits KDE_PACKED;
 
226
                                } bridgeControl KDE_PACKED;
 
227
                        } header1 KDE_PACKED;
 
228
                        struct{ //header2
 
229
                                unsigned baseAddress0_3;
 
230
                                union {
 
231
                                        unsigned short cbSecStatus;
 
232
                                        struct {
 
233
                                                unsigned cbSecStatUnk:3;
 
234
                                                unsigned cbSecStatInterrupt:1;
 
235
                                                unsigned cbSecStatCapList:1;
 
236
                                                unsigned cbSecStat66MHz:1;
 
237
                                                unsigned cbSecStatUdf:1;
 
238
                                                unsigned cbSecStatFastBack:1;
 
239
                                                unsigned cbSecStatParity:1;
 
240
                                                unsigned cbSecStatDevsel:2;
 
241
                                                unsigned cbSecStatSigTargetAbort:1;
 
242
                                                unsigned cbSecStatRecTargetAbort:1;
 
243
                                                unsigned cbSecStatRecMasterAbort:1;
 
244
                                                unsigned cbSecStatSigSystemError:1;
 
245
                                                unsigned cbSecStatDetectedParity:1;
 
246
                                        } cbSecStatus_bits KDE_PACKED;
 
247
                                } cbSecStatus KDE_PACKED;
 
248
                                unsigned char cbPrimaryBus;
 
249
                                unsigned char cbCardBus;
 
250
                                unsigned char cbSubordinateBus;
 
251
                                unsigned char cbLatencyTimer;
 
252
                                struct {
 
253
                                        unsigned cbMemoryBase;
 
254
                                        unsigned cbMemoryLimit;
 
255
                                } KDE_PACKED cbMemory[2];
 
256
                                struct {
 
257
                                        union {
 
258
                                                unsigned cbIoBase;
 
259
                                                struct {
 
260
                                                        unsigned cbIoBaseType:1;
 
261
                                                        unsigned coIoBaseUnk:1;
 
262
                                                        unsigned cbIoBaseAddr:30;
 
263
                                                } cbIoBase_bits KDE_PACKED;
 
264
                                        } cbIoBase KDE_PACKED;
 
265
                                        unsigned cbIoLimit;
 
266
                                } KDE_PACKED cbIo[2];
 
267
                                unsigned char interruptLine_3;
 
268
                                unsigned char interruptPin_3;
 
269
                                union {
 
270
                                        unsigned short cbControl;
 
271
                                        struct {
 
272
                                                unsigned cbControlParity:1;
 
273
                                                unsigned cbControlSerr:1;
 
274
                                                unsigned cbControlIsa:1;
 
275
                                                unsigned cbControlVga:1;
 
276
                                                unsigned cbControlUnk:1;
 
277
                                                unsigned cbControlMasterAbort:1;
 
278
                                                unsigned cbControlBusReset:1;
 
279
                                                unsigned cbControl16Int:1;
 
280
                                                unsigned cbControlPref0:1;
 
281
                                                unsigned cbControlPref1:1;
 
282
                                                unsigned cbControlPostWrites:1;
 
283
                                                unsigned cbControlUnk2:5;
 
284
                                        } cbControl_bits KDE_PACKED;
 
285
                                } cbControl KDE_PACKED;
 
286
                                unsigned short cbSubVendor;
 
287
                                unsigned short cbSubDevice;
 
288
                                unsigned short cbLegacyModeBase;
 
289
                        } header2 KDE_PACKED;
 
290
                } header KDE_PACKED;
 
291
        } cooked KDE_PACKED;
 
292
} KDE_PACKED;
 
293
 
 
294
union agpInfo{
 
295
        unsigned char raw[10];
 
296
        struct {
 
297
                struct {
 
298
                        unsigned revMinor:4;
 
299
                        unsigned revMaior:4;
 
300
                        unsigned char unk;
 
301
                } revision KDE_PACKED;
 
302
                union {
 
303
                        unsigned status;
 
304
                        struct {
 
305
                                unsigned statusEnhRate:4;
 
306
                                unsigned statusUnk:28;
 
307
                        } status_bits0 KDE_PACKED;
 
308
                        struct {
 
309
                                unsigned statusRate:3;
 
310
                                unsigned statusMode:1;
 
311
                                unsigned statusFastWrite:1;
 
312
                                unsigned statusOver4gb:1;
 
313
                                unsigned statusHtrans:1;
 
314
                                unsigned statusGart64b:1;
 
315
                                unsigned statusItaCoh:1;
 
316
                                unsigned statusSba:1;
 
317
                                unsigned statusCalCycle:3;
 
318
                                unsigned statusOptReqSize:3;
 
319
                                unsigned statusUnk1:1;
 
320
                                unsigned statusIsochSupp:1;
 
321
                                unsigned statusUnk2:6;
 
322
                                unsigned statusReq:8;
 
323
                        } status_bits1 KDE_PACKED;
 
324
                } status KDE_PACKED;
 
325
                union {
 
326
                        unsigned config;
 
327
                        struct {
 
328
                                unsigned configEnhRate:4;
 
329
                                unsigned configUnk:28;
 
330
                        } config_bits0 KDE_PACKED;
 
331
                        struct {
 
332
                                unsigned configRate:3;
 
333
                                unsigned configUnk1:1;
 
334
                                unsigned configFastWrite:1;
 
335
                                unsigned configOver4gb:1;
 
336
                                unsigned configUnk2:1;
 
337
                                unsigned configGart64b:1;
 
338
                                unsigned configAgp:1;
 
339
                                unsigned configSba:1;
 
340
                                unsigned configCalCycle:3;
 
341
                                unsigned configOptReqSize:3;
 
342
                                unsigned configUnk3:8;
 
343
                                unsigned configReq:8;
 
344
                        } config_bits1 KDE_PACKED;
 
345
                } config KDE_PACKED;
 
346
        } cooked KDE_PACKED;
 
347
} KDE_PACKED;
 
348
 
 
349
union pmInfo {
 
350
        unsigned char raw[6];
 
351
        struct {
 
352
                union {
 
353
                        unsigned short caps;
 
354
                        struct {
 
355
                                unsigned capsVer:3;
 
356
                                unsigned capsClock:1;
 
357
                                unsigned capsUnk:1;
 
358
                                unsigned capsDsi:1;
 
359
                                unsigned capsAuxCur:3;
 
360
                                unsigned capsD1Supp:1;
 
361
                                unsigned capsD2Supp:1;
 
362
                                unsigned capsPmeD0:1;
 
363
                                unsigned capsPmeD1:1;
 
364
                                unsigned capsPmeD2:1;
 
365
                                unsigned capsPmeD3hot:1;
 
366
                                unsigned capsPmeD3cold:1;
 
367
                        } caps_bits KDE_PACKED;
 
368
                } caps KDE_PACKED;
 
369
                union {
 
370
                        unsigned short status;
 
371
                        struct {
 
372
                                unsigned statPower:2;
 
373
                                unsigned statUnk:6;
 
374
                                unsigned statPme:1;
 
375
                                unsigned statDataSelect:4;
 
376
                                unsigned statDataScale:2;
 
377
                                unsigned statPmeStat:1;
 
378
                        } status_bits KDE_PACKED;
 
379
                } status KDE_PACKED;
 
380
                union {
 
381
                        unsigned char statusBridge;
 
382
                        struct {
 
383
                                unsigned statBridgeUnk:6;
 
384
                                unsigned statBridgeBx:1;
 
385
                                unsigned statBridgeClock:1;
 
386
                        } statusBridge_bits KDE_PACKED;
 
387
                } statusBridge KDE_PACKED;
 
388
                unsigned char data;
 
389
        } cooked KDE_PACKED;
 
390
} KDE_PACKED;
 
391
 
 
392
union vpdInfo {
 
393
        unsigned char raw[6];
 
394
        struct {
 
395
                unsigned vpdAddress:15;
 
396
                unsigned vpdTransfer:1;
 
397
                unsigned vpdData;
 
398
        } cooked  KDE_PACKED;
 
399
} KDE_PACKED;
 
400
 
 
401
union msiInfo {
 
402
        unsigned char raw[22];
 
403
        struct {
 
404
                union {
 
405
                        unsigned short msiControl;
 
406
                        struct {
 
407
                                unsigned msiEnable:1;
 
408
                                unsigned msiMmCapable:3;
 
409
                                unsigned msiMmEnable:3;
 
410
                                unsigned msi64bit:1;
 
411
                                unsigned msiPerVector:1;
 
412
                                unsigned msiUnk0:7;
 
413
                        } msiControl_bits KDE_PACKED;
 
414
                } msiControl KDE_PACKED;
 
415
                unsigned msiAddress;
 
416
                union {
 
417
                        struct {
 
418
                                unsigned msiUpperAddress;
 
419
                                unsigned short msiData64;
 
420
                                unsigned short msiUnk64;
 
421
                                unsigned msiMask64;
 
422
                                unsigned msiPending64;
 
423
                        } address KDE_PACKED;
 
424
                        struct {
 
425
                                unsigned short msiData;
 
426
                                unsigned short msiUnk;                  
 
427
                                unsigned msiMask;
 
428
                                unsigned msiPending;
 
429
                        } data KDE_PACKED;
 
430
                } payload KDE_PACKED;
 
431
        } cooked KDE_PACKED;
 
432
} KDE_PACKED;
 
433
 
 
434
//In following arrays -1 mean default value
 
435
 
 
436
//keep -1 in last position
 
437
//device classes list
 
438
static const id2name devClass[]={{      0x00,   i18n("Unclassified device")},
 
439
                                                                {       0x01,   i18n("Mass storage controller")},
 
440
                                                                {       0x02,   i18n("Network controller")},
 
441
                                                                {       0x03,   i18n("Display controller")},
 
442
                                                                {       0x04,   i18n("Multimedia controller")},
 
443
                                                                {       0x05,   i18n("Memory controller")},
 
444
                                                                {       0x06,   i18n("Bridge")},
 
445
                                                                {       0x07,   i18n("Communication controller")},
 
446
                                                                {       0x08,   i18n("Generic system peripheral")},
 
447
                                                                {       0x09,   i18n("Input device controller")},
 
448
                                                                {       0x0A,   i18n("Docking station")},
 
449
                                                                {       0x0B,   i18n("Processor")},
 
450
                                                                {       0x0C,   i18n("Serial bus controller")},
 
451
                                                                {       0x0D,   i18n("Wireless controller")},
 
452
                                                                {       0x0E,   i18n("Intelligent controller")},
 
453
                                                                {       0x0F,   i18n("Satellite communications controller")},
 
454
                                                                {       0x10,   i18n("Encryption controller")},
 
455
                                                                {       0x11,   i18n("Signal processing controller")},
 
456
                                                                {       -1,             i18n("Unknown device class")}
 
457
};
 
458
 
 
459
//keep -1 in last position in "id"
 
460
//and in last position in "id2" with certain "id"
 
461
//subdevice classes list
 
462
static const id3name devSubclass[]={    {       0x00,   0x00,   i18n("Non-VGA unclassified device")},
 
463
                                                                                {       0x00,   0x01,   i18n("VGA unclassified device")},
 
464
                                                                                {       0x00,   -1,             i18n("Unknown unclassified device")},
 
465
 
 
466
                                                                                {       0x01,   0x00,   i18n("SCSI storage controller")},
 
467
                                                                                {       0x01,   0x01,   i18n("IDE controller")},
 
468
                                                                                {       0x01,   0x02,   i18n("Floppy disk controller")},
 
469
                                                                                {       0x01,   0x03,   i18n("IPI bus controller")},
 
470
                                                                                {       0x01,   0x04,   i18n("RAID bus controller")},
 
471
                                                                                {       0x01,   0x05,   i18n("ATA controller")},
 
472
                                                                                {       0x01,   0x06,   i18n("Serial ATA direct port access")},
 
473
                                                                                {       0x01,   0x80,   i18n("Mass storage controller")},
 
474
                                                                                {       0x01,   -1,             i18n("Unknown storage controller")},
 
475
 
 
476
                                                                                {       0x02,   0x00,   i18n("Ethernet controller")},
 
477
                                                                                {       0x02,   0x01,   i18n("Token ring network controller")},
 
478
                                                                                {       0x02,   0x02,   i18n("FDDI network controller")},
 
479
                                                                                {       0x02,   0x03,   i18n("ATM network controller")},
 
480
                                                                                {       0x02,   0x04,   i18n("ISDN controller")},
 
481
                                                                                {       0x02,   0x05,   i18n("WorldFip controller")},
 
482
                                                                                {       0x02,   0x06,   i18n("PICMG 2.14 multi computing")},
 
483
                                                                                {       0x02,   0x80,   i18n("Network controller")},
 
484
                                                                                {       0x02,   -1,             i18n("Unknown network controller")},
 
485
 
 
486
                                                                                {       0x03,   0x00,   i18n("VGA compatible controller")},
 
487
                                                                                {       0x03,   0x01,   i18n("XGA compatible controller")},
 
488
                                                                                {       0x03,   0x02,   i18n("3D controller")},
 
489
                                                                                {       0x03,   0x80,   i18n("Display controller")},
 
490
                                                                                {       0x03,   -1,             i18n("Unknown display controller")},
 
491
 
 
492
                                                                                {       0x04,   0x00,   i18n("Multimedia video controller")},
 
493
                                                                                {       0x04,   0x01,   i18n("Multimedia audio controller")},
 
494
                                                                                {       0x04,   0x02,   i18n("Computer telephony device")},
 
495
                                                                                {       0x04,   0x80,   i18n("Multimedia controller")},
 
496
                                                                                {       0x04,   -1,             i18n("Unknown multimedia controller")},
 
497
 
 
498
                                                                                {       0x05,   0x00,   i18n("RAM memory")},
 
499
                                                                                {       0x05,   0x01,   i18n("FLASH memory")},
 
500
                                                                                {       0x05,   0x80,   i18n("Memory controller")},
 
501
                                                                                {       0x05,   -1,             i18n("Unknown memory controller")},
 
502
 
 
503
                                                                                {       0x06,   0x00,   i18n("Host bridge")},
 
504
                                                                                {       0x06,   0x01,   i18n("ISA bridge")},
 
505
                                                                                {       0x06,   0x02,   i18n("EISA bridge")},
 
506
                                                                                {       0x06,   0x03,   i18n("MicroChannel bridge")},
 
507
                                                                                {       0x06,   0x04,   i18n("PCI bridge")},
 
508
                                                                                {       0x06,   0x05,   i18n("PCMCIA bridge")},
 
509
                                                                                {       0x06,   0x06,   i18n("NuBus bridge")},
 
510
                                                                                {       0x06,   0x07,   i18n("CardBus bridge")},
 
511
                                                                                {       0x06,   0x08,   i18n("RACEway bridge")},
 
512
                                                                                {       0x06,   0x09,   i18n("Semi-transparent PCI-to-PCI bridge")},
 
513
                                                                                {       0x06,   0x0A,   i18n("InfiniBand to PCI host bridge")},
 
514
                                                                                {       0x06,   0x80,   i18n("Bridge")},
 
515
                                                                                {       0x06,   -1,             i18n("Unknown bridge")},
 
516
 
 
517
                                                                                {       0x07,   0x00,   i18n("Serial controller")},
 
518
                                                                                {       0x07,   0x01,   i18n("Parallel controller")},
 
519
                                                                                {       0x07,   0x02,   i18n("Multiport serial controller")},
 
520
                                                                                {       0x07,   0x03,   i18n("Modem")},
 
521
                                                                                {       0x07,   0x04,   i18n("GPIB (IEEE 488.1/2) controller")},
 
522
                                                                                {       0x07,   0x05,   i18n("Smart card")},
 
523
                                                                                {       0x07,   0x80,   i18n("Communication controller")},
 
524
                                                                                {       0x07,   -1,             i18n("Unknown communication controller")},
 
525
 
 
526
                                                                                {       0x08,   0x00,   i18n("PIC")},
 
527
                                                                                {       0x08,   0x01,   i18n("DMA controller")},
 
528
                                                                                {       0x08,   0x02,   i18n("Timer")},
 
529
                                                                                {       0x08,   0x03,   i18n("RTC")},
 
530
                                                                                {       0x08,   0x04,   i18n("PCI Hot-plug controller")},
 
531
                                                                                {       0x08,   0x80,   i18n("System peripheral")},
 
532
                                                                                {       0x08,   -1,             i18n("Unknown system peripheral")},
 
533
 
 
534
                                                                                {       0x09,   0x00,   i18n("Keyboard controller")},
 
535
                                                                                {       0x09,   0x01,   i18n("Digitizer Pen")},
 
536
                                                                                {       0x09,   0x02,   i18n("Mouse controller")},
 
537
                                                                                {       0x09,   0x03,   i18n("Scanner controller")},
 
538
                                                                                {       0x09,   0x04,   i18n("Gameport controller")},
 
539
                                                                                {       0x09,   0x80,   i18n("Input device controller")},
 
540
                                                                                {       0x09,   -1,             i18n("Unknown input device controller")},
 
541
 
 
542
                                                                                {       0x0A,   0x00,   i18n("Generic docking station")},
 
543
                                                                                {       0x0A,   0x80,   i18n("Docking station")},
 
544
                                                                                {       0x0A,   -1,             i18n("Unknown docking station")},
 
545
 
 
546
                                                                                {       0x0B,   0x00,   i18n("386")},
 
547
                                                                                {       0x0B,   0x01,   i18n("486")},
 
548
                                                                                {       0x0B,   0x02,   i18n("Pentium")},
 
549
                                                                                {       0x0B,   0x10,   i18n("Alpha")},
 
550
                                                                                {       0x0B,   0x20,   i18n("Power PC")},
 
551
                                                                                {       0x0B,   0x30,   i18n("MIPS")},
 
552
                                                                                {       0x0B,   0x40,   i18n("Co-processor")},
 
553
                                                                                {       0x0B,   -1,             i18n("Unknown processor")},
 
554
 
 
555
                                                                                {       0x0C,   0x00,   i18n("FireWire (IEEE 1394)")},
 
556
                                                                                {       0x0C,   0x01,   i18n("ACCESS bus")},
 
557
                                                                                {       0x0C,   0x02,   i18n("SSA")},
 
558
                                                                                {       0x0C,   0x03,   i18n("USB controller")},
 
559
                                                                                {       0x0C,   0x04,   i18n("Fibre channel")},
 
560
                                                                                {       0x0C,   0x05,   i18n("SMBus")},
 
561
                                                                                {       0x0C,   0x06,   i18n("InfiniBand")},
 
562
                                                                                {       0x0C,   0x07,   i18n("IPMI interface")},
 
563
                                                                                {       0x0C,   0x08,   i18n("SERCOS interface")},
 
564
                                                                                {       0x0C,   0x09,   i18n("CANbus")},
 
565
                                                                                {       0x0C,   -1,             i18n("Unknown serial bus controller")},
 
566
 
 
567
                                                                                {       0x0D,   0x00,   i18n("IRDA controller")},
 
568
                                                                                {       0x0D,   0x01,   i18n("Consumer IR controller")},
 
569
                                                                                {       0x0D,   0x10,   i18n("RF controller")},
 
570
                                                                                {       0x0D,   0x11,   i18n("Bluetooth")},
 
571
                                                                                {       0x0D,   0x12,   i18n("Broadband")},
 
572
                                                                                {       0x0D,   0x20,   i18n("Ethernet (802.11a - 5 GHz)")},
 
573
                                                                                {       0x0D,   0x21,   i18n("Ethernet (802.11b - 2.4 GHz)")},
 
574
                                                                                {       0x0D,   0x80,   i18n("Wireless controller")},
 
575
                                                                                {       0x0D,   -1,             i18n("Unknown wireless controller")},
 
576
 
 
577
                                                                                {       0x0E,   0x00,   i18n("I2O")},
 
578
                                                                                {       0x0E,   -1,             i18n("Unknown intelligent controller")},
 
579
 
 
580
                                                                                {       0x0F,   0x01,   i18n("Satellite TV controller")},
 
581
                                                                                {       0x0F,   0x02,   i18n("Satellite audio communication controller")},
 
582
                                                                                {       0x0F,   0x03,   i18n("Satellite voice communication controller")},
 
583
                                                                                {       0x0F,   0x04,   i18n("Satellite data communication controller")},
 
584
                                                                                {       0x0F,   -1,             i18n("Unknown satellite communications controller")},
 
585
 
 
586
                                                                                {       0x10,   0x00,   i18n("Network and computing encryption device")},
 
587
                                                                                {       0x10,   0x10,   i18n("Entertainment encryption device")},
 
588
                                                                                {       0x10,   0x80,   i18n("Encryption controller")},
 
589
                                                                                {       0x10,   -1,             i18n("Unknown encryption controller")},
 
590
 
 
591
                                                                                {       0x11,   0x00,   i18n("DPIO module")},
 
592
                                                                                {       0x11,   0x01,   i18n("Performance counters")},
 
593
                                                                                {       0x11,   0x10,   i18n("Communication synchronizer")},
 
594
                                                                                {       0x11,   0x20,   i18n("Management card")},
 
595
                                                                                {       0x11,   0x80,   i18n("Signal processing controller")},
 
596
                                                                                {       0x11,   -1,             i18n("Unknown signal processing controller")},
 
597
 
 
598
                                                                                {       -1,             -1,             i18n("Unknown subdevice class")}
 
599
};
 
600
 
 
601
//keep -1 in last position in "id",
 
602
//in last position in "id2" with certain "id",
 
603
//and in last position in "id3" with certain "id2"
 
604
//device programming interface list
 
605
static const id4name devInterface[]={   {       0x01,   0x05,   0x20,   i18n("single DMA")},
 
606
                                                                                {       0x01,   0x05,   0x30,   i18n("chained DMA")},
 
607
 
 
608
                                                                                {       0x03,   0x00,   0x00,   i18n("VGA compatible")},
 
609
                                                                                {       0x03,   0x00,   0x01,   i18n("8514 compatible")},
 
610
 
 
611
                                                                                {       0x06,   0x04,   0x00,   i18n("Normal decode")},
 
612
                                                                                {       0x06,   0x04,   0x01,   i18n("Subtractive decode")},
 
613
 
 
614
                                                                                {       0x06,   0x08,   0x00,   i18n("Transparent mode")},
 
615
                                                                                {       0x06,   0x08,   0x01,   i18n("Endpoint mode")},
 
616
 
 
617
                                                                                {       0x06,   0x09,   0x40,   i18n("Primary bus towards host CPU")},
 
618
                                                                                {       0x06,   0x09,   0x40,   i18n("Secondary bus towards host CPU")},
 
619
 
 
620
                                                                                {       0x07,   0x00,   0x00,   i18n("8250")},
 
621
                                                                                {       0x07,   0x00,   0x01,   i18n("16450")},
 
622
                                                                                {       0x07,   0x00,   0x02,   i18n("16550")},
 
623
                                                                                {       0x07,   0x00,   0x03,   i18n("16650")},
 
624
                                                                                {       0x07,   0x00,   0x04,   i18n("16750")},
 
625
                                                                                {       0x07,   0x00,   0x05,   i18n("16850")},
 
626
                                                                                {       0x07,   0x00,   0x06,   i18n("16950")},
 
627
 
 
628
                                                                                {       0x07,   0x01,   0x00,   i18n("SPP")},
 
629
                                                                                {       0x07,   0x01,   0x01,   i18n("BiDir")},
 
630
                                                                                {       0x07,   0x01,   0x02,   i18n("ECP")},
 
631
                                                                                {       0x07,   0x01,   0x03,   i18n("IEEE1284")},
 
632
                                                                                {       0x07,   0x01,   0xFE,   i18n("IEEE1284 Target")},
 
633
 
 
634
                                                                                {       0x07,   0x03,   0x00,   i18n("Generic")},
 
635
                                                                                {       0x07,   0x03,   0x01,   i18n("Hayes/16450")},
 
636
                                                                                {       0x07,   0x03,   0x02,   i18n("Hayes/16550")},
 
637
                                                                                {       0x07,   0x03,   0x03,   i18n("Hayes/16650")},
 
638
                                                                                {       0x07,   0x03,   0x04,   i18n("Hayes/16750")},
 
639
 
 
640
                                                                                {       0x08,   0x00,   0x00,   i18n("8259")},
 
641
                                                                                {       0x08,   0x00,   0x01,   i18n("ISA PIC")},
 
642
                                                                                {       0x08,   0x00,   0x02,   i18n("EISA PIC")},
 
643
                                                                                {       0x08,   0x00,   0x03,   i18n("IO-APIC")},
 
644
                                                                                {       0x08,   0x00,   0x04,   i18n("IO(X)-APIC")},
 
645
 
 
646
                                                                                {       0x08,   0x01,   0x00,   i18n("8237")},
 
647
                                                                                {       0x08,   0x01,   0x01,   i18n("ISA DMA")},
 
648
                                                                                {       0x08,   0x01,   0x01,   i18n("EISA DMA")},
 
649
 
 
650
                                                                                {       0x08,   0x02,   0x00,   i18n("8254")},
 
651
                                                                                {       0x08,   0x02,   0x01,   i18n("ISA timer")},
 
652
                                                                                {       0x08,   0x02,   0x01,   i18n("EISA timers")},
 
653
 
 
654
                                                                                {       0x08,   0x03,   0x00,   i18n("Generic")},
 
655
                                                                                {       0x08,   0x03,   0x01,   i18n("ISA RTC")},
 
656
 
 
657
                                                                                {       0x09,   0x04,   0x00,   i18n("Generic")},
 
658
                                                                                {       0x09,   0x04,   0x01,   i18n("Extended")},
 
659
 
 
660
                                                                                {       0x0C,   0x00,   0x00,   i18n("Generic")},
 
661
                                                                                {       0x0C,   0x00,   0x01,   i18n("OHCI")},
 
662
 
 
663
                                                                                {       0x0C,   0x03,   0x00,   i18n("UHCI")},
 
664
                                                                                {       0x0C,   0x03,   0x10,   i18n("OHCI")},
 
665
                                                                                {       0x0C,   0x03,   0x20,   i18n("EHCI")},
 
666
                                                                                {       0x0C,   0x03,   0x80,   i18n("Unspecified")},
 
667
                                                                                {       0x0C,   0x03,   0xFE,   i18n("USB Device")},
 
668
 
 
669
                                                                                {       0x0C,   0x07,   0x00,   i18n("SMIC")},
 
670
                                                                                {       0x0C,   0x07,   0x01,   i18n("Keyboard controller style")},
 
671
                                                                                {       0x0C,   0x07,   0x02,   i18n("Block transfer")},
 
672
                                                                        
 
673
                                                                                {       -1,             -1,             -1,             i18n(strUnknown)}
 
674
};
 
675
 
 
676
 
 
677
//keep -1 in last position
 
678
//capabilities list
 
679
static const id2name capNames[]={{      0x01,   i18n("Power management")},
 
680
                                                                {       0x02,   i18n("AGP")},
 
681
                                                                {       0x03,   i18n("Vital product data")},
 
682
                                                                {       0x04,   i18n("Slot identification")},
 
683
                                                                {       0x05,   i18n("Message signaled interrupts")},
 
684
                                                                {       0x06,   i18n("CompactPCI hot swap")},
 
685
                                                                {       0x07,   i18n("PCI-X")},
 
686
                                                                {       0x08,   i18n("HyperTransport")},
 
687
                                                                {       0x09,   i18n("Vendor specific")},
 
688
                                                                {       0x0A,   i18n("Debug port")},
 
689
                                                                {       0x0B,   i18n("CompactPCI central resource control")},
 
690
                                                                {       0x0C,   i18n("PCI hot-plug")},
 
691
                                                                {       0x0E,   i18n("AGP x8")},
 
692
                                                                {       0x0F,   i18n("Secure device")},
 
693
                                                                {       0x10,   i18n("PCI express")},
 
694
                                                                {       0x11,   i18n("MSI-X")},
 
695
                                                                {       -1,             i18n(strUnknown)}
 
696
};
 
697
 
 
698
//keep -1 in last position
 
699
//device selection timing
 
700
static const id2name devSel[]={ {       0x00,   i18n("Fast")},
 
701
                                                                {       0x01,   i18n("Medium")},
 
702
                                                                {       0x02,   i18n("Slow")},
 
703
                                                                {       -1,             i18n(strUnknown)}
 
704
};
 
705
 
 
706
//keep -1 in last position
 
707
//mapping type
 
708
static const id2name mappingType[]={{   0x00,   i18n("32 bit")},
 
709
                                                                        {       0x01,   i18n("Below 1M")},
 
710
                                                                        {       0x02,   i18n("64 bit")},
 
711
                                                                        {       -1,             i18n(strUnknown)}
 
712
};
 
713
 
 
714
//keep -1 in last position
 
715
//header type
 
716
static const id2name headerType[]={     {       0x00,   i18n("Standard")},
 
717
                                                                        {       0x01,   i18n("Bridge")},
 
718
                                                                        {       0x02,   i18n("CardBus")},
 
719
                                                                        {       -1,             i18n(strUnknown)}
 
720
};
 
721
 
 
722
//keep -1 in last position
 
723
//AGP rate
 
724
static const id2name agpRate[]={{       0x01,   i18n("1X")},
 
725
                                                                {       0x02,   i18n("2X")},
 
726
                                                                {       0x03,   i18n("1X & 2X")},
 
727
                                                                {       0x04,   i18n("4X")},
 
728
                                                                {       0x05,   i18n("1X & 4X")},
 
729
                                                                {       0x06,   i18n("2X & 4X")},
 
730
                                                                {       0x07,   i18n("1X & 2X & 4X")},
 
731
                                                                {       0x09,   i18n("4X")},
 
732
                                                                {       0x0A,   i18n("8X")},
 
733
                                                                {       0x0B,   i18n("4X & 8X")},
 
734
                                                                {       -1,             i18n(strUnknown)}
 
735
};
 
736
 
 
737
//keep -1 in last position
 
738
//AGP calibrating cycle
 
739
static const id2name calCycle[]={       {       0x00,   i18n("4 ms")},
 
740
                                                                        {       0x01,   i18n("16 ms")},
 
741
                                                                        {       0x02,   i18n("64 ms")},
 
742
                                                                        {       0x03,   i18n("256 ms")},
 
743
                                                                        {       0x07,   i18n("Not needed")},
 
744
                                                                        {       -1,             i18n(strUnknown)}
 
745
};
 
746
 
 
747
//keep -1 in last position
 
748
//PM auxiliary current
 
749
static const id2name auxCur[]={ {       0x00,   i18n("0 (self powered)")},
 
750
                                                                {       0x01,   i18n("55 mA")},
 
751
                                                                {       0x02,   i18n("100 mA")},
 
752
                                                                {       0x03,   i18n("160 mA")},
 
753
                                                                {       0x04,   i18n("220 mA")},
 
754
                                                                {       0x05,   i18n("270 mA")},
 
755
                                                                {       0x06,   i18n("320 mA")},
 
756
                                                                {       0x07,   i18n("375 mA")},
 
757
                                                                {       -1,             i18n(strUnknown)}
 
758
};
 
759
 
 
760
//keep -1 in last position
 
761
//PM power state
 
762
static const id2name powerState[]={     {       0x00,   i18n("D0")},
 
763
                                                                        {       0x01,   i18n("D1")},
 
764
                                                                        {       0x02,   i18n("D2")},
 
765
                                                                        {       0x03,   i18n("D3 hot")},
 
766
                                                                        {       -1,             i18n(strUnknown)}
 
767
};
 
768
 
 
769
//keep -1 in last position
 
770
//MSI multiple message
 
771
static const id2name multipleMessage[]={{       0x00,   i18n("1 vector")},
 
772
                                                                                {       0x01,   i18n("2 vectors")},
 
773
                                                                                {       0x02,   i18n("4 vectors")},
 
774
                                                                                {       0x03,   i18n("8 vectors")},
 
775
                                                                                {       0x04,   i18n("16 vectors")},
 
776
                                                                                {       0x05,   i18n("32 vectors")},
 
777
                                                                                {       -1,             i18n(strUnknown)}
 
778
};
 
779
 
 
780
static const QString& getNameById(const id2name *const table,int id);
 
781
static const QString& getNameBy2Id(const id3name *const table,int id,int id2);
 
782
static const QString& getNameBy3Id(const id4name *const table,int id,int id2, int id3);
 
783
 
 
784
#endif //KCONTROL_KPCI_PRIVATE_H