Changeset View
Changeset View
Standalone View
Standalone View
Modules/pci/kpci_private.h
Show All 39 Lines | 38 | struct id3name { | |||
---|---|---|---|---|---|
40 | QString name; | 40 | QString name; | ||
41 | }; | 41 | }; | ||
42 | 42 | | |||
43 | struct id4name { | 43 | struct id4name { | ||
44 | int id,id2,id3; | 44 | int id,id2,id3; | ||
45 | QString name; | 45 | QString name; | ||
46 | }; | 46 | }; | ||
47 | 47 | | |||
48 | /* Following structures MUST BE packed, otherwise variables will be mapped to | ||||
cfeck: structure or structures? | |||||
49 | wrong places. Q_PACKED macro seems to not work very well. `#pragma pack` are | ||||
cfeck: seems to | |||||
50 | more widely adopted, and should be ignored if not supported. | ||||
51 | | ||||
52 | TODO: It will be good to check if structures was packed by compiler, and | ||||
53 | disable this module entirely if not. | ||||
54 | */ | ||||
55 | #pragma pack(push, 1) | ||||
56 | | ||||
48 | union pciInfo { | 57 | union pciInfo { | ||
49 | unsigned char raw[256]; | 58 | unsigned char raw[256]; | ||
50 | struct { | 59 | struct { | ||
51 | unsigned short vendor; | 60 | unsigned short vendor; | ||
52 | unsigned short device; | 61 | unsigned short device; | ||
53 | union { | 62 | union { | ||
54 | unsigned short command; | 63 | unsigned short command; | ||
55 | struct { | 64 | struct { | ||
▲ Show 20 Lines • Show All 371 Lines • ▼ Show 20 Line(s) | 434 | struct { | |||
427 | unsigned short msiUnk; | 436 | unsigned short msiUnk; | ||
428 | unsigned msiMask; | 437 | unsigned msiMask; | ||
429 | unsigned msiPending; | 438 | unsigned msiPending; | ||
430 | } data Q_PACKED; | 439 | } data Q_PACKED; | ||
431 | } payload Q_PACKED; | 440 | } payload Q_PACKED; | ||
432 | } cooked Q_PACKED; | 441 | } cooked Q_PACKED; | ||
433 | } Q_PACKED; | 442 | } Q_PACKED; | ||
434 | 443 | | |||
444 | #pragma pack(pop) | ||||
445 | | ||||
435 | //In following arrays -1 mean default value | 446 | //In following arrays -1 mean default value | ||
436 | 447 | | |||
437 | //keep -1 in last position | 448 | //keep -1 in last position | ||
438 | //device classes list | 449 | //device classes list | ||
439 | static const id2name devClass[]={{ 0x00, i18n("Unclassified device")}, | 450 | static const id2name devClass[]={{ 0x00, i18n("Unclassified device")}, | ||
440 | { 0x01, i18n("Mass storage controller")}, | 451 | { 0x01, i18n("Mass storage controller")}, | ||
441 | { 0x02, i18n("Network controller")}, | 452 | { 0x02, i18n("Network controller")}, | ||
442 | { 0x03, i18n("Display controller")}, | 453 | { 0x03, i18n("Display controller")}, | ||
▲ Show 20 Lines • Show All 378 Lines • Show Last 20 Lines |
structure or structures?