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 21
00023 #define HD_MINOR_VERSION 38
00024 #define HD_FULL_VERSION (HD_VERSION * 1000 + HD_MINOR_VERSION)
00025
00033 #define HD_DEB_SHOW_LOG (1 << 0)
00034 #define HD_DEB_PROGRESS (1 << 1)
00035 #define HD_DEB_CREATION (1 << 2)
00036 #define HD_DEB_DRIVER_INFO (1 << 3)
00037 #define HD_DEB_PCI (1 << 4)
00038 #define HD_DEB_ISAPNP (1 << 5)
00039 #define HD_DEB_CDROM (1 << 6)
00040 #define HD_DEB_NET (1 << 7)
00041 #define HD_DEB_FLOPPY (1 << 8)
00042 #define HD_DEB_MISC (1 << 9)
00043 #define HD_DEB_SERIAL (1 << 10)
00044 #define HD_DEB_MONITOR (1 << 11)
00045 #define HD_DEB_CPU (1 << 12)
00046 #define HD_DEB_BIOS (1 << 13)
00047 #define HD_DEB_MOUSE (1 << 14)
00048 #define HD_DEB_IDE (1 << 15)
00049 #define HD_DEB_SCSI (1 << 16)
00050 #define HD_DEB_USB (1 << 17)
00051 #define HD_DEB_ADB (1 << 18)
00052 #define HD_DEB_MODEM (1 << 19)
00053 #define HD_DEB_PARALLEL (1 << 20)
00054 #define HD_DEB_ISA (1 << 21)
00055 #define HD_DEB_BOOT (1 << 22)
00056 #define HD_DEB_HDDB (1 << 23)
00057
00059 #include <stdio.h>
00060 #include <inttypes.h>
00061 #include <termios.h>
00062 #include <sys/types.h>
00063
00064
00065
00069 #define HARDWARE_DIR "/var/lib/hardware"
00070
00085 #define TAG_PCI 1
00086 #define TAG_EISA 2
00087 #define TAG_USB 3
00088 #define TAG_SPECIAL 4
00089 #define TAG_PCMCIA 5
00090 #define TAG_SDIO 6
00095 #define ID_VALUE(id) ((id) & 0xffff)
00096
00100 #define ID_TAG(id) (((id) >> 16) & 0xf)
00101
00105 #define MAKE_ID(tag, id_val) ((tag << 16) | (id_val))
00106
00112 typedef enum probe_feature {
00113 pr_memory = 1, pr_pci, pr_isapnp, pr_net, pr_floppy, pr_misc,
00114 pr_misc_serial, pr_misc_par, pr_misc_floppy, pr_serial, pr_cpu, pr_bios,
00115 pr_monitor, pr_mouse, pr_scsi, pr_usb, pr_usb_mods, pr_adb, pr_modem,
00116 pr_modem_usb, pr_parallel, pr_parallel_lp, pr_parallel_zip, pr_isa,
00117 pr_isa_isdn, pr_isdn, pr_kbd, pr_prom, pr_sbus, pr_int, pr_braille,
00118 pr_braille_alva, pr_braille_fhp, pr_braille_ht, pr_ignx11, pr_sys,
00119 pr_bios_vbe, pr_isapnp_old, pr_isapnp_new, pr_isapnp_mod, pr_braille_baum,
00120 pr_manual, pr_fb, pr_veth, pr_pppoe, pr_scan, pr_pcmcia, pr_fork,
00121 pr_parallel_imm, pr_s390, pr_cpuemu, pr_sysfs, pr_s390disks, pr_udev,
00122 pr_block, pr_block_cdrom, pr_block_part, pr_edd, pr_edd_mod, pr_bios_ddc,
00123 pr_bios_fb, pr_bios_mode, pr_input, pr_block_mods, pr_bios_vesa,
00124 pr_cpuemu_debug, pr_scsi_noserial, pr_wlan, pr_bios_crc, pr_hal,
00125 pr_bios_vram, pr_bios_acpi, pr_bios_ddc_ports, pr_modules_pata,
00126 pr_net_eeprom, pr_x86emu,
00127 pr_max, pr_lxrc, pr_default,
00128 pr_all
00129 } hd_probe_feature_t;
00130
00139 typedef enum hw_item {
00140 hw_none = 0, hw_sys, hw_cpu, hw_keyboard, hw_braille, hw_mouse,
00141 hw_joystick, hw_printer, hw_scanner, hw_chipcard, hw_monitor, hw_tv,
00142 hw_display, hw_framebuffer, hw_camera, hw_sound, hw_storage_ctrl,
00143 hw_network_ctrl, hw_isdn, hw_modem, hw_network, hw_disk, hw_partition,
00144 hw_cdrom, hw_floppy, hw_manual, hw_usb_ctrl, hw_usb, hw_bios, hw_pci,
00145 hw_isapnp, hw_bridge, hw_hub, hw_scsi, hw_ide, hw_memory, hw_dvb,
00146 hw_pcmcia, hw_pcmcia_ctrl, hw_ieee1394, hw_ieee1394_ctrl, hw_hotplug,
00147 hw_hotplug_ctrl, hw_zip, hw_pppoe, hw_wlan, hw_redasd, hw_dsl, hw_block,
00148 hw_tape, hw_vbe, hw_bluetooth, hw_fingerprint, hw_mmc_ctrl,
00150 hw_unknown, hw_all
00151 } hd_hw_item_t;
00152
00160 typedef enum base_classes {
00161
00162 bc_none, bc_storage, bc_network, bc_display, bc_multimedia,
00163 bc_memory, bc_bridge, bc_comm, bc_system, bc_input, bc_docking,
00164 bc_processor, bc_serial, bc_wireless, bc_i2o, bc_other = 0xff,
00165
00166
00167 bc_monitor = 0x100, bc_internal, bc_modem, bc_isdn, bc_ps2, bc_mouse,
00168 bc_storage_device, bc_network_interface, bc_keyboard, bc_printer,
00169 bc_hub, bc_braille, bc_scanner, bc_joystick, bc_chipcard, bc_camera,
00170 bc_framebuffer, bc_dvb, bc_tv, bc_partition, bc_dsl, bc_bluetooth, bc_fingerprint,
00171 bc_mmc_ctrl
00172 } hd_base_classes_t;
00173
00175 typedef enum sc_monitor {
00176 sc_mon_other, sc_mon_crt, sc_mon_lcd
00177 } hd_sc_monitor_t;
00178
00180 typedef enum sc_storage {
00181 sc_sto_scsi, sc_sto_ide, sc_sto_floppy, sc_sto_ipi, sc_sto_raid,
00182 sc_sto_other = 0x80
00183 } hd_sc_storage_t;
00184
00186 typedef enum sc_display {
00187 sc_dis_vga, sc_dis_xga, sc_dis_other = 0x80
00188 } hd_sc_display_t;
00189
00191 typedef enum sc_framebuffer {
00192 sc_fb_vesa = 1
00193 } hd_sc_framebuffer_t;
00194
00196 typedef enum sc_bridge {
00197 sc_bridge_host, sc_bridge_isa, sc_bridge_eisa, sc_bridge_mc,
00198 sc_bridge_pci, sc_bridge_pcmcia, sc_bridge_nubus, sc_bridge_cardbus,
00199 sc_bridge_other = 0x80
00200 } hd_sc_bridge_t;
00201
00203 typedef enum sc_comm {
00204 sc_com_ser, sc_com_par, sc_com_multi, sc_com_modem, sc_com_other = 0x80
00205 } hd_sc_comm_t;
00206
00208 typedef enum sc_system {
00209 sc_sys_pic, sc_sys_dma, sc_sys_timer, sc_sys_rtc, sc_sys_other = 0x80
00210 } hd_sc_system_t;
00211
00213 typedef enum sc_input {
00214 sc_inp_keyb, sc_inp_digit, sc_inp_mouse, sc_inp_other = 0x80
00215 } hd_sc_input_t;
00216
00218 typedef enum sc_serial {
00219 sc_ser_fire, sc_ser_access, sc_ser_ssa, sc_ser_usb, sc_ser_fiber,
00220 sc_ser_smbus, sc_ser_infiniband, sc_ser_other = 0x80
00221 } hd_sc_serial_t;
00222
00224 typedef enum sc_internal {
00225 sc_int_none, sc_int_isapnp_if, sc_int_main_mem, sc_int_cpu, sc_int_fpu,
00226 sc_int_bios, sc_int_prom, sc_int_sys
00227 } hd_sc_internal_t;
00228
00230 typedef enum sc_mouse {
00231 sc_mou_ps2, sc_mou_ser, sc_mou_bus, sc_mou_usb, sc_mou_sun,
00232 sc_mou_other = 0x80
00233 } hd_sc_mouse_t;
00234
00236 typedef enum sc_std {
00237 sc_sdev_disk, sc_sdev_tape, sc_sdev_cdrom, sc_sdev_floppy, sc_sdev_scanner,
00238 sc_sdev_other = 0x80
00239 } hd_sc_std_t;
00240
00242 typedef enum sc_net_if {
00243 sc_nif_loopback, sc_nif_ethernet, sc_nif_tokenring, sc_nif_fddi,
00244 sc_nif_ctc, sc_nif_iucv, sc_nif_hsi, sc_nif_qeth,
00245 sc_nif_escon, sc_nif_myrinet, sc_nif_wlan, sc_nif_xp,
00246 sc_nif_usb, sc_nif_other = 0x80, sc_nif_sit
00247 } hd_sc_net_if_t;
00248
00250 typedef enum sc_multimedia {
00251 sc_multi_video, sc_multi_audio, sc_multi_other
00252 } hd_sc_multimedia_t;
00253
00255 typedef enum sc_keyboard {
00256 sc_keyboard_kbd, sc_keyboard_console
00257 } hd_sc_keyboard_t;
00258
00260 typedef enum sc_hub {
00261 sc_hub_other, sc_hub_usb
00262 } hd_sc_hub_t;
00263
00265 typedef enum sc_camera {
00266 sc_camera_webcam, sc_camera_digital
00267 } hd_sc_camera_t;
00268
00270 typedef enum sc_modem {
00271 sc_mod_at, sc_mod_win1, sc_mod_win2, sc_mod_win3, sc_mod_win4
00272 } hd_sc_modem_t;
00273
00275 typedef enum sc_dsl {
00276 sc_dsl_unknown, sc_dsl_pppoe, sc_dsl_capi, sc_dsl_capiisdn
00277 } hd_sc_dsl_t;
00278
00280 typedef enum pif_usb_e {
00281 pif_usb_uhci = 0, pif_usb_ohci = 0x10, pif_usb_ehci = 0x20,
00282 pif_usb_other = 0x80, pif_usb_device = 0xfe
00283 } hd_pif_usb_t;
00284
00286 typedef enum pif_cdrom {
00287 pif_cdrom, pif_cdr, pif_cdrw, pif_dvd, pif_dvdr, pif_dvdram
00288 } hd_pif_cdrom_t ;
00289
00291 typedef enum pif_s390disk {
00292 pif_scsi, pif_dasd, pif_dasd_fba
00293 } hd_pif_s390disk_t;
00294
00296 typedef enum bus_types {
00297 bus_none, bus_isa, bus_eisa, bus_mc, bus_pci, bus_pcmcia, bus_nubus,
00298 bus_cardbus, bus_other,
00299
00301 bus_ps2 = 0x80, bus_serial, bus_parallel, bus_floppy, bus_scsi, bus_ide, bus_usb,
00302 bus_adb, bus_raid, bus_sbus, bus_i2o, bus_vio, bus_ccw, bus_iucv, bus_ps3_system_bus,
00303 bus_virtio, bus_ibmebus, bus_gameport, bus_uisvirtpci, bus_mmc, bus_sdio, bus_nd
00304 } hd_bus_types_t;
00305
00314 typedef struct {
00318 unsigned invalid:1;
00319
00329 unsigned reconfig:3;
00330
00336 unsigned configured:3;
00337
00348 unsigned available:3;
00349
00357 unsigned needed:3;
00358
00365 unsigned available_orig:3;
00366
00370 unsigned active:3;
00371 } hd_status_t;
00372
00374 typedef enum {
00375 status_no = 1, status_yes, status_unknown, status_new
00376 } hd_status_value_t;
00377
00381 typedef enum {
00382 hp_none,
00383 hp_pcmcia,
00384 hp_cardbus,
00385 hp_pci,
00386 hp_usb,
00387 hp_ieee1394
00388 } hd_hotplug_t;
00389
00400 typedef struct {
00401 unsigned id;
00402 char *name;
00403 } hd_id_t;
00404
00405
00410 typedef struct s_str_list_t {
00411 struct s_str_list_t *next;
00412 char *str;
00413 } str_list_t;
00414
00415
00419 typedef struct {
00420 unsigned char bitmap[16];
00421 unsigned bits;
00422 unsigned not_empty:1;
00423 str_list_t *str;
00424 } hd_bitmap_t;
00425
00442 typedef struct {
00443 unsigned start, size;
00444 unsigned char *data;
00445 } memory_range_t;
00446
00447
00451 typedef struct {
00452 unsigned ok:1;
00453 unsigned rev;
00454 unsigned mpfp;
00455 unsigned mpconfig_ok:1;
00456 unsigned mpconfig;
00457 unsigned mpconfig_size;
00458 unsigned char feature[5];
00459 char oem_id[9];
00460 char prod_id[13];
00461 unsigned cpus, cpus_en;
00462 } smp_info_t;
00463
00464
00468 typedef struct vbe_mode_info_s {
00469 unsigned number;
00470 unsigned attributes;
00471 unsigned width, height;
00472 unsigned bytes_p_line;
00473 unsigned pixel_size;
00474 unsigned fb_start;
00475 unsigned win_A_start;
00476 unsigned win_A_attr;
00477 unsigned win_B_start;
00478 unsigned win_B_attr;
00479 unsigned win_size;
00480 unsigned win_gran;
00481 unsigned pixel_clock;
00482 } vbe_mode_info_t;
00483
00489 typedef struct {
00490 unsigned ok:1;
00491 unsigned version;
00492 unsigned oem_version;
00493 unsigned memory;
00494 unsigned fb_start;
00495 char *oem_name;
00496 char *vendor_name;
00497 char *product_name;
00498 char *product_revision;
00499 unsigned modes;
00500 vbe_mode_info_t *mode;
00501 unsigned current_mode;
00502 unsigned ddc_ports;
00503 unsigned char ddc_port[4][0x80];
00504 } vbe_info_t;
00505
00506
00510 typedef struct {
00511 unsigned id;
00512 unsigned char slot;
00513 unsigned char bus;
00514 unsigned char devfn;
00515 unsigned char misc;
00516 } cpq_ctlorder_t;
00517
00518
00519 typedef struct {
00520 unsigned ok:1;
00521 unsigned entry;
00522 unsigned compaq:1;
00523 cpq_ctlorder_t cpq_ctrl[32];
00524 } bios32_info_t;
00525
00535 typedef enum {
00536 sm_biosinfo, sm_sysinfo, sm_boardinfo, sm_chassis,
00537 sm_processor, sm_memctrl, sm_memmodule, sm_cache,
00538 sm_connect, sm_slot, sm_onboard, sm_oem,
00539 sm_config, sm_lang, sm_group, sm_eventlog,
00540 sm_memarray, sm_memdevice, sm_memerror, sm_memarraymap,
00541 sm_memdevicemap, sm_mouse, sm_battery, sm_reset,
00542 sm_secure, sm_power, sm_voltage, sm_cool,
00543 sm_temperature, sm_current, sm_outofband, sm_bis,
00544 sm_boot, sm_mem64error, sm_mandev, sm_mandevcomp,
00545 sm_mdtd, sm_inactive = 126, sm_end = 127
00546 } hd_smbios_type_t;
00547
00548
00550 typedef struct {
00551 union u_hd_smbios_t *next;
00552 hd_smbios_type_t type;
00553 int data_len;
00554 unsigned char *data;
00555 str_list_t *strings;
00556 int handle;
00557 } smbios_any_t;
00558
00559
00561 typedef struct {
00562 union u_hd_smbios_t *next;
00563 hd_smbios_type_t type;
00564 int data_len;
00565 unsigned char *data;
00566 str_list_t *strings;
00567 int handle;
00568 char *vendor;
00569 char *version;
00570 char *date;
00571 hd_bitmap_t feature;
00572 unsigned start;
00573 unsigned rom_size;
00574 } smbios_biosinfo_t;
00575
00576
00578 typedef struct {
00579 union u_hd_smbios_t *next;
00580 hd_smbios_type_t type;
00581 int data_len;
00582 unsigned char *data;
00583 str_list_t *strings;
00584 int handle;
00585 char *manuf;
00586 char *product;
00587 char *version;
00588 char *serial;
00589 unsigned char uuid[16];
00590 hd_id_t wake_up;
00591 } smbios_sysinfo_t;
00592
00593
00595 typedef struct {
00596 union u_hd_smbios_t *next;
00597 hd_smbios_type_t type;
00598 int data_len;
00599 unsigned char *data;
00600 str_list_t *strings;
00601 int handle;
00602 char *manuf;
00603 char *product;
00604 char *version;
00605 char *serial;
00606 char *asset;
00607 hd_id_t board_type;
00608 hd_bitmap_t feature;
00609 char *location;
00610 int chassis;
00611 int objects_len;
00612 int *objects;
00613 } smbios_boardinfo_t;
00614
00615
00617 typedef struct {
00618 union u_hd_smbios_t *next;
00619 hd_smbios_type_t type;
00620 int data_len;
00621 unsigned char *data;
00622 str_list_t *strings;
00623 int handle;
00624 char *manuf;
00625 char *version;
00626 char *serial;
00627 char *asset;
00628 hd_id_t ch_type;
00629 unsigned lock;
00630 hd_id_t bootup;
00631 hd_id_t power;
00632 hd_id_t thermal;
00633 hd_id_t security;
00634 unsigned oem;
00635 } smbios_chassis_t;
00636
00637
00639 typedef struct {
00640 union u_hd_smbios_t *next;
00641 hd_smbios_type_t type;
00642 int data_len;
00643 unsigned char *data;
00644 str_list_t *strings;
00645 int handle;
00646 char *socket;
00647 hd_id_t upgrade;
00648 char *manuf;
00649 char *version;
00650 char *serial;
00651 char *asset;
00652 char *part;
00653 hd_id_t pr_type;
00654 hd_id_t family;
00655 uint64_t cpu_id;
00656 unsigned voltage;
00657 unsigned ext_clock;
00658 unsigned max_speed;
00659 unsigned current_speed;
00660 unsigned sock_status;
00661 hd_id_t cpu_status;
00662 int l1_cache;
00663 int l2_cache;
00664 int l3_cache;
00665 } smbios_processor_t;
00666
00667
00669 typedef struct {
00670 union u_hd_smbios_t *next;
00671 hd_smbios_type_t type;
00672 int data_len;
00673 unsigned char *data;
00674 str_list_t *strings;
00675 int handle;
00676 char *socket;
00677 unsigned max_size;
00678 unsigned current_size;
00679 unsigned speed;
00680 hd_id_t mode;
00681 unsigned state;
00682 hd_id_t location;
00683 unsigned socketed;
00684 unsigned level;
00685 hd_id_t ecc;
00686 hd_id_t cache_type;
00687 hd_id_t assoc;
00688 hd_bitmap_t supp_sram;
00689 hd_bitmap_t sram;
00690 } smbios_cache_t;
00691
00692
00694 typedef struct {
00695 union u_hd_smbios_t *next;
00696 hd_smbios_type_t type;
00697 int data_len;
00698 unsigned char *data;
00699 str_list_t *strings;
00700 int handle;
00701 hd_id_t port_type;
00702 char *i_des;
00703 hd_id_t i_type;
00704 char *x_des;
00705 hd_id_t x_type;
00706 } smbios_connect_t;
00707
00708
00710 typedef struct {
00711 union u_hd_smbios_t *next;
00712 hd_smbios_type_t type;
00713 int data_len;
00714 unsigned char *data;
00715 str_list_t *strings;
00716 int handle;
00717 char *desig;
00718 hd_id_t slot_type;
00719 hd_id_t bus_width;
00720 hd_id_t usage;
00721 hd_id_t length;
00722 unsigned id;
00723 hd_bitmap_t feature;
00724 } smbios_slot_t;
00725
00726
00728 typedef struct {
00729 union u_hd_smbios_t *next;
00730 hd_smbios_type_t type;
00731 int data_len;
00732 unsigned char *data;
00733 str_list_t *strings;
00734 int handle;
00735 unsigned dev_len;
00736 struct {
00737 char *name;
00738 hd_id_t type;
00739 unsigned status;
00740 } *dev;
00741 } smbios_onboard_t;
00742
00743
00745 typedef struct {
00746 union u_hd_smbios_t *next;
00747 hd_smbios_type_t type;
00748 int data_len;
00749 unsigned char *data;
00750 str_list_t *strings;
00751 int handle;
00752 str_list_t *oem_strings;
00753 } smbios_oem_t;
00754
00755
00757 typedef struct {
00758 union u_hd_smbios_t *next;
00759 hd_smbios_type_t type;
00760 int data_len;
00761 unsigned char *data;
00762 str_list_t *strings;
00763 int handle;
00764 str_list_t *options;
00765 } smbios_config_t;
00766
00767
00769 typedef struct {
00770 union u_hd_smbios_t *next;
00771 hd_smbios_type_t type;
00772 int data_len;
00773 unsigned char *data;
00774 str_list_t *strings;
00775 int handle;
00776 char *current;
00777 } smbios_lang_t;
00778
00779
00781 typedef struct {
00782 union u_hd_smbios_t *next;
00783 hd_smbios_type_t type;
00784 int data_len;
00785 unsigned char *data;
00786 str_list_t *strings;
00787 int handle;
00788 char *name;
00789 int items_len;
00790 int *item_handles;
00791 } smbios_group_t;
00792
00793
00795 typedef struct {
00796 union u_hd_smbios_t *next;
00797 hd_smbios_type_t type;
00798 int data_len;
00799 unsigned char *data;
00800 str_list_t *strings;
00801 int handle;
00802 hd_id_t location;
00803 hd_id_t use;
00804 hd_id_t ecc;
00805 unsigned max_size;
00806 int error_handle;
00807 unsigned slots;
00808 } smbios_memarray_t;
00809
00810
00812 typedef struct {
00813 union u_hd_smbios_t *next;
00814 hd_smbios_type_t type;
00815 int data_len;
00816 unsigned char *data;
00817 str_list_t *strings;
00818 int handle;
00819 char *location;
00820 char *bank;
00821 char *manuf;
00822 char *serial;
00823 char *asset;
00824 char *part;
00825 int array_handle;
00826 int error_handle;
00827 unsigned width;
00828 unsigned eccbits;
00829 unsigned size;
00830 hd_id_t form;
00831 unsigned set;
00832 hd_id_t mem_type;
00833 hd_bitmap_t type_detail;
00834 unsigned speed;
00835 } smbios_memdevice_t;
00836
00837
00839 typedef struct {
00840 union u_hd_smbios_t *next;
00841 hd_smbios_type_t type;
00842 int data_len;
00843 unsigned char *data;
00844 str_list_t *strings;
00845 int handle;
00846 hd_id_t err_type;
00847 hd_id_t granularity;
00848 hd_id_t operation;
00849 unsigned syndrome;
00850 unsigned array_addr;
00851 unsigned device_addr;
00852 unsigned range;
00853 } smbios_memerror_t;
00854
00855
00857 typedef struct {
00858 union u_hd_smbios_t *next;
00859 hd_smbios_type_t type;
00860 int data_len;
00861 unsigned char *data;
00862 str_list_t *strings;
00863 int handle;
00864 int array_handle;
00865 uint64_t start_addr;
00866 uint64_t end_addr;
00867 unsigned part_width;
00868 } smbios_memarraymap_t;
00869
00870
00872 typedef struct {
00873 union u_hd_smbios_t *next;
00874 hd_smbios_type_t type;
00875 int data_len;
00876 unsigned char *data;
00877 str_list_t *strings;
00878 int handle;
00879 int memdevice_handle;
00880 int arraymap_handle;
00881 uint64_t start_addr;
00882 uint64_t end_addr;
00883 unsigned row_pos;
00884 unsigned interleave_pos;
00885 unsigned interleave_depth;
00886 } smbios_memdevicemap_t;
00887
00888
00890 typedef struct {
00891 union u_hd_smbios_t *next;
00892 hd_smbios_type_t type;
00893 int data_len;
00894 unsigned char *data;
00895 str_list_t *strings;
00896 int handle;
00897 hd_id_t mtype;
00898 hd_id_t interface;
00899 unsigned buttons;
00900 } smbios_mouse_t;
00901
00902
00904 typedef struct {
00905 union u_hd_smbios_t *next;
00906 hd_smbios_type_t type;
00907 int data_len;
00908 unsigned char *data;
00909 str_list_t *strings;
00910 int handle;
00911 hd_id_t power;
00912 hd_id_t keyboard;
00913 hd_id_t admin;
00914 hd_id_t reset;
00915 } smbios_secure_t;
00916
00917
00919 typedef struct {
00920 union u_hd_smbios_t *next;
00921 hd_smbios_type_t type;
00922 int data_len;
00923 unsigned char *data;
00924 str_list_t *strings;
00925 int handle;
00926 unsigned month;
00927 unsigned day;
00928 unsigned hour;
00929 unsigned minute;
00930 unsigned second;
00931 } smbios_power_t;
00932
00933
00935 typedef struct {
00936 union u_hd_smbios_t *next;
00937 hd_smbios_type_t type;
00938 int data_len;
00939 unsigned char *data;
00940 str_list_t *strings;
00941 int handle;
00942 hd_id_t err_type;
00943 hd_id_t granularity;
00944 hd_id_t operation;
00945 unsigned syndrome;
00946 uint64_t array_addr;
00947 uint64_t device_addr;
00948 unsigned range;
00949 } smbios_mem64error_t;
00950
00951
00953 typedef union u_hd_smbios_t {
00954 union u_hd_smbios_t *next;
00955 smbios_any_t any;
00956 smbios_biosinfo_t biosinfo;
00957 smbios_sysinfo_t sysinfo;
00958 smbios_boardinfo_t boardinfo;
00959 smbios_chassis_t chassis;
00960 smbios_processor_t processor;
00961 smbios_cache_t cache;
00962 smbios_connect_t connect;
00963 smbios_slot_t slot;
00964 smbios_onboard_t onboard;
00965 smbios_oem_t oem;
00966 smbios_config_t config;
00967 smbios_lang_t lang;
00968 smbios_group_t group;
00969 smbios_memarray_t memarray;
00970 smbios_memdevice_t memdevice;
00971 smbios_memerror_t memerror;
00972 smbios_memarraymap_t memarraymap;
00973 smbios_memdevicemap_t memdevicemap;
00974 smbios_mouse_t mouse;
00975 smbios_secure_t secure;
00976 smbios_power_t power;
00977 smbios_mem64error_t mem64error;
00978 } hd_smbios_t;
00979
00987 typedef struct s_udevinfo_t {
00988 struct s_udevinfo_t *next;
00989 char *sysfs;
00990 char *name;
00991 str_list_t *links;
00992 } hd_udevinfo_t;
00993
00994
00998 typedef struct s_sysfsdrv_t {
00999 struct s_sysfsdrv_t *next;
01000 char *driver;
01001 char *device;
01002 char *module;
01003 } hd_sysfsdrv_t;
01004
01005
01011 typedef struct {
01012 int type;
01013 unsigned major, minor, range;
01014 } hd_dev_num_t;
01015
01016
01031 typedef struct s_pci_t {
01032 struct s_pci_t *next;
01033 unsigned data_len;
01034 unsigned data_ext_len;
01035 unsigned char data[256];
01036 char *log;
01037 unsigned flags,
01038 cmd,
01039 hdr_type,
01040 secondary_bus;
01041 unsigned bus,
01042 slot, func;
01043 unsigned base_class, sub_class, prog_if;
01044 unsigned dev, vend, sub_dev, sub_vend, rev;
01045 unsigned irq;
01046 uint64_t base_addr[7];
01047 uint64_t base_len[7];
01048 unsigned addr_flags[7];
01049 uint64_t rom_base_addr;
01050 uint64_t rom_base_len;
01051 char *sysfs_id;
01052 char *sysfs_bus_id;
01053 char *modalias;
01054 char *label;
01055 unsigned edid_len[6];
01056 unsigned char edid_data[6][0x80];
01057 } pci_t;
01058
01063 typedef enum pci_flags {
01064 pci_flag_ok, pci_flag_pm, pci_flag_agp
01065 } hd_pci_flags_t;
01066
01067
01072 typedef struct usb_s {
01073 struct usb_s *next;
01074 unsigned hd_idx;
01075 unsigned hd_base_idx;
01076 str_list_t *c, *d, *e, *i, *p, *s, *t;
01077 struct usb_s *cloned;
01078 int bus, dev_nr, lev, parent, port, count, conns, used_conns, ifdescr;
01079 unsigned speed;
01080 unsigned vendor, device, rev;
01081 char *manufact, *product, *serial;
01082 char *driver;
01083 memory_range_t raw_descr;
01084 int d_cls, d_sub, d_prot;
01085 int i_alt, i_cls, i_sub, i_prot;
01086 unsigned country;
01087 } usb_t;
01088
01089
01093 typedef struct {
01094 int len;
01095 int type;
01096 unsigned char *data;
01097 } isapnp_res_t;
01098
01102 typedef struct {
01103 int csn;
01104 int log_devs;
01105 unsigned char *serial;
01106 unsigned char *card_regs;
01107 unsigned char (*ldev_regs)[0xd0];
01108 int res_len;
01109 unsigned broken:1;
01110 isapnp_res_t *res;
01111 } isapnp_card_t;
01112
01116 typedef struct {
01117 int read_port;
01118 int cards;
01119 isapnp_card_t *card;
01120 } isapnp_t;
01121
01125 typedef struct {
01126 isapnp_card_t *card;
01127 int dev;
01128 unsigned flags;
01129 unsigned ref:1;
01130 } isapnp_dev_t;
01131
01136 typedef enum isapnp_flags {
01137 isapnp_flag_act
01138 } hd_isapnp_flags_t;
01139
01140
01144 typedef struct scsi_s {
01145 struct scsi_s *next;
01146 unsigned deleted:1;
01147 unsigned generic:1;
01148 unsigned fake:1;
01149 unsigned wwpn_ok:1;
01150 unsigned fcp_lun_ok:1;
01151 char *dev_name;
01152 char *guessed_dev_name;
01153 int generic_dev;
01154 unsigned host, channel, id, lun;
01155 char *vendor, *model, *rev, *type_str, *serial;
01156 int type;
01157 unsigned inode_low;
01158 char *proc_dir, *driver;
01159 unsigned unique;
01160 char *info;
01161 unsigned lgeo_c, lgeo_h, lgeo_s;
01162 unsigned pgeo_c, pgeo_h, pgeo_s;
01163 uint64_t size;
01164 unsigned sec_size;
01165 unsigned cache;
01166 str_list_t *host_info;
01167 char *usb_guid;
01168 unsigned pci_info;
01169 unsigned pci_bus;
01170 unsigned pci_slot;
01171 unsigned pci_func;
01172 uint64_t wwpn;
01173 uint64_t fcp_lun;
01174 char *controller_id;
01175 } scsi_t;
01176
01177
01181 typedef struct devtree_s {
01182 struct devtree_s *next;
01183 struct devtree_s *parent;
01184 unsigned idx;
01185 char *path, *filename;
01186 unsigned pci:1;
01187 char *name, *model, *device_type, *compatible;
01188 char *ccin, *fru_number, *loc_code, *serial_number, *part_number;
01189 char *description;
01190 int class_code;
01191 int vendor_id, device_id, subvendor_id, subdevice_id;
01192 int revision_id, interrupt;
01193 unsigned char *edid;
01194 } devtree_t;
01195
01196 enum pmac_model {
01197 AAPL_3400,
01198 AAPL_3500,
01199 AAPL_7200,
01200 AAPL_7300,
01201 AAPL_7500,
01202 AAPL_8500,
01203 AAPL_9500,
01204 AAPL_Gossamer,
01205 AAPL_PowerBook1998,
01206 AAPL_PowerMac_G3,
01207 AAPL_ShinerESB,
01208 AAPL_e407,
01209 AAPL_e411,
01210 PowerBook1_1,
01211 PowerBook2_1,
01212 PowerBook2_2,
01213 PowerBook3_1,
01214 PowerBook3_2,
01215 PowerBook3_3,
01216 PowerBook3_4,
01217 PowerBook3_5,
01218 PowerBook4_1,
01219 PowerBook4_2,
01220 PowerBook4_3,
01221 PowerBook5_1,
01222 PowerBook5_2,
01223 PowerBook5_3,
01224 PowerBook5_4,
01225 PowerBook5_5,
01226 PowerBook5_6,
01227 PowerBook5_7,
01228 PowerBook5_8,
01229 PowerBook5_9,
01230 PowerBook6_1,
01231 PowerBook6_2,
01232 PowerBook6_3,
01233 PowerBook6_4,
01234 PowerBook6_5,
01235 PowerBook6_7,
01236 PowerBook6_8,
01237 PowerMac1_1,
01238 PowerMac1_2,
01239 PowerMac10_1,
01240 PowerMac11_2,
01241 PowerMac12_1,
01242 PowerMac2_1,
01243 PowerMac2_2,
01244 PowerMac3_1,
01245 PowerMac3_2,
01246 PowerMac3_3,
01247 PowerMac3_4,
01248 PowerMac3_5,
01249 PowerMac3_6,
01250 PowerMac4_1,
01251 PowerMac4_2,
01252 PowerMac4_4,
01253 PowerMac5_1,
01254 PowerMac6_1,
01255 PowerMac6_3,
01256 PowerMac6_4,
01257 PowerMac7_2,
01258 PowerMac7_3,
01259 PowerMac8_1,
01260 PowerMac9_1,
01261 RackMac1_1,
01262 RackMac1_2,
01263 RackMac3_1,
01264 iMac_1,
01265 };
01269 struct pmac_mb_def {
01270 enum pmac_model model;
01271 const char *string;
01272 };
01273
01277 typedef struct ccw_s {
01278 unsigned char lcss;
01279 unsigned char cu_model;
01280 unsigned char dev_model;
01281 } ccw_t;
01282
01286 typedef struct joystick_s {
01287 unsigned char buttons;
01288 unsigned char axes;
01289 } joystick_t;
01290
01294 typedef struct cdrom_info_s {
01295 struct cdrom_info_s *next;
01296 char *name;
01297 unsigned speed;
01298 unsigned cdr:1, cdrw:1, dvd:1, dvdr:1, dvdram:1;
01299 unsigned cdrom:1;
01300 struct {
01301 unsigned ok:1;
01302 char *volume, *publisher, *preparer, *application, *creation_date;
01303 } iso9660;
01304 struct {
01305 unsigned ok:1;
01306 unsigned platform;
01307 char *id_string;
01308 unsigned bootable:1;
01309 unsigned media_type;
01310 unsigned load_address;
01311 unsigned load_count;
01312 unsigned start;
01313 unsigned catalog;
01314 struct {
01315 unsigned c, h, s;
01316 unsigned size;
01317 } geo;
01318 char *label;
01319 } el_torito;
01320
01321 } cdrom_info_t;
01322
01323
01329 typedef struct {
01330 unsigned char block0[512];
01331 } floppy_info_t;
01332
01333
01337 typedef struct {
01338 unsigned apm_supported:1;
01339 unsigned apm_enabled:1;
01340 unsigned apm_ver, apm_subver;
01341 unsigned apm_bios_flags;
01342
01343 unsigned vbe_ver;
01344 unsigned vbe_video_mem;
01345
01346 unsigned ser_port0, ser_port1, ser_port2, ser_port3;
01347 unsigned par_port0, par_port1, par_port2;
01348
01350 unsigned is_pnp_bios:1;
01351 unsigned pnp_id;
01352 unsigned lba_support:1;
01353
01354 unsigned low_mem_size;
01355 smp_info_t smp;
01356 vbe_info_t vbe;
01357
01358 unsigned smbios_ver;
01359
01360 struct {
01361 unsigned width;
01362 unsigned height;
01363 unsigned xsize;
01364 unsigned ysize;
01365 char *vendor;
01366 char *name;
01367 } lcd;
01368
01369 struct {
01370 char *vendor;
01371 char *type;
01372 unsigned bus;
01373 unsigned compat_vend;
01374 unsigned compat_dev;
01375 } mouse;
01376
01377 struct {
01378 unsigned ok:1;
01379 unsigned scroll_lock:1;
01380 unsigned num_lock:1;
01381 unsigned caps_lock:1;
01382 } led;
01383
01384 bios32_info_t bios32;
01385
01386 } bios_info_t;
01387
01388
01392 typedef struct {
01393 unsigned has_color:1;
01394 unsigned color;
01395 } prom_info_t;
01396
01397
01401 typedef struct {
01402 char *system_type;
01403 char *generation;
01404 char *vendor;
01405 char *model;
01406 char *serial;
01407 char *lang;
01408 char *formfactor;
01409 } sys_info_t;
01410
01411
01415 typedef struct {
01416 unsigned manu_year;
01417 unsigned manu_week;
01418 unsigned min_vsync, max_vsync;
01419 unsigned min_hsync, max_hsync;
01420 unsigned clock;
01421 unsigned width, height;
01422 unsigned width_mm, height_mm;
01423 unsigned hdisp, hsyncstart, hsyncend, htotal;
01424 unsigned vdisp, vsyncstart, vsyncend, vtotal;
01425 char hflag,vflag;
01426 char *vendor;
01427 char *name;
01428 char *serial;
01429 } monitor_info_t;
01430
01437 typedef enum cpu_arch {
01438 arch_unknown = 0,
01439 arch_intel,
01440 arch_alpha,
01441 arch_sparc, arch_sparc64,
01442 arch_ppc, arch_ppc64,
01443 arch_68k,
01444 arch_ia64,
01445 arch_s390, arch_s390x,
01446 arch_arm,
01447 arch_mips,
01448 arch_x86_64,
01449 arch_aarch64
01450 } hd_cpu_arch_t;
01451
01455 typedef enum boot_arch {
01456 boot_unknown = 0,
01457 boot_lilo, boot_milo, boot_aboot, boot_silo, boot_ppc, boot_elilo, boot_s390,
01458 boot_mips, boot_grub, boot_uboot,
01459 } hd_boot_arch_t;
01460
01461
01470 typedef struct {
01471 enum cpu_arch architecture;
01472 unsigned family;
01473 unsigned model;
01474 unsigned stepping;
01475 unsigned cache;
01476 unsigned clock;
01477 unsigned units;
01478 char *vend_name;
01479 char *model_name;
01480 char *platform;
01481 str_list_t *features;
01482 double bogo;
01483 } cpu_info_t;
01484
01485
01490 typedef struct {
01491 uint64_t sectors;
01492 struct {
01493 unsigned cyls, heads, sectors;
01494 } edd;
01495 struct {
01496 unsigned cyls, heads, sectors;
01497 } legacy;
01498 unsigned ext_fixed_disk:1;
01499 unsigned ext_lock_eject:1;
01500 unsigned ext_edd:1;
01501 unsigned ext_64bit:1;
01502 unsigned assigned:1;
01503 unsigned valid:1;
01504 unsigned ext_fibre:1;
01505 unsigned ext_net:1;
01506 char *sysfs_id;
01507 unsigned hd_idx;
01508 unsigned signature;
01509 } edd_info_t;
01510
01516 typedef struct {
01517 unsigned data_len, data_max;
01518 unsigned *data;
01519 unsigned names_len, names_max;
01520 char *names;
01521 } hddb_data_t;
01522
01526 typedef uint32_t hddb_entry_mask_t;
01527
01531 typedef struct hddb_list_s {
01532 hddb_entry_mask_t key_mask;
01533 hddb_entry_mask_t value_mask;
01534 unsigned key;
01535 unsigned value;
01536 } hddb_list_t;
01537
01541 typedef struct {
01542 unsigned list_len, list_max;
01543 hddb_list_t *list;
01544 unsigned ids_len, ids_max;
01545 unsigned *ids;
01546 unsigned strings_len, strings_max;
01547 char *strings;
01548 } hddb2_data_t;
01549
01550
01554 typedef enum modinfo_type_e { mi_none = 0, mi_pci, mi_other } modinfo_type_t;
01555
01559 typedef struct {
01560 char *module;
01561 char *alias;
01562 modinfo_type_t type;
01563 union {
01564 struct {
01565 struct {
01566 unsigned vendor:1;
01567 unsigned device:1;
01568 unsigned sub_vendor:1;
01569 unsigned sub_device:1;
01570 unsigned base_class:1;
01571 unsigned sub_class:1;
01572 unsigned prog_if:1;
01573 } has;
01574 unsigned vendor;
01575 unsigned device;
01576 unsigned sub_vendor;
01577 unsigned sub_device;
01578 unsigned base_class;
01579 unsigned sub_class;
01580 unsigned prog_if;
01581 } pci;
01582
01583 struct {
01584 struct {
01585 unsigned vendor:1;
01586 unsigned product:1;
01587 unsigned device_class:1;
01588 unsigned device_subclass:1;
01589 } has;
01590 unsigned vendor;
01591 unsigned product;
01592 unsigned device_class;
01593 unsigned device_subclass;
01594 } usb;
01595 };
01596 } modinfo_t;
01597
01598
01602 typedef enum {
01603 p_invalid, p_string, p_int32, p_uint64, p_double, p_bool, p_list
01604 } hal_prop_type_t;
01605
01606
01610 typedef struct hal_prop_s {
01611 struct hal_prop_s *next;
01612 hal_prop_type_t type;
01613 char *key;
01614 union {
01615 char *str;
01616 int32_t int32;
01617 uint64_t uint64;
01618 double d;
01619 int b;
01620 str_list_t *list;
01621 } val;
01622 } hal_prop_t;
01623
01624
01628 typedef struct hal_device_s {
01629 struct hal_device_s *next, *parent;
01630 char *udi;
01631 unsigned used:1;
01632 hal_prop_t *prop;
01633 } hal_device_t;
01634
01638 typedef enum resource_types {
01639 res_any, res_phys_mem, res_mem, res_io, res_irq, res_dma, res_monitor,
01640 res_size, res_disk_geo, res_cache, res_baud, res_init_strings, res_pppd_option,
01641 res_framebuffer, res_hwaddr, res_link, res_wlan, res_fc, res_phwaddr
01642 } hd_resource_types_t;
01643
01644
01648 typedef enum size_units {
01649 size_unit_cm, size_unit_cinch, size_unit_byte, size_unit_sectors,
01650 size_unit_kbyte, size_unit_mbyte, size_unit_gbyte, size_unit_mm
01651 } hd_size_units_t;
01652
01656 typedef enum access_flags {
01657 acc_unknown,
01658 acc_ro,
01659 acc_wo,
01660 acc_rw
01661 } hd_access_flags_t;
01662
01663
01664 typedef enum yes_no_flag {
01665 flag_unknown,
01666 flag_no,
01667 flag_yes
01668 } hd_yes_no_flag_t;
01669
01670
01671 typedef enum geo_types {
01672 geo_physical = 0,
01673 geo_logical,
01674 geo_bios_edd,
01675 geo_bios_legacy
01676 } hd_geo_types_t;
01677
01678
01685 typedef struct {
01686 union u_hd_res_t *next;
01687 enum resource_types type;
01688 } res_any_t;
01689
01690 typedef struct {
01691 union u_hd_res_t *next;
01692 enum resource_types type;
01693 uint64_t base, range;
01694 unsigned
01695 enabled:1,
01696 access:2,
01697 prefetch:2;
01698 } res_mem_t;
01699
01700 typedef struct {
01701 union u_hd_res_t *next;
01702 enum resource_types type;
01703 uint64_t range;
01704 } res_phys_mem_t;
01705
01706 typedef struct {
01707 union u_hd_res_t *next;
01708 enum resource_types type;
01709 uint64_t base, range;
01710 unsigned
01711 enabled:1,
01712 access:2;
01713 } res_io_t;
01714
01715 typedef struct {
01716 union u_hd_res_t *next;
01717 enum resource_types type;
01718 unsigned base;
01719 unsigned triggered;
01720 unsigned enabled:1;
01721 } res_irq_t;
01722
01723 typedef struct {
01724 union u_hd_res_t *next;
01725 enum resource_types type;
01726 unsigned base;
01727 unsigned enabled:1;
01728 } res_dma_t;
01729
01730 typedef struct {
01731 union u_hd_res_t *next;
01732 enum resource_types type;
01733 enum size_units unit;
01734 uint64_t val1, val2;
01735 } res_size_t;
01736
01737 typedef struct {
01738 union u_hd_res_t *next;
01739 enum resource_types type;
01740 unsigned speed;
01741 unsigned bits, stopbits;
01742 char parity;
01743 char handshake;
01744 } res_baud_t;
01745
01746 typedef struct {
01747 union u_hd_res_t *next;
01748 enum resource_types type;
01749 unsigned size;
01750 } res_cache_t;
01751
01752 typedef struct {
01753 union u_hd_res_t *next;
01754 enum resource_types type;
01755 unsigned cyls, heads, sectors;
01756 uint64_t size;
01757 enum geo_types geotype;
01758 } res_disk_geo_t;
01759
01760 typedef struct {
01761 union u_hd_res_t *next;
01762 enum resource_types type;
01763 unsigned width, height;
01764 unsigned vfreq;
01765 unsigned interlaced:1;
01766 } res_monitor_t;
01767
01768 typedef struct {
01769 union u_hd_res_t *next;
01770 enum resource_types type;
01771 char *init1;
01772 char *init2;
01773 } res_init_strings_t;
01774
01775 typedef struct {
01776 union u_hd_res_t *next;
01777 enum resource_types type;
01778 char *option;
01779 } res_pppd_option_t;
01780
01781 typedef struct {
01782 union u_hd_res_t *next;
01783 enum resource_types type;
01784 unsigned width, height;
01785 unsigned bytes_p_line;
01786 unsigned colorbits;
01787 unsigned mode;
01788 } res_framebuffer_t;
01789
01790 typedef struct {
01791 union u_hd_res_t *next;
01792 enum resource_types type;
01793 char *addr;
01794 } res_hwaddr_t;
01795
01796 typedef struct {
01797 union u_hd_res_t *next;
01798 enum resource_types type;
01799 unsigned state:1;
01800 } res_link_t;
01801
01803 typedef struct {
01804 union u_hd_res_t *next;
01805 enum resource_types type;
01806 str_list_t *channels;
01807 str_list_t *frequencies;
01808 str_list_t *bitrates;
01809 str_list_t *auth_modes;
01810 str_list_t *enc_modes;
01811 } res_wlan_t;
01812
01813 typedef struct {
01814 union u_hd_res_t *next;
01815 enum resource_types type;
01816 unsigned wwpn_ok:1;
01817 unsigned fcp_lun_ok:1;
01818 unsigned port_id_ok:1;
01819 uint64_t wwpn;
01820 uint64_t fcp_lun;
01821 unsigned port_id;
01822 char *controller_id;
01823 } res_fc_t;
01824
01826 typedef union u_hd_res_t {
01827 union u_hd_res_t *next;
01828 res_any_t any;
01829 res_io_t io;
01830 res_mem_t mem;
01831 res_phys_mem_t phys_mem;
01832 res_irq_t irq;
01833 res_dma_t dma;
01834 res_size_t size;
01835 res_cache_t cache;
01836 res_baud_t baud;
01837 res_disk_geo_t disk_geo;
01838 res_monitor_t monitor;
01839 res_init_strings_t init_strings;
01840 res_pppd_option_t pppd_option;
01841 res_framebuffer_t framebuffer;
01842 res_hwaddr_t hwaddr;
01843 res_link_t link;
01844 res_wlan_t wlan;
01845 res_fc_t fc;
01846 } hd_res_t;
01847
01856 typedef struct {
01857 uint64_t addr, size;
01858 char *dev;
01859 unsigned tag;
01860 } misc_io_t;
01861
01862 typedef struct {
01863 unsigned channel;
01864 char *dev;
01865 unsigned tag;
01866 } misc_dma_t;
01867
01868 typedef struct {
01869 unsigned irq, events;
01870 int devs;
01871 char **dev;
01872 unsigned tag;
01873 } misc_irq_t;
01874
01875 typedef struct {
01876 unsigned io_len, dma_len, irq_len;
01877 misc_io_t *io;
01878 misc_dma_t *dma;
01879 misc_irq_t *irq;
01880 str_list_t *proc_io, *proc_dma, *proc_irq;
01881 } misc_t;
01882
01888 typedef struct s_serial_t {
01889 struct s_serial_t *next;
01890 char *name;
01891 char *device;
01892 unsigned line, port, irq, baud;
01893 } serial_t;
01894
01898 typedef struct s_ser_device_t {
01899 struct s_ser_device_t *next;
01900 unsigned hd_idx;
01901 char *dev_name;
01902 str_list_t *at_resp;
01903 int fd;
01904 struct termios tio;
01905 unsigned max_baud, cur_baud;
01906 unsigned is_mouse:1;
01907 unsigned is_modem:1;
01908 unsigned do_io:1;
01909 unsigned char buf[0x1000];
01910 int buf_len;
01911 int garbage, non_pnp, pnp;
01912 unsigned char pnp_id[8];
01913 char *serial, *class_name, *dev_id, *user_name, *vend, *init_string1, *init_string2, *pppd_option;
01914 unsigned pnp_rev;
01915 unsigned bits;
01916 } ser_device_t;
01917
01931 typedef struct isdn_parm_s {
01932 struct isdn_parm_s *next;
01933 char *name;
01934 unsigned valid:1;
01935 unsigned conflict:1;
01936 uint64_t value;
01937 unsigned type;
01938 unsigned flags;
01939 unsigned def_value;
01940 int alt_values;
01941 unsigned *alt_value;
01942 } isdn_parm_t;
01943
01945 typedef enum driver_info_type {
01946 di_any, di_display, di_module, di_mouse, di_x11, di_isdn, di_kbd, di_dsl
01947 } hd_driver_info_t;
01948
01950 typedef struct {
01951 union driver_info_u *next;
01952 enum driver_info_type type;
01953 str_list_t *hddb0, *hddb1;
01954 } driver_info_any_t;
01955
01957 typedef struct {
01958 union driver_info_u *next;
01959 enum driver_info_type type;
01960 str_list_t *hddb0, *hddb1;
01961 unsigned width, height;
01962 unsigned min_vsync, max_vsync;
01963 unsigned min_hsync, max_hsync;
01964 unsigned bandwidth;
01965 unsigned hdisp, hsyncstart, hsyncend, htotal;
01966 unsigned vdisp, vsyncstart, vsyncend, vtotal;
01967 char hflag,vflag;
01968 } driver_info_display_t;
01969
01971 typedef struct {
01972 union driver_info_u *next;
01973 enum driver_info_type type;
01974 str_list_t *hddb0, *hddb1;
01975 unsigned active:1;
01976 unsigned modprobe:1;
01977 str_list_t *names;
01978 str_list_t *mod_args;
01979 char *conf;
01980 } driver_info_module_t;
01981
01983 typedef struct {
01984 union driver_info_u *next;
01985 enum driver_info_type type;
01986 str_list_t *hddb0, *hddb1;
01987 char *xf86;
01988 char *gpm;
01989 int buttons;
01990 int wheels;
01991 } driver_info_mouse_t;
01992
01994 typedef struct {
01995 union driver_info_u *next;
01996 enum driver_info_type type;
01997 str_list_t *hddb0, *hddb1;
01998 char *server;
01999 char *xf86_ver;
02000 unsigned x3d:1;
02001 struct {
02002 unsigned all:5;
02003 unsigned c8:1, c15:1, c16:1, c24:1, c32:1;
02004 } colors;
02005 unsigned dacspeed;
02006 str_list_t *extensions;
02007 str_list_t *options;
02008 str_list_t *raw;
02009 char *script;
02010 } driver_info_x11_t;
02011
02013 typedef struct {
02014 union driver_info_u *next;
02015 enum driver_info_type type;
02016 str_list_t *hddb0, *hddb1;
02017 int i4l_type, i4l_subtype;
02018 char *i4l_name;
02019 isdn_parm_t *params;
02020 } driver_info_isdn_t;
02021
02023 typedef struct {
02024 union driver_info_u *next;
02025 enum driver_info_type type;
02026 str_list_t *hddb0, *hddb1;
02027 char *mode;
02028 char *name;
02029 } driver_info_dsl_t;
02030
02032 typedef struct {
02033 union driver_info_u *next;
02034 enum driver_info_type type;
02035 str_list_t *hddb0, *hddb1;
02036 char *XkbRules;
02037 char *XkbModel;
02038 char *XkbLayout;
02039 char *keymap;
02040 } driver_info_kbd_t;
02041
02042
02043
02044
02045 typedef union driver_info_u {
02046 union driver_info_u *next;
02047 driver_info_any_t any;
02048 driver_info_module_t module;
02049 driver_info_mouse_t mouse;
02050 driver_info_x11_t x11;
02051 driver_info_display_t display;
02052 driver_info_isdn_t isdn;
02053 driver_info_dsl_t dsl;
02054 driver_info_kbd_t kbd;
02055 } driver_info_t;
02056
02067 typedef enum hd_detail_type {
02068 hd_detail_pci, hd_detail_usb, hd_detail_isapnp, hd_detail_cdrom,
02069 hd_detail_floppy, hd_detail_bios, hd_detail_cpu, hd_detail_prom,
02070 hd_detail_monitor, hd_detail_sys, hd_detail_scsi, hd_detail_devtree,
02071 hd_detail_ccw, hd_detail_joystick
02072 } hd_detail_type_t;
02073
02074 typedef struct {
02075 enum hd_detail_type type;
02076 pci_t *data;
02077 } hd_detail_pci_t;
02078
02079 typedef struct {
02080 enum hd_detail_type type;
02081 usb_t *data;
02082 } hd_detail_usb_t;
02083
02084 typedef struct {
02085 enum hd_detail_type type;
02086 isapnp_dev_t *data;
02087 } hd_detail_isapnp_t;
02088
02089 typedef struct {
02090 enum hd_detail_type type;
02091 cdrom_info_t *data;
02092 } hd_detail_cdrom_t;
02093
02094 typedef struct {
02095 enum hd_detail_type type;
02096 floppy_info_t *data;
02097 } hd_detail_floppy_t;
02098
02099 typedef struct {
02100 enum hd_detail_type type;
02101 bios_info_t *data;
02102 } hd_detail_bios_t;
02103
02104 typedef struct {
02105 enum hd_detail_type type;
02106 cpu_info_t *data;
02107 } hd_detail_cpu_t;
02108
02109 typedef struct {
02110 enum hd_detail_type type;
02111 prom_info_t *data;
02112 } hd_detail_prom_t;
02113
02114 typedef struct hd_detail_monitor_s {
02115 enum hd_detail_type type;
02116 monitor_info_t *data;
02117 struct hd_detail_monitor_s *next;
02118 } hd_detail_monitor_t;
02119
02120 typedef struct {
02121 enum hd_detail_type type;
02122 sys_info_t *data;
02123 } hd_detail_sys_t;
02124
02125 typedef struct {
02126 enum hd_detail_type type;
02127 scsi_t *data;
02128 } hd_detail_scsi_t;
02129
02130 typedef struct {
02131 enum hd_detail_type type;
02132 devtree_t *data;
02133 } hd_detail_devtree_t;
02134
02135 typedef struct {
02136 enum hd_detail_type type;
02137 ccw_t *data;
02138 } hd_detail_ccw_t;
02139
02140 typedef struct {
02141 enum hd_detail_type type;
02142 joystick_t *data;
02143 } hd_detail_joystick_t;
02144
02145 typedef union {
02146 enum hd_detail_type type;
02147 hd_detail_pci_t pci;
02148 hd_detail_usb_t usb;
02149 hd_detail_isapnp_t isapnp;
02150 hd_detail_cdrom_t cdrom;
02151 hd_detail_floppy_t floppy;
02152 hd_detail_bios_t bios;
02153 hd_detail_cpu_t cpu;
02154 hd_detail_prom_t prom;
02155 hd_detail_monitor_t monitor;
02156 hd_detail_sys_t sys;
02157 hd_detail_scsi_t scsi;
02158 hd_detail_devtree_t devtree;
02159 hd_detail_ccw_t ccw;
02160 hd_detail_joystick_t joystick;
02161 } hd_detail_t;
02162
02175 typedef struct hd_manual_s {
02176 struct hd_manual_s *next;
02177
02178 char *unique_id;
02179 char *parent_id;
02180 char *child_ids;
02181 unsigned hw_class;
02182 char *model;
02183
02184 hd_status_t status;
02185 char *config_string;
02186
02187
02188
02189
02190 str_list_t *key;
02191 str_list_t *value;
02192 } hd_manual_t;
02193
02194
02200 typedef struct s_hd_t {
02201 struct s_hd_t *next;
02207 unsigned idx;
02208
02214 unsigned broken:1;
02215
02219 hd_id_t bus;
02220
02225 unsigned slot;
02226
02230 unsigned func;
02231
02235 hd_id_t base_class;
02236
02240 hd_id_t sub_class;
02241
02245 hd_id_t prog_if;
02246
02253 hd_id_t vendor;
02254
02263 hd_id_t device;
02264
02271 hd_id_t sub_vendor;
02272
02279 hd_id_t sub_device;
02280
02286 hd_id_t revision;
02287
02291 char *serial;
02292
02297 hd_id_t compat_vendor;
02298
02303 hd_id_t compat_device;
02304
02309 hd_hw_item_t hw_class;
02310
02315 unsigned char hw_class_list[(hw_all + 7) / 8];
02323 char *model;
02324
02330 unsigned attached_to;
02331
02335 char *sysfs_id;
02336
02340 char *sysfs_bus_id;
02341
02345 char *sysfs_device_link;
02346
02352 char *unix_dev_name;
02353
02357 hd_dev_num_t unix_dev_num;
02358
02365 str_list_t *unix_dev_names;
02366
02373 char *unix_dev_name2;
02374
02378 hd_dev_num_t unix_dev_num2;
02379
02386 char *rom_id;
02387
02391 char *udi;
02392
02396 char *parent_udi;
02397
02408 char *unique_id;
02409
02411 str_list_t *unique_ids;
02412
02416 unsigned module;
02417
02421 unsigned line;
02422
02426 unsigned count;
02427
02431 hd_res_t *res;
02432
02437 hd_detail_t *detail;
02438
02444 str_list_t *extra_info;
02445
02451 hd_status_t status;
02452
02459 char *config_string;
02460
02465 hd_hotplug_t hotplug;
02466
02471 unsigned hotplug_slot;
02472
02473 struct is_s {
02474 unsigned agp:1;
02475 unsigned isapnp:1;
02476 unsigned notready:1;
02477 unsigned manual:1;
02478 unsigned softraiddisk:1;
02479 unsigned zip:1;
02480 unsigned cdr:1;
02481 unsigned cdrw:1;
02482 unsigned dvd:1;
02483 unsigned dvdr:1;
02484 unsigned dvdrw:1;
02485 unsigned dvdrdl:1;
02486 unsigned dvdpr:1;
02487 unsigned dvdprw:1;
02488 unsigned dvdprdl:1;
02489 unsigned dvdprwdl:1;
02490 unsigned bd:1;
02491 unsigned bdr:1;
02492 unsigned bdre:1;
02493 unsigned hd:1;
02494 unsigned hdr:1;
02495 unsigned hdrw:1;
02496 unsigned dvdram:1;
02497 unsigned mo:1;
02498 unsigned mrw:1;
02499 unsigned mrww:1;
02500 unsigned pppoe:1;
02501 unsigned wlan:1;
02502 unsigned with_acpi:1;
02503 unsigned hotpluggable:1;
02504 unsigned dualport:1;
02505 unsigned fcoe:1;
02506 unsigned fcoe_offload:2;
02507 unsigned iscsi_offload:2;
02508 unsigned storage_only:2;
02509 } is;
02510
02511 struct tag_s {
02512 unsigned remove:1;
02513 unsigned freeit:1;
02514 unsigned fixed:1;
02515 unsigned skip_mouse:1;
02516 unsigned skip_modem:1;
02517 unsigned skip_braille:1;
02518 unsigned ser_device:2;
02519 } tag;
02520
02526 unsigned char *block0;
02527
02531 char *driver;
02532
02536 char *driver_module;
02537
02541 str_list_t *drivers;
02542
02546 str_list_t *driver_modules;
02547
02555 char *old_unique_id;
02556
02562 char *parent_id;
02563
02569 str_list_t *child_ids;
02570
02575 char *unique_id1;
02576
02583 char *usb_guid;
02584
02585 driver_info_t *driver_info;
02587 str_list_t *requires;
02589 hal_prop_t *hal_prop;
02591 hal_prop_t *persistent_prop;
02593 char *modalias;
02594 char *label;
02596
02597
02598
02599
02600 unsigned ref_cnt;
02601 struct s_hd_t *ref;
02602 } hd_t;
02603
02604
02608 typedef struct {
02614 hd_t *hd;
02615
02624 void (*progress)(char *pos, char *msg);
02625
02630 char *log;
02631
02639 unsigned debug;
02640
02646 struct flag_struct {
02647 unsigned internal:1;
02648 unsigned dformat:2;
02649 unsigned no_parport:1;
02650 unsigned iseries:1;
02651 unsigned list_all:1;
02652 unsigned fast:1;
02653 unsigned list_md:1;
02654 unsigned nofork:1;
02655 unsigned nosysfs:1;
02656 unsigned forked:1;
02657 unsigned cpuemu:1;
02658 unsigned udev:1;
02659 unsigned edd_used:1;
02660 unsigned keep_kmods:2;
02661 unsigned nobioscrc:1;
02662 unsigned biosvram:1;
02663 unsigned nowpa:1;
02664 unsigned pata:1;
02665 unsigned vbox:1;
02666 unsigned vmware:1;
02667 unsigned vmware_mouse:1;
02668 } flags;
02669
02670
02675 str_list_t *only;
02676
02677
02678
02679
02680 unsigned char probe[(pr_all + 7) / 8];
02681 unsigned char probe_set[(pr_all + 7) / 8];
02682 unsigned char probe_clr[(pr_all + 7) / 8];
02683 hal_prop_t *probe_val;
02684 unsigned last_idx;
02685 unsigned module;
02686 enum boot_arch boot;
02687 hd_t *old_hd;
02688 pci_t *pci;
02689 isapnp_t *isapnp;
02690 cdrom_info_t *cdrom;
02691 str_list_t *net;
02692 str_list_t *floppy;
02693 misc_t *misc;
02694 serial_t *serial;
02695 scsi_t *scsi;
02696 ser_device_t *ser_mouse;
02697 ser_device_t *ser_modem;
02698 str_list_t *cpu;
02699 str_list_t *klog;
02700 str_list_t *proc_usb;
02701 usb_t *usb;
02702 modinfo_t *modinfo_ext;
02703 modinfo_t *modinfo;
02704 hddb2_data_t *hddb2[2];
02705 str_list_t *kmods;
02706 uint64_t used_irqs;
02707 uint64_t assigned_irqs;
02708 memory_range_t bios_rom;
02709 memory_range_t bios_ram;
02710 memory_range_t bios_ebda;
02711 unsigned display;
02712 unsigned color_code;
02713 char *cmd_line;
02714 str_list_t *xtra_hd;
02715 devtree_t *devtree;
02716 unsigned kernel_version;
02717 hd_t *manual;
02718 str_list_t *disks;
02719 str_list_t *partitions;
02720 str_list_t *cdroms;
02721 hd_smbios_t *smbios;
02722 struct {
02723 unsigned ok:1;
02724 unsigned size;
02725 unsigned used;
02726 void *data;
02727 int id;
02728 int updated;
02729 } shm;
02730 unsigned pci_config_type;
02731 hd_udevinfo_t *udevinfo;
02732 hd_sysfsdrv_t *sysfsdrv;
02733 uint64_t sysfsdrv_id;
02734 str_list_t *scanner_db;
02735 edd_info_t edd[0x80];
02736 hal_device_t *hal;
02737 str_list_t *lsscsi;
02738 struct vm_s *vm;
02739 size_t log_size;
02740 size_t log_max;
02741 str_list_t *klog_raw;
02742 } hd_data_t;
02743
02744
02745
02746
02747
02748
02749
02750
02751
02752
02753
02755 void hd_scan(hd_data_t *hd_data);
02756
02758 hd_data_t *hd_free_hd_data(hd_data_t *hd_data);
02759
02761 hd_t *hd_free_hd_list(hd_t *hd);
02762
02763 void hd_set_probe_feature(hd_data_t *hd_data, enum probe_feature feature);
02764 void hd_clear_probe_feature(hd_data_t *hd_data, enum probe_feature feature);
02765 int hd_probe_feature(hd_data_t *hd_data, enum probe_feature feature);
02766 void hd_set_probe_feature_hw(hd_data_t *hd_data, hd_hw_item_t item);
02767
02768 enum probe_feature hd_probe_feature_by_name(char *name);
02769 char *hd_probe_feature_by_value(enum probe_feature feature);
02770
02771 int hd_module_is_active(hd_data_t *hd_data, char *mod);
02772
02773 hd_t *hd_base_class_list(hd_data_t *hd_data, unsigned base_class);
02774 hd_t *hd_sub_class_list(hd_data_t *hd_data, unsigned base_class, unsigned sub_class);
02775 hd_t *hd_bus_list(hd_data_t *hd_data, unsigned bus);
02776 const char* hd_busid_to_hwcfg(int busid);
02777 hd_t *hd_list(hd_data_t *hd_data, hd_hw_item_t item, int rescan, hd_t *hd_old);
02778 hd_t *hd_list_with_status(hd_data_t *hd_data, hd_hw_item_t item, hd_status_t status);
02779 hd_t *hd_list2(hd_data_t *hd_data, hd_hw_item_t *items, int rescan);
02780 hd_t *hd_list_with_status2(hd_data_t *hd_data, hd_hw_item_t *items, hd_status_t status);
02781
02782 void hd_add_driver_data(hd_data_t *hd_data, hd_t *hd);
02783
02784 int hd_has_pcmcia(hd_data_t *hd_data);
02785 #if 0
02786
02790 int hd_apm_enabled(hd_data_t *hd_data);
02791 #endif
02792 int hd_usb_support(hd_data_t *hd_data);
02793 int hd_smp_support(hd_data_t *hd_data);
02794 int hd_mac_color(hd_data_t *hd_data);
02795 int hd_color(hd_data_t *hd_data);
02796 int hd_is_uml(hd_data_t *hd_data);
02797 int hd_is_xen(hd_data_t *hd_data);
02798 unsigned hd_display_adapter(hd_data_t *hd_data);
02799 unsigned hd_boot_disk(hd_data_t *hd_data, int *matches);
02800 enum cpu_arch hd_cpu_arch(hd_data_t *hd_data);
02801 enum boot_arch hd_boot_arch(hd_data_t *hd_data);
02802
02803 hd_t *hd_get_device_by_idx(hd_data_t *hd_data, unsigned idx);
02804
02805 void hd_set_hw_class(hd_t *hd, hd_hw_item_t hw_class);
02806 int hd_is_hw_class(hd_t *hd, hd_hw_item_t hw_class);
02807
02808 int hd_is_sgi_altix(hd_data_t *hd_data);
02809
02810 char *hd_version(void);
02811
02812 hal_prop_t *hd_free_hal_properties(hal_prop_t *prop);
02813 hal_prop_t *hd_read_properties(const char *udi);
02814 int hd_write_properties(const char *udi, hal_prop_t *prop);
02815
02816 int hd_change_status(const char *id, hd_status_t status, const char *config_string);
02817 int hd_change_config_status(hd_data_t *hd_data, const char *id, hd_status_t status, const char *config_string);
02818 int hd_read_mmap(hd_data_t *hd_data, char *name, unsigned char *buf, off_t start, unsigned size);
02819
02820
02821
02825 str_list_t *hddb_get_packages(hd_data_t *hd_data);
02826 void hddb_add_info(hd_data_t *hd_data, hd_t *hd);
02827
02828 void hddb_dump_raw(hddb2_data_t *hddb, FILE *f);
02829 void hddb_dump(hddb2_data_t *hddb, FILE *f);
02830
02831
02832
02833 void hd_dump_entry(hd_data_t *hd_data, hd_t *hd, FILE *f);
02834
02835
02836 cdrom_info_t *hd_read_cdrom_info(hd_data_t *hd_data, hd_t *hd);
02837
02845 hd_manual_t *hd_manual_read_entry(hd_data_t *hd_data, const char *id);
02846 int hd_manual_write_entry(hd_data_t *hd_data, hd_manual_t *entry);
02847 hd_manual_t *hd_free_manual(hd_manual_t *manual);
02848 hd_t *hd_read_config(hd_data_t *hd_data, const char *id);
02849 int hd_write_config(hd_data_t *hd_data, hd_t *hd);
02850 char *hd_hw_item_name(hd_hw_item_t item);
02851 hd_hw_item_t hd_hw_item_type(char *name);
02852 char *hd_status_value_name(hd_status_value_t status);
02853
02864 #define CDBISDN_VERSION 0x0101
02865
02866 #ifndef PCI_ANY_ID
02867 #define PCI_ANY_ID 0xffff
02868 #endif
02869
02870 #define CDBISDN_P_NONE 0x0
02871 #define CDBISDN_P_IRQ 0x1
02872 #define CDBISDN_P_MEM 0x2
02873 #define CDBISDN_P_IO 0x3
02874
02876 typedef struct {
02877 char *name;
02878 char *shortname;
02879 int vnr;
02880 int refcnt;
02881 } cdb_isdn_vendor;
02882
02883 typedef struct {
02884 int handle;
02885 int vhandle;
02886 char *name;
02887 char *lname;
02888 char *Class;
02889 char *bus;
02890 int revision;
02891 int vendor;
02892 int device;
02893 int subvendor;
02895 int subdevice;
02897 unsigned int features;
02898 int line_cnt;
02899 int vario_cnt;
02900 int vario;
02901 } cdb_isdn_card;
02902
02903 typedef struct {
02904 int handle;
02905 int next_vario;
02906 int drvid;
02907 int typ;
02908 int subtyp;
02909 int smp;
02910 char *mod_name;
02911 char *para_str;
02912 char *mod_preload;
02913 char *cfg_prog;
02914 char *firmware;
02915 char *description;
02916 char *need_pkg;
02917 char *info;
02918 char *protocol;
02919 char *interface;
02920 char *io;
02921 char *irq;
02922 char *membase;
02923 char *features;
02924 int card_ref;
02925 char *name;
02926 } cdb_isdn_vario;
02927
02928
02929 extern cdb_isdn_vendor *hd_cdbisdn_get_vendor(int);
02930 extern cdb_isdn_card *hd_cdbisdn_get_card(int);
02931 extern cdb_isdn_vario *hd_cdbisdn_get_vario_from_type(int, int);
02932 extern cdb_isdn_card *hd_cdbisdn_get_card_from_type(int, int);
02933 extern cdb_isdn_card *hd_cdbisdn_get_card_from_id(int, int, int, int);
02934 extern cdb_isdn_vario *hd_cdbisdn_get_vario(int);
02935 extern int hd_cdbisdn_get_version(void);
02936 extern int hd_cdbisdn_get_db_version(void);
02937 extern char *hd_cdbisdn_get_db_date(void);
02938
02944 #ifdef __cplusplus
02945 }
02946 #endif
02947
02950 #endif