2 Copyright (C) 2003-2014, 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.7 (12.3.2014)"
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
, 10, "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_SubBus
, (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-2014, 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
,
541 Child
, VGroup
, GroupFrameT(_(MSG_DRIVER_INFO
)),
543 Child
, Label(_(MSG_DRIVER_NAME
)),
545 Child
, StrDriverName
= TextObject
,
547 MUIA_Background
, MUII_TextBack
,
548 MUIA_Text_SetMax
, FALSE
,
549 MUIA_Text_Contents
, "",
551 Child
, Label(_(MSG_DIRECT_BUS
)),
552 Child
, StrDriverDirect
= TextObject
,
554 MUIA_Background
, MUII_TextBack
,
555 MUIA_Text_SetMax
, FALSE
,
556 MUIA_Text_Contents
, "",
559 Child
, Label(_(MSG_IO_BASE
)),
561 Child
, StrIOBase
= TextObject
,
563 MUIA_Background
, MUII_TextBack
,
564 MUIA_Text_SetMax
, FALSE
,
565 MUIA_Text_Contents
, "0x00000000",
569 Child
, Label(_(MSG_HARDWARE_INFO
)),
570 Child
, StrDriverHWName
= TextObject
,
572 MUIA_Background
, MUII_TextBack
,
573 MUIA_Text_SetMax
, FALSE
,
574 MUIA_Text_Contents
, "",
578 Child
, VGroup
, GroupFrameT(_(MSG_PCI_DEVICE_INFO
)),
580 Child
, Label(_(MSG_DEVICE_DESCRIPTION
)),
581 Child
, StrDescription
= TextObject
,
583 MUIA_Background
, MUII_TextBack
,
584 MUIA_Text_SetMax
, FALSE
,
585 MUIA_Text_Contents
, "",
587 Child
, Label(_(MSG_VENDORNAME
)),
588 Child
, VendorName
= TextObject
,
590 MUIA_Background
, MUII_TextBack
,
591 MUIA_Text_SetMax
, FALSE
,
592 MUIA_Text_Contents
, "",
594 Child
, Label(_(MSG_PRODUCTNAME
)),
595 Child
, ProductName
= TextObject
,
597 MUIA_Background
, MUII_TextBack
,
598 MUIA_Text_SetMax
, FALSE
,
599 MUIA_Text_Contents
, "",
601 Child
, Label(_(MSG_SUBSYSTEM
)),
602 Child
, SubsystemName
= TextObject
,
604 MUIA_Background
, MUII_TextBack
,
605 MUIA_Text_SetMax
, FALSE
,
606 MUIA_Text_Contents
, "",
608 Child
, Label(_(MSG_OWNER
)),
609 Child
, OwnerName
= TextObject
,
611 MUIA_Background
, MUII_TextBack
,
612 MUIA_Text_SetMax
, FALSE
,
613 MUIA_Text_Contents
, "",
617 Child
, Label(_(MSG_VENDORID
)),
618 Child
, VendorID
= TextObject
,
620 MUIA_Background
, MUII_TextBack
,
621 MUIA_Text_SetMax
, FALSE
,
622 MUIA_Text_Contents
, "0x0000",
624 Child
, Label(_(MSG_PRODUCTID
)),
625 Child
, ProductID
= TextObject
,
627 MUIA_Background
, MUII_TextBack
,
628 MUIA_Text_SetMax
, FALSE
,
629 MUIA_Text_Contents
, "0x0000",
631 Child
, Label(_(MSG_REVISIONID
)),
632 Child
, RevisionID
= TextObject
,
634 MUIA_Background
, MUII_TextBack
,
635 MUIA_Text_SetMax
, FALSE
,
636 MUIA_Text_Contents
, "0x0000",
638 Child
, Label(_(MSG_CLASS
)),
639 Child
, _Class
= TextObject
,
641 MUIA_Background
, MUII_TextBack
,
642 MUIA_Text_SetMax
, FALSE
,
643 MUIA_Text_Contents
, "0x00",
645 Child
, Label(_(MSG_SUBCLASS
)),
646 Child
, SubClass
= TextObject
,
648 MUIA_Background
, MUII_TextBack
,
649 MUIA_Text_SetMax
, FALSE
,
650 MUIA_Text_Contents
, "0x00",
652 Child
, Label(_(MSG_INTERFACE
)),
653 Child
, Interface
= TextObject
,
655 MUIA_Background
, MUII_TextBack
,
656 MUIA_Text_SetMax
, FALSE
,
657 MUIA_Text_Contents
, "0x00",
659 Child
, Label(_(MSG_ROM_BASE
)),
660 Child
, ROMBase
= TextObject
,
662 MUIA_Background
, MUII_TextBack
,
663 MUIA_Text_SetMax
, FALSE
,
664 MUIA_Text_Contents
, "0x00000000",
666 Child
, Label(_(MSG_ROM_SIZE
)),
667 Child
, ROMSize
= TextObject
,
669 MUIA_Background
, MUII_TextBack
,
670 MUIA_Text_SetMax
, FALSE
,
671 MUIA_Text_Contents
, "0x00000000",
673 Child
, Label(_(MSG_IRQ
)),
674 Child
, IRQLine
= TextObject
,
676 MUIA_Background
, MUII_TextBack
,
677 MUIA_Text_SetMax
, FALSE
,
678 MUIA_Text_Contents
, "15",
681 Child
, VGroup
, GroupFrameT(_(MSG_PCIE_DEVICE_INFO
)),
683 Child
, Label(_(MSG_PCIE_SERIAL_NUMBER
)),
684 Child
, PCIeSerialNumber
= TextObject
,
686 MUIA_Background
, MUII_TextBack
,
687 MUIA_Text_SetMax
, FALSE
,
688 MUIA_Text_Contents
, "00000000:00000000",
693 Child
, RangeList
= ListviewObject
,
694 MUIA_Listview_List
, ListObject
,
696 MUIA_List_AdjustWidth
, FALSE
,
700 Child
, Status
= TextObject
,
702 MUIA_Background
, MUII_TextBack
,
703 MUIA_Text_SetMax
, FALSE
,
706 /*Save the displayed info into a text file in RAM:*/
707 Child
, SaveInfo
= SimpleButton(_(MSG_SAVETORAMDISK
) ),
708 Child
, SaveAllInfo
= SimpleButton(_(MSG_SAVEALLTORAMDISK
) ),
710 End
, // WindowContents
712 End
; // ApplicationObject
716 /* Quit application if the windowclosegadget or the esc key is pressed. */
717 DoMethod(MainWindow
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
719 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
721 DoMethod(DriverList
, MUIM_Notify
, MUIA_List_Active
, MUIV_EveryTime
,
723 MUIM_CallHook
, (IPTR
)&select_hook
);
725 DoMethod(SaveInfo
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
727 MUIM_CallHook
, (IPTR
)&save_hook
);
729 DoMethod(SaveAllInfo
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
731 MUIM_CallHook
, (IPTR
)&saveall_hook
);
741 pci_hook
.h_Entry
= (APTR
)pci_callback
;
742 display_hook
.h_Entry
= (APTR
)display_function
;
743 select_hook
.h_Entry
= (APTR
)select_function
;
744 save_hook
.h_Entry
= (APTR
)save_function
;
745 saveall_hook
.h_Entry
= (APTR
)saveall_function
;
747 if (!Locale_Initialize())
748 cleanup(_(MSG_ERROR_LOCALE
));
754 pci
= OOP_NewObject(NULL
, CLID_Hidd_PCI
, NULL
);
757 HIDD_PCI_EnumDevices(pci
, &pci_hook
, NULL
);
760 set(DriverList
, MUIA_List_Active
, MUIV_List_Active_Top
);
761 set(MainWindow
, MUIA_Window_ActiveObject
, DriverList
);
762 set(MainWindow
, MUIA_Window_Open
, TRUE
);
764 if(xget(MainWindow
, MUIA_Window_Open
))
766 DoMethod(app
, MUIM_Application_Execute
);
767 set(MainWindow
, MUIA_Window_Open
, FALSE
);
779 } /* main(int argc, char *argv[]) */