Changeset View
Changeset View
Standalone View
Standalone View
Modules/pci/kpci.cpp
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | 77 | static QTreeWidgetItem* addVendor(QTreeWidgetItem *parent, QTreeWidgetItem *after, pciInfo *info, pci_access *PCIAccess) { | |||
---|---|---|---|---|---|
87 | }//if | 87 | }//if | ||
88 | else { | 88 | else { | ||
89 | subvendor=info->cooked.header.header0.subVendor; | 89 | subvendor=info->cooked.header.header0.subVendor; | ||
90 | subdevice=info->cooked.header.header0.subDevice; | 90 | subdevice=info->cooked.header.header0.subDevice; | ||
91 | }//else | 91 | }//else | ||
92 | 92 | | |||
93 | //WARNING all pci_lookup_name calls should have 4 extra args for compatibility with older pcilib ! | 93 | //WARNING all pci_lookup_name calls should have 4 extra args for compatibility with older pcilib ! | ||
94 | if (pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_VENDOR, info->cooked.vendor, 0, 0, 0)!=nullptr) { | 94 | if (pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_VENDOR, info->cooked.vendor, 0, 0, 0)!=nullptr) { | ||
95 | // line.setAscii(nameBuffer); //not work, workaround below | 95 | //line.setAscii(nameBuffer); //not work, workaround below | ||
96 | line = QString::fromLatin1(pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_VENDOR, info->cooked.vendor, 0, 0, 0)); | 96 | line = QString::fromLatin1(pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_VENDOR, info->cooked.vendor, 0, 0, 0)); | ||
97 | if (line.contains(QStringLiteral("Unknown"))==0) { | 97 | if (line.contains(QStringLiteral("Unknown"))==0) { | ||
98 | isVendor=true; | 98 | isVendor=true; | ||
99 | topname=line; | 99 | topname=line; | ||
100 | after=create(parent, i18n("Vendor"), line+value.sprintf(" (0x%04X)", info->cooked.vendor)); | 100 | after=create(parent, i18n("Vendor"), line+value.sprintf(" (0x%04X)", info->cooked.vendor)); | ||
101 | if (pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_DEVICE, info->cooked.vendor, info->cooked.device, 0, 0)!=nullptr) { | 101 | if (pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_DEVICE, info->cooked.vendor, info->cooked.device, 0, 0)!=nullptr) { | ||
102 | // line.setAscii(nameBuffer); //not work, workaround below | 102 | //line.setAscii(nameBuffer); //not work, workaround below | ||
103 | line = QString::fromLatin1(pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_DEVICE, info->cooked.vendor, info->cooked.device, 0, 0)); | 103 | line = QString::fromLatin1(pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_DEVICE, info->cooked.vendor, info->cooked.device, 0, 0)); | ||
104 | if (line.contains(QStringLiteral("Unknown"))==0) { | 104 | if (line.contains(QStringLiteral("Unknown"))==0) { | ||
105 | isDevice=true; | 105 | isDevice=true; | ||
106 | topname+=QStringLiteral(" ")+line; | 106 | topname+=QStringLiteral(" ")+line; | ||
107 | after=create(parent, i18n("Device"), line+value.sprintf(" (0x%04X)", info->cooked.device)); | 107 | after=create(parent, i18n("Device"), line+value.sprintf(" (0x%04X)", info->cooked.device)); | ||
108 | if (info->cooked.headerType.headerType_bits.headerType==PCI_HEADER_TYPE_BRIDGE) { | 108 | if (info->cooked.headerType.headerType_bits.headerType==PCI_HEADER_TYPE_BRIDGE) { | ||
109 | isSub=true; | 109 | isSub=true; | ||
110 | }//if | 110 | }//if | ||
111 | else if (pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_DEVICE|PCI_LOOKUP_SUBSYSTEM, info->cooked.vendor, info->cooked.device, subvendor, subdevice)!=nullptr) { | 111 | else if (pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_DEVICE|PCI_LOOKUP_SUBSYSTEM, info->cooked.vendor, info->cooked.device, subvendor, subdevice)!=nullptr) { | ||
112 | // line.setAscii(nameBuffer); //not work, workaround below | 112 | //line.setAscii(nameBuffer); //not work, workaround below | ||
113 | line = QString::fromLatin1(pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_DEVICE|PCI_LOOKUP_SUBSYSTEM, info->cooked.vendor, info->cooked.device, subvendor, subdevice)); | 113 | line = QString::fromLatin1(pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_DEVICE|PCI_LOOKUP_SUBSYSTEM, info->cooked.vendor, info->cooked.device, subvendor, subdevice)); | ||
114 | if (line.contains(QStringLiteral("Unknown"))==0) { | 114 | if (line.contains(QStringLiteral("Unknown"))==0) { | ||
115 | isSub=true; | 115 | isSub=true; | ||
116 | after=create(parent, i18n("Subsystem"), line+value.sprintf(" (0x%04X:0x%04X)", subvendor, subdevice)); | 116 | after=create(parent, i18n("Subsystem"), line+value.sprintf(" (0x%04X:0x%04X)", subvendor, subdevice)); | ||
117 | }//if | 117 | }//if | ||
118 | }//eliif | 118 | }//eliif | ||
119 | }//if | 119 | }//if | ||
120 | }//iif | 120 | }//iif | ||
121 | }//if | 121 | }//if | ||
122 | }//if | 122 | }//if | ||
123 | if (!isVendor) { | 123 | if (!isVendor) { | ||
124 | after=create(parent, i18n("Vendor"), i18nc(strCtxt, strUnknown)+value.sprintf(" (0x%04X)", info->cooked.vendor)); | 124 | after=create(parent, i18n("Vendor"), i18nc(strCtxt, strUnknown)+value.sprintf(" (0x%04X)", info->cooked.vendor)); | ||
125 | if (!isDevice) { | 125 | if (!isDevice) { | ||
126 | after=create(parent, i18n("Device"), i18nc(strCtxt, strUnknown)+value.sprintf(" (0x%04X)", info->cooked.device)); | 126 | after=create(parent, i18n("Device"), i18nc(strCtxt, strUnknown)+value.sprintf(" (0x%04X)", info->cooked.device)); | ||
127 | }//if | 127 | }//if | ||
128 | topname=i18nc(strCtxt, strUnknown); | 128 | topname=i18nc(strCtxt, strUnknown); | ||
129 | }//if | 129 | }//if | ||
130 | if ((!isSub)&&(info->cooked.headerType.headerType_bits.headerType!=PCI_HEADER_TYPE_BRIDGE)) { //if entire subsytem was not found, search at least for subvendor | 130 | if ((!isSub)&&(info->cooked.headerType.headerType_bits.headerType!=PCI_HEADER_TYPE_BRIDGE)) { //if entire subsytem was not found, search at least for subvendor | ||
131 | if (pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_VENDOR, subvendor, 0, 0, 0)!=nullptr) { | 131 | if (pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_VENDOR, subvendor, 0, 0, 0)!=nullptr) { | ||
132 | // line.setAscii(nameBuffer); //not work, workaround below | 132 | //line.setAscii(nameBuffer); //not work, workaround below | ||
133 | line = QString::fromLatin1(pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_VENDOR, subvendor, 0, 0, 0)); | 133 | line = QString::fromLatin1(pci_lookup_name(PCIAccess, nameBuffer, NAME_BUFFER_SIZE, PCI_LOOKUP_VENDOR, subvendor, 0, 0, 0)); | ||
134 | if (line.contains(QStringLiteral("Unknown"))==0) { | 134 | if (line.contains(QStringLiteral("Unknown"))==0) { | ||
135 | after=create(parent, i18n("Subsystem"), line+i18n(" - device:")+value.sprintf(" 0x%04X (0x%04X:0x%04X)", subdevice, subvendor, subdevice)); | 135 | after=create(parent, i18n("Subsystem"), line+i18n(" - device:")+value.sprintf(" 0x%04X (0x%04X:0x%04X)", subdevice, subvendor, subdevice)); | ||
136 | }//if | 136 | }//if | ||
137 | else { | 137 | else { | ||
138 | after=create(parent, i18n("Subsystem"), i18nc(strCtxt, strUnknown)+value.sprintf(" (0x%04X:0x%04X)", subvendor, subdevice)); | 138 | after=create(parent, i18n("Subsystem"), i18nc(strCtxt, strUnknown)+value.sprintf(" (0x%04X:0x%04X)", subvendor, subdevice)); | ||
139 | }//else | 139 | }//else | ||
140 | }//if | 140 | }//if | ||
▲ Show 20 Lines • Show All 411 Lines • ▼ Show 20 Line(s) | |||||
552 | 552 | | |||
553 | static QTreeWidgetItem* addCapsAgp(QTreeWidgetItem *parent, QTreeWidgetItem *after, pciInfo *info, int offset) { | 553 | static QTreeWidgetItem* addCapsAgp(QTreeWidgetItem *parent, QTreeWidgetItem *after, pciInfo *info, int offset) { | ||
554 | QTreeWidgetItem *localAfter=nullptr; | 554 | QTreeWidgetItem *localAfter=nullptr; | ||
555 | QString value; | 555 | QString value; | ||
556 | agpInfo infoAgp; | 556 | agpInfo infoAgp; | ||
557 | int i, cycleSize; | 557 | int i, cycleSize; | ||
558 | if ((offset+2+sizeof(agpInfo))<256) { | 558 | if ((offset+2+sizeof(agpInfo))<256) { | ||
559 | memcpy(reinterpret_cast<void*>(&infoAgp.raw[0]), reinterpret_cast<void*>(&info->raw[offset+2]), sizeof(agpInfo)); | 559 | memcpy(reinterpret_cast<void*>(&infoAgp.raw[0]), reinterpret_cast<void*>(&info->raw[offset+2]), sizeof(agpInfo)); | ||
560 | // after=create(parent, i18n("Revision"),value.sprintf("%i.%i",infoAgp.revMaior,infoAgp.revMinor)); | 560 | //after=create(parent, i18n("Revision"),value.sprintf("%i.%i",infoAgp.revMaior,infoAgp.revMinor)); | ||
561 | after=create(parent, i18n("Revision"),QStringLiteral("%1.%2").arg(infoAgp.cooked.revision.revMaior).arg(infoAgp.cooked.revision.revMinor)); | 561 | after=create(parent, i18n("Revision"),QStringLiteral("%1.%2").arg(infoAgp.cooked.revision.revMaior).arg(infoAgp.cooked.revision.revMinor)); | ||
562 | after=create(parent, i18n("Status"),value.sprintf("0x%08X",infoAgp.cooked.status.status)); | 562 | after=create(parent, i18n("Status"),value.sprintf("0x%08X",infoAgp.cooked.status.status)); | ||
563 | localAfter=create(after, i18n("Rate"),getNameById(agpRate,infoAgp.cooked.status.status_bits0.statusEnhRate)); | 563 | localAfter=create(after, i18n("Rate"),getNameById(agpRate,infoAgp.cooked.status.status_bits0.statusEnhRate)); | ||
564 | localAfter=create(after, i18n("AGP 3.0 mode"),(infoAgp.cooked.status.status_bits1.statusMode?i18nc(strCtxt, strEnabled):i18nc(strCtxt, strDisabled))); | 564 | localAfter=create(after, i18n("AGP 3.0 mode"),(infoAgp.cooked.status.status_bits1.statusMode?i18nc(strCtxt, strEnabled):i18nc(strCtxt, strDisabled))); | ||
565 | localAfter=create(after, i18n("Fast Writes"),(infoAgp.cooked.status.status_bits1.statusFastWrite?i18nc(strCtxt, strEnabled):i18nc(strCtxt, strDisabled))); | 565 | localAfter=create(after, i18n("Fast Writes"),(infoAgp.cooked.status.status_bits1.statusFastWrite?i18nc(strCtxt, strEnabled):i18nc(strCtxt, strDisabled))); | ||
566 | localAfter=create(after, i18n("Address over 4 GiB"),(infoAgp.cooked.status.status_bits1.statusOver4gb?i18nc(strCtxt, strEnabled):i18nc(strCtxt, strDisabled))); | 566 | localAfter=create(after, i18n("Address over 4 GiB"),(infoAgp.cooked.status.status_bits1.statusOver4gb?i18nc(strCtxt, strEnabled):i18nc(strCtxt, strDisabled))); | ||
567 | if (infoAgp.cooked.status.status_bits1.statusMode==1) { | 567 | if (infoAgp.cooked.status.status_bits1.statusMode==1) { | ||
568 | localAfter=create(after, i18n("Translation of host processor access"),(infoAgp.cooked.status.status_bits1.statusHtrans?i18nc(strCtxt, strDisabled):i18nc(strCtxt, strEnabled))); //reverse order is intentional | 568 | localAfter=create(after, i18n("Translation of host processor access"),(infoAgp.cooked.status.status_bits1.statusHtrans?i18nc(strCtxt, strDisabled):i18nc(strCtxt, strEnabled))); //reverse order is intentional | ||
▲ Show 20 Lines • Show All 229 Lines • ▼ Show 20 Line(s) | 745 | for (PCIDevice=PCIAccess->devices; PCIDevice; PCIDevice=PCIDevice->next) { | |||
798 | //adding interrupt info (IRQ, pin) | 798 | //adding interrupt info (IRQ, pin) | ||
799 | after=addInterrupt(DeviceName, after, PCIDevice->irq, info.cooked.header.header0.interruptPin); //PCI data have wrong IRQ ?!? | 799 | after=addInterrupt(DeviceName, after, PCIDevice->irq, info.cooked.header.header0.interruptPin); //PCI data have wrong IRQ ?!? | ||
800 | //add raw PCI config data | 800 | //add raw PCI config data | ||
801 | after=addRaw(DeviceName, after, &info); | 801 | after=addRaw(DeviceName, after, &info); | ||
802 | }//for | 802 | }//for | ||
803 | 803 | | |||
804 | pci_cleanup(PCIAccess); | 804 | pci_cleanup(PCIAccess); | ||
805 | return true; | 805 | return true; | ||
806 | } //GetInfo_PCIUtils | 806 | }//GetInfo_PCIUtils | ||
807 | 807 | |