00001 #ifndef _HD_H
00002 #define _HD_H
00003
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #define HD_VERSION 12
00017
00018
00019
00020
00021 #define HD_DEB_SHOW_LOG (1 << 0)
00022 #define HD_DEB_PROGRESS (1 << 1)
00023 #define HD_DEB_CREATION (1 << 2)
00024 #define HD_DEB_DRIVER_INFO (1 << 3)
00025 #define HD_DEB_PCI (1 << 4)
00026 #define HD_DEB_ISAPNP (1 << 5)
00027 #define HD_DEB_CDROM (1 << 6)
00028 #define HD_DEB_NET (1 << 7)
00029 #define HD_DEB_FLOPPY (1 << 8)
00030 #define HD_DEB_MISC (1 << 9)
00031 #define HD_DEB_SERIAL (1 << 10)
00032 #define HD_DEB_MONITOR (1 << 11)
00033 #define HD_DEB_CPU (1 << 12)
00034 #define HD_DEB_BIOS (1 << 13)
00035 #define HD_DEB_MOUSE (1 << 14)
00036 #define HD_DEB_IDE (1 << 15)
00037 #define HD_DEB_SCSI (1 << 16)
00038 #define HD_DEB_USB (1 << 17)
00039 #define HD_DEB_ADB (1 << 18)
00040 #define HD_DEB_MODEM (1 << 19)
00041 #define HD_DEB_PARALLEL (1 << 20)
00042 #define HD_DEB_ISA (1 << 21)
00043 #define HD_DEB_BOOT (1 << 22)
00044 #define HD_DEB_HDDB (1 << 23)
00045
00046 #include <stdio.h>
00047 #include <inttypes.h>
00048 #include <termios.h>
00049 #include <sys/types.h>
00050
00051
00052
00053
00054 #define HARDWARE_DIR "/var/lib/hardware"
00055
00070 #define TAG_PCI 1
00071 #define TAG_EISA 2
00072 #define TAG_USB 3
00073 #define TAG_SPECIAL 4
00074 #define TAG_PCMCIA 5
00079 #define ID_VALUE(id) ((id) & 0xffff)
00080
00084 #define ID_TAG(id) (((id) >> 16) & 0xf)
00085
00089 #define MAKE_ID(tag, id_val) ((tag << 16) | (id_val))
00090
00093
00094
00095
00096 typedef enum probe_feature {
00097 pr_memory = 1, pr_pci, pr_isapnp, pr_net, pr_floppy, pr_misc,
00098 pr_misc_serial, pr_misc_par, pr_misc_floppy, pr_serial, pr_cpu, pr_bios,
00099 pr_monitor, pr_mouse, pr_scsi, pr_usb, pr_usb_mods, pr_adb, pr_modem,
00100 pr_modem_usb, pr_parallel, pr_parallel_lp, pr_parallel_zip, pr_isa,
00101 pr_isa_isdn, pr_isdn, pr_kbd, pr_prom, pr_sbus, pr_int, pr_braille,
00102 pr_braille_alva, pr_braille_fhp, pr_braille_ht, pr_ignx11, pr_sys,
00103 pr_bios_vbe, pr_isapnp_old, pr_isapnp_new, pr_isapnp_mod, pr_braille_baum,
00104 pr_manual, pr_fb, pr_veth, pr_pppoe, pr_scan, pr_pcmcia, pr_fork,
00105 pr_parallel_imm, pr_s390, pr_cpuemu, pr_sysfs, pr_s390disks, pr_udev,
00106 pr_block, pr_block_cdrom, pr_block_part, pr_edd, pr_edd_mod, pr_bios_ddc,
00107 pr_bios_fb, pr_bios_mode, pr_input, pr_block_mods, pr_bios_vesa,
00108 pr_cpuemu_debug, pr_scsi_noserial, pr_wlan, pr_bios_crc, pr_hal,
00109 pr_bios_vram, pr_modules_pata,
00110 pr_max, pr_lxrc, pr_default, pr_all
00111 } hd_probe_feature_t;
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121 typedef enum hw_item {
00122 hw_none = 0, hw_sys, hw_cpu, hw_keyboard, hw_braille, hw_mouse,
00123 hw_joystick, hw_printer, hw_scanner, hw_chipcard, hw_monitor, hw_tv,
00124 hw_display, hw_framebuffer, hw_camera, hw_sound, hw_storage_ctrl,
00125 hw_network_ctrl, hw_isdn, hw_modem, hw_network, hw_disk, hw_partition,
00126 hw_cdrom, hw_floppy, hw_manual, hw_usb_ctrl, hw_usb, hw_bios, hw_pci,
00127 hw_isapnp, hw_bridge, hw_hub, hw_scsi, hw_ide, hw_memory, hw_dvb,
00128 hw_pcmcia, hw_pcmcia_ctrl, hw_ieee1394, hw_ieee1394_ctrl, hw_hotplug,
00129 hw_hotplug_ctrl, hw_zip, hw_pppoe, hw_wlan, hw_redasd, hw_dsl, hw_block,
00130 hw_tape, hw_vbe, hw_bluetooth, hw_fingerprint,
00131
00132 hw_unknown, hw_all
00133 } hd_hw_item_t;
00134
00135
00136
00137
00138
00139
00140
00141 typedef enum base_classes {
00142
00143 bc_none, bc_storage, bc_network, bc_display, bc_multimedia,
00144 bc_memory, bc_bridge, bc_comm, bc_system, bc_input, bc_docking,
00145 bc_processor, bc_serial, bc_wireless, bc_i2o, bc_other = 0xff,
00146
00147
00148 bc_monitor = 0x100, bc_internal, bc_modem, bc_isdn, bc_ps2, bc_mouse,
00149 bc_storage_device, bc_network_interface, bc_keyboard, bc_printer,
00150 bc_hub, bc_braille, bc_scanner, bc_joystick, bc_chipcard, bc_camera,
00151 bc_framebuffer, bc_dvb, bc_tv, bc_partition, bc_dsl, bc_bluetooth, bc_fingerprint
00152 } hd_base_classes_t;
00153
00154
00155 typedef enum sc_monitor {
00156 sc_mon_other, sc_mon_crt, sc_mon_lcd
00157 } hd_sc_monitor_t;
00158
00159
00160 typedef enum sc_storage {
00161 sc_sto_scsi, sc_sto_ide, sc_sto_floppy, sc_sto_ipi, sc_sto_raid,
00162 sc_sto_other = 0x80
00163 } hd_sc_storage_t;
00164
00165
00166 typedef enum sc_display {
00167 sc_dis_vga, sc_dis_xga, sc_dis_other = 0x80
00168 } hd_sc_display_t;
00169
00170
00171 typedef enum sc_framebuffer {
00172 sc_fb_vesa = 1
00173 } hd_sc_framebuffer_t;
00174
00175
00176 typedef enum sc_bridge {
00177 sc_bridge_host, sc_bridge_isa, sc_bridge_eisa, sc_bridge_mc,
00178 sc_bridge_pci, sc_bridge_pcmcia, sc_bridge_nubus, sc_bridge_cardbus,
00179 sc_bridge_other = 0x80
00180 } hd_sc_bridge_t;
00181
00182
00183 typedef enum sc_comm {
00184 sc_com_ser, sc_com_par, sc_com_multi, sc_com_modem, sc_com_other = 0x80
00185 } hd_sc_comm_t;
00186
00187
00188 typedef enum sc_system {
00189 sc_sys_pic, sc_sys_dma, sc_sys_timer, sc_sys_rtc, sc_sys_other = 0x80
00190 } hd_sc_system_t;
00191
00192
00193 typedef enum sc_input {
00194 sc_inp_keyb, sc_inp_digit, sc_inp_mouse, sc_inp_other = 0x80
00195 } hd_sc_input_t;
00196
00197
00198 typedef enum sc_serial {
00199 sc_ser_fire, sc_ser_access, sc_ser_ssa, sc_ser_usb, sc_ser_fiber,
00200 sc_ser_smbus, sc_ser_infiniband, sc_ser_other = 0x80
00201 } hd_sc_serial_t;
00202
00203
00204 typedef enum sc_internal {
00205 sc_int_none, sc_int_isapnp_if, sc_int_main_mem, sc_int_cpu, sc_int_fpu,
00206 sc_int_bios, sc_int_prom, sc_int_sys
00207 } hd_sc_internal_t;
00208
00209
00210 typedef enum sc_mouse {
00211 sc_mou_ps2, sc_mou_ser, sc_mou_bus, sc_mou_usb, sc_mou_sun,
00212 sc_mou_other = 0x80
00213 } hd_sc_mouse_t;
00214
00215
00216 typedef enum sc_std {
00217 sc_sdev_disk, sc_sdev_tape, sc_sdev_cdrom, sc_sdev_floppy, sc_sdev_scanner,
00218 sc_sdev_other = 0x80
00219 } hd_sc_std_t;
00220
00221
00222 typedef enum sc_net_if {
00223 sc_nif_loopback, sc_nif_ethernet, sc_nif_tokenring, sc_nif_fddi,
00224 sc_nif_ctc, sc_nif_iucv, sc_nif_hsi, sc_nif_qeth,
00225 sc_nif_escon, sc_nif_myrinet, sc_nif_wlan, sc_nif_xp,
00226 sc_nif_usb, sc_nif_other = 0x80, sc_nif_sit
00227 } hd_sc_net_if_t;
00228
00229
00230 typedef enum sc_multimedia {
00231 sc_multi_video, sc_multi_audio, sc_multi_other
00232 } hd_sc_multimedia_t;
00233
00234
00235 typedef enum sc_keyboard {
00236 sc_keyboard_kbd, sc_keyboard_console
00237 } hd_sc_keyboard_t;
00238
00239
00240 typedef enum sc_hub {
00241 sc_hub_other, sc_hub_usb
00242 } hd_sc_hub_t;
00243
00244
00245 typedef enum sc_camera {
00246 sc_camera_webcam, sc_camera_digital
00247 } hd_sc_camera_t;
00248
00249
00250 typedef enum sc_modem {
00251 sc_mod_at, sc_mod_win1, sc_mod_win2, sc_mod_win3, sc_mod_win4
00252 } hd_sc_modem_t;
00253
00254
00255 typedef enum sc_dsl {
00256 sc_dsl_unknown, sc_dsl_pppoe, sc_dsl_capi, sc_dsl_capiisdn
00257 } hd_sc_dsl_t;
00258
00259
00260 typedef enum pif_usb_e {
00261 pif_usb_uhci = 0, pif_usb_ohci = 0x10, pif_usb_ehci = 0x20,
00262 pif_usb_other = 0x80, pif_usb_device = 0xfe
00263 } hd_pif_usb_t;
00264
00265
00266 typedef enum pif_cdrom {
00267 pif_cdrom, pif_cdr, pif_cdrw, pif_dvd, pif_dvdr, pif_dvdram
00268 } hd_pif_cdrom_t ;
00269
00270
00271 typedef enum pif_s390disk {
00272 pif_scsi, pif_dasd, pif_dasd_fba
00273 } hd_pif_s390disk_t;
00274
00275
00276 typedef enum bus_types {
00277 bus_none, bus_isa, bus_eisa, bus_mc, bus_pci, bus_pcmcia, bus_nubus,
00278 bus_cardbus, bus_other,
00279
00280
00281 bus_ps2 = 0x80, bus_serial, bus_parallel, bus_floppy, bus_scsi, bus_ide, bus_usb,
00282 bus_adb, bus_raid, bus_sbus, bus_i2o, bus_vio, bus_ccw, bus_iucv, bus_ps3_system_bus,
00283 bus_virtio, bus_ibmebus
00284 } hd_bus_types_t;
00285
00292 typedef struct {
00296 unsigned invalid:1;
00306 unsigned reconfig:3;
00307
00313 unsigned configured:3;
00314
00325 unsigned available:3;
00326
00334 unsigned needed:3;
00335
00342 unsigned available_orig:3;
00343
00347 unsigned active:3;
00348 } hd_status_t;
00349
00350
00351 typedef enum {
00352 status_no = 1, status_yes, status_unknown, status_new
00353 } hd_status_value_t;
00354
00358 typedef enum {
00359 hp_none,
00360 hp_pcmcia,
00361 hp_cardbus,
00362 hp_pci,
00363 hp_usb,
00364 hp_ieee1394
00365 } hd_hotplug_t;
00366
00367
00372 typedef struct {
00373 unsigned id;
00374 char *name;
00375 } hd_id_t;
00376
00381 typedef struct s_str_list_t {
00382 struct s_str_list_t *next;
00383 char *str;
00384 } str_list_t;
00385
00386
00387 typedef struct {
00388 unsigned char bitmap[16];
00389 unsigned bits;
00390 unsigned not_empty:1;
00391 str_list_t *str;
00392 } hd_bitmap_t;
00393
00394
00395
00396
00397
00398 typedef struct {
00399 unsigned start, size;
00400 unsigned char *data;
00401 } memory_range_t;
00402
00403
00404
00405
00406
00407 typedef struct {
00408 unsigned ok:1;
00409 unsigned rev;
00410 unsigned mpfp;
00411 unsigned mpconfig_ok:1;
00412 unsigned mpconfig;
00413 unsigned mpconfig_size;
00414 unsigned char feature[5];
00415 char oem_id[9];
00416 char prod_id[13];
00417 unsigned cpus, cpus_en;
00418 } smp_info_t;
00419
00420
00421
00422
00423
00424 typedef struct vbe_mode_info_s {
00425 unsigned number;
00426 unsigned attributes;
00427 unsigned width, height;
00428 unsigned bytes_p_line;
00429 unsigned pixel_size;
00430 unsigned fb_start;
00431 unsigned win_A_start;
00432 unsigned win_A_attr;
00433 unsigned win_B_start;
00434 unsigned win_B_attr;
00435 unsigned win_size;
00436 unsigned win_gran;
00437 unsigned pixel_clock;
00438 } vbe_mode_info_t;
00439
00440
00441 typedef struct {
00442 unsigned ok:1;
00443 unsigned version;
00444 unsigned oem_version;
00445 unsigned memory;
00446 unsigned fb_start;
00447 char *oem_name;
00448 char *vendor_name;
00449 char *product_name;
00450 char *product_revision;
00451 unsigned modes;
00452 vbe_mode_info_t *mode;
00453 unsigned current_mode;
00454 unsigned char ddc_port[2][0x80];
00455 } vbe_info_t;
00456
00457
00458
00459
00460
00461 typedef struct {
00462 unsigned id;
00463 unsigned char slot;
00464 unsigned char bus;
00465 unsigned char devfn;
00466 unsigned char misc;
00467 } cpq_ctlorder_t;
00468
00469
00470 typedef struct {
00471 unsigned ok:1;
00472 unsigned entry;
00473 unsigned compaq:1;
00474 cpq_ctlorder_t cpq_ctrl[32];
00475 } bios32_info_t;
00476
00477
00478
00479
00480
00481 typedef enum {
00482 sm_biosinfo, sm_sysinfo, sm_boardinfo, sm_chassis,
00483 sm_processor, sm_memctrl, sm_memmodule, sm_cache,
00484 sm_connect, sm_slot, sm_onboard, sm_oem,
00485 sm_config, sm_lang, sm_group, sm_eventlog,
00486 sm_memarray, sm_memdevice, sm_memerror, sm_memarraymap,
00487 sm_memdevicemap, sm_mouse, sm_battery, sm_reset,
00488 sm_secure, sm_power, sm_voltage, sm_cool,
00489 sm_temperature, sm_current, sm_outofband, sm_bis,
00490 sm_boot, sm_mem64error, sm_mandev, sm_mandevcomp,
00491 sm_mdtd, sm_inactive = 126, sm_end = 127
00492 } hd_smbios_type_t;
00493
00494
00495
00496 typedef struct {
00497 union u_hd_smbios_t *next;
00498 hd_smbios_type_t type;
00499 int data_len;
00500 unsigned char *data;
00501 str_list_t *strings;
00502 int handle;
00503 } smbios_any_t;
00504
00505
00506
00507 typedef struct {
00508 union u_hd_smbios_t *next;
00509 hd_smbios_type_t type;
00510 int data_len;
00511 unsigned char *data;
00512 str_list_t *strings;
00513 int handle;
00514 char *vendor;
00515 char *version;
00516 char *date;
00517 hd_bitmap_t feature;
00518 unsigned start;
00519 unsigned rom_size;
00520 } smbios_biosinfo_t;
00521
00522
00523
00524 typedef struct {
00525 union u_hd_smbios_t *next;
00526 hd_smbios_type_t type;
00527 int data_len;
00528 unsigned char *data;
00529 str_list_t *strings;
00530 int handle;
00531 char *manuf;
00532 char *product;
00533 char *version;
00534 char *serial;
00535 unsigned char uuid[16];
00536 hd_id_t wake_up;
00537 } smbios_sysinfo_t;
00538
00539
00540
00541 typedef struct {
00542 union u_hd_smbios_t *next;
00543 hd_smbios_type_t type;
00544 int data_len;
00545 unsigned char *data;
00546 str_list_t *strings;
00547 int handle;
00548 char *manuf;
00549 char *product;
00550 char *version;
00551 char *serial;
00552 char *asset;
00553 hd_id_t board_type;
00554 hd_bitmap_t feature;
00555 char *location;
00556 int chassis;
00557 int objects_len;
00558 int *objects;
00559 } smbios_boardinfo_t;
00560
00561
00562
00563 typedef struct {
00564 union u_hd_smbios_t *next;
00565 hd_smbios_type_t type;
00566 int data_len;
00567 unsigned char *data;
00568 str_list_t *strings;
00569 int handle;
00570 char *manuf;
00571 char *version;
00572 char *serial;
00573 char *asset;
00574 hd_id_t ch_type;
00575 unsigned lock;
00576 hd_id_t bootup;
00577 hd_id_t power;
00578 hd_id_t thermal;
00579 hd_id_t security;
00580 unsigned oem;
00581 } smbios_chassis_t;
00582
00583
00584
00585 typedef struct {
00586 union u_hd_smbios_t *next;
00587 hd_smbios_type_t type;
00588 int data_len;
00589 unsigned char *data;
00590 str_list_t *strings;
00591 int handle;
00592 char *socket;
00593 hd_id_t upgrade;
00594 char *manuf;
00595 char *version;
00596 char *serial;
00597 char *asset;
00598 char *part;
00599 hd_id_t pr_type;
00600 hd_id_t family;
00601 uint64_t cpu_id;
00602 unsigned voltage;
00603 unsigned ext_clock;
00604 unsigned max_speed;
00605 unsigned current_speed;
00606 unsigned sock_status;
00607 hd_id_t cpu_status;
00608 int l1_cache;
00609 int l2_cache;
00610 int l3_cache;
00611 } smbios_processor_t;
00612
00613
00614
00615 typedef struct {
00616 union u_hd_smbios_t *next;
00617 hd_smbios_type_t type;
00618 int data_len;
00619 unsigned char *data;
00620 str_list_t *strings;
00621 int handle;
00622 char *socket;
00623 unsigned max_size;
00624 unsigned current_size;
00625 unsigned speed;
00626 hd_id_t mode;
00627 unsigned state;
00628 hd_id_t location;
00629 unsigned socketed;
00630 unsigned level;
00631 hd_id_t ecc;
00632 hd_id_t cache_type;
00633 hd_id_t assoc;
00634 hd_bitmap_t supp_sram;
00635 hd_bitmap_t sram;
00636 } smbios_cache_t;
00637
00638
00639
00640 typedef struct {
00641 union u_hd_smbios_t *next;
00642 hd_smbios_type_t type;
00643 int data_len;
00644 unsigned char *data;
00645 str_list_t *strings;
00646 int handle;
00647 hd_id_t port_type;
00648 char *i_des;
00649 hd_id_t i_type;
00650 char *x_des;
00651 hd_id_t x_type;
00652 } smbios_connect_t;
00653
00654
00655
00656 typedef struct {
00657 union u_hd_smbios_t *next;
00658 hd_smbios_type_t type;
00659 int data_len;
00660 unsigned char *data;
00661 str_list_t *strings;
00662 int handle;
00663 char *desig;
00664 hd_id_t slot_type;
00665 hd_id_t bus_width;
00666 hd_id_t usage;
00667 hd_id_t length;
00668 unsigned id;
00669 hd_bitmap_t feature;
00670 } smbios_slot_t;
00671
00672
00673
00674 typedef struct {
00675 union u_hd_smbios_t *next;
00676 hd_smbios_type_t type;
00677 int data_len;
00678 unsigned char *data;
00679 str_list_t *strings;
00680 int handle;
00681 unsigned dev_len;
00682 struct {
00683 char *name;
00684 hd_id_t type;
00685 unsigned status;
00686 } *dev;
00687 } smbios_onboard_t;
00688
00689
00690
00691 typedef struct {
00692 union u_hd_smbios_t *next;
00693 hd_smbios_type_t type;
00694 int data_len;
00695 unsigned char *data;
00696 str_list_t *strings;
00697 int handle;
00698 str_list_t *oem_strings;
00699 } smbios_oem_t;
00700
00701
00702
00703 typedef struct {
00704 union u_hd_smbios_t *next;
00705 hd_smbios_type_t type;
00706 int data_len;
00707 unsigned char *data;
00708 str_list_t *strings;
00709 int handle;
00710 str_list_t *options;
00711 } smbios_config_t;
00712
00713
00714
00715 typedef struct {
00716 union u_hd_smbios_t *next;
00717 hd_smbios_type_t type;
00718 int data_len;
00719 unsigned char *data;
00720 str_list_t *strings;
00721 int handle;
00722 char *current;
00723 } smbios_lang_t;
00724
00725
00726
00727 typedef struct {
00728 union u_hd_smbios_t *next;
00729 hd_smbios_type_t type;
00730 int data_len;
00731 unsigned char *data;
00732 str_list_t *strings;
00733 int handle;
00734 char *name;
00735 int items_len;
00736 int *item_handles;
00737 } smbios_group_t;
00738
00739
00740
00741 typedef struct {
00742 union u_hd_smbios_t *next;
00743 hd_smbios_type_t type;
00744 int data_len;
00745 unsigned char *data;
00746 str_list_t *strings;
00747 int handle;
00748 hd_id_t location;
00749 hd_id_t use;
00750 hd_id_t ecc;
00751 unsigned max_size;
00752 int error_handle;
00753 unsigned slots;
00754 } smbios_memarray_t;
00755
00756
00757
00758 typedef struct {
00759 union u_hd_smbios_t *next;
00760 hd_smbios_type_t type;
00761 int data_len;
00762 unsigned char *data;
00763 str_list_t *strings;
00764 int handle;
00765 char *location;
00766 char *bank;
00767 char *manuf;
00768 char *serial;
00769 char *asset;
00770 char *part;
00771 int array_handle;
00772 int error_handle;
00773 unsigned width;
00774 unsigned eccbits;
00775 unsigned size;
00776 hd_id_t form;
00777 unsigned set;
00778 hd_id_t mem_type;
00779 hd_bitmap_t type_detail;
00780 unsigned speed;
00781 } smbios_memdevice_t;
00782
00783
00784
00785 typedef struct {
00786 union u_hd_smbios_t *next;
00787 hd_smbios_type_t type;
00788 int data_len;
00789 unsigned char *data;
00790 str_list_t *strings;
00791 int handle;
00792 hd_id_t err_type;
00793 hd_id_t granularity;
00794 hd_id_t operation;
00795 unsigned syndrome;
00796 unsigned array_addr;
00797 unsigned device_addr;
00798 unsigned range;
00799 } smbios_memerror_t;
00800
00801
00802
00803 typedef struct {
00804 union u_hd_smbios_t *next;
00805 hd_smbios_type_t type;
00806 int data_len;
00807 unsigned char *data;
00808 str_list_t *strings;
00809 int handle;
00810 int array_handle;
00811 uint64_t start_addr;
00812 uint64_t end_addr;
00813 unsigned part_width;
00814 } smbios_memarraymap_t;
00815
00816
00817
00818 typedef struct {
00819 union u_hd_smbios_t *next;
00820 hd_smbios_type_t type;
00821 int data_len;
00822 unsigned char *data;
00823 str_list_t *strings;
00824 int handle;
00825 int memdevice_handle;
00826 int arraymap_handle;
00827 uint64_t start_addr;
00828 uint64_t end_addr;
00829 unsigned row_pos;
00830 unsigned interleave_pos;
00831 unsigned interleave_depth;
00832 } smbios_memdevicemap_t;
00833
00834
00835
00836 typedef struct {
00837 union u_hd_smbios_t *next;
00838 hd_smbios_type_t type;
00839 int data_len;
00840 unsigned char *data;
00841 str_list_t *strings;
00842 int handle;
00843 hd_id_t mtype;
00844 hd_id_t interface;
00845 unsigned buttons;
00846 } smbios_mouse_t;
00847
00848
00849
00850 typedef struct {
00851 union u_hd_smbios_t *next;
00852 hd_smbios_type_t type;
00853 int data_len;
00854 unsigned char *data;
00855 str_list_t *strings;
00856 int handle;
00857 hd_id_t power;
00858 hd_id_t keyboard;
00859 hd_id_t admin;
00860 hd_id_t reset;
00861 } smbios_secure_t;
00862
00863
00864
00865 typedef struct {
00866 union u_hd_smbios_t *next;
00867 hd_smbios_type_t type;
00868 int data_len;
00869 unsigned char *data;
00870 str_list_t *strings;
00871 int handle;
00872 unsigned month;
00873 unsigned day;
00874 unsigned hour;
00875 unsigned minute;
00876 unsigned second;
00877 } smbios_power_t;
00878
00879
00880
00881 typedef struct {
00882 union u_hd_smbios_t *next;
00883 hd_smbios_type_t type;
00884 int data_len;
00885 unsigned char *data;
00886 str_list_t *strings;
00887 int handle;
00888 hd_id_t err_type;
00889 hd_id_t granularity;
00890 hd_id_t operation;
00891 unsigned syndrome;
00892 uint64_t array_addr;
00893 uint64_t device_addr;
00894 unsigned range;
00895 } smbios_mem64error_t;
00896
00897
00898 typedef union u_hd_smbios_t {
00899 union u_hd_smbios_t *next;
00900 smbios_any_t any;
00901 smbios_biosinfo_t biosinfo;
00902 smbios_sysinfo_t sysinfo;
00903 smbios_boardinfo_t boardinfo;
00904 smbios_chassis_t chassis;
00905 smbios_processor_t processor;
00906 smbios_cache_t cache;
00907 smbios_connect_t connect;
00908 smbios_slot_t slot;
00909 smbios_onboard_t onboard;
00910 smbios_oem_t oem;
00911 smbios_config_t config;
00912 smbios_lang_t lang;
00913 smbios_group_t group;
00914 smbios_memarray_t memarray;
00915 smbios_memdevice_t memdevice;
00916 smbios_memerror_t memerror;
00917 smbios_memarraymap_t memarraymap;
00918 smbios_memdevicemap_t memdevicemap;
00919 smbios_mouse_t mouse;
00920 smbios_secure_t secure;
00921 smbios_power_t power;
00922 smbios_mem64error_t mem64error;
00923 } hd_smbios_t;
00924
00925
00926
00927
00928
00929 typedef struct s_udevinfo_t {
00930 struct s_udevinfo_t *next;
00931 char *sysfs;
00932 char *name;
00933 str_list_t *links;
00934 } hd_udevinfo_t;
00935
00936
00937
00938
00939
00940 typedef struct s_sysfsdrv_t {
00941 struct s_sysfsdrv_t *next;
00942 char *driver;
00943 char *device;
00944 } hd_sysfsdrv_t;
00945
00946
00947
00948
00949
00950
00951
00952 typedef struct {
00953 int type;
00954 unsigned major, minor, range;
00955 } hd_dev_num_t;
00956
00957
00958
00959
00960
00961 typedef struct s_pci_t {
00962 struct s_pci_t *next;
00963 unsigned data_len;
00964 unsigned data_ext_len;
00965 unsigned char data[256];
00966 char *log;
00967 unsigned flags,
00968 cmd,
00969 hdr_type,
00970 secondary_bus;
00971 unsigned bus,
00972 slot, func;
00973 unsigned base_class, sub_class, prog_if;
00974 unsigned dev, vend, sub_dev, sub_vend, rev;
00975 unsigned irq;
00976 uint64_t base_addr[7];
00977 uint64_t base_len[7];
00978 unsigned addr_flags[7];
00979 uint64_t rom_base_addr;
00980 uint64_t rom_base_len;
00981 char *sysfs_id;
00982 char *sysfs_bus_id;
00983 char *modalias;
00984 unsigned edid_len;
00985 unsigned char edid[0x80];
00986 } pci_t;
00987
00988
00989
00990
00991 typedef enum pci_flags {
00992 pci_flag_ok, pci_flag_pm, pci_flag_agp
00993 } hd_pci_flags_t;
00994
00995
00996
00997
00998
00999 typedef struct usb_s {
01000 struct usb_s *next;
01001 unsigned hd_idx;
01002 unsigned hd_base_idx;
01003
01004 str_list_t *c, *d, *e, *i, *p, *s, *t;
01005 struct usb_s *cloned;
01006 int bus, dev_nr, lev, parent, port, count, conns, used_conns, ifdescr;
01007 unsigned speed;
01008 unsigned vendor, device, rev;
01009 char *manufact, *product, *serial;
01010 char *driver;
01011 memory_range_t raw_descr;
01012 int d_cls, d_sub, d_prot;
01013 int i_alt, i_cls, i_sub, i_prot;
01014 unsigned country;
01015 } usb_t;
01016
01017
01018
01019
01020 typedef struct {
01021 int len;
01022 int type;
01023 unsigned char *data;
01024 } isapnp_res_t;
01025
01026 typedef struct {
01027 int csn;
01028 int log_devs;
01029 unsigned char *serial;
01030 unsigned char *card_regs;
01031 unsigned char (*ldev_regs)[0xd0];
01032 int res_len;
01033 unsigned broken:1;
01034 isapnp_res_t *res;
01035 } isapnp_card_t;
01036
01037 typedef struct {
01038 int read_port;
01039 int cards;
01040 isapnp_card_t *card;
01041 } isapnp_t;
01042
01043 typedef struct {
01044 isapnp_card_t *card;
01045 int dev;
01046 unsigned flags;
01047 unsigned ref:1;
01048 } isapnp_dev_t;
01049
01050
01051
01052
01053 typedef enum isapnp_flags {
01054 isapnp_flag_act
01055 } hd_isapnp_flags_t;
01056
01057
01058
01059
01060
01061 typedef struct scsi_s {
01062 struct scsi_s *next;
01063 unsigned deleted:1;
01064 unsigned generic:1;
01065 unsigned fake:1;
01066 char *dev_name;
01067 char *guessed_dev_name;
01068 int generic_dev;
01069 unsigned host, channel, id, lun;
01070 char *vendor, *model, *rev, *type_str, *serial;
01071 int type;
01072 unsigned inode_low;
01073 char *proc_dir, *driver;
01074 unsigned unique;
01075 char *info;
01076 unsigned lgeo_c, lgeo_h, lgeo_s;
01077 unsigned pgeo_c, pgeo_h, pgeo_s;
01078 uint64_t size;
01079 unsigned sec_size;
01080 unsigned cache;
01081 str_list_t *host_info;
01082 char *usb_guid;
01083 unsigned pci_info;
01084 unsigned pci_bus;
01085 unsigned pci_slot;
01086 unsigned pci_func;
01087 uint64_t wwpn;
01088 uint64_t fcp_lun;
01089 char *controller_id;
01090 } scsi_t;
01091
01092
01093
01094
01095
01096 typedef struct devtree_s {
01097 struct devtree_s *next;
01098 struct devtree_s *parent;
01099 unsigned idx;
01100 char *path, *filename;
01101 unsigned pci:1;
01102 char *name, *model, *device_type, *compatible;
01103 int class_code;
01104 int vendor_id, device_id, subvendor_id, subdevice_id;
01105 int revision_id, interrupt;
01106 unsigned char *edid;
01107 } devtree_t;
01108
01109
01110
01111
01112 typedef struct ccw_s {
01113 unsigned char lcss;
01114 unsigned char cu_model;
01115 unsigned char dev_model;
01116 } ccw_t;
01117
01118
01119
01120
01121 typedef struct cdrom_info_s {
01122 struct cdrom_info_s *next;
01123 char *name;
01124 unsigned speed;
01125 unsigned cdr:1, cdrw:1, dvd:1, dvdr:1, dvdram:1;
01126 unsigned cdrom:1;
01127 struct {
01128 unsigned ok:1;
01129 char *volume, *publisher, *preparer, *application, *creation_date;
01130 } iso9660;
01131 struct {
01132 unsigned ok:1;
01133 unsigned platform;
01134 char *id_string;
01135 unsigned bootable:1;
01136 unsigned media_type;
01137 unsigned load_address;
01138 unsigned load_count;
01139 unsigned start;
01140 unsigned catalog;
01141 struct {
01142 unsigned c, h, s;
01143 unsigned size;
01144 } geo;
01145 char *label;
01146 } el_torito;
01147
01148 } cdrom_info_t;
01149
01150
01151 typedef struct {
01152 unsigned char block0[512];
01153 } floppy_info_t;
01154
01155
01156
01157
01158 typedef struct {
01159 unsigned apm_supported:1;
01160 unsigned apm_enabled:1;
01161 unsigned apm_ver, apm_subver;
01162 unsigned apm_bios_flags;
01163
01164 unsigned vbe_ver;
01165 unsigned vbe_video_mem;
01166
01167 unsigned ser_port0, ser_port1, ser_port2, ser_port3;
01168 unsigned par_port0, par_port1, par_port2;
01169
01170
01171 unsigned is_pnp_bios:1;
01172 unsigned pnp_id;
01173 unsigned lba_support:1;
01174
01175 unsigned low_mem_size;
01176 smp_info_t smp;
01177 vbe_info_t vbe;
01178
01179 unsigned smbios_ver;
01180
01181 struct {
01182 unsigned width;
01183 unsigned height;
01184 unsigned xsize;
01185 unsigned ysize;
01186 char *vendor;
01187 char *name;
01188 } lcd;
01189
01190 struct {
01191 char *vendor;
01192 char *type;
01193 unsigned bus;
01194 unsigned compat_vend;
01195 unsigned compat_dev;
01196 } mouse;
01197
01198 struct {
01199 unsigned ok:1;
01200 unsigned scroll_lock:1;
01201 unsigned num_lock:1;
01202 unsigned caps_lock:1;
01203 } led;
01204
01205 bios32_info_t bios32;
01206
01207 } bios_info_t;
01208
01209
01210
01211
01212
01213 typedef struct {
01214 unsigned has_color:1;
01215 unsigned color;
01216 } prom_info_t;
01217
01218
01219
01220
01221
01222 typedef struct {
01223 char *system_type;
01224 char *generation;
01225 char *vendor;
01226 char *model;
01227 char *serial;
01228 char *lang;
01229 char *formfactor;
01230 } sys_info_t;
01231
01232
01233
01234
01235
01236 typedef struct {
01237 unsigned manu_year;
01238 unsigned min_vsync, max_vsync;
01239 unsigned min_hsync, max_hsync;
01240 unsigned clock;
01241 unsigned width, height;
01242 unsigned width_mm, height_mm;
01243 char *vendor;
01244 char *name;
01245 char *serial;
01246 } monitor_info_t;
01247
01248
01249 typedef enum cpu_arch {
01250 arch_unknown = 0,
01251 arch_intel,
01252 arch_alpha,
01253 arch_sparc, arch_sparc64,
01254 arch_ppc, arch_ppc64,
01255 arch_68k,
01256 arch_ia64,
01257 arch_s390, arch_s390x,
01258 arch_arm,
01259 arch_mips,
01260 arch_x86_64
01261 } hd_cpu_arch_t;
01262
01263
01264 typedef enum boot_arch {
01265 boot_unknown = 0,
01266 boot_lilo, boot_milo, boot_aboot, boot_silo, boot_ppc, boot_elilo, boot_s390,
01267 boot_mips, boot_grub
01268 } hd_boot_arch_t;
01269
01270
01271 typedef struct {
01272 enum cpu_arch architecture;
01273 unsigned family;
01274 unsigned model;
01275 unsigned stepping;
01276 unsigned cache;
01277 unsigned clock;
01278 unsigned units;
01279 char *vend_name;
01280 char *model_name;
01281 char *platform;
01282 str_list_t *features;
01283 } cpu_info_t;
01284
01285
01286
01287
01288
01289 typedef struct {
01290 uint64_t sectors;
01291 struct {
01292 unsigned cyls, heads, sectors;
01293 } edd;
01294 struct {
01295 unsigned cyls, heads, sectors;
01296 } legacy;
01297 unsigned ext_fixed_disk:1;
01298 unsigned ext_lock_eject:1;
01299 unsigned ext_edd:1;
01300 unsigned ext_64bit:1;
01301 unsigned assigned:1;
01302 char *sysfs_id;
01303 unsigned hd_idx;
01304 } edd_info_t;
01305
01306
01307
01308
01309
01310 typedef struct {
01311 unsigned data_len, data_max;
01312 unsigned *data;
01313 unsigned names_len, names_max;
01314 char *names;
01315 } hddb_data_t;
01316
01317 typedef uint32_t hddb_entry_mask_t;
01318
01319 typedef struct hddb_list_s {
01320 hddb_entry_mask_t key_mask;
01321 hddb_entry_mask_t value_mask;
01322 unsigned key;
01323 unsigned value;
01324 } hddb_list_t;
01325
01326 typedef struct {
01327 unsigned list_len, list_max;
01328 hddb_list_t *list;
01329 unsigned ids_len, ids_max;
01330 unsigned *ids;
01331 unsigned strings_len, strings_max;
01332 char *strings;
01333 } hddb2_data_t;
01334
01335
01336
01337
01338 typedef enum modinfo_type_e { mi_none = 0, mi_pci, mi_other } modinfo_type_t;
01339
01340 typedef struct {
01341 char *module;
01342 char *alias;
01343 modinfo_type_t type;
01344 union {
01345 struct {
01346 struct {
01347 unsigned vendor:1;
01348 unsigned device:1;
01349 unsigned sub_vendor:1;
01350 unsigned sub_device:1;
01351 unsigned base_class:1;
01352 unsigned sub_class:1;
01353 unsigned prog_if:1;
01354 } has;
01355 unsigned vendor;
01356 unsigned device;
01357 unsigned sub_vendor;
01358 unsigned sub_device;
01359 unsigned base_class;
01360 unsigned sub_class;
01361 unsigned prog_if;
01362 } pci;
01363
01364 struct {
01365 struct {
01366 unsigned vendor:1;
01367 unsigned product:1;
01368 unsigned device_class:1;
01369 unsigned device_subclass:1;
01370 } has;
01371 unsigned vendor;
01372 unsigned product;
01373 unsigned device_class;
01374 unsigned device_subclass;
01375 } usb;
01376 };
01377 } modinfo_t;
01378
01379
01380
01381
01382
01383 typedef enum {
01384 p_invalid, p_string, p_int32, p_uint64, p_double, p_bool, p_list
01385 } hal_prop_type_t;
01386
01387
01388
01389
01390
01391 typedef struct hal_prop_s {
01392 struct hal_prop_s *next;
01393 hal_prop_type_t type;
01394 char *key;
01395 union {
01396 char *str;
01397 int32_t int32;
01398 uint64_t uint64;
01399 double d;
01400 int b;
01401 str_list_t *list;
01402 } val;
01403 } hal_prop_t;
01404
01405
01406
01407
01408
01409 typedef struct hal_device_s {
01410 struct hal_device_s *next, *parent;
01411 char *udi;
01412 unsigned used:1;
01413 hal_prop_t *prop;
01414 } hal_device_t;
01415
01416
01417
01418
01419
01420 typedef enum resource_types {
01421 res_any, res_phys_mem, res_mem, res_io, res_irq, res_dma, res_monitor,
01422 res_size, res_disk_geo, res_cache, res_baud, res_init_strings, res_pppd_option,
01423 res_framebuffer, res_hwaddr, res_link, res_wlan
01424 } hd_resource_types_t;
01425
01426
01427
01428
01429
01430 typedef enum size_units {
01431 size_unit_cm, size_unit_cinch, size_unit_byte, size_unit_sectors,
01432 size_unit_kbyte, size_unit_mbyte, size_unit_gbyte, size_unit_mm
01433 } hd_size_units_t;
01434
01435
01436
01437
01438 typedef enum access_flags {
01439 acc_unknown, acc_ro, acc_wo, acc_rw
01440 } hd_access_flags_t;
01441
01442
01443 typedef enum yes_no_flag {
01444 flag_unknown, flag_no, flag_yes
01445 } hd_yes_no_flag_t;
01446
01447
01448 typedef enum geo_types {
01449 geo_physical = 0, geo_logical, geo_bios_edd, geo_bios_legacy
01450 } hd_geo_types_t;
01451
01452
01453
01454
01455
01456 typedef struct {
01457 union u_hd_res_t *next;
01458 enum resource_types type;
01459 } res_any_t;
01460
01461 typedef struct {
01462 union u_hd_res_t *next;
01463 enum resource_types type;
01464 uint64_t base, range;
01465 unsigned
01466 enabled:1,
01467 access:2,
01468 prefetch:2;
01469 } res_mem_t;
01470
01471 typedef struct {
01472 union u_hd_res_t *next;
01473 enum resource_types type;
01474 uint64_t range;
01475 } res_phys_mem_t;
01476
01477 typedef struct {
01478 union u_hd_res_t *next;
01479 enum resource_types type;
01480 uint64_t base, range;
01481 unsigned
01482 enabled:1,
01483 access:2;
01484 } res_io_t;
01485
01486 typedef struct {
01487 union u_hd_res_t *next;
01488 enum resource_types type;
01489 unsigned base;
01490 unsigned triggered;
01491 unsigned enabled:1;
01492 } res_irq_t;
01493
01494 typedef struct {
01495 union u_hd_res_t *next;
01496 enum resource_types type;
01497 unsigned base;
01498 unsigned enabled:1;
01499 } res_dma_t;
01500
01501 typedef struct {
01502 union u_hd_res_t *next;
01503 enum resource_types type;
01504 enum size_units unit;
01505 uint64_t val1, val2;
01506 } res_size_t;
01507
01508 typedef struct {
01509 union u_hd_res_t *next;
01510 enum resource_types type;
01511 unsigned speed;
01512 unsigned bits, stopbits;
01513 char parity;
01514 char handshake;
01515 } res_baud_t;
01516
01517 typedef struct {
01518 union u_hd_res_t *next;
01519 enum resource_types type;
01520 unsigned size;
01521 } res_cache_t;
01522
01523 typedef struct {
01524 union u_hd_res_t *next;
01525 enum resource_types type;
01526 unsigned cyls, heads, sectors;
01527 uint64_t size;
01528 enum geo_types geotype;
01529 } res_disk_geo_t;
01530
01531 typedef struct {
01532 union u_hd_res_t *next;
01533 enum resource_types type;
01534 unsigned width, height;
01535 unsigned vfreq;
01536 unsigned interlaced:1;
01537 } res_monitor_t;
01538
01539 typedef struct {
01540 union u_hd_res_t *next;
01541 enum resource_types type;
01542 char *init1;
01543 char *init2;
01544 } res_init_strings_t;
01545
01546 typedef struct {
01547 union u_hd_res_t *next;
01548 enum resource_types type;
01549 char *option;
01550 } res_pppd_option_t;
01551
01552 typedef struct {
01553 union u_hd_res_t *next;
01554 enum resource_types type;
01555 unsigned width, height;
01556 unsigned bytes_p_line;
01557 unsigned colorbits;
01558 unsigned mode;
01559 } res_framebuffer_t;
01560
01561 typedef struct {
01562 union u_hd_res_t *next;
01563 enum resource_types type;
01564 char *addr;
01565 } res_hwaddr_t;
01566
01567 typedef struct {
01568 union u_hd_res_t *next;
01569 enum resource_types type;
01570 unsigned state:1;
01571 } res_link_t;
01572
01573
01574 typedef struct {
01575 union u_hd_res_t *next;
01576 enum resource_types type;
01577 str_list_t *channels;
01578 str_list_t *frequencies;
01579 str_list_t *bitrates;
01580 str_list_t *auth_modes;
01581 str_list_t *enc_modes;
01582 } res_wlan_t;
01583
01584 typedef union u_hd_res_t {
01585 union u_hd_res_t *next;
01586 res_any_t any;
01587 res_io_t io;
01588 res_mem_t mem;
01589 res_phys_mem_t phys_mem;
01590 res_irq_t irq;
01591 res_dma_t dma;
01592 res_size_t size;
01593 res_cache_t cache;
01594 res_baud_t baud;
01595 res_disk_geo_t disk_geo;
01596 res_monitor_t monitor;
01597 res_init_strings_t init_strings;
01598 res_pppd_option_t pppd_option;
01599 res_framebuffer_t framebuffer;
01600 res_hwaddr_t hwaddr;
01601 res_link_t link;
01602 res_wlan_t wlan;
01603 } hd_res_t;
01604
01605
01606
01607
01608
01609 typedef struct {
01610 uint64_t addr, size;
01611 char *dev;
01612 unsigned tag;
01613 } misc_io_t;
01614
01615 typedef struct {
01616 unsigned channel;
01617 char *dev;
01618 unsigned tag;
01619 } misc_dma_t;
01620
01621 typedef struct {
01622 unsigned irq, events;
01623 int devs;
01624 char **dev;
01625 unsigned tag;
01626 } misc_irq_t;
01627
01628 typedef struct {
01629 unsigned io_len, dma_len, irq_len;
01630 misc_io_t *io;
01631 misc_dma_t *dma;
01632 misc_irq_t *irq;
01633 str_list_t *proc_io, *proc_dma, *proc_irq;
01634 } misc_t;
01635
01636 typedef struct s_serial_t {
01637 struct s_serial_t *next;
01638 char *name;
01639 char *device;
01640 unsigned line, port, irq, baud;
01641 } serial_t;
01642
01643 typedef struct s_ser_device_t {
01644 struct s_ser_device_t *next;
01645 unsigned hd_idx;
01646 char *dev_name;
01647 str_list_t *at_resp;
01648 int fd;
01649 struct termios tio;
01650 unsigned max_baud, cur_baud;
01651 unsigned is_mouse:1;
01652 unsigned is_modem:1;
01653 unsigned do_io:1;
01654 unsigned char buf[0x1000];
01655 int buf_len;
01656 int garbage, non_pnp, pnp;
01657 unsigned char pnp_id[8];
01658 char *serial, *class_name, *dev_id, *user_name, *vend, *init_string1, *init_string2, *pppd_option;
01659 unsigned pnp_rev;
01660 unsigned bits;
01661 } ser_device_t;
01662
01663
01664
01665
01666
01667
01668
01669 typedef struct isdn_parm_s {
01670 struct isdn_parm_s *next;
01671 char *name;
01672 unsigned valid:1;
01673 unsigned conflict:1;
01674 uint64_t value;
01675 unsigned type;
01676 unsigned flags;
01677 unsigned def_value;
01678 int alt_values;
01679 unsigned *alt_value;
01680 } isdn_parm_t;
01681
01682
01683 typedef enum driver_info_type {
01684 di_any, di_display, di_module, di_mouse, di_x11, di_isdn, di_kbd, di_dsl
01685 } hd_driver_info_t;
01686
01687
01688 typedef struct {
01689 union driver_info_u *next;
01690 enum driver_info_type type;
01691 str_list_t *hddb0, *hddb1;
01692 } driver_info_any_t;
01693
01694
01695 typedef struct {
01696 union driver_info_u *next;
01697 enum driver_info_type type;
01698 str_list_t *hddb0, *hddb1;
01699 unsigned width, height;
01700 unsigned min_vsync, max_vsync;
01701 unsigned min_hsync, max_hsync;
01702 unsigned bandwidth;
01703 } driver_info_display_t;
01704
01705
01706 typedef struct {
01707 union driver_info_u *next;
01708 enum driver_info_type type;
01709 str_list_t *hddb0, *hddb1;
01710 unsigned active:1;
01711 unsigned modprobe:1;
01712 str_list_t *names;
01713 str_list_t *mod_args;
01714 char *conf;
01715 } driver_info_module_t;
01716
01717
01718 typedef struct {
01719 union driver_info_u *next;
01720 enum driver_info_type type;
01721 str_list_t *hddb0, *hddb1;
01722 char *xf86;
01723 char *gpm;
01724 int buttons;
01725 int wheels;
01726 } driver_info_mouse_t;
01727
01728
01729 typedef struct {
01730 union driver_info_u *next;
01731 enum driver_info_type type;
01732 str_list_t *hddb0, *hddb1;
01733 char *server;
01734 char *xf86_ver;
01735 unsigned x3d:1;
01736 struct {
01737 unsigned all:5;
01738 unsigned c8:1, c15:1, c16:1, c24:1, c32:1;
01739 } colors;
01740 unsigned dacspeed;
01741 str_list_t *extensions;
01742 str_list_t *options;
01743 str_list_t *raw;
01744 char *script;
01745 } driver_info_x11_t;
01746
01747
01748 typedef struct {
01749 union driver_info_u *next;
01750 enum driver_info_type type;
01751 str_list_t *hddb0, *hddb1;
01752 int i4l_type, i4l_subtype;
01753 char *i4l_name;
01754 isdn_parm_t *params;
01755 } driver_info_isdn_t;
01756
01757
01758 typedef struct {
01759 union driver_info_u *next;
01760 enum driver_info_type type;
01761 str_list_t *hddb0, *hddb1;
01762 char *mode;
01763 char *name;
01764 } driver_info_dsl_t;
01765
01766
01767 typedef struct {
01768 union driver_info_u *next;
01769 enum driver_info_type type;
01770 str_list_t *hddb0, *hddb1;
01771 char *XkbRules;
01772 char *XkbModel;
01773 char *XkbLayout;
01774 char *keymap;
01775 } driver_info_kbd_t;
01776
01777
01778
01779
01780 typedef union driver_info_u {
01781 union driver_info_u *next;
01782 driver_info_any_t any;
01783 driver_info_module_t module;
01784 driver_info_mouse_t mouse;
01785 driver_info_x11_t x11;
01786 driver_info_display_t display;
01787 driver_info_isdn_t isdn;
01788 driver_info_dsl_t dsl;
01789 driver_info_kbd_t kbd;
01790 } driver_info_t;
01791
01792
01793
01794
01795
01796
01797
01798 typedef enum hd_detail_type {
01799 hd_detail_pci, hd_detail_usb, hd_detail_isapnp, hd_detail_cdrom,
01800 hd_detail_floppy, hd_detail_bios, hd_detail_cpu, hd_detail_prom,
01801 hd_detail_monitor, hd_detail_sys, hd_detail_scsi, hd_detail_devtree,
01802 hd_detail_ccw
01803 } hd_detail_type_t;
01804
01805 typedef struct {
01806 enum hd_detail_type type;
01807 pci_t *data;
01808 } hd_detail_pci_t;
01809
01810 typedef struct {
01811 enum hd_detail_type type;
01812 usb_t *data;
01813 } hd_detail_usb_t;
01814
01815 typedef struct {
01816 enum hd_detail_type type;
01817 isapnp_dev_t *data;
01818 } hd_detail_isapnp_t;
01819
01820 typedef struct {
01821 enum hd_detail_type type;
01822 cdrom_info_t *data;
01823 } hd_detail_cdrom_t;
01824
01825 typedef struct {
01826 enum hd_detail_type type;
01827 floppy_info_t *data;
01828 } hd_detail_floppy_t;
01829
01830 typedef struct {
01831 enum hd_detail_type type;
01832 bios_info_t *data;
01833 } hd_detail_bios_t;
01834
01835 typedef struct {
01836 enum hd_detail_type type;
01837 cpu_info_t *data;
01838 } hd_detail_cpu_t;
01839
01840 typedef struct {
01841 enum hd_detail_type type;
01842 prom_info_t *data;
01843 } hd_detail_prom_t;
01844
01845 typedef struct {
01846 enum hd_detail_type type;
01847 monitor_info_t *data;
01848 } hd_detail_monitor_t;
01849
01850 typedef struct {
01851 enum hd_detail_type type;
01852 sys_info_t *data;
01853 } hd_detail_sys_t;
01854
01855 typedef struct {
01856 enum hd_detail_type type;
01857 scsi_t *data;
01858 } hd_detail_scsi_t;
01859
01860 typedef struct {
01861 enum hd_detail_type type;
01862 devtree_t *data;
01863 } hd_detail_devtree_t;
01864
01865 typedef struct {
01866 enum hd_detail_type type;
01867 ccw_t *data;
01868 } hd_detail_ccw_t;
01869
01870 typedef union {
01871 enum hd_detail_type type;
01872 hd_detail_pci_t pci;
01873 hd_detail_usb_t usb;
01874 hd_detail_isapnp_t isapnp;
01875 hd_detail_cdrom_t cdrom;
01876 hd_detail_floppy_t floppy;
01877 hd_detail_bios_t bios;
01878 hd_detail_cpu_t cpu;
01879 hd_detail_prom_t prom;
01880 hd_detail_monitor_t monitor;
01881 hd_detail_sys_t sys;
01882 hd_detail_scsi_t scsi;
01883 hd_detail_devtree_t devtree;
01884 hd_detail_ccw_t ccw;
01885 } hd_detail_t;
01886
01887
01888
01889 typedef struct hd_manual_s {
01890 struct hd_manual_s *next;
01891
01892 char *unique_id;
01893 char *parent_id;
01894 char *child_ids;
01895 unsigned hw_class;
01896 char *model;
01897
01898 hd_status_t status;
01899 char *config_string;
01900
01901
01902
01903
01904 str_list_t *key;
01905 str_list_t *value;
01906 } hd_manual_t;
01907
01908
01914 typedef struct s_hd_t {
01915 struct s_hd_t *next;
01921 unsigned idx;
01922
01928 unsigned broken:1;
01929
01933 hd_id_t bus;
01934
01939 unsigned slot;
01940
01944 unsigned func;
01945
01949 hd_id_t base_class;
01950
01954 hd_id_t sub_class;
01955
01959 hd_id_t prog_if;
01960
01967 hd_id_t vendor;
01968
01977 hd_id_t device;
01978
01985 hd_id_t sub_vendor;
01986
01993 hd_id_t sub_device;
01994
02000 hd_id_t revision;
02001
02005 char *serial;
02006
02011 hd_id_t compat_vendor;
02012
02017 hd_id_t compat_device;
02018
02023 hd_hw_item_t hw_class;
02024
02029 unsigned char hw_class_list[(hw_all + 7) / 8];
02037 char *model;
02038
02044 unsigned attached_to;
02045
02049 char *sysfs_id;
02050
02054 char *sysfs_bus_id;
02055
02059 char *sysfs_device_link;
02060
02066 char *unix_dev_name;
02067
02071 hd_dev_num_t unix_dev_num;
02072
02079 str_list_t *unix_dev_names;
02080
02087 char *unix_dev_name2;
02088
02092 hd_dev_num_t unix_dev_num2;
02093
02100 char *rom_id;
02101
02105 char *udi;
02106
02110 char *parent_udi;
02111
02122 char *unique_id;
02123
02124
02125 str_list_t *unique_ids;
02126
02130 unsigned module;
02131
02135 unsigned line;
02136
02140 unsigned count;
02141
02145 hd_res_t *res;
02146
02151 hd_detail_t *detail;
02152
02158 str_list_t *extra_info;
02159
02165 hd_status_t status;
02166
02173 char *config_string;
02174
02179 hd_hotplug_t hotplug;
02180
02185 unsigned hotplug_slot;
02186
02187 struct is_s {
02188 unsigned agp:1;
02189 unsigned isapnp:1;
02190 unsigned notready:1;
02191 unsigned manual:1;
02192 unsigned softraiddisk:1;
02193 unsigned zip:1;
02194 unsigned cdr:1;
02195 unsigned cdrw:1;
02196 unsigned dvd:1;
02197 unsigned dvdr:1;
02198 unsigned dvdrw:1;
02199 unsigned dvdpr:1;
02200 unsigned dvdprw:1;
02201 unsigned dvdprdl:1;
02202 unsigned dvdram:1;
02203 unsigned pppoe:1;
02204 unsigned wlan:1;
02205 unsigned with_acpi:1;
02206 unsigned hotpluggable:1;
02207 } is;
02208
02209 struct tag_s {
02210 unsigned remove:1;
02211 unsigned freeit:1;
02212 unsigned fixed:1;
02213 unsigned ser_skip:1;
02214 unsigned ser_device:2;
02215 } tag;
02216
02222 unsigned char *block0;
02223
02227 char *driver;
02228
02232 str_list_t *drivers;
02233
02241 char *old_unique_id;
02242
02248 char *parent_id;
02249
02255 str_list_t *child_ids;
02256
02261 char *unique_id1;
02262
02269 char *usb_guid;
02270
02271 driver_info_t *driver_info;
02272
02273 str_list_t *requires;
02274
02275 hal_prop_t *hal_prop;
02276
02277 hal_prop_t *persistent_prop;
02278
02279 char *modalias;
02280
02281
02282
02283
02284
02285 unsigned ref_cnt;
02286 struct s_hd_t *ref;
02287 } hd_t;
02288
02289
02293 typedef struct {
02299 hd_t *hd;
02300
02309 void (*progress)(char *pos, char *msg);
02310
02314 char *log;
02315
02321 unsigned debug;
02322
02328 struct flag_struct {
02329 unsigned internal:1;
02330 unsigned dformat:2;
02331 unsigned no_parport:1;
02332 unsigned iseries:1;
02333 unsigned list_all:1;
02334 unsigned fast:1;
02335 unsigned list_md:1;
02336 unsigned nofork:1;
02337 unsigned nosysfs:1;
02338 unsigned forked:1;
02339 unsigned cpuemu:1;
02340 unsigned udev:1;
02341 unsigned edd_used:1;
02342 unsigned keep_kmods:2;
02343 unsigned nobioscrc:1;
02344 unsigned biosvram:1;
02345 unsigned nowpa:1;
02346 unsigned pata:1;
02347 } flags;
02348
02349
02353 str_list_t *only;
02354
02355
02356
02357
02358 unsigned char probe[(pr_all + 7) / 8];
02359 unsigned char probe_set[(pr_all + 7) / 8];
02360 unsigned char probe_clr[(pr_all + 7) / 8];
02361 unsigned last_idx;
02362 unsigned module;
02363 enum boot_arch boot;
02364 hd_t *old_hd;
02365 pci_t *pci;
02366 isapnp_t *isapnp;
02367 cdrom_info_t *cdrom;
02368 str_list_t *net;
02369 str_list_t *floppy;
02370 misc_t *misc;
02371 serial_t *serial;
02372 scsi_t *scsi;
02373 ser_device_t *ser_mouse;
02374 ser_device_t *ser_modem;
02375 str_list_t *cpu;
02376 str_list_t *klog;
02377 str_list_t *proc_usb;
02378 usb_t *usb;
02379 modinfo_t *modinfo_ext;
02380 modinfo_t *modinfo;
02381 hddb2_data_t *hddb2[2];
02382 str_list_t *kmods;
02383 uint64_t used_irqs;
02384 uint64_t assigned_irqs;
02385 memory_range_t bios_rom;
02386 memory_range_t bios_ram;
02387 memory_range_t bios_ebda;
02388 unsigned display;
02389 unsigned color_code;
02390 char *cmd_line;
02391 str_list_t *xtra_hd;
02392 devtree_t *devtree;
02393 unsigned kernel_version;
02394 int in_vmware;
02395 hd_t *manual;
02396 str_list_t *disks;
02397 str_list_t *partitions;
02398 str_list_t *cdroms;
02399 hd_smbios_t *smbios;
02400 struct {
02401 unsigned ok:1;
02402 unsigned size;
02403 unsigned used;
02404 void *data;
02405 int id;
02406 int updated;
02407 } shm;
02408 unsigned pci_config_type;
02409 hd_udevinfo_t *udevinfo;
02410 hd_sysfsdrv_t *sysfsdrv;
02411 uint64_t sysfsdrv_id;
02412 str_list_t *scanner_db;
02413 edd_info_t edd[0x80];
02414 hal_device_t *hal;
02415 } hd_data_t;
02416
02417
02418
02419
02420
02421
02422
02423
02424
02425
02426
02427
02428 void hd_scan(hd_data_t *hd_data);
02429
02431 hd_data_t *hd_free_hd_data(hd_data_t *hd_data);
02432
02434 hd_t *hd_free_hd_list(hd_t *hd);
02435
02436 void hd_set_probe_feature(hd_data_t *hd_data, enum probe_feature feature);
02437 void hd_clear_probe_feature(hd_data_t *hd_data, enum probe_feature feature);
02438 int hd_probe_feature(hd_data_t *hd_data, enum probe_feature feature);
02439 void hd_set_probe_feature_hw(hd_data_t *hd_data, hd_hw_item_t item);
02440
02441 enum probe_feature hd_probe_feature_by_name(char *name);
02442 char *hd_probe_feature_by_value(enum probe_feature feature);
02443
02444 int hd_module_is_active(hd_data_t *hd_data, char *mod);
02445
02446 hd_t *hd_base_class_list(hd_data_t *hd_data, unsigned base_class);
02447 hd_t *hd_sub_class_list(hd_data_t *hd_data, unsigned base_class, unsigned sub_class);
02448 hd_t *hd_bus_list(hd_data_t *hd_data, unsigned bus);
02449 const char* hd_busid_to_hwcfg(int busid);
02450 hd_t *hd_list(hd_data_t *hd_data, hd_hw_item_t item, int rescan, hd_t *hd_old);
02451 hd_t *hd_list_with_status(hd_data_t *hd_data, hd_hw_item_t item, hd_status_t status);
02452 hd_t *hd_list2(hd_data_t *hd_data, hd_hw_item_t *items, int rescan);
02453 hd_t *hd_list_with_status2(hd_data_t *hd_data, hd_hw_item_t *items, hd_status_t status);
02454
02455 int hd_has_pcmcia(hd_data_t *hd_data);
02456
02457
02458 int hd_usb_support(hd_data_t *hd_data);
02459 int hd_smp_support(hd_data_t *hd_data);
02460 int hd_mac_color(hd_data_t *hd_data);
02461 int hd_color(hd_data_t *hd_data);
02462 int hd_is_uml(hd_data_t *hd_data);
02463 int hd_is_xen(hd_data_t *hd_data);
02464 unsigned hd_display_adapter(hd_data_t *hd_data);
02465 unsigned hd_boot_disk(hd_data_t *hd_data, int *matches);
02466 enum cpu_arch hd_cpu_arch(hd_data_t *hd_data);
02467 enum boot_arch hd_boot_arch(hd_data_t *hd_data);
02468
02469 hd_t *hd_get_device_by_idx(hd_data_t *hd_data, unsigned idx);
02470
02471 void hd_set_hw_class(hd_t *hd, hd_hw_item_t hw_class);
02472 int hd_is_hw_class(hd_t *hd, hd_hw_item_t hw_class);
02473
02474 int hd_is_sgi_altix(hd_data_t *hd_data);
02475
02476 char *hd_version(void);
02477
02478 hal_prop_t *hd_free_hal_properties(hal_prop_t *prop);
02479 hal_prop_t *hd_read_properties(const char *udi);
02480 int hd_write_properties(const char *udi, hal_prop_t *prop);
02481
02482
02483
02484 str_list_t *get_hddb_packages(hd_data_t *hd_data);
02485 void hddb_add_info(hd_data_t *hd_data, hd_t *hd);
02486
02487 void hddb_dump_raw(hddb2_data_t *hddb, FILE *f);
02488 void hddb_dump(hddb2_data_t *hddb, FILE *f);
02489
02490
02491
02492 void hd_dump_entry(hd_data_t *hd_data, hd_t *hd, FILE *f);
02493
02494
02495
02496
02497 cdrom_info_t *hd_read_cdrom_info(hd_data_t *hd_data, hd_t *hd);
02498
02499
02500 hd_manual_t *hd_manual_read_entry(hd_data_t *hd_data, const char *id);
02501 int hd_manual_write_entry(hd_data_t *hd_data, hd_manual_t *entry);
02502 hd_manual_t *hd_free_manual(hd_manual_t *manual);
02503 hd_t *hd_read_config(hd_data_t *hd_data, const char *id);
02504 int hd_write_config(hd_data_t *hd_data, hd_t *hd);
02505 char *hd_hw_item_name(hd_hw_item_t item);
02506 hd_hw_item_t hd_hw_item_type(char *name);
02507 char *hd_status_value_name(hd_status_value_t status);
02508 int hd_change_status(const char *id, hd_status_t status, const char *config_string);
02509 int hd_change_config_status(hd_data_t *hd_data, const char *id, hd_status_t status, const char *config_string);
02510 int hd_read_mmap(hd_data_t *hd_data, char *name, unsigned char *buf, off_t start, unsigned size);
02511
02512
02513
02514
02515
02516
02517
02518
02519
02520 #define CDBISDN_VERSION 0x0101
02521
02522 #ifndef PCI_ANY_ID
02523 #define PCI_ANY_ID 0xffff
02524 #endif
02525
02526 #define CDBISDN_P_NONE 0x0
02527 #define CDBISDN_P_IRQ 0x1
02528 #define CDBISDN_P_MEM 0x2
02529 #define CDBISDN_P_IO 0x3
02530
02531
02532 typedef struct {
02533 char *name;
02534 char *shortname;
02535 int vnr;
02536 int refcnt;
02537 } cdb_isdn_vendor;
02538
02539 typedef struct {
02540 int handle;
02541 int vhandle;
02542 char *name;
02543 char *lname;
02544 char *Class;
02545 char *bus;
02546 int revision;
02547 int vendor;
02548 int device;
02549 int subvendor;
02550
02551 int subdevice;
02552
02553 unsigned int features;
02554 int line_cnt;
02555 int vario_cnt;
02556 int vario;
02557 } cdb_isdn_card;
02558
02559 typedef struct {
02560 int handle;
02561 int next_vario;
02562 int drvid;
02563 int typ;
02564 int subtyp;
02565 int smp;
02566 char *mod_name;
02567 char *para_str;
02568 char *mod_preload;
02569 char *cfg_prog;
02570 char *firmware;
02571 char *description;
02572 char *need_pkg;
02573 char *info;
02574 char *protocol;
02575 char *interface;
02576 char *io;
02577 char *irq;
02578 char *membase;
02579 char *features;
02580 int card_ref;
02581 char *name;
02582 } cdb_isdn_vario;
02583
02584
02585 extern cdb_isdn_vendor *hd_cdbisdn_get_vendor(int);
02586 extern cdb_isdn_card *hd_cdbisdn_get_card(int);
02587 extern cdb_isdn_vario *hd_cdbisdn_get_vario_from_type(int, int);
02588 extern cdb_isdn_card *hd_cdbisdn_get_card_from_type(int, int);
02589 extern cdb_isdn_card *hd_cdbisdn_get_card_from_id(int, int, int, int);
02590 extern cdb_isdn_vario *hd_cdbisdn_get_vario(int);
02591 extern int hd_cdbisdn_get_version(void);
02592 extern int hd_cdbisdn_get_db_version(void);
02593 extern char *hd_cdbisdn_get_db_date(void);
02594
02595
02596
02597 #ifdef __cplusplus
02598 }
02599 #endif
02600
02601 #endif