00001 #ifndef _HD_H
00002 #define _HD_H
00003
00009 #ifdef __cplusplus
00010 extern "C" {
00011 #endif
00012
00013
00014
00015
00016
00017
00018
00019
00020
00022 #define HD_VERSION 20
00023
00031 #define HD_DEB_SHOW_LOG (1 << 0)
00032 #define HD_DEB_PROGRESS (1 << 1)
00033 #define HD_DEB_CREATION (1 << 2)
00034 #define HD_DEB_DRIVER_INFO (1 << 3)
00035 #define HD_DEB_PCI (1 << 4)
00036 #define HD_DEB_ISAPNP (1 << 5)
00037 #define HD_DEB_CDROM (1 << 6)
00038 #define HD_DEB_NET (1 << 7)
00039 #define HD_DEB_FLOPPY (1 << 8)
00040 #define HD_DEB_MISC (1 << 9)
00041 #define HD_DEB_SERIAL (1 << 10)
00042 #define HD_DEB_MONITOR (1 << 11)
00043 #define HD_DEB_CPU (1 << 12)
00044 #define HD_DEB_BIOS (1 << 13)
00045 #define HD_DEB_MOUSE (1 << 14)
00046 #define HD_DEB_IDE (1 << 15)
00047 #define HD_DEB_SCSI (1 << 16)
00048 #define HD_DEB_USB (1 << 17)
00049 #define HD_DEB_ADB (1 << 18)
00050 #define HD_DEB_MODEM (1 << 19)
00051 #define HD_DEB_PARALLEL (1 << 20)
00052 #define HD_DEB_ISA (1 << 21)
00053 #define HD_DEB_BOOT (1 << 22)
00054 #define HD_DEB_HDDB (1 << 23)
00055
00057 #include <stdio.h>
00058 #include <inttypes.h>
00059 #include <termios.h>
00060 #include <sys/types.h>
00061
00062
00063
00067 #define HARDWARE_DIR "/var/lib/hardware"
00068
00083 #define TAG_PCI 1
00084 #define TAG_EISA 2
00085 #define TAG_USB 3
00086 #define TAG_SPECIAL 4
00087 #define TAG_PCMCIA 5
00092 #define ID_VALUE(id) ((id) & 0xffff)
00093
00097 #define ID_TAG(id) (((id) >> 16) & 0xf)
00098
00102 #define MAKE_ID(tag, id_val) ((tag << 16) | (id_val))
00103
00109 typedef enum probe_feature {
00110 pr_memory = 1, pr_pci, pr_isapnp, pr_net, pr_floppy, pr_misc,
00111 pr_misc_serial, pr_misc_par, pr_misc_floppy, pr_serial, pr_cpu, pr_bios,
00112 pr_monitor, pr_mouse, pr_scsi, pr_usb, pr_usb_mods, pr_adb, pr_modem,
00113 pr_modem_usb, pr_parallel, pr_parallel_lp, pr_parallel_zip, pr_isa,
00114 pr_isa_isdn, pr_isdn, pr_kbd, pr_prom, pr_sbus, pr_int, pr_braille,
00115 pr_braille_alva, pr_braille_fhp, pr_braille_ht, pr_ignx11, pr_sys,
00116 pr_bios_vbe, pr_isapnp_old, pr_isapnp_new, pr_isapnp_mod, pr_braille_baum,
00117 pr_manual, pr_fb, pr_veth, pr_pppoe, pr_scan, pr_pcmcia, pr_fork,
00118 pr_parallel_imm, pr_s390, pr_cpuemu, pr_sysfs, pr_s390disks, pr_udev,
00119 pr_block, pr_block_cdrom, pr_block_part, pr_edd, pr_edd_mod, pr_bios_ddc,
00120 pr_bios_fb, pr_bios_mode, pr_input, pr_block_mods, pr_bios_vesa,
00121 pr_cpuemu_debug, pr_scsi_noserial, pr_wlan, pr_bios_crc, pr_hal,
00122 pr_bios_vram, pr_bios_acpi, pr_bios_ddc_ports, pr_modules_pata,
00123 pr_net_eeprom, pr_x86emu,
00124 pr_max, pr_lxrc, pr_default,
00125 pr_all
00126 } hd_probe_feature_t;
00127
00136 typedef enum hw_item {
00137 hw_none = 0, hw_sys, hw_cpu, hw_keyboard, hw_braille, hw_mouse,
00138 hw_joystick, hw_printer, hw_scanner, hw_chipcard, hw_monitor, hw_tv,
00139 hw_display, hw_framebuffer, hw_camera, hw_sound, hw_storage_ctrl,
00140 hw_network_ctrl, hw_isdn, hw_modem, hw_network, hw_disk, hw_partition,
00141 hw_cdrom, hw_floppy, hw_manual, hw_usb_ctrl, hw_usb, hw_bios, hw_pci,
00142 hw_isapnp, hw_bridge, hw_hub, hw_scsi, hw_ide, hw_memory, hw_dvb,
00143 hw_pcmcia, hw_pcmcia_ctrl, hw_ieee1394, hw_ieee1394_ctrl, hw_hotplug,
00144 hw_hotplug_ctrl, hw_zip, hw_pppoe, hw_wlan, hw_redasd, hw_dsl, hw_block,
00145 hw_tape, hw_vbe, hw_bluetooth, hw_fingerprint,
00147 hw_unknown, hw_all
00148 } hd_hw_item_t;
00149
00157 typedef enum base_classes {
00158
00159 bc_none, bc_storage, bc_network, bc_display, bc_multimedia,
00160 bc_memory, bc_bridge, bc_comm, bc_system, bc_input, bc_docking,
00161 bc_processor, bc_serial, bc_wireless, bc_i2o, bc_other = 0xff,
00162
00163
00164 bc_monitor = 0x100, bc_internal, bc_modem, bc_isdn, bc_ps2, bc_mouse,
00165 bc_storage_device, bc_network_interface, bc_keyboard, bc_printer,
00166 bc_hub, bc_braille, bc_scanner, bc_joystick, bc_chipcard, bc_camera,
00167 bc_framebuffer, bc_dvb, bc_tv, bc_partition, bc_dsl, bc_bluetooth, bc_fingerprint
00168 } hd_base_classes_t;
00169
00171 typedef enum sc_monitor {
00172 sc_mon_other, sc_mon_crt, sc_mon_lcd
00173 } hd_sc_monitor_t;
00174
00176 typedef enum sc_storage {
00177 sc_sto_scsi, sc_sto_ide, sc_sto_floppy, sc_sto_ipi, sc_sto_raid,
00178 sc_sto_other = 0x80
00179 } hd_sc_storage_t;
00180
00182 typedef enum sc_display {
00183 sc_dis_vga, sc_dis_xga, sc_dis_other = 0x80
00184 } hd_sc_display_t;
00185
00187 typedef enum sc_framebuffer {
00188 sc_fb_vesa = 1
00189 } hd_sc_framebuffer_t;
00190
00192 typedef enum sc_bridge {
00193 sc_bridge_host, sc_bridge_isa, sc_bridge_eisa, sc_bridge_mc,
00194 sc_bridge_pci, sc_bridge_pcmcia, sc_bridge_nubus, sc_bridge_cardbus,
00195 sc_bridge_other = 0x80
00196 } hd_sc_bridge_t;
00197
00199 typedef enum sc_comm {
00200 sc_com_ser, sc_com_par, sc_com_multi, sc_com_modem, sc_com_other = 0x80
00201 } hd_sc_comm_t;
00202
00204 typedef enum sc_system {
00205 sc_sys_pic, sc_sys_dma, sc_sys_timer, sc_sys_rtc, sc_sys_other = 0x80
00206 } hd_sc_system_t;
00207
00209 typedef enum sc_input {
00210 sc_inp_keyb, sc_inp_digit, sc_inp_mouse, sc_inp_other = 0x80
00211 } hd_sc_input_t;
00212
00214 typedef enum sc_serial {
00215 sc_ser_fire, sc_ser_access, sc_ser_ssa, sc_ser_usb, sc_ser_fiber,
00216 sc_ser_smbus, sc_ser_other = 0x80
00217 } hd_sc_serial_t;
00218
00220 typedef enum sc_internal {
00221 sc_int_none, sc_int_isapnp_if, sc_int_main_mem, sc_int_cpu, sc_int_fpu,
00222 sc_int_bios, sc_int_prom, sc_int_sys
00223 } hd_sc_internal_t;
00224
00226 typedef enum sc_mouse {
00227 sc_mou_ps2, sc_mou_ser, sc_mou_bus, sc_mou_usb, sc_mou_sun,
00228 sc_mou_other = 0x80
00229 } hd_sc_mouse_t;
00230
00232 typedef enum sc_std {
00233 sc_sdev_disk, sc_sdev_tape, sc_sdev_cdrom, sc_sdev_floppy, sc_sdev_scanner,
00234 sc_sdev_other = 0x80
00235 } hd_sc_std_t;
00236
00238 typedef enum sc_net_if {
00239 sc_nif_loopback, sc_nif_ethernet, sc_nif_tokenring, sc_nif_fddi,
00240 sc_nif_ctc, sc_nif_iucv, sc_nif_hsi, sc_nif_qeth,
00241 sc_nif_escon, sc_nif_myrinet, sc_nif_wlan, sc_nif_xp,
00242 sc_nif_usb, sc_nif_other = 0x80, sc_nif_sit
00243 } hd_sc_net_if_t;
00244
00246 typedef enum sc_multimedia {
00247 sc_multi_video, sc_multi_audio, sc_multi_other
00248 } hd_sc_multimedia_t;
00249
00251 typedef enum sc_keyboard {
00252 sc_keyboard_kbd, sc_keyboard_console
00253 } hd_sc_keyboard_t;
00254
00256 typedef enum sc_hub {
00257 sc_hub_other, sc_hub_usb
00258 } hd_sc_hub_t;
00259
00261 typedef enum sc_camera {
00262 sc_camera_webcam, sc_camera_digital
00263 } hd_sc_camera_t;
00264
00266 typedef enum sc_modem {
00267 sc_mod_at, sc_mod_win1, sc_mod_win2, sc_mod_win3, sc_mod_win4
00268 } hd_sc_modem_t;
00269
00271 typedef enum sc_dsl {
00272 sc_dsl_unknown, sc_dsl_pppoe, sc_dsl_capi, sc_dsl_capiisdn
00273 } hd_sc_dsl_t;
00274
00276 typedef enum pif_usb_e {
00277 pif_usb_uhci = 0, pif_usb_ohci = 0x10, pif_usb_ehci = 0x20,
00278 pif_usb_other = 0x80, pif_usb_device = 0xfe
00279 } hd_pif_usb_t;
00280
00282 typedef enum pif_cdrom {
00283 pif_cdrom, pif_cdr, pif_cdrw, pif_dvd, pif_dvdr, pif_dvdram
00284 } hd_pif_cdrom_t ;
00285
00287 typedef enum pif_s390disk {
00288 pif_scsi, pif_dasd, pif_dasd_fba
00289 } hd_pif_s390disk_t;
00290
00292 typedef enum bus_types {
00293 bus_none, bus_isa, bus_eisa, bus_mc, bus_pci, bus_pcmcia, bus_nubus,
00294 bus_cardbus, bus_other,
00295
00297 bus_ps2 = 0x80, bus_serial, bus_parallel, bus_floppy, bus_scsi, bus_ide, bus_usb,
00298 bus_adb, bus_raid, bus_sbus, bus_i2o, bus_vio, bus_ccw, bus_iucv, bus_ps3_system_bus,
00299 bus_virtio, bus_ibmebus, bus_gameport
00300 } hd_bus_types_t;
00301
00310 typedef struct {
00314 unsigned invalid:1;
00315
00325 unsigned reconfig:3;
00326
00332 unsigned configured:3;
00333
00344 unsigned available:3;
00345
00353 unsigned needed:3;
00354
00361 unsigned available_orig:3;
00362
00366 unsigned active:3;
00367 } hd_status_t;
00368
00370 typedef enum {
00371 status_no = 1, status_yes, status_unknown, status_new
00372 } hd_status_value_t;
00373
00377 typedef enum {
00378 hp_none,
00379 hp_pcmcia,
00380 hp_cardbus,
00381 hp_pci,
00382 hp_usb,
00383 hp_ieee1394
00384 } hd_hotplug_t;
00385
00396 typedef struct {
00397 unsigned id;
00398 char *name;
00399 } hd_id_t;
00400
00401
00406 typedef struct s_str_list_t {
00407 struct s_str_list_t *next;
00408 char *str;
00409 } str_list_t;
00410
00411
00415 typedef struct {
00416 unsigned char bitmap[16];
00417 unsigned bits;
00418 unsigned not_empty:1;
00419 str_list_t *str;
00420 } hd_bitmap_t;
00421
00438 typedef struct {
00439 unsigned start, size;
00440 unsigned char *data;
00441 } memory_range_t;
00442
00443
00447 typedef struct {
00448 unsigned ok:1;
00449 unsigned rev;
00450 unsigned mpfp;
00451 unsigned mpconfig_ok:1;
00452 unsigned mpconfig;
00453 unsigned mpconfig_size;
00454 unsigned char feature[5];
00455 char oem_id[9];
00456 char prod_id[13];
00457 unsigned cpus, cpus_en;
00458 } smp_info_t;
00459
00460
00464 typedef struct vbe_mode_info_s {
00465 unsigned number;
00466 unsigned attributes;
00467 unsigned width, height;
00468 unsigned bytes_p_line;
00469 unsigned pixel_size;
00470 unsigned fb_start;
00471 unsigned win_A_start;
00472 unsigned win_A_attr;
00473 unsigned win_B_start;
00474 unsigned win_B_attr;
00475 unsigned win_size;
00476 unsigned win_gran;
00477 unsigned pixel_clock;
00478 } vbe_mode_info_t;
00479
00485 typedef struct {
00486 unsigned ok:1;
00487 unsigned version;
00488 unsigned oem_version;
00489 unsigned memory;
00490 unsigned fb_start;
00491 char *oem_name;
00492 char *vendor_name;
00493 char *product_name;
00494 char *product_revision;
00495 unsigned modes;
00496 vbe_mode_info_t *mode;
00497 unsigned current_mode;
00498 unsigned ddc_ports;
00499 unsigned char ddc_port[4][0x80];
00500 } vbe_info_t;
00501
00502
00506 typedef struct {
00507 unsigned id;
00508 unsigned char slot;
00509 unsigned char bus;
00510 unsigned char devfn;
00511 unsigned char misc;
00512 } cpq_ctlorder_t;
00513
00514
00515 typedef struct {
00516 unsigned ok:1;
00517 unsigned entry;
00518 unsigned compaq:1;
00519 cpq_ctlorder_t cpq_ctrl[32];
00520 } bios32_info_t;
00521
00531 typedef enum {
00532 sm_biosinfo, sm_sysinfo, sm_boardinfo, sm_chassis,
00533 sm_processor, sm_memctrl, sm_memmodule, sm_cache,
00534 sm_connect, sm_slot, sm_onboard, sm_oem,
00535 sm_config, sm_lang, sm_group, sm_eventlog,
00536 sm_memarray, sm_memdevice, sm_memerror, sm_memarraymap,
00537 sm_memdevicemap, sm_mouse, sm_battery, sm_reset,
00538 sm_secure, sm_power, sm_voltage, sm_cool,
00539 sm_temperature, sm_current, sm_outofband, sm_bis,
00540 sm_boot, sm_mem64error, sm_mandev, sm_mandevcomp,
00541 sm_mdtd, sm_inactive = 126, sm_end = 127
00542 } hd_smbios_type_t;
00543
00544
00546 typedef struct {
00547 union u_hd_smbios_t *next;
00548 hd_smbios_type_t type;
00549 int data_len;
00550 unsigned char *data;
00551 str_list_t *strings;
00552 int handle;
00553 } smbios_any_t;
00554
00555
00557 typedef struct {
00558 union u_hd_smbios_t *next;
00559 hd_smbios_type_t type;
00560 int data_len;
00561 unsigned char *data;
00562 str_list_t *strings;
00563 int handle;
00564 char *vendor;
00565 char *version;
00566 char *date;
00567 hd_bitmap_t feature;
00568 unsigned start;
00569 unsigned rom_size;
00570 } smbios_biosinfo_t;
00571
00572
00574 typedef struct {
00575 union u_hd_smbios_t *next;
00576 hd_smbios_type_t type;
00577 int data_len;
00578 unsigned char *data;
00579 str_list_t *strings;
00580 int handle;
00581 char *manuf;
00582 char *product;
00583 char *version;
00584 char *serial;
00585 unsigned char uuid[16];
00586 hd_id_t wake_up;
00587 } smbios_sysinfo_t;
00588
00589
00591 typedef struct {
00592 union u_hd_smbios_t *next;
00593 hd_smbios_type_t type;
00594 int data_len;
00595 unsigned char *data;
00596 str_list_t *strings;
00597 int handle;
00598 char *manuf;
00599 char *product;
00600 char *version;
00601 char *serial;
00602 char *asset;
00603 hd_id_t board_type;
00604 hd_bitmap_t feature;
00605 char *location;
00606 int chassis;
00607 int objects_len;
00608 int *objects;
00609 } smbios_boardinfo_t;
00610
00611
00613 typedef struct {
00614 union u_hd_smbios_t *next;
00615 hd_smbios_type_t type;
00616 int data_len;
00617 unsigned char *data;
00618 str_list_t *strings;
00619 int handle;
00620 char *manuf;
00621 char *version;
00622 char *serial;
00623 char *asset;
00624 hd_id_t ch_type;
00625 unsigned lock;
00626 hd_id_t bootup;
00627 hd_id_t power;
00628 hd_id_t thermal;
00629 hd_id_t security;
00630 unsigned oem;
00631 } smbios_chassis_t;
00632
00633
00635 typedef struct {
00636 union u_hd_smbios_t *next;
00637 hd_smbios_type_t type;
00638 int data_len;
00639 unsigned char *data;
00640 str_list_t *strings;
00641 int handle;
00642 char *socket;
00643 hd_id_t upgrade;
00644 char *manuf;
00645 char *version;
00646 char *serial;
00647 char *asset;
00648 char *part;
00649 hd_id_t pr_type;
00650 hd_id_t family;
00651 uint64_t cpu_id;
00652 unsigned voltage;
00653 unsigned ext_clock;
00654 unsigned max_speed;
00655 unsigned current_speed;
00656 unsigned sock_status;
00657 hd_id_t cpu_status;
00658 int l1_cache;
00659 int l2_cache;
00660 int l3_cache;
00661 } smbios_processor_t;
00662
00663
00665 typedef struct {
00666 union u_hd_smbios_t *next;
00667 hd_smbios_type_t type;
00668 int data_len;
00669 unsigned char *data;
00670 str_list_t *strings;
00671 int handle;
00672 char *socket;
00673 unsigned max_size;
00674 unsigned current_size;
00675 unsigned speed;
00676 hd_id_t mode;
00677 unsigned state;
00678 hd_id_t location;
00679 unsigned socketed;
00680 unsigned level;
00681 hd_id_t ecc;
00682 hd_id_t cache_type;
00683 hd_id_t assoc;
00684 hd_bitmap_t supp_sram;
00685 hd_bitmap_t sram;
00686 } smbios_cache_t;
00687
00688
00690 typedef struct {
00691 union u_hd_smbios_t *next;
00692 hd_smbios_type_t type;
00693 int data_len;
00694 unsigned char *data;
00695 str_list_t *strings;
00696 int handle;
00697 hd_id_t port_type;
00698 char *i_des;
00699 hd_id_t i_type;
00700 char *x_des;
00701 hd_id_t x_type;
00702 } smbios_connect_t;
00703
00704
00706 typedef struct {
00707 union u_hd_smbios_t *next;
00708 hd_smbios_type_t type;
00709 int data_len;
00710 unsigned char *data;
00711 str_list_t *strings;
00712 int handle;
00713 char *desig;
00714 hd_id_t slot_type;
00715 hd_id_t bus_width;
00716 hd_id_t usage;
00717 hd_id_t length;
00718 unsigned id;
00719 hd_bitmap_t feature;
00720 } smbios_slot_t;
00721
00722
00724 typedef struct {
00725 union u_hd_smbios_t *next;
00726 hd_smbios_type_t type;
00727 int data_len;
00728 unsigned char *data;
00729 str_list_t *strings;
00730 int handle;
00731 unsigned dev_len;
00732 struct {
00733 char *name;
00734 hd_id_t type;
00735 unsigned status;
00736 } *dev;
00737 } smbios_onboard_t;
00738
00739
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 str_list_t *oem_strings;
00749 } smbios_oem_t;
00750
00751
00753 typedef struct {
00754 union u_hd_smbios_t *next;
00755 hd_smbios_type_t type;
00756 int data_len;
00757 unsigned char *data;
00758 str_list_t *strings;
00759 int handle;
00760 str_list_t *options;
00761 } smbios_config_t;
00762
00763
00765 typedef struct {
00766 union u_hd_smbios_t *next;
00767 hd_smbios_type_t type;
00768 int data_len;
00769 unsigned char *data;
00770 str_list_t *strings;
00771 int handle;
00772 char *current;
00773 } smbios_lang_t;
00774
00775
00777 typedef struct {
00778 union u_hd_smbios_t *next;
00779 hd_smbios_type_t type;
00780 int data_len;
00781 unsigned char *data;
00782 str_list_t *strings;
00783 int handle;
00784 char *name;
00785 int items_len;
00786 int *item_handles;
00787 } smbios_group_t;
00788
00789
00791 typedef struct {
00792 union u_hd_smbios_t *next;
00793 hd_smbios_type_t type;
00794 int data_len;
00795 unsigned char *data;
00796 str_list_t *strings;
00797 int handle;
00798 hd_id_t location;
00799 hd_id_t use;
00800 hd_id_t ecc;
00801 unsigned max_size;
00802 int error_handle;
00803 unsigned slots;
00804 } smbios_memarray_t;
00805
00806
00808 typedef struct {
00809 union u_hd_smbios_t *next;
00810 hd_smbios_type_t type;
00811 int data_len;
00812 unsigned char *data;
00813 str_list_t *strings;
00814 int handle;
00815 char *location;
00816 char *bank;
00817 char *manuf;
00818 char *serial;
00819 char *asset;
00820 char *part;
00821 int array_handle;
00822 int error_handle;
00823 unsigned width;
00824 unsigned eccbits;
00825 unsigned size;
00826 hd_id_t form;
00827 unsigned set;
00828 hd_id_t mem_type;
00829 hd_bitmap_t type_detail;
00830 unsigned speed;
00831 } smbios_memdevice_t;
00832
00833
00835 typedef struct {
00836 union u_hd_smbios_t *next;
00837 hd_smbios_type_t type;
00838 int data_len;
00839 unsigned char *data;
00840 str_list_t *strings;
00841 int handle;
00842 hd_id_t err_type;
00843 hd_id_t granularity;
00844 hd_id_t operation;
00845 unsigned syndrome;
00846 unsigned array_addr;
00847 unsigned device_addr;
00848 unsigned range;
00849 } smbios_memerror_t;
00850
00851
00853 typedef struct {
00854 union u_hd_smbios_t *next;
00855 hd_smbios_type_t type;
00856 int data_len;
00857 unsigned char *data;
00858 str_list_t *strings;
00859 int handle;
00860 int array_handle;
00861 uint64_t start_addr;
00862 uint64_t end_addr;
00863 unsigned part_width;
00864 } smbios_memarraymap_t;
00865
00866
00868 typedef struct {
00869 union u_hd_smbios_t *next;
00870 hd_smbios_type_t type;
00871 int data_len;
00872 unsigned char *data;
00873 str_list_t *strings;
00874 int handle;
00875 int memdevice_handle;
00876 int arraymap_handle;
00877 uint64_t start_addr;
00878 uint64_t end_addr;
00879 unsigned row_pos;
00880 unsigned interleave_pos;
00881 unsigned interleave_depth;
00882 } smbios_memdevicemap_t;
00883
00884
00886 typedef struct {
00887 union u_hd_smbios_t *next;
00888 hd_smbios_type_t type;
00889 int data_len;
00890 unsigned char *data;
00891 str_list_t *strings;
00892 int handle;
00893 hd_id_t mtype;
00894 hd_id_t interface;
00895 unsigned buttons;
00896 } smbios_mouse_t;
00897
00898
00900 typedef struct {
00901 union u_hd_smbios_t *next;
00902 hd_smbios_type_t type;
00903 int data_len;
00904 unsigned char *data;
00905 str_list_t *strings;
00906 int handle;
00907 hd_id_t power;
00908 hd_id_t keyboard;
00909 hd_id_t admin;
00910 hd_id_t reset;
00911 } smbios_secure_t;
00912
00913
00915 typedef struct {
00916 union u_hd_smbios_t *next;
00917 hd_smbios_type_t type;
00918 int data_len;
00919 unsigned char *data;
00920 str_list_t *strings;
00921 int handle;
00922 unsigned month;
00923 unsigned day;
00924 unsigned hour;
00925 unsigned minute;
00926 unsigned second;
00927 } smbios_power_t;
00928
00929
00931 typedef struct {
00932 union u_hd_smbios_t *next;
00933 hd_smbios_type_t type;
00934 int data_len;
00935 unsigned char *data;
00936 str_list_t *strings;
00937 int handle;
00938 hd_id_t err_type;
00939 hd_id_t granularity;
00940 hd_id_t operation;
00941 unsigned syndrome;
00942 uint64_t array_addr;
00943 uint64_t device_addr;
00944 unsigned range;
00945 } smbios_mem64error_t;
00946
00947
00949 typedef union u_hd_smbios_t {
00950 union u_hd_smbios_t *next;
00951 smbios_any_t any;
00952 smbios_biosinfo_t biosinfo;
00953 smbios_sysinfo_t sysinfo;
00954 smbios_boardinfo_t boardinfo;
00955 smbios_chassis_t chassis;
00956 smbios_processor_t processor;
00957 smbios_cache_t cache;
00958 smbios_connect_t connect;
00959 smbios_slot_t slot;
00960 smbios_onboard_t onboard;
00961 smbios_oem_t oem;
00962 smbios_config_t config;
00963 smbios_lang_t lang;
00964 smbios_group_t group;
00965 smbios_memarray_t memarray;
00966 smbios_memdevice_t memdevice;
00967 smbios_memerror_t memerror;
00968 smbios_memarraymap_t memarraymap;
00969 smbios_memdevicemap_t memdevicemap;
00970 smbios_mouse_t mouse;
00971 smbios_secure_t secure;
00972 smbios_power_t power;
00973 smbios_mem64error_t mem64error;
00974 } hd_smbios_t;
00975
00983 typedef struct s_udevinfo_t {
00984 struct s_udevinfo_t *next;
00985 char *sysfs;
00986 char *name;
00987 str_list_t *links;
00988 } hd_udevinfo_t;
00989
00990
00994 typedef struct s_sysfsdrv_t {
00995 struct s_sysfsdrv_t *next;
00996 char *driver;
00997 char *device;
00998 char *module;
00999 } hd_sysfsdrv_t;
01000
01001
01007 typedef struct {
01008 int type;
01009 unsigned major, minor, range;
01010 } hd_dev_num_t;
01011
01012
01027 typedef struct s_pci_t {
01028 struct s_pci_t *next;
01029 unsigned data_len;
01030 unsigned data_ext_len;
01031 unsigned char data[256];
01032 char *log;
01033 unsigned flags,
01034 cmd,
01035 hdr_type,
01036 secondary_bus;
01037 unsigned bus,
01038 slot, func;
01039 unsigned base_class, sub_class, prog_if;
01040 unsigned dev, vend, sub_dev, sub_vend, rev;
01041 unsigned irq;
01042 uint64_t base_addr[7];
01043 uint64_t base_len[7];
01044 unsigned addr_flags[7];
01045 uint64_t rom_base_addr;
01046 uint64_t rom_base_len;
01047 char *sysfs_id;
01048 char *sysfs_bus_id;
01049 char *modalias;
01050 unsigned edid_len[4];
01051 unsigned char edid_data[4][0x80];
01052 } pci_t;
01053
01058 typedef enum pci_flags {
01059 pci_flag_ok, pci_flag_pm, pci_flag_agp
01060 } hd_pci_flags_t;
01061
01062
01067 typedef struct usb_s {
01068 struct usb_s *next;
01069 unsigned hd_idx;
01070 unsigned hd_base_idx;
01071 str_list_t *c, *d, *e, *i, *p, *s, *t;
01072 struct usb_s *cloned;
01073 int bus, dev_nr, lev, parent, port, count, conns, used_conns, ifdescr;
01074 unsigned speed;
01075 unsigned vendor, device, rev;
01076 char *manufact, *product, *serial;
01077 char *driver;
01078 memory_range_t raw_descr;
01079 int d_cls, d_sub, d_prot;
01080 int i_alt, i_cls, i_sub, i_prot;
01081 unsigned country;
01082 } usb_t;
01083
01084
01088 typedef struct {
01089 int len;
01090 int type;
01091 unsigned char *data;
01092 } isapnp_res_t;
01093
01097 typedef struct {
01098 int csn;
01099 int log_devs;
01100 unsigned char *serial;
01101 unsigned char *card_regs;
01102 unsigned char (*ldev_regs)[0xd0];
01103 int res_len;
01104 unsigned broken:1;
01105 isapnp_res_t *res;
01106 } isapnp_card_t;
01107
01111 typedef struct {
01112 int read_port;
01113 int cards;
01114 isapnp_card_t *card;
01115 } isapnp_t;
01116
01120 typedef struct {
01121 isapnp_card_t *card;
01122 int dev;
01123 unsigned flags;
01124 unsigned ref:1;
01125 } isapnp_dev_t;
01126
01131 typedef enum isapnp_flags {
01132 isapnp_flag_act
01133 } hd_isapnp_flags_t;
01134
01135
01139 typedef struct scsi_s {
01140 struct scsi_s *next;
01141 unsigned deleted:1;
01142 unsigned generic:1;
01143 unsigned fake:1;
01144 unsigned wwpn_ok:1;
01145 unsigned fcp_lun_ok:1;
01146 char *dev_name;
01147 char *guessed_dev_name;
01148 int generic_dev;
01149 unsigned host, channel, id, lun;
01150 char *vendor, *model, *rev, *type_str, *serial;
01151 int type;
01152 unsigned inode_low;
01153 char *proc_dir, *driver;
01154 unsigned unique;
01155 char *info;
01156 unsigned lgeo_c, lgeo_h, lgeo_s;
01157 unsigned pgeo_c, pgeo_h, pgeo_s;
01158 uint64_t size;
01159 unsigned sec_size;
01160 unsigned cache;
01161 str_list_t *host_info;
01162 char *usb_guid;
01163 unsigned pci_info;
01164 unsigned pci_bus;
01165 unsigned pci_slot;
01166 unsigned pci_func;
01167 uint64_t wwpn;
01168 uint64_t fcp_lun;
01169 char *controller_id;
01170 } scsi_t;
01171
01172
01176 typedef struct devtree_s {
01177 struct devtree_s *next;
01178 struct devtree_s *parent;
01179 unsigned idx;
01180 char *path, *filename;
01181 unsigned pci:1;
01182 char *name, *model, *device_type, *compatible;
01183 int class_code;
01184 int vendor_id, device_id, subvendor_id, subdevice_id;
01185 int revision_id, interrupt;
01186 unsigned char *edid;
01187 } devtree_t;
01188
01189 enum pmac_model {
01190 AAPL_3400,
01191 AAPL_3500,
01192 AAPL_7200,
01193 AAPL_7300,
01194 AAPL_7500,
01195 AAPL_8500,
01196 AAPL_9500,
01197 AAPL_Gossamer,
01198 AAPL_PowerBook1998,
01199 AAPL_PowerMac_G3,
01200 AAPL_ShinerESB,
01201 AAPL_e407,
01202 AAPL_e411,
01203 PowerBook1_1,
01204 PowerBook2_1,
01205 PowerBook2_2,
01206 PowerBook3_1,
01207 PowerBook3_2,
01208 PowerBook3_3,
01209 PowerBook3_4,
01210 PowerBook3_5,
01211 PowerBook4_1,
01212 PowerBook4_2,
01213 PowerBook4_3,
01214 PowerBook5_1,
01215 PowerBook5_2,
01216 PowerBook5_3,
01217 PowerBook5_4,
01218 PowerBook5_5,
01219 PowerBook5_6,
01220 PowerBook5_7,
01221 PowerBook5_8,
01222 PowerBook5_9,
01223 PowerBook6_1,
01224 PowerBook6_2,
01225 PowerBook6_3,
01226 PowerBook6_4,
01227 PowerBook6_5,
01228 PowerBook6_7,
01229 PowerBook6_8,
01230 PowerMac1_1,
01231 PowerMac1_2,
01232 PowerMac10_1,
01233 PowerMac11_2,
01234 PowerMac12_1,
01235 PowerMac2_1,
01236 PowerMac2_2,
01237 PowerMac3_1,
01238 PowerMac3_2,
01239 PowerMac3_3,
01240 PowerMac3_4,
01241 PowerMac3_5,
01242 PowerMac3_6,
01243 PowerMac4_1,
01244 PowerMac4_2,
01245 PowerMac4_4,
01246 PowerMac5_1,
01247 PowerMac6_1,
01248 PowerMac6_3,
01249 PowerMac6_4,
01250 PowerMac7_2,
01251 PowerMac7_3,
01252 PowerMac8_1,
01253 PowerMac9_1,
01254 RackMac1_1,
01255 RackMac1_2,
01256 RackMac3_1,
01257 iMac_1,
01258 };
01262 struct pmac_mb_def {
01263 enum pmac_model model;
01264 const char *string;
01265 };
01266
01270 typedef struct ccw_s {
01271 unsigned char lcss;
01272 unsigned char cu_model;
01273 unsigned char dev_model;
01274 } ccw_t;
01275
01279 typedef struct joystick_s {
01280 unsigned char buttons;
01281 unsigned char axes;
01282 } joystick_t;
01283
01287 typedef struct cdrom_info_s {
01288 struct cdrom_info_s *next;
01289 char *name;
01290 unsigned speed;
01291 unsigned cdr:1, cdrw:1, dvd:1, dvdr:1, dvdram:1;
01292 unsigned cdrom:1;
01293 struct {
01294 unsigned ok:1;
01295 char *volume, *publisher, *preparer, *application, *creation_date;
01296 } iso9660;
01297 struct {
01298 unsigned ok:1;
01299 unsigned platform;
01300 char *id_string;
01301 unsigned bootable:1;
01302 unsigned media_type;
01303 unsigned load_address;
01304 unsigned load_count;
01305 unsigned start;
01306 unsigned catalog;
01307 struct {
01308 unsigned c, h, s;
01309 unsigned size;
01310 } geo;
01311 char *label;
01312 } el_torito;
01313
01314 } cdrom_info_t;
01315
01316
01322 typedef struct {
01323 unsigned char block0[512];
01324 } floppy_info_t;
01325
01326
01330 typedef struct {
01331 unsigned apm_supported:1;
01332 unsigned apm_enabled:1;
01333 unsigned apm_ver, apm_subver;
01334 unsigned apm_bios_flags;
01335
01336 unsigned vbe_ver;
01337 unsigned vbe_video_mem;
01338
01339 unsigned ser_port0, ser_port1, ser_port2, ser_port3;
01340 unsigned par_port0, par_port1, par_port2;
01341
01343 unsigned is_pnp_bios:1;
01344 unsigned pnp_id;
01345 unsigned lba_support:1;
01346
01347 unsigned low_mem_size;
01348 smp_info_t smp;
01349 vbe_info_t vbe;
01350
01351 unsigned smbios_ver;
01352
01353 struct {
01354 unsigned width;
01355 unsigned height;
01356 unsigned xsize;
01357 unsigned ysize;
01358 char *vendor;
01359 char *name;
01360 } lcd;
01361
01362 struct {
01363 char *vendor;
01364 char *type;
01365 unsigned bus;
01366 unsigned compat_vend;
01367 unsigned compat_dev;
01368 } mouse;
01369
01370 struct {
01371 unsigned ok:1;
01372 unsigned scroll_lock:1;
01373 unsigned num_lock:1;
01374 unsigned caps_lock:1;
01375 } led;
01376
01377 bios32_info_t bios32;
01378
01379 } bios_info_t;
01380
01381
01385 typedef struct {
01386 unsigned has_color:1;
01387 unsigned color;
01388 } prom_info_t;
01389
01390
01394 typedef struct {
01395 char *system_type;
01396 char *generation;
01397 char *vendor;
01398 char *model;
01399 char *serial;
01400 char *lang;
01401 char *formfactor;
01402 } sys_info_t;
01403
01404
01408 typedef struct {
01409 unsigned manu_year;
01410 unsigned min_vsync, max_vsync;
01411 unsigned min_hsync, max_hsync;
01412 unsigned clock;
01413 unsigned width, height;
01414 unsigned width_mm, height_mm;
01415 unsigned hdisp, hsyncstart, hsyncend, htotal;
01416 unsigned vdisp, vsyncstart, vsyncend, vtotal;
01417 char hflag,vflag;
01418 char *vendor;
01419 char *name;
01420 char *serial;
01421 } monitor_info_t;
01422
01429 typedef enum cpu_arch {
01430 arch_unknown = 0,
01431 arch_intel,
01432 arch_alpha,
01433 arch_sparc, arch_sparc64,
01434 arch_ppc, arch_ppc64,
01435 arch_68k,
01436 arch_ia64,
01437 arch_s390, arch_s390x,
01438 arch_arm,
01439 arch_mips,
01440 arch_x86_64,
01441 arch_aarch64
01442 } hd_cpu_arch_t;
01443
01447 typedef enum boot_arch {
01448 boot_unknown = 0,
01449 boot_lilo, boot_milo, boot_aboot, boot_silo, boot_ppc, boot_elilo, boot_s390,
01450 boot_mips, boot_grub, boot_uboot,
01451 } hd_boot_arch_t;
01452
01453
01462 typedef struct {
01463 enum cpu_arch architecture;
01464 unsigned family;
01465 unsigned model;
01466 unsigned stepping;
01467 unsigned cache;
01468 unsigned clock;
01469 unsigned units;
01470 char *vend_name;
01471 char *model_name;
01472 char *platform;
01473 str_list_t *features;
01474 double bogo;
01475 } cpu_info_t;
01476
01477
01482 typedef struct {
01483 uint64_t sectors;
01484 struct {
01485 unsigned cyls, heads, sectors;
01486 } edd;
01487 struct {
01488 unsigned cyls, heads, sectors;
01489 } legacy;
01490 unsigned ext_fixed_disk:1;
01491 unsigned ext_lock_eject:1;
01492 unsigned ext_edd:1;
01493 unsigned ext_64bit:1;
01494 unsigned assigned:1;
01495 unsigned valid:1;
01496 unsigned ext_fibre:1;
01497 unsigned ext_net:1;
01498 char *sysfs_id;
01499 unsigned hd_idx;
01500 unsigned signature;
01501 } edd_info_t;
01502
01508 typedef struct {
01509 unsigned data_len, data_max;
01510 unsigned *data;
01511 unsigned names_len, names_max;
01512 char *names;
01513 } hddb_data_t;
01514
01518 typedef uint32_t hddb_entry_mask_t;
01519
01523 typedef struct hddb_list_s {
01524 hddb_entry_mask_t key_mask;
01525 hddb_entry_mask_t value_mask;
01526 unsigned key;
01527 unsigned value;
01528 } hddb_list_t;
01529
01533 typedef struct {
01534 unsigned list_len, list_max;
01535 hddb_list_t *list;
01536 unsigned ids_len, ids_max;
01537 unsigned *ids;
01538 unsigned strings_len, strings_max;
01539 char *strings;
01540 } hddb2_data_t;
01541
01542
01546 typedef enum modinfo_type_e { mi_none = 0, mi_pci, mi_other } modinfo_type_t;
01547
01551 typedef struct {
01552 char *module;
01553 char *alias;
01554 modinfo_type_t type;
01555 union {
01556 struct {
01557 struct {
01558 unsigned vendor:1;
01559 unsigned device:1;
01560 unsigned sub_vendor:1;
01561 unsigned sub_device:1;
01562 unsigned base_class:1;
01563 unsigned sub_class:1;
01564 unsigned prog_if:1;
01565 } has;
01566 unsigned vendor;
01567 unsigned device;
01568 unsigned sub_vendor;
01569 unsigned sub_device;
01570 unsigned base_class;
01571 unsigned sub_class;
01572 unsigned prog_if;
01573 } pci;
01574
01575 struct {
01576 struct {
01577 unsigned vendor:1;
01578 unsigned product:1;
01579 unsigned device_class:1;
01580 unsigned device_subclass:1;
01581 } has;
01582 unsigned vendor;
01583 unsigned product;
01584 unsigned device_class;
01585 unsigned device_subclass;
01586 } usb;
01587 };
01588 } modinfo_t;
01589
01590
01594 typedef enum {
01595 p_invalid, p_string, p_int32, p_uint64, p_double, p_bool, p_list
01596 } hal_prop_type_t;
01597
01598
01602 typedef struct hal_prop_s {
01603 struct hal_prop_s *next;
01604 hal_prop_type_t type;
01605 char *key;
01606 union {
01607 char *str;
01608 int32_t int32;
01609 uint64_t uint64;
01610 double d;
01611 int b;
01612 str_list_t *list;
01613 } val;
01614 } hal_prop_t;
01615
01616
01620 typedef struct hal_device_s {
01621 struct hal_device_s *next, *parent;
01622 char *udi;
01623 unsigned used:1;
01624 hal_prop_t *prop;
01625 } hal_device_t;
01626
01630 typedef enum resource_types {
01631 res_any, res_phys_mem, res_mem, res_io, res_irq, res_dma, res_monitor,
01632 res_size, res_disk_geo, res_cache, res_baud, res_init_strings, res_pppd_option,
01633 res_framebuffer, res_hwaddr, res_link, res_wlan, res_fc
01634 } hd_resource_types_t;
01635
01636
01640 typedef enum size_units {
01641 size_unit_cm, size_unit_cinch, size_unit_byte, size_unit_sectors,
01642 size_unit_kbyte, size_unit_mbyte, size_unit_gbyte, size_unit_mm
01643 } hd_size_units_t;
01644
01648 typedef enum access_flags {
01649 acc_unknown,
01650 acc_ro,
01651 acc_wo,
01652 acc_rw
01653 } hd_access_flags_t;
01654
01655
01656 typedef enum yes_no_flag {
01657 flag_unknown,
01658 flag_no,
01659 flag_yes
01660 } hd_yes_no_flag_t;
01661
01662
01663 typedef enum geo_types {
01664 geo_physical = 0,
01665 geo_logical,
01666 geo_bios_edd,
01667 geo_bios_legacy
01668 } hd_geo_types_t;
01669
01670
01677 typedef struct {
01678 union u_hd_res_t *next;
01679 enum resource_types type;
01680 } res_any_t;
01681
01682 typedef struct {
01683 union u_hd_res_t *next;
01684 enum resource_types type;
01685 uint64_t base, range;
01686 unsigned
01687 enabled:1,
01688 access:2,
01689 prefetch:2;
01690 } res_mem_t;
01691
01692 typedef struct {
01693 union u_hd_res_t *next;
01694 enum resource_types type;
01695 uint64_t range;
01696 } res_phys_mem_t;
01697
01698 typedef struct {
01699 union u_hd_res_t *next;
01700 enum resource_types type;
01701 uint64_t base, range;
01702 unsigned
01703 enabled:1,
01704 access:2;
01705 } res_io_t;
01706
01707 typedef struct {
01708 union u_hd_res_t *next;
01709 enum resource_types type;
01710 unsigned base;
01711 unsigned triggered;
01712 unsigned enabled:1;
01713 } res_irq_t;
01714
01715 typedef struct {
01716 union u_hd_res_t *next;
01717 enum resource_types type;
01718 unsigned base;
01719 unsigned enabled:1;
01720 } res_dma_t;
01721
01722 typedef struct {
01723 union u_hd_res_t *next;
01724 enum resource_types type;
01725 enum size_units unit;
01726 uint64_t val1, val2;
01727 } res_size_t;
01728
01729 typedef struct {
01730 union u_hd_res_t *next;
01731 enum resource_types type;
01732 unsigned speed;
01733 unsigned bits, stopbits;
01734 char parity;
01735 char handshake;
01736 } res_baud_t;
01737
01738 typedef struct {
01739 union u_hd_res_t *next;
01740 enum resource_types type;
01741 unsigned size;
01742 } res_cache_t;
01743
01744 typedef struct {
01745 union u_hd_res_t *next;
01746 enum resource_types type;
01747 unsigned cyls, heads, sectors;
01748 uint64_t size;
01749 enum geo_types geotype;
01750 } res_disk_geo_t;
01751
01752 typedef struct {
01753 union u_hd_res_t *next;
01754 enum resource_types type;
01755 unsigned width, height;
01756 unsigned vfreq;
01757 unsigned interlaced:1;
01758 } res_monitor_t;
01759
01760 typedef struct {
01761 union u_hd_res_t *next;
01762 enum resource_types type;
01763 char *init1;
01764 char *init2;
01765 } res_init_strings_t;
01766
01767 typedef struct {
01768 union u_hd_res_t *next;
01769 enum resource_types type;
01770 char *option;
01771 } res_pppd_option_t;
01772
01773 typedef struct {
01774 union u_hd_res_t *next;
01775 enum resource_types type;
01776 unsigned width, height;
01777 unsigned bytes_p_line;
01778 unsigned colorbits;
01779 unsigned mode;
01780 } res_framebuffer_t;
01781
01782 typedef struct {
01783 union u_hd_res_t *next;
01784 enum resource_types type;
01785 char *addr;
01786 } res_hwaddr_t;
01787
01788 typedef struct {
01789 union u_hd_res_t *next;
01790 enum resource_types type;
01791 unsigned state:1;
01792 } res_link_t;
01793
01795 typedef struct {
01796 union u_hd_res_t *next;
01797 enum resource_types type;
01798 str_list_t *channels;
01799 str_list_t *frequencies;
01800 str_list_t *bitrates;
01801 str_list_t *auth_modes;
01802 str_list_t *enc_modes;
01803 } res_wlan_t;
01804
01805 typedef struct {
01806 union u_hd_res_t *next;
01807 enum resource_types type;
01808 unsigned wwpn_ok:1;
01809 unsigned fcp_lun_ok:1;
01810 unsigned port_id_ok:1;
01811 uint64_t wwpn;
01812 uint64_t fcp_lun;
01813 unsigned port_id;
01814 char *controller_id;
01815 } res_fc_t;
01816
01818 typedef union u_hd_res_t {
01819 union u_hd_res_t *next;
01820 res_any_t any;
01821 res_io_t io;
01822 res_mem_t mem;
01823 res_phys_mem_t phys_mem;
01824 res_irq_t irq;
01825 res_dma_t dma;
01826 res_size_t size;
01827 res_cache_t cache;
01828 res_baud_t baud;
01829 res_disk_geo_t disk_geo;
01830 res_monitor_t monitor;
01831 res_init_strings_t init_strings;
01832 res_pppd_option_t pppd_option;
01833 res_framebuffer_t framebuffer;
01834 res_hwaddr_t hwaddr;
01835 res_link_t link;
01836 res_wlan_t wlan;
01837 res_fc_t fc;
01838 } hd_res_t;
01839
01848 typedef struct {
01849 uint64_t addr, size;
01850 char *dev;
01851 unsigned tag;
01852 } misc_io_t;
01853
01854 typedef struct {
01855 unsigned channel;
01856 char *dev;
01857 unsigned tag;
01858 } misc_dma_t;
01859
01860 typedef struct {
01861 unsigned irq, events;
01862 int devs;
01863 char **dev;
01864 unsigned tag;
01865 } misc_irq_t;
01866
01867 typedef struct {
01868 unsigned io_len, dma_len, irq_len;
01869 misc_io_t *io;
01870 misc_dma_t *dma;
01871 misc_irq_t *irq;
01872 str_list_t *proc_io, *proc_dma, *proc_irq;
01873 } misc_t;
01874
01880 typedef struct s_serial_t {
01881 struct s_serial_t *next;
01882 char *name;
01883 char *device;
01884 unsigned line, port, irq, baud;
01885 } serial_t;
01886
01890 typedef struct s_ser_device_t {
01891 struct s_ser_device_t *next;
01892 unsigned hd_idx;
01893 char *dev_name;
01894 str_list_t *at_resp;
01895 int fd;
01896 struct termios tio;
01897 unsigned max_baud, cur_baud;
01898 unsigned is_mouse:1;
01899 unsigned is_modem:1;
01900 unsigned do_io:1;
01901 unsigned char buf[0x1000];
01902 int buf_len;
01903 int garbage, non_pnp, pnp;
01904 unsigned char pnp_id[8];
01905 char *serial, *class_name, *dev_id, *user_name, *vend, *init_string1, *init_string2, *pppd_option;
01906 unsigned pnp_rev;
01907 unsigned bits;
01908 } ser_device_t;
01909
01923 typedef struct isdn_parm_s {
01924 struct isdn_parm_s *next;
01925 char *name;
01926 unsigned valid:1;
01927 unsigned conflict:1;
01928 uint64_t value;
01929 unsigned type;
01930 unsigned flags;
01931 unsigned def_value;
01932 int alt_values;
01933 unsigned *alt_value;
01934 } isdn_parm_t;
01935
01937 typedef enum driver_info_type {
01938 di_any, di_display, di_module, di_mouse, di_x11, di_isdn, di_kbd, di_dsl
01939 } hd_driver_info_t;
01940
01942 typedef struct {
01943 union driver_info_u *next;
01944 enum driver_info_type type;
01945 str_list_t *hddb0, *hddb1;
01946 } driver_info_any_t;
01947
01949 typedef struct {
01950 union driver_info_u *next;
01951 enum driver_info_type type;
01952 str_list_t *hddb0, *hddb1;
01953 unsigned width, height;
01954 unsigned min_vsync, max_vsync;
01955 unsigned min_hsync, max_hsync;
01956 unsigned bandwidth;
01957 unsigned hdisp, hsyncstart, hsyncend, htotal;
01958 unsigned vdisp, vsyncstart, vsyncend, vtotal;
01959 char hflag,vflag;
01960 } driver_info_display_t;
01961
01963 typedef struct {
01964 union driver_info_u *next;
01965 enum driver_info_type type;
01966 str_list_t *hddb0, *hddb1;
01967 unsigned active:1;
01968 unsigned modprobe:1;
01969 str_list_t *names;
01970 str_list_t *mod_args;
01971 char *conf;
01972 } driver_info_module_t;
01973
01975 typedef struct {
01976 union driver_info_u *next;
01977 enum driver_info_type type;
01978 str_list_t *hddb0, *hddb1;
01979 char *xf86;
01980 char *gpm;
01981 int buttons;
01982 int wheels;
01983 } driver_info_mouse_t;
01984
01986 typedef struct {
01987 union driver_info_u *next;
01988 enum driver_info_type type;
01989 str_list_t *hddb0, *hddb1;
01990 char *server;
01991 char *xf86_ver;
01992 unsigned x3d:1;
01993 struct {
01994 unsigned all:5;
01995 unsigned c8:1, c15:1, c16:1, c24:1, c32:1;
01996 } colors;
01997 unsigned dacspeed;
01998 str_list_t *extensions;
01999 str_list_t *options;
02000 str_list_t *raw;
02001 char *script;
02002 } driver_info_x11_t;
02003
02005 typedef struct {
02006 union driver_info_u *next;
02007 enum driver_info_type type;
02008 str_list_t *hddb0, *hddb1;
02009 int i4l_type, i4l_subtype;
02010 char *i4l_name;
02011 isdn_parm_t *params;
02012 } driver_info_isdn_t;
02013
02015 typedef struct {
02016 union driver_info_u *next;
02017 enum driver_info_type type;
02018 str_list_t *hddb0, *hddb1;
02019 char *mode;
02020 char *name;
02021 } driver_info_dsl_t;
02022
02024 typedef struct {
02025 union driver_info_u *next;
02026 enum driver_info_type type;
02027 str_list_t *hddb0, *hddb1;
02028 char *XkbRules;
02029 char *XkbModel;
02030 char *XkbLayout;
02031 char *keymap;
02032 } driver_info_kbd_t;
02033
02034
02035
02036
02037 typedef union driver_info_u {
02038 union driver_info_u *next;
02039 driver_info_any_t any;
02040 driver_info_module_t module;
02041 driver_info_mouse_t mouse;
02042 driver_info_x11_t x11;
02043 driver_info_display_t display;
02044 driver_info_isdn_t isdn;
02045 driver_info_dsl_t dsl;
02046 driver_info_kbd_t kbd;
02047 } driver_info_t;
02048
02059 typedef enum hd_detail_type {
02060 hd_detail_pci, hd_detail_usb, hd_detail_isapnp, hd_detail_cdrom,
02061 hd_detail_floppy, hd_detail_bios, hd_detail_cpu, hd_detail_prom,
02062 hd_detail_monitor, hd_detail_sys, hd_detail_scsi, hd_detail_devtree,
02063 hd_detail_ccw, hd_detail_joystick
02064 } hd_detail_type_t;
02065
02066 typedef struct {
02067 enum hd_detail_type type;
02068 pci_t *data;
02069 } hd_detail_pci_t;
02070
02071 typedef struct {
02072 enum hd_detail_type type;
02073 usb_t *data;
02074 } hd_detail_usb_t;
02075
02076 typedef struct {
02077 enum hd_detail_type type;
02078 isapnp_dev_t *data;
02079 } hd_detail_isapnp_t;
02080
02081 typedef struct {
02082 enum hd_detail_type type;
02083 cdrom_info_t *data;
02084 } hd_detail_cdrom_t;
02085
02086 typedef struct {
02087 enum hd_detail_type type;
02088 floppy_info_t *data;
02089 } hd_detail_floppy_t;
02090
02091 typedef struct {
02092 enum hd_detail_type type;
02093 bios_info_t *data;
02094 } hd_detail_bios_t;
02095
02096 typedef struct {
02097 enum hd_detail_type type;
02098 cpu_info_t *data;
02099 } hd_detail_cpu_t;
02100
02101 typedef struct {
02102 enum hd_detail_type type;
02103 prom_info_t *data;
02104 } hd_detail_prom_t;
02105
02106 typedef struct hd_detail_monitor_s {
02107 enum hd_detail_type type;
02108 monitor_info_t *data;
02109 struct hd_detail_monitor_s *next;
02110 } hd_detail_monitor_t;
02111
02112 typedef struct {
02113 enum hd_detail_type type;
02114 sys_info_t *data;
02115 } hd_detail_sys_t;
02116
02117 typedef struct {
02118 enum hd_detail_type type;
02119 scsi_t *data;
02120 } hd_detail_scsi_t;
02121
02122 typedef struct {
02123 enum hd_detail_type type;
02124 devtree_t *data;
02125 } hd_detail_devtree_t;
02126
02127 typedef struct {
02128 enum hd_detail_type type;
02129 ccw_t *data;
02130 } hd_detail_ccw_t;
02131
02132 typedef struct {
02133 enum hd_detail_type type;
02134 joystick_t *data;
02135 } hd_detail_joystick_t;
02136
02137 typedef union {
02138 enum hd_detail_type type;
02139 hd_detail_pci_t pci;
02140 hd_detail_usb_t usb;
02141 hd_detail_isapnp_t isapnp;
02142 hd_detail_cdrom_t cdrom;
02143 hd_detail_floppy_t floppy;
02144 hd_detail_bios_t bios;
02145 hd_detail_cpu_t cpu;
02146 hd_detail_prom_t prom;
02147 hd_detail_monitor_t monitor;
02148 hd_detail_sys_t sys;
02149 hd_detail_scsi_t scsi;
02150 hd_detail_devtree_t devtree;
02151 hd_detail_ccw_t ccw;
02152 hd_detail_joystick_t joystick;
02153 } hd_detail_t;
02154
02167 typedef struct hd_manual_s {
02168 struct hd_manual_s *next;
02169
02170 char *unique_id;
02171 char *parent_id;
02172 char *child_ids;
02173 unsigned hw_class;
02174 char *model;
02175
02176 hd_status_t status;
02177 char *config_string;
02178
02179
02180
02181
02182 str_list_t *key;
02183 str_list_t *value;
02184 } hd_manual_t;
02185
02186
02192 typedef struct s_hd_t {
02193 struct s_hd_t *next;
02199 unsigned idx;
02200
02206 unsigned broken:1;
02207
02211 hd_id_t bus;
02212
02217 unsigned slot;
02218
02222 unsigned func;
02223
02227 hd_id_t base_class;
02228
02232 hd_id_t sub_class;
02233
02237 hd_id_t prog_if;
02238
02245 hd_id_t vendor;
02246
02255 hd_id_t device;
02256
02263 hd_id_t sub_vendor;
02264
02271 hd_id_t sub_device;
02272
02278 hd_id_t revision;
02279
02283 char *serial;
02284
02289 hd_id_t compat_vendor;
02290
02295 hd_id_t compat_device;
02296
02301 hd_hw_item_t hw_class;
02302
02307 unsigned char hw_class_list[(hw_all + 7) / 8];
02315 char *model;
02316
02322 unsigned attached_to;
02323
02327 char *sysfs_id;
02328
02332 char *sysfs_bus_id;
02333
02337 char *sysfs_device_link;
02338
02344 char *unix_dev_name;
02345
02349 hd_dev_num_t unix_dev_num;
02350
02357 str_list_t *unix_dev_names;
02358
02365 char *unix_dev_name2;
02366
02370 hd_dev_num_t unix_dev_num2;
02371
02378 char *rom_id;
02379
02383 char *udi;
02384
02388 char *parent_udi;
02389
02400 char *unique_id;
02401
02403 str_list_t *unique_ids;
02404
02408 unsigned module;
02409
02413 unsigned line;
02414
02418 unsigned count;
02419
02423 hd_res_t *res;
02424
02429 hd_detail_t *detail;
02430
02436 str_list_t *extra_info;
02437
02443 hd_status_t status;
02444
02451 char *config_string;
02452
02457 hd_hotplug_t hotplug;
02458
02463 unsigned hotplug_slot;
02464
02465 struct is_s {
02466 unsigned agp:1;
02467 unsigned isapnp:1;
02468 unsigned notready:1;
02469 unsigned manual:1;
02470 unsigned softraiddisk:1;
02471 unsigned zip:1;
02472 unsigned cdr:1;
02473 unsigned cdrw:1;
02474 unsigned dvd:1;
02475 unsigned dvdr:1;
02476 unsigned dvdrw:1;
02477 unsigned dvdrdl:1;
02478 unsigned dvdpr:1;
02479 unsigned dvdprw:1;
02480 unsigned dvdprdl:1;
02481 unsigned dvdprwdl:1;
02482 unsigned bd:1;
02483 unsigned bdr:1;
02484 unsigned bdre:1;
02485 unsigned hd:1;
02486 unsigned hdr:1;
02487 unsigned hdrw:1;
02488 unsigned dvdram:1;
02489 unsigned mo:1;
02490 unsigned mrw:1;
02491 unsigned mrww:1;
02492 unsigned pppoe:1;
02493 unsigned wlan:1;
02494 unsigned with_acpi:1;
02495 unsigned hotpluggable:1;
02496 unsigned dualport:1;
02497 unsigned fcoe:1;
02498 } is;
02499
02500 struct tag_s {
02501 unsigned remove:1;
02502 unsigned freeit:1;
02503 unsigned fixed:1;
02504 unsigned skip_mouse:1;
02505 unsigned skip_modem:1;
02506 unsigned skip_braille:1;
02507 unsigned ser_device:2;
02508 } tag;
02509
02515 unsigned char *block0;
02516
02520 char *driver;
02521
02525 char *driver_module;
02526
02530 str_list_t *drivers;
02531
02535 str_list_t *driver_modules;
02536
02544 char *old_unique_id;
02545
02551 char *parent_id;
02552
02558 str_list_t *child_ids;
02559
02564 char *unique_id1;
02565
02572 char *usb_guid;
02573
02574 driver_info_t *driver_info;
02576 str_list_t *requires;
02578 hal_prop_t *hal_prop;
02580 hal_prop_t *persistent_prop;
02582 char *modalias;
02584
02585
02586
02587
02588 unsigned ref_cnt;
02589 struct s_hd_t *ref;
02590 } hd_t;
02591
02592
02596 typedef struct {
02602 hd_t *hd;
02603
02612 void (*progress)(char *pos, char *msg);
02613
02618 char *log;
02619
02627 unsigned debug;
02628
02634 struct flag_struct {
02635 unsigned internal:1;
02636 unsigned dformat:2;
02637 unsigned no_parport:1;
02638 unsigned iseries:1;
02639 unsigned list_all:1;
02640 unsigned fast:1;
02641 unsigned list_md:1;
02642 unsigned nofork:1;
02643 unsigned nosysfs:1;
02644 unsigned forked:1;
02645 unsigned cpuemu:1;
02646 unsigned udev:1;
02647 unsigned edd_used:1;
02648 unsigned keep_kmods:2;
02649 unsigned nobioscrc:1;
02650 unsigned biosvram:1;
02651 unsigned nowpa:1;
02652 unsigned pata:1;
02653 unsigned vbox:1;
02654 unsigned vmware:1;
02655 unsigned vmware_mouse:1;
02656 } flags;
02657
02658
02663 str_list_t *only;
02664
02665
02666
02667
02668 unsigned char probe[(pr_all + 7) / 8];
02669 unsigned char probe_set[(pr_all + 7) / 8];
02670 unsigned char probe_clr[(pr_all + 7) / 8];
02671 hal_prop_t *probe_val;
02672 unsigned last_idx;
02673 unsigned module;
02674 enum boot_arch boot;
02675 hd_t *old_hd;
02676 pci_t *pci;
02677 isapnp_t *isapnp;
02678 cdrom_info_t *cdrom;
02679 str_list_t *net;
02680 str_list_t *floppy;
02681 misc_t *misc;
02682 serial_t *serial;
02683 scsi_t *scsi;
02684 ser_device_t *ser_mouse;
02685 ser_device_t *ser_modem;
02686 str_list_t *cpu;
02687 str_list_t *klog;
02688 str_list_t *proc_usb;
02689 usb_t *usb;
02690 modinfo_t *modinfo_ext;
02691 modinfo_t *modinfo;
02692 hddb2_data_t *hddb2[2];
02693 str_list_t *kmods;
02694 uint64_t used_irqs;
02695 uint64_t assigned_irqs;
02696 memory_range_t bios_rom;
02697 memory_range_t bios_ram;
02698 memory_range_t bios_ebda;
02699 unsigned display;
02700 unsigned color_code;
02701 char *cmd_line;
02702 str_list_t *xtra_hd;
02703 devtree_t *devtree;
02704 unsigned kernel_version;
02705 hd_t *manual;
02706 str_list_t *disks;
02707 str_list_t *partitions;
02708 str_list_t *cdroms;
02709 hd_smbios_t *smbios;
02710 struct {
02711 unsigned ok:1;
02712 unsigned size;
02713 unsigned used;
02714 void *data;
02715 int id;
02716 int updated;
02717 } shm;
02718 unsigned pci_config_type;
02719 hd_udevinfo_t *udevinfo;
02720 hd_sysfsdrv_t *sysfsdrv;
02721 uint64_t sysfsdrv_id;
02722 str_list_t *scanner_db;
02723 edd_info_t edd[0x80];
02724 hal_device_t *hal;
02725 str_list_t *lsscsi;
02726 struct vm_s *vm;
02727 size_t log_size;
02728 size_t log_max;
02729 str_list_t *klog_raw;
02730 } hd_data_t;
02731
02732
02733
02734
02735
02736
02737
02738
02739
02740
02741
02743 void hd_scan(hd_data_t *hd_data);
02744
02746 hd_data_t *hd_free_hd_data(hd_data_t *hd_data);
02747
02749 hd_t *hd_free_hd_list(hd_t *hd);
02750
02751 void hd_set_probe_feature(hd_data_t *hd_data, enum probe_feature feature);
02752 void hd_clear_probe_feature(hd_data_t *hd_data, enum probe_feature feature);
02753 int hd_probe_feature(hd_data_t *hd_data, enum probe_feature feature);
02754 void hd_set_probe_feature_hw(hd_data_t *hd_data, hd_hw_item_t item);
02755
02756 enum probe_feature hd_probe_feature_by_name(char *name);
02757 char *hd_probe_feature_by_value(enum probe_feature feature);
02758
02759 int hd_module_is_active(hd_data_t *hd_data, char *mod);
02760
02761 hd_t *hd_base_class_list(hd_data_t *hd_data, unsigned base_class);
02762 hd_t *hd_sub_class_list(hd_data_t *hd_data, unsigned base_class, unsigned sub_class);
02763 hd_t *hd_bus_list(hd_data_t *hd_data, unsigned bus);
02764 const char* hd_busid_to_hwcfg(int busid);
02765 hd_t *hd_list(hd_data_t *hd_data, hd_hw_item_t item, int rescan, hd_t *hd_old);
02766 hd_t *hd_list_with_status(hd_data_t *hd_data, hd_hw_item_t item, hd_status_t status);
02767 hd_t *hd_list2(hd_data_t *hd_data, hd_hw_item_t *items, int rescan);
02768 hd_t *hd_list_with_status2(hd_data_t *hd_data, hd_hw_item_t *items, hd_status_t status);
02769
02770 void hd_add_driver_data(hd_data_t *hd_data, hd_t *hd);
02771
02772 int hd_has_pcmcia(hd_data_t *hd_data);
02773 #if 0
02774
02778 int hd_apm_enabled(hd_data_t *hd_data);
02779 #endif
02780 int hd_usb_support(hd_data_t *hd_data);
02781 int hd_smp_support(hd_data_t *hd_data);
02782 int hd_mac_color(hd_data_t *hd_data);
02783 int hd_color(hd_data_t *hd_data);
02784 int hd_is_uml(hd_data_t *hd_data);
02785 int hd_is_xen(hd_data_t *hd_data);
02786 unsigned hd_display_adapter(hd_data_t *hd_data);
02787 unsigned hd_boot_disk(hd_data_t *hd_data, int *matches);
02788 enum cpu_arch hd_cpu_arch(hd_data_t *hd_data);
02789 enum boot_arch hd_boot_arch(hd_data_t *hd_data);
02790
02791 hd_t *hd_get_device_by_idx(hd_data_t *hd_data, unsigned idx);
02792
02793 void hd_set_hw_class(hd_t *hd, hd_hw_item_t hw_class);
02794 int hd_is_hw_class(hd_t *hd, hd_hw_item_t hw_class);
02795
02796 int hd_is_sgi_altix(hd_data_t *hd_data);
02797
02798 char *hd_version(void);
02799
02800 hal_prop_t *hd_free_hal_properties(hal_prop_t *prop);
02801 hal_prop_t *hd_read_properties(const char *udi);
02802 int hd_write_properties(const char *udi, hal_prop_t *prop);
02803
02804 int hd_change_status(const char *id, hd_status_t status, const char *config_string);
02805 int hd_change_config_status(hd_data_t *hd_data, const char *id, hd_status_t status, const char *config_string);
02806 int hd_read_mmap(hd_data_t *hd_data, char *name, unsigned char *buf, off_t start, unsigned size);
02807
02808
02809
02813 str_list_t *hddb_get_packages(hd_data_t *hd_data);
02814 void hddb_add_info(hd_data_t *hd_data, hd_t *hd);
02815
02816 void hddb_dump_raw(hddb2_data_t *hddb, FILE *f);
02817 void hddb_dump(hddb2_data_t *hddb, FILE *f);
02818
02819
02820
02821 void hd_dump_entry(hd_data_t *hd_data, hd_t *hd, FILE *f);
02822
02823
02824 cdrom_info_t *hd_read_cdrom_info(hd_data_t *hd_data, hd_t *hd);
02825
02833 hd_manual_t *hd_manual_read_entry(hd_data_t *hd_data, const char *id);
02834 int hd_manual_write_entry(hd_data_t *hd_data, hd_manual_t *entry);
02835 hd_manual_t *hd_free_manual(hd_manual_t *manual);
02836 hd_t *hd_read_config(hd_data_t *hd_data, const char *id);
02837 int hd_write_config(hd_data_t *hd_data, hd_t *hd);
02838 char *hd_hw_item_name(hd_hw_item_t item);
02839 hd_hw_item_t hd_hw_item_type(char *name);
02840 char *hd_status_value_name(hd_status_value_t status);
02841
02852 #define CDBISDN_VERSION 0x0101
02853
02854 #ifndef PCI_ANY_ID
02855 #define PCI_ANY_ID 0xffff
02856 #endif
02857
02858 #define CDBISDN_P_NONE 0x0
02859 #define CDBISDN_P_IRQ 0x1
02860 #define CDBISDN_P_MEM 0x2
02861 #define CDBISDN_P_IO 0x3
02862
02864 typedef struct {
02865 char *name;
02866 char *shortname;
02867 int vnr;
02868 int refcnt;
02869 } cdb_isdn_vendor;
02870
02871 typedef struct {
02872 int handle;
02873 int vhandle;
02874 char *name;
02875 char *lname;
02876 char *Class;
02877 char *bus;
02878 int revision;
02879 int vendor;
02880 int device;
02881 int subvendor;
02883 int subdevice;
02885 unsigned int features;
02886 int line_cnt;
02887 int vario_cnt;
02888 int vario;
02889 } cdb_isdn_card;
02890
02891 typedef struct {
02892 int handle;
02893 int next_vario;
02894 int drvid;
02895 int typ;
02896 int subtyp;
02897 int smp;
02898 char *mod_name;
02899 char *para_str;
02900 char *mod_preload;
02901 char *cfg_prog;
02902 char *firmware;
02903 char *description;
02904 char *need_pkg;
02905 char *info;
02906 char *protocol;
02907 char *interface;
02908 char *io;
02909 char *irq;
02910 char *membase;
02911 char *features;
02912 int card_ref;
02913 char *name;
02914 } cdb_isdn_vario;
02915
02916
02917 extern cdb_isdn_vendor *hd_cdbisdn_get_vendor(int);
02918 extern cdb_isdn_card *hd_cdbisdn_get_card(int);
02919 extern cdb_isdn_vario *hd_cdbisdn_get_vario_from_type(int, int);
02920 extern cdb_isdn_card *hd_cdbisdn_get_card_from_type(int, int);
02921 extern cdb_isdn_card *hd_cdbisdn_get_card_from_id(int, int, int, int);
02922 extern cdb_isdn_vario *hd_cdbisdn_get_vario(int);
02923 extern int hd_cdbisdn_get_version(void);
02924 extern int hd_cdbisdn_get_db_version(void);
02925 extern char *hd_cdbisdn_get_db_date(void);
02926
02932 #ifdef __cplusplus
02933 }
02934 #endif
02935
02938 #endif