2 Copyright (C) 2003-2018, The AROS Development Team.
6 #include <exec/types.h>
7 #include <exec/memory.h>
8 #include <libraries/mui.h>
11 #include <utility/tagitem.h>
12 #include <utility/hooks.h>
14 #include <proto/alib.h>
15 #include <proto/exec.h>
16 #include <proto/muimaster.h>
17 #include <proto/oop.h>
18 #include <proto/utility.h>
19 #include <proto/intuition.h>
22 #include <aros/debug.h>
30 #define APPNAME "PCITool"
31 #define VERSION "PCITool 0.8 (25.2.2017)"
32 #define IDB_SAVE 10001
33 #define IDB_SAVEALL 10002
34 #define MAX_STRING_LENGTH 200
35 const char version
[] = "$VER: " VERSION
"\n";
37 struct Library
*OOPBase
= NULL
;
38 struct Library
*MUIMasterBase
= NULL
;
39 struct UtilityBase
*UtilityBase
= NULL
;
40 struct PCIInfo SaveDeviceInfo
;
42 OOP_AttrBase __IHidd_PCIDevice
;
43 OOP_AttrBase __IHidd_PCIDriver
;
44 OOP_AttrBase HiddAttrBase
;
50 if ((OOPBase
=OpenLibrary("oop.library", 0)) != NULL
)
52 __IHidd_PCIDevice
= OOP_ObtainAttrBase(IID_Hidd_PCIDevice
);
53 __IHidd_PCIDriver
= OOP_ObtainAttrBase(IID_Hidd_PCIDriver
);
54 HiddAttrBase
= OOP_ObtainAttrBase(IID_Hidd
);
56 if ((MUIMasterBase
=OpenLibrary("muimaster.library", 0)) != NULL
)
58 if ((UtilityBase
=(struct UtilityBase
*)OpenLibrary("utility.library", 0)) != NULL
)
73 OOP_DisposeObject(pci
);
75 OOP_ReleaseAttrBase(IID_Hidd_PCIDevice
);
76 OOP_ReleaseAttrBase(IID_Hidd_PCIDriver
);
77 OOP_ReleaseAttrBase(IID_Hidd
);
80 CloseLibrary(OOPBase
);
82 if (UtilityBase
!= NULL
)
83 CloseLibrary((struct Library
*)UtilityBase
);
85 if (MUIMasterBase
!= NULL
)
86 CloseLibrary(MUIMasterBase
);
93 void cleanup(CONST_STRPTR message
)
95 Locale_Deinitialize();
99 ShowError(NULL
, NULL
, message
, TRUE
);
108 Object
*MakeLabel(STRPTR str
)
110 return (MUI_MakeObject(MUIO_Label
, str
, 0));
113 LONG
xget(Object
* obj
, ULONG attr
)
123 Object
*StrDriverName
, *StrDriverHWName
, *StrDriverDirect
, *StrIOBase
;
125 Object
*StrDescription
, *VendorID
, *ProductID
, *RevisionID
;
126 Object
*VendorName
, *ProductName
, *SubsystemName
, *OwnerName
;
127 Object
*_Class
, *SubClass
, *Interface
, *IRQLine
;
128 Object
*ROMBase
, *ROMSize
;
131 Object
*SaveInfo
, *SaveAllInfo
;
133 Object
*PCIeSerialNumber
;
135 struct Hook pci_hook
;
136 struct Hook display_hook
;
137 struct Hook select_hook
;
138 struct Hook save_hook
;
139 struct Hook saveall_hook
;
141 AROS_UFH3(void, pci_callback
,
142 AROS_UFHA(struct Hook
*, hook
, A0
),
143 AROS_UFHA(OOP_Object
*, obj
, A2
),
144 AROS_UFHA(APTR
, msg
, A1
))
148 DoMethod(DriverList
, MUIM_List_InsertSingle
, (IPTR
)obj
, MUIV_List_Insert_Bottom
);
153 AROS_UFH3(void, save_function
,
154 AROS_UFHA(struct Hook
*, hook
, A0
),
155 AROS_UFHA(Object
*, obj
, A2
),
156 AROS_UFHA(APTR
, msg
, A1
))
160 LONG active
= xget(DriverList
, MUIA_List_Active
);
161 if (active
!= MUIV_List_Active_Off
)
163 /*Saves the Info of the Displayed Device to RamDisk*/
164 SaveToDisk(&SaveDeviceInfo
);
169 PutStr("No active entry\n");
175 AROS_UFH3(void, saveall_function
,
176 AROS_UFHA(struct Hook
*, hook
, A0
),
177 AROS_UFHA(Object
*, obj
, A2
),
178 AROS_UFHA(APTR
, msg
, A1
))
184 /*Saves All PCITool Info to RamDisk*/
185 if (OpenPCIInfoFile())
187 entries
= XGET(DriverList
, MUIA_List_Entries
);
188 for(i
= 0 ; i
< entries
; i
++)
190 set(DriverList
, MUIA_List_Active
, i
);
191 WriteToPCIInfoFile(&SaveDeviceInfo
);
199 AROS_UFH3(void, display_function
,
200 AROS_UFHA(struct Hook
*, h
, A0
),
201 AROS_UFHA(char **, strings
, A2
),
202 AROS_UFHA(OOP_Object
*, obj
, A1
))
211 OOP_GetAttr(obj
, aHidd_PCIDevice_Bus
, (APTR
)&bus
);
212 OOP_GetAttr(obj
, aHidd_PCIDevice_Dev
, (APTR
)&dev
);
213 OOP_GetAttr(obj
, aHidd_PCIDevice_Sub
, (APTR
)&sub
);
215 snprintf(buf
, 19, "%02lx.%02lx.%01lx", bus
, dev
, sub
);
222 void memoryPrint(STRPTR buffer
, unsigned int bar
, unsigned int base
, unsigned int size
, unsigned int type
)
226 snprintf(buffer
, 59, "Bar%d: %s%s at 0x%04x (size 0x%x)", bar
,
227 (type
& ADDRF_PREFETCH
) ? "Prefetchable " :"",
228 (type
& ADDRF_IO
)?"I/O":"Memory",
233 snprintf(buffer
, 59, "Bar%d: %s%s at 0x%08x (size 0x%x)", bar
,
234 (type
& ADDRF_PREFETCH
) ? "Prefetchable " :"",
235 (type
& ADDRF_IO
)?"I/O":"Memory",
240 AROS_UFH3(void, select_function
,
241 AROS_UFHA(struct Hook
*, h
, A0
),
242 AROS_UFHA(Object
*, object
, A2
),
243 AROS_UFHA(APTR
, msg
, A1
))
248 OOP_Object
*obj
, *drv
;
249 STRPTR
class, subclass
, interface
, str
, owner
;
250 UWORD vendor
, product
, subvendor
, subdevice
;
252 active
= xget(object
, MUIA_List_Active
);
253 if (active
!= MUIV_List_Active_Off
)
255 IPTR val
, val2
, val3
;
256 static char buf
[MAX_STRING_LENGTH
+ 1];
258 static char ranges
[6][60];
259 DoMethod(object
, MUIM_List_GetEntry
, active
, (IPTR
)&obj
);
261 OOP_GetAttr(obj
, aHidd_PCIDevice_Driver
, (APTR
)&drv
);
262 OOP_GetAttr(drv
, aHidd_Name
, (APTR
)&str
);
263 set(StrDriverName
, MUIA_Text_Contents
, str
);
264 strcpy(SaveDeviceInfo
.Driver_name
, str
); //Save Debug Info
265 OOP_GetAttr(drv
, aHidd_HardwareName
, (APTR
)&str
);
266 set(StrDriverHWName
, MUIA_Text_Contents
, str
);
267 strcpy(SaveDeviceInfo
.Hardware_info
, str
); //Save Debug Info
268 OOP_GetAttr(drv
, aHidd_PCIDriver_IOBase
, &val
);
269 snprintf(SaveDeviceInfo
.IOBase
, 11, "0x%08lx", val
);
270 set(StrIOBase
, MUIA_Text_Contents
, SaveDeviceInfo
.IOBase
);
271 OOP_GetAttr(drv
, aHidd_PCIDriver_DirectBus
, (APTR
)&val
);
272 set(StrDriverDirect
, MUIA_Text_Contents
, (IPTR
)((val
)?_(MSG_YES
):_(MSG_NO
)));
273 strcpy(SaveDeviceInfo
.Direct_bus
, (val
)?_(MSG_YES
):_(MSG_NO
)); //Save Debug Info
274 OOP_GetAttr(obj
, aHidd_PCIDevice_ClassDesc
, (APTR
)&class);
275 OOP_GetAttr(obj
, aHidd_PCIDevice_SubClassDesc
, (APTR
)&subclass
);
276 OOP_GetAttr(obj
, aHidd_PCIDevice_InterfaceDesc
, (APTR
)&interface
);
277 snprintf(buf
, MAX_STRING_LENGTH
, "%s %s %s", class, subclass
,
279 set(StrDescription
, MUIA_Text_Contents
, buf
);
280 strcpy(SaveDeviceInfo
.Description
, buf
); //Save Debug Info
281 OOP_GetAttr(obj
, aHidd_PCIDevice_VendorID
, (APTR
)&val
);
282 snprintf(buf
, MAX_STRING_LENGTH
, "0x%04lx", val
);
283 set(VendorID
, MUIA_Text_Contents
, buf
);
284 strcpy(SaveDeviceInfo
.VendorID
, buf
);
285 set(VendorName
, MUIA_Text_Contents
, pciids_GetVendorName(val
, buf
,
288 strcpy(SaveDeviceInfo
.Vendor_name
,
289 pciids_GetVendorName(val
, buf
, MAX_STRING_LENGTH
)); //Save Debug Info
290 OOP_GetAttr(obj
, aHidd_PCIDevice_ProductID
, (APTR
)&val
);
291 snprintf(buf
, MAX_STRING_LENGTH
, "0x%04lx", val
);
292 set(ProductID
, MUIA_Text_Contents
, buf
);
293 strcpy(SaveDeviceInfo
.ProductID
, buf
); //Save Debug Info
294 set(ProductName
, MUIA_Text_Contents
,
295 pciids_GetDeviceName(vendor
, val
, buf
, MAX_STRING_LENGTH
));
297 strcpy(SaveDeviceInfo
.Product_name
,
298 pciids_GetDeviceName(vendor
, val
, buf
, MAX_STRING_LENGTH
));
300 OOP_GetAttr(obj
, aHidd_PCIDevice_SubsystemVendorID
, (APTR
)&val
);
302 OOP_GetAttr(obj
, aHidd_PCIDevice_SubsystemID
, (APTR
)&val
);
304 set(SubsystemName
, MUIA_Text_Contents
,
305 pciids_GetSubDeviceName(vendor
, product
, subvendor
, subdevice
,
306 buf
, MAX_STRING_LENGTH
));
307 strcpy(SaveDeviceInfo
.Subsystem
, pciids_GetSubDeviceName(vendor
,
308 product
, subvendor
, subdevice
, buf
, MAX_STRING_LENGTH
));
310 OOP_GetAttr(obj
, aHidd_PCIDevice_Owner
, (IPTR
*)&owner
);
313 set(OwnerName
, MUIA_Text_Contents
, owner
);
314 strcpy(SaveDeviceInfo
.Owner
, owner
);
318 set(OwnerName
, MUIA_Text_Contents
, "");
319 SaveDeviceInfo
.Owner
[0] = 0;
322 OOP_GetAttr(obj
, aHidd_PCIDevice_RevisionID
, (APTR
)&val
);
323 snprintf(buf
, MAX_STRING_LENGTH
, "0x%02lx", val
);
324 set(RevisionID
, MUIA_Text_Contents
, buf
);
325 strcpy(SaveDeviceInfo
.RevisionID
, buf
); //Save Debug Info
327 OOP_GetAttr(obj
, aHidd_PCIDevice_Interface
, (APTR
)&val
);
328 snprintf(buf
, MAX_STRING_LENGTH
, "0x%02lx", val
);
329 set(Interface
, MUIA_Text_Contents
, buf
);
330 strcpy(SaveDeviceInfo
.Interface
, buf
); //Save Debug Info
332 OOP_GetAttr(obj
, aHidd_PCIDevice_Class
, (APTR
)&val
);
333 snprintf(buf
, MAX_STRING_LENGTH
, "0x%02lx", val
);
334 set(_Class
, MUIA_Text_Contents
, buf
);
335 strcpy(SaveDeviceInfo
.Class
, buf
); //Save Debug Info
337 OOP_GetAttr(obj
, aHidd_PCIDevice_SubClass
, (APTR
)&val
);
338 snprintf(buf
, MAX_STRING_LENGTH
, "0x%02lx", val
);
339 set(SubClass
, MUIA_Text_Contents
, buf
);
340 strcpy(SaveDeviceInfo
.Subclass
, buf
); //Save Debug Info
342 OOP_GetAttr(obj
, aHidd_PCIDevice_IRQLine
, (APTR
)&val
);
343 OOP_GetAttr(obj
, aHidd_PCIDevice_INTLine
, (APTR
)&val2
);
346 snprintf(buf
, MAX_STRING_LENGTH
, "%ld (%c)", val2
,
349 else strncpy(buf
, _(MSG_NA
), MAX_STRING_LENGTH
);
350 buf
[MAX_STRING_LENGTH
] = 0;
351 set(IRQLine
, MUIA_Text_Contents
, buf
);
352 strcpy(SaveDeviceInfo
.IRQ
, buf
); //Save Debug Info
354 OOP_GetAttr(obj
, aHidd_PCIDevice_RomBase
, (APTR
)&val
);
355 OOP_GetAttr(obj
, aHidd_PCIDevice_RomSize
, (APTR
)&val2
);
356 snprintf(buf
, MAX_STRING_LENGTH
, "0x%08lx", val2
);
359 set(ROMSize
, MUIA_Text_Contents
, buf
);
360 strcpy(SaveDeviceInfo
.ROM_Size
, buf
); //Save Debug Info
363 snprintf(buf
, MAX_STRING_LENGTH
, "0x%08lx", val
);
364 set(ROMBase
, MUIA_Text_Contents
, buf
);
365 strcpy(SaveDeviceInfo
.ROM_Base
, buf
); //Save Debug Info
367 else set(ROMBase
, MUIA_Text_Contents
, _(MSG_UNUSED
));
371 set(ROMBase
, MUIA_Text_Contents
, _(MSG_NA
));
372 strcpy(SaveDeviceInfo
.ROM_Base
, _(MSG_NA
));
373 set(ROMSize
, MUIA_Text_Contents
, _(MSG_NA
));
374 strcpy(SaveDeviceInfo
.ROM_Size
, _(MSG_NA
));
377 OOP_GetAttr(obj
, aHidd_PCIDevice_ExtendedCapabilitySerialNumber
, (APTR
)&val
);
380 val2
= HIDD_PCIDevice_ReadConfigLong(obj
, val
+4);
381 val3
= HIDD_PCIDevice_ReadConfigLong(obj
, val
+8);
382 snprintf(buf
, MAX_STRING_LENGTH
, "%08lx:%08lx", val3
, val2
);
383 set(PCIeSerialNumber
, MUIA_Text_Contents
, buf
);
385 else set(PCIeSerialNumber
, MUIA_Text_Contents
, _(MSG_NA
));
387 DoMethod(RangeList
, MUIM_List_Clear
);
389 OOP_GetAttr(obj
, aHidd_PCIDevice_Base0
, (APTR
)&val
);
390 OOP_GetAttr(obj
, aHidd_PCIDevice_Size0
, (APTR
)&val2
);
391 OOP_GetAttr(obj
, aHidd_PCIDevice_Type0
, (APTR
)&val3
);
395 memoryPrint(ranges
[0], 0, val
, val2
, val3
);
396 DoMethod(RangeList
, MUIM_List_InsertSingle
, (IPTR
)ranges
[0], MUIV_List_Insert_Bottom
);
397 strcpy(SaveDeviceInfo
.Rangelist_0
, ranges
[0]);
400 OOP_GetAttr(obj
, aHidd_PCIDevice_Base1
, (APTR
)&val
);
401 OOP_GetAttr(obj
, aHidd_PCIDevice_Size1
, (APTR
)&val2
);
402 OOP_GetAttr(obj
, aHidd_PCIDevice_Type1
, (APTR
)&val3
);
406 memoryPrint(ranges
[1], 1, val
, val2
, val3
);
407 DoMethod(RangeList
, MUIM_List_InsertSingle
, (IPTR
)ranges
[1], MUIV_List_Insert_Bottom
);
408 strcpy(SaveDeviceInfo
.Rangelist_1
, ranges
[1]);
411 OOP_GetAttr(obj
, aHidd_PCIDevice_isBridge
, (APTR
)&val
);
415 OOP_GetAttr(obj
, aHidd_PCIDevice_Base2
, (APTR
)&val
);
416 OOP_GetAttr(obj
, aHidd_PCIDevice_Size2
, (APTR
)&val2
);
417 OOP_GetAttr(obj
, aHidd_PCIDevice_Type2
, (APTR
)&val3
);
421 memoryPrint(ranges
[2], 2, val
, val2
, val3
);
422 DoMethod(RangeList
, MUIM_List_InsertSingle
, (IPTR
)ranges
[2], MUIV_List_Insert_Bottom
);
423 strcpy(SaveDeviceInfo
.Rangelist_2
, ranges
[2]);
426 OOP_GetAttr(obj
, aHidd_PCIDevice_Base3
, (APTR
)&val
);
427 OOP_GetAttr(obj
, aHidd_PCIDevice_Size3
, (APTR
)&val2
);
428 OOP_GetAttr(obj
, aHidd_PCIDevice_Type3
, (APTR
)&val3
);
432 memoryPrint(ranges
[3], 3, val
, val2
, val3
);
433 DoMethod(RangeList
, MUIM_List_InsertSingle
, (IPTR
)ranges
[3], MUIV_List_Insert_Bottom
);
434 strcpy(SaveDeviceInfo
.Rangelist_3
, ranges
[3]);
437 OOP_GetAttr(obj
, aHidd_PCIDevice_Base4
, (APTR
)&val
);
438 OOP_GetAttr(obj
, aHidd_PCIDevice_Size4
, (APTR
)&val2
);
439 OOP_GetAttr(obj
, aHidd_PCIDevice_Type4
, (APTR
)&val3
);
443 memoryPrint(ranges
[4], 4, val
, val2
, val3
);
444 DoMethod(RangeList
, MUIM_List_InsertSingle
, (IPTR
)ranges
[4], MUIV_List_Insert_Bottom
);
445 strcpy(SaveDeviceInfo
.Rangelist_4
, ranges
[4]);
448 OOP_GetAttr(obj
, aHidd_PCIDevice_Base5
, (APTR
)&val
);
449 OOP_GetAttr(obj
, aHidd_PCIDevice_Size5
, (APTR
)&val2
);
450 OOP_GetAttr(obj
, aHidd_PCIDevice_Type5
, (APTR
)&val3
);
454 memoryPrint(ranges
[5], 5, val
, val2
, val3
);
455 DoMethod(RangeList
, MUIM_List_InsertSingle
, (IPTR
)ranges
[5], MUIV_List_Insert_Bottom
);
456 strcpy(SaveDeviceInfo
.Rangelist_5
, ranges
[5]);
461 OOP_GetAttr(obj
, aHidd_PCIDevice_SecBus
, (APTR
)&val
);
462 OOP_GetAttr(obj
, aHidd_PCIDevice_ISAEnable
, (APTR
)&val2
);
463 OOP_GetAttr(obj
, aHidd_PCIDevice_VGAEnable
, (APTR
)&val3
);
465 snprintf(ranges
[2], 59, _(MSG_BRIDGE
),
466 val
, (val2
) ? (CONST_STRPTR
)" " : _(MSG_NOT
),
467 (val3
) ? (CONST_STRPTR
)" " : _(MSG_NOT
));
468 DoMethod(RangeList
, MUIM_List_InsertSingle
, (IPTR
)ranges
[2], MUIV_List_Insert_Bottom
);
469 strcpy(SaveDeviceInfo
.Rangelist_2
, ranges
[2]);
470 OOP_GetAttr(obj
, aHidd_PCIDevice_MemoryBase
, (APTR
)&val
);
471 OOP_GetAttr(obj
, aHidd_PCIDevice_MemoryLimit
, (APTR
)&val2
);
473 snprintf(ranges
[3], 59, _(MSG_MEMORY_RANGE
), val
, val2
);
474 DoMethod(RangeList
, MUIM_List_InsertSingle
, (IPTR
)ranges
[3], MUIV_List_Insert_Bottom
);
475 strcpy(SaveDeviceInfo
.Rangelist_3
, ranges
[3]);
476 OOP_GetAttr(obj
, aHidd_PCIDevice_PrefetchableBase
, (APTR
)&val
);
477 OOP_GetAttr(obj
, aHidd_PCIDevice_PrefetchableLimit
, (APTR
)&val2
);
479 snprintf(ranges
[4], 59, _(MSG_PREFETCHABLE_MEMORY
), val
, val2
);
480 DoMethod(RangeList
, MUIM_List_InsertSingle
, (IPTR
)ranges
[4], MUIV_List_Insert_Bottom
);
481 strcpy(SaveDeviceInfo
.Rangelist_4
, ranges
[4]);
482 OOP_GetAttr(obj
, aHidd_PCIDevice_IOBase
, (APTR
)&val
);
483 OOP_GetAttr(obj
, aHidd_PCIDevice_IOLimit
, (APTR
)&val2
);
485 snprintf(ranges
[5], 59, _(MSG_IO_RANGE
), val
, val2
);
486 DoMethod(RangeList
, MUIM_List_InsertSingle
, (IPTR
)ranges
[5], MUIV_List_Insert_Bottom
);
487 strcpy(SaveDeviceInfo
.Rangelist_5
, ranges
[5]);
490 IPTR io
, mem
, master
, snoop
, is66
;
492 OOP_GetAttr(obj
, aHidd_PCIDevice_isIO
, (APTR
)&io
);
493 OOP_GetAttr(obj
, aHidd_PCIDevice_isMEM
, (APTR
)&mem
);
494 OOP_GetAttr(obj
, aHidd_PCIDevice_isMaster
, (APTR
)&master
);
495 OOP_GetAttr(obj
, aHidd_PCIDevice_paletteSnoop
, (APTR
)&snoop
);
496 OOP_GetAttr(obj
, aHidd_PCIDevice_is66MHz
, (APTR
)&is66
);
498 snprintf(buf
, MAX_STRING_LENGTH
, _(MSG_IO_MSG
),
499 io
? _(MSG_YES
):_(MSG_NO
),
500 mem
? _(MSG_YES
):_(MSG_NO
),
501 master
? _(MSG_YES
):_(MSG_NO
),
502 snoop
? _(MSG_YES
):_(MSG_NO
),
503 is66
? _(MSG_YES
):_(MSG_NO
));
504 set(Status
, MUIA_Text_Contents
, buf
);
505 strcpy(SaveDeviceInfo
.Status
, buf
);
516 app
= ApplicationObject
,
517 MUIA_Application_Title
, (IPTR
)APPNAME
,
518 MUIA_Application_Version
, (IPTR
)VERSION
,
519 MUIA_Application_Copyright
, (IPTR
)"(C) 2004-2017, The AROS Development Team",
520 MUIA_Application_Author
, (IPTR
)"Michal Schulz",
521 MUIA_Application_Base
, (IPTR
)APPNAME
,
522 MUIA_Application_Description
, __(MSG_DESCRIPTION
),
524 SubWindow
, MainWindow
= WindowObject
,
525 MUIA_Window_Title
, __(MSG_WINTITLE
),
526 // MUIA_Window_Height, MUIV_Window_Height_Visible(50),
527 // MUIA_Window_Width, MUIV_Window_Width_Visible(60),
529 WindowContents
, HGroup
,
530 MUIA_Group_SameWidth
, FALSE
,
532 Child
, ListviewObject
,
533 MUIA_Listview_List
, DriverList
= ListObject
,
535 MUIA_List_AdjustWidth
, TRUE
,
536 MUIA_List_DisplayHook
, &display_hook
,
540 Child
, ScrollgroupObject
,
541 MUIA_Scrollgroup_Contents
, VirtgroupObject
,
542 Child
, VGroup
, GroupFrameT(_(MSG_DRIVER_INFO
)),
544 Child
, Label(_(MSG_DRIVER_NAME
)),
546 Child
, StrDriverName
= TextObject
,
548 MUIA_Background
, MUII_TextBack
,
549 MUIA_Text_SetMax
, FALSE
,
550 MUIA_Text_Contents
, "",
552 Child
, Label(_(MSG_DIRECT_BUS
)),
553 Child
, StrDriverDirect
= TextObject
,
555 MUIA_Background
, MUII_TextBack
,
556 MUIA_Text_SetMax
, FALSE
,
557 MUIA_Text_Contents
, "",
560 Child
, Label(_(MSG_IO_BASE
)),
562 Child
, StrIOBase
= TextObject
,
564 MUIA_Background
, MUII_TextBack
,
565 MUIA_Text_SetMax
, FALSE
,
566 MUIA_Text_Contents
, "0x00000000",
570 Child
, Label(_(MSG_HARDWARE_INFO
)),
571 Child
, StrDriverHWName
= TextObject
,
573 MUIA_Background
, MUII_TextBack
,
574 MUIA_Text_SetMax
, FALSE
,
575 MUIA_Text_Contents
, "",
579 Child
, VGroup
, GroupFrameT(_(MSG_PCI_DEVICE_INFO
)),
581 Child
, Label(_(MSG_DEVICE_DESCRIPTION
)),
582 Child
, StrDescription
= TextObject
,
584 MUIA_Background
, MUII_TextBack
,
585 MUIA_Text_SetMax
, FALSE
,
586 MUIA_Text_Contents
, "",
588 Child
, Label(_(MSG_VENDORNAME
)),
589 Child
, VendorName
= TextObject
,
591 MUIA_Background
, MUII_TextBack
,
592 MUIA_Text_SetMax
, FALSE
,
593 MUIA_Text_Contents
, "",
595 Child
, Label(_(MSG_PRODUCTNAME
)),
596 Child
, ProductName
= TextObject
,
598 MUIA_Background
, MUII_TextBack
,
599 MUIA_Text_SetMax
, FALSE
,
600 MUIA_Text_Contents
, "",
602 Child
, Label(_(MSG_SUBSYSTEM
)),
603 Child
, SubsystemName
= TextObject
,
605 MUIA_Background
, MUII_TextBack
,
606 MUIA_Text_SetMax
, FALSE
,
607 MUIA_Text_Contents
, "",
609 Child
, Label(_(MSG_OWNER
)),
610 Child
, OwnerName
= TextObject
,
612 MUIA_Background
, MUII_TextBack
,
613 MUIA_Text_SetMax
, FALSE
,
614 MUIA_Text_Contents
, "",
618 Child
, Label(_(MSG_VENDORID
)),
619 Child
, VendorID
= TextObject
,
621 MUIA_Background
, MUII_TextBack
,
622 MUIA_Text_SetMax
, FALSE
,
623 MUIA_Text_Contents
, "0x0000",
625 Child
, Label(_(MSG_PRODUCTID
)),
626 Child
, ProductID
= TextObject
,
628 MUIA_Background
, MUII_TextBack
,
629 MUIA_Text_SetMax
, FALSE
,
630 MUIA_Text_Contents
, "0x0000",
632 Child
, Label(_(MSG_REVISIONID
)),
633 Child
, RevisionID
= TextObject
,
635 MUIA_Background
, MUII_TextBack
,
636 MUIA_Text_SetMax
, FALSE
,
637 MUIA_Text_Contents
, "0x0000",
639 Child
, Label(_(MSG_CLASS
)),
640 Child
, _Class
= TextObject
,
642 MUIA_Background
, MUII_TextBack
,
643 MUIA_Text_SetMax
, FALSE
,
644 MUIA_Text_Contents
, "0x00",
646 Child
, Label(_(MSG_SUBCLASS
)),
647 Child
, SubClass
= TextObject
,
649 MUIA_Background
, MUII_TextBack
,
650 MUIA_Text_SetMax
, FALSE
,
651 MUIA_Text_Contents
, "0x00",
653 Child
, Label(_(MSG_INTERFACE
)),
654 Child
, Interface
= TextObject
,
656 MUIA_Background
, MUII_TextBack
,
657 MUIA_Text_SetMax
, FALSE
,
658 MUIA_Text_Contents
, "0x00",
660 Child
, Label(_(MSG_ROM_BASE
)),
661 Child
, ROMBase
= TextObject
,
663 MUIA_Background
, MUII_TextBack
,
664 MUIA_Text_SetMax
, FALSE
,
665 MUIA_Text_Contents
, "0x00000000",
667 Child
, Label(_(MSG_ROM_SIZE
)),
668 Child
, ROMSize
= TextObject
,
670 MUIA_Background
, MUII_TextBack
,
671 MUIA_Text_SetMax
, FALSE
,
672 MUIA_Text_Contents
, "0x00000000",
674 Child
, Label(_(MSG_IRQ
)),
675 Child
, IRQLine
= TextObject
,
677 MUIA_Background
, MUII_TextBack
,
678 MUIA_Text_SetMax
, FALSE
,
679 MUIA_Text_Contents
, "15",
682 Child
, VGroup
, GroupFrameT(_(MSG_PCIE_DEVICE_INFO
)),
684 Child
, Label(_(MSG_PCIE_SERIAL_NUMBER
)),
685 Child
, PCIeSerialNumber
= TextObject
,
687 MUIA_Background
, MUII_TextBack
,
688 MUIA_Text_SetMax
, FALSE
,
689 MUIA_Text_Contents
, "00000000:00000000",
694 Child
, RangeList
= ListviewObject
,
695 MUIA_Listview_List
, ListObject
,
697 MUIA_List_AdjustWidth
, FALSE
,
701 Child
, Status
= TextObject
,
703 MUIA_Background
, MUII_TextBack
,
704 MUIA_Text_SetMax
, FALSE
,
707 /*Save the displayed info into a text file in RAM:*/
708 Child
, SaveInfo
= SimpleButton(_(MSG_SAVETORAMDISK
) ),
709 Child
, SaveAllInfo
= SimpleButton(_(MSG_SAVEALLTORAMDISK
) ),
712 End
, // WindowContents
714 End
; // ApplicationObject
718 /* Quit application if the windowclosegadget or the esc key is pressed. */
719 DoMethod(MainWindow
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
721 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
723 DoMethod(DriverList
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
725 MUIM_CallHook
, (IPTR
)&select_hook
);
727 DoMethod(SaveInfo
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
729 MUIM_CallHook
, (IPTR
)&save_hook
);
731 DoMethod(SaveAllInfo
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
733 MUIM_CallHook
, (IPTR
)&saveall_hook
);
743 pci_hook
.h_Entry
= (APTR
)pci_callback
;
744 display_hook
.h_Entry
= (APTR
)display_function
;
745 select_hook
.h_Entry
= (APTR
)select_function
;
746 save_hook
.h_Entry
= (APTR
)save_function
;
747 saveall_hook
.h_Entry
= (APTR
)saveall_function
;
749 if (!Locale_Initialize())
750 cleanup(_(MSG_ERROR_LOCALE
));
756 pci
= OOP_NewObject(NULL
, CLID_Hidd_PCI
, NULL
);
759 HIDD_PCI_EnumDevices(pci
, &pci_hook
, NULL
);
762 set(DriverList
, MUIA_List_Active
, MUIV_List_Active_Top
);
763 set(MainWindow
, MUIA_Window_ActiveObject
, DriverList
);
764 set(MainWindow
, MUIA_Window_Open
, TRUE
);
766 if(xget(MainWindow
, MUIA_Window_Open
))
768 DoMethod(app
, MUIM_Application_Execute
);
769 set(MainWindow
, MUIA_Window_Open
, FALSE
);
781 } /* main(int argc, char *argv[]) */