|
libhd
5.0
|
00001 #ifndef _HD_H 00002 #define _HD_H 00003 00009 #ifdef __cplusplus 00010 extern "C" { 00011 #endif 00012 00013 00014 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00015 * 00016 * libhd data structures 00017 * 00018 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00019 */ 00020 00022 #define HD_VERSION 19 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 //typedef struct vm_s vm_t; 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 // these *must* match standard PCI class numbers 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 // add our own classes here (starting at 0x100 as PCI values are 8 bit) 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 } hd_cpu_arch_t; 01442 01446 typedef enum boot_arch { 01447 boot_unknown = 0, 01448 boot_lilo, boot_milo, boot_aboot, boot_silo, boot_ppc, boot_elilo, boot_s390, 01449 boot_mips, boot_grub 01450 } hd_boot_arch_t; 01451 01452 01461 typedef struct { 01462 enum cpu_arch architecture; 01463 unsigned family; 01464 unsigned model; 01465 unsigned stepping; 01466 unsigned cache; 01467 unsigned clock; 01468 unsigned units; 01469 char *vend_name; 01470 char *model_name; 01471 char *platform; 01472 str_list_t *features; 01473 double bogo; 01474 } cpu_info_t; 01475 01476 01481 typedef struct { 01482 uint64_t sectors; 01483 struct { 01484 unsigned cyls, heads, sectors; 01485 } edd; 01486 struct { 01487 unsigned cyls, heads, sectors; 01488 } legacy; 01489 unsigned ext_fixed_disk:1; 01490 unsigned ext_lock_eject:1; 01491 unsigned ext_edd:1; 01492 unsigned ext_64bit:1; 01493 unsigned assigned:1; 01494 unsigned valid:1; 01495 char *sysfs_id; 01496 unsigned hd_idx; 01497 unsigned signature; 01498 } edd_info_t; 01499 01505 typedef struct { 01506 unsigned data_len, data_max; 01507 unsigned *data; 01508 unsigned names_len, names_max; 01509 char *names; 01510 } hddb_data_t; 01511 01515 typedef uint32_t hddb_entry_mask_t; 01516 01520 typedef struct hddb_list_s { 01521 hddb_entry_mask_t key_mask; 01522 hddb_entry_mask_t value_mask; 01523 unsigned key; 01524 unsigned value; 01525 } hddb_list_t; 01526 01530 typedef struct { 01531 unsigned list_len, list_max; 01532 hddb_list_t *list; 01533 unsigned ids_len, ids_max; 01534 unsigned *ids; 01535 unsigned strings_len, strings_max; 01536 char *strings; 01537 } hddb2_data_t; 01538 01539 01543 typedef enum modinfo_type_e { mi_none = 0, mi_pci, mi_other } modinfo_type_t; 01544 01548 typedef struct { 01549 char *module; 01550 char *alias; 01551 modinfo_type_t type; 01552 union { 01553 struct { 01554 struct { 01555 unsigned vendor:1; 01556 unsigned device:1; 01557 unsigned sub_vendor:1; 01558 unsigned sub_device:1; 01559 unsigned base_class:1; 01560 unsigned sub_class:1; 01561 unsigned prog_if:1; 01562 } has; 01563 unsigned vendor; 01564 unsigned device; 01565 unsigned sub_vendor; 01566 unsigned sub_device; 01567 unsigned base_class; 01568 unsigned sub_class; 01569 unsigned prog_if; 01570 } pci; 01571 01572 struct { 01573 struct { 01574 unsigned vendor:1; 01575 unsigned product:1; 01576 unsigned device_class:1; 01577 unsigned device_subclass:1; 01578 } has; 01579 unsigned vendor; 01580 unsigned product; 01581 unsigned device_class; 01582 unsigned device_subclass; 01583 } usb; 01584 }; 01585 } modinfo_t; 01586 01587 01591 typedef enum { 01592 p_invalid, p_string, p_int32, p_uint64, p_double, p_bool, p_list 01593 } hal_prop_type_t; 01594 01595 01599 typedef struct hal_prop_s { 01600 struct hal_prop_s *next; 01601 hal_prop_type_t type; 01602 char *key; 01603 union { 01604 char *str; 01605 int32_t int32; 01606 uint64_t uint64; 01607 double d; 01608 int b; 01609 str_list_t *list; 01610 } val; 01611 } hal_prop_t; 01612 01613 01617 typedef struct hal_device_s { 01618 struct hal_device_s *next, *parent; 01619 char *udi; 01620 unsigned used:1; 01621 hal_prop_t *prop; 01622 } hal_device_t; 01623 01627 typedef enum resource_types { 01628 res_any, res_phys_mem, res_mem, res_io, res_irq, res_dma, res_monitor, 01629 res_size, res_disk_geo, res_cache, res_baud, res_init_strings, res_pppd_option, 01630 res_framebuffer, res_hwaddr, res_link, res_wlan, res_fc 01631 } hd_resource_types_t; 01632 01633 01637 typedef enum size_units { 01638 size_unit_cm, size_unit_cinch, size_unit_byte, size_unit_sectors, 01639 size_unit_kbyte, size_unit_mbyte, size_unit_gbyte, size_unit_mm 01640 } hd_size_units_t; 01641 01645 typedef enum access_flags { 01646 acc_unknown, 01647 acc_ro, 01648 acc_wo, 01649 acc_rw 01650 } hd_access_flags_t; 01651 01652 01653 typedef enum yes_no_flag { 01654 flag_unknown, 01655 flag_no, 01656 flag_yes 01657 } hd_yes_no_flag_t; 01658 01659 01660 typedef enum geo_types { 01661 geo_physical = 0, 01662 geo_logical, 01663 geo_bios_edd, 01664 geo_bios_legacy 01665 } hd_geo_types_t; 01666 01667 01674 typedef struct { 01675 union u_hd_res_t *next; 01676 enum resource_types type; 01677 } res_any_t; 01678 01679 typedef struct { 01680 union u_hd_res_t *next; 01681 enum resource_types type; 01682 uint64_t base, range; 01683 unsigned 01684 enabled:1, 01685 access:2, 01686 prefetch:2; 01687 } res_mem_t; 01688 01689 typedef struct { 01690 union u_hd_res_t *next; 01691 enum resource_types type; 01692 uint64_t range; 01693 } res_phys_mem_t; 01694 01695 typedef struct { 01696 union u_hd_res_t *next; 01697 enum resource_types type; 01698 uint64_t base, range; 01699 unsigned 01700 enabled:1, 01701 access:2; 01702 } res_io_t; 01703 01704 typedef struct { 01705 union u_hd_res_t *next; 01706 enum resource_types type; 01707 unsigned base; 01708 unsigned triggered; 01709 unsigned enabled:1; 01710 } res_irq_t; 01711 01712 typedef struct { 01713 union u_hd_res_t *next; 01714 enum resource_types type; 01715 unsigned base; 01716 unsigned enabled:1; 01717 } res_dma_t; 01718 01719 typedef struct { 01720 union u_hd_res_t *next; 01721 enum resource_types type; 01722 enum size_units unit; 01723 uint64_t val1, val2; 01724 } res_size_t; 01725 01726 typedef struct { 01727 union u_hd_res_t *next; 01728 enum resource_types type; 01729 unsigned speed; 01730 unsigned bits, stopbits; 01731 char parity; 01732 char handshake; 01733 } res_baud_t; 01734 01735 typedef struct { 01736 union u_hd_res_t *next; 01737 enum resource_types type; 01738 unsigned size; 01739 } res_cache_t; 01740 01741 typedef struct { 01742 union u_hd_res_t *next; 01743 enum resource_types type; 01744 unsigned cyls, heads, sectors; 01745 uint64_t size; 01746 enum geo_types geotype; 01747 } res_disk_geo_t; 01748 01749 typedef struct { 01750 union u_hd_res_t *next; 01751 enum resource_types type; 01752 unsigned width, height; 01753 unsigned vfreq; 01754 unsigned interlaced:1; 01755 } res_monitor_t; 01756 01757 typedef struct { 01758 union u_hd_res_t *next; 01759 enum resource_types type; 01760 char *init1; 01761 char *init2; 01762 } res_init_strings_t; 01763 01764 typedef struct { 01765 union u_hd_res_t *next; 01766 enum resource_types type; 01767 char *option; 01768 } res_pppd_option_t; 01769 01770 typedef struct { 01771 union u_hd_res_t *next; 01772 enum resource_types type; 01773 unsigned width, height; 01774 unsigned bytes_p_line; 01775 unsigned colorbits; 01776 unsigned mode; 01777 } res_framebuffer_t; 01778 01779 typedef struct { 01780 union u_hd_res_t *next; 01781 enum resource_types type; 01782 char *addr; 01783 } res_hwaddr_t; 01784 01785 typedef struct { 01786 union u_hd_res_t *next; 01787 enum resource_types type; 01788 unsigned state:1; 01789 } res_link_t; 01790 01792 typedef struct { 01793 union u_hd_res_t *next; 01794 enum resource_types type; 01795 str_list_t *channels; 01796 str_list_t *frequencies; 01797 str_list_t *bitrates; 01798 str_list_t *auth_modes; 01799 str_list_t *enc_modes; 01800 } res_wlan_t; 01801 01802 typedef struct { 01803 union u_hd_res_t *next; 01804 enum resource_types type; 01805 unsigned wwpn_ok:1; 01806 unsigned fcp_lun_ok:1; 01807 unsigned port_id_ok:1; 01808 uint64_t wwpn; 01809 uint64_t fcp_lun; 01810 unsigned port_id; 01811 char *controller_id; 01812 } res_fc_t; 01813 01815 typedef union u_hd_res_t { 01816 union u_hd_res_t *next; 01817 res_any_t any; 01818 res_io_t io; 01819 res_mem_t mem; 01820 res_phys_mem_t phys_mem; 01821 res_irq_t irq; 01822 res_dma_t dma; 01823 res_size_t size; 01824 res_cache_t cache; 01825 res_baud_t baud; 01826 res_disk_geo_t disk_geo; 01827 res_monitor_t monitor; 01828 res_init_strings_t init_strings; 01829 res_pppd_option_t pppd_option; 01830 res_framebuffer_t framebuffer; 01831 res_hwaddr_t hwaddr; 01832 res_link_t link; 01833 res_wlan_t wlan; 01834 res_fc_t fc; 01835 } hd_res_t; 01836 01845 typedef struct { 01846 uint64_t addr, size; 01847 char *dev; 01848 unsigned tag; 01849 } misc_io_t; 01850 01851 typedef struct { 01852 unsigned channel; 01853 char *dev; 01854 unsigned tag; 01855 } misc_dma_t; 01856 01857 typedef struct { 01858 unsigned irq, events; 01859 int devs; 01860 char **dev; 01861 unsigned tag; 01862 } misc_irq_t; 01863 01864 typedef struct { 01865 unsigned io_len, dma_len, irq_len; 01866 misc_io_t *io; 01867 misc_dma_t *dma; 01868 misc_irq_t *irq; 01869 str_list_t *proc_io, *proc_dma, *proc_irq; 01870 } misc_t; 01871 01877 typedef struct s_serial_t { 01878 struct s_serial_t *next; 01879 char *name; 01880 char *device; 01881 unsigned line, port, irq, baud; 01882 } serial_t; 01883 01887 typedef struct s_ser_device_t { 01888 struct s_ser_device_t *next; 01889 unsigned hd_idx; 01890 char *dev_name; 01891 str_list_t *at_resp; 01892 int fd; 01893 struct termios tio; 01894 unsigned max_baud, cur_baud; 01895 unsigned is_mouse:1; 01896 unsigned is_modem:1; 01897 unsigned do_io:1; 01898 unsigned char buf[0x1000]; 01899 int buf_len; 01900 int garbage, non_pnp, pnp; 01901 unsigned char pnp_id[8]; 01902 char *serial, *class_name, *dev_id, *user_name, *vend, *init_string1, *init_string2, *pppd_option; 01903 unsigned pnp_rev; 01904 unsigned bits; 01905 } ser_device_t; 01906 01920 typedef struct isdn_parm_s { 01921 struct isdn_parm_s *next; 01922 char *name; 01923 unsigned valid:1; 01924 unsigned conflict:1; 01925 uint64_t value; 01926 unsigned type; 01927 unsigned flags; 01928 unsigned def_value; 01929 int alt_values; 01930 unsigned *alt_value; 01931 } isdn_parm_t; 01932 01934 typedef enum driver_info_type { 01935 di_any, di_display, di_module, di_mouse, di_x11, di_isdn, di_kbd, di_dsl 01936 } hd_driver_info_t; 01937 01939 typedef struct { 01940 union driver_info_u *next; 01941 enum driver_info_type type; 01942 str_list_t *hddb0, *hddb1; 01943 } driver_info_any_t; 01944 01946 typedef struct { 01947 union driver_info_u *next; 01948 enum driver_info_type type; 01949 str_list_t *hddb0, *hddb1; 01950 unsigned width, height; 01951 unsigned min_vsync, max_vsync; 01952 unsigned min_hsync, max_hsync; 01953 unsigned bandwidth; 01954 unsigned hdisp, hsyncstart, hsyncend, htotal; 01955 unsigned vdisp, vsyncstart, vsyncend, vtotal; 01956 char hflag,vflag; 01957 } driver_info_display_t; 01958 01960 typedef struct { 01961 union driver_info_u *next; 01962 enum driver_info_type type; 01963 str_list_t *hddb0, *hddb1; 01964 unsigned active:1; 01965 unsigned modprobe:1; 01966 str_list_t *names; 01967 str_list_t *mod_args; 01968 char *conf; 01969 } driver_info_module_t; 01970 01972 typedef struct { 01973 union driver_info_u *next; 01974 enum driver_info_type type; 01975 str_list_t *hddb0, *hddb1; 01976 char *xf86; 01977 char *gpm; 01978 int buttons; 01979 int wheels; 01980 } driver_info_mouse_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 *server; 01988 char *xf86_ver; 01989 unsigned x3d:1; 01990 struct { 01991 unsigned all:5; 01992 unsigned c8:1, c15:1, c16:1, c24:1, c32:1; 01993 } colors; 01994 unsigned dacspeed; 01995 str_list_t *extensions; 01996 str_list_t *options; 01997 str_list_t *raw; 01998 char *script; 01999 } driver_info_x11_t; 02000 02002 typedef struct { 02003 union driver_info_u *next; 02004 enum driver_info_type type; 02005 str_list_t *hddb0, *hddb1; 02006 int i4l_type, i4l_subtype; 02007 char *i4l_name; 02008 isdn_parm_t *params; 02009 } driver_info_isdn_t; 02010 02012 typedef struct { 02013 union driver_info_u *next; 02014 enum driver_info_type type; 02015 str_list_t *hddb0, *hddb1; 02016 char *mode; 02017 char *name; 02018 } driver_info_dsl_t; 02019 02021 typedef struct { 02022 union driver_info_u *next; 02023 enum driver_info_type type; 02024 str_list_t *hddb0, *hddb1; 02025 char *XkbRules; 02026 char *XkbModel; 02027 char *XkbLayout; 02028 char *keymap; 02029 } driver_info_kbd_t; 02030 02031 /* 02032 * holds device driver info 02033 */ 02034 typedef union driver_info_u { 02035 union driver_info_u *next; 02036 driver_info_any_t any; 02037 driver_info_module_t module; 02038 driver_info_mouse_t mouse; 02039 driver_info_x11_t x11; 02040 driver_info_display_t display; 02041 driver_info_isdn_t isdn; 02042 driver_info_dsl_t dsl; 02043 driver_info_kbd_t kbd; 02044 } driver_info_t; 02045 02056 typedef enum hd_detail_type { 02057 hd_detail_pci, hd_detail_usb, hd_detail_isapnp, hd_detail_cdrom, 02058 hd_detail_floppy, hd_detail_bios, hd_detail_cpu, hd_detail_prom, 02059 hd_detail_monitor, hd_detail_sys, hd_detail_scsi, hd_detail_devtree, 02060 hd_detail_ccw, hd_detail_joystick 02061 } hd_detail_type_t; 02062 02063 typedef struct { 02064 enum hd_detail_type type; 02065 pci_t *data; 02066 } hd_detail_pci_t; 02067 02068 typedef struct { 02069 enum hd_detail_type type; 02070 usb_t *data; 02071 } hd_detail_usb_t; 02072 02073 typedef struct { 02074 enum hd_detail_type type; 02075 isapnp_dev_t *data; 02076 } hd_detail_isapnp_t; 02077 02078 typedef struct { 02079 enum hd_detail_type type; 02080 cdrom_info_t *data; 02081 } hd_detail_cdrom_t; 02082 02083 typedef struct { 02084 enum hd_detail_type type; 02085 floppy_info_t *data; 02086 } hd_detail_floppy_t; 02087 02088 typedef struct { 02089 enum hd_detail_type type; 02090 bios_info_t *data; 02091 } hd_detail_bios_t; 02092 02093 typedef struct { 02094 enum hd_detail_type type; 02095 cpu_info_t *data; 02096 } hd_detail_cpu_t; 02097 02098 typedef struct { 02099 enum hd_detail_type type; 02100 prom_info_t *data; 02101 } hd_detail_prom_t; 02102 02103 typedef struct hd_detail_monitor_s { 02104 enum hd_detail_type type; 02105 monitor_info_t *data; 02106 struct hd_detail_monitor_s *next; 02107 } hd_detail_monitor_t; 02108 02109 typedef struct { 02110 enum hd_detail_type type; 02111 sys_info_t *data; 02112 } hd_detail_sys_t; 02113 02114 typedef struct { 02115 enum hd_detail_type type; 02116 scsi_t *data; 02117 } hd_detail_scsi_t; 02118 02119 typedef struct { 02120 enum hd_detail_type type; 02121 devtree_t *data; 02122 } hd_detail_devtree_t; 02123 02124 typedef struct { 02125 enum hd_detail_type type; 02126 ccw_t *data; 02127 } hd_detail_ccw_t; 02128 02129 typedef struct { 02130 enum hd_detail_type type; 02131 joystick_t *data; 02132 } hd_detail_joystick_t; 02133 02134 typedef union { 02135 enum hd_detail_type type; 02136 hd_detail_pci_t pci; 02137 hd_detail_usb_t usb; 02138 hd_detail_isapnp_t isapnp; 02139 hd_detail_cdrom_t cdrom; 02140 hd_detail_floppy_t floppy; 02141 hd_detail_bios_t bios; 02142 hd_detail_cpu_t cpu; 02143 hd_detail_prom_t prom; 02144 hd_detail_monitor_t monitor; 02145 hd_detail_sys_t sys; 02146 hd_detail_scsi_t scsi; 02147 hd_detail_devtree_t devtree; 02148 hd_detail_ccw_t ccw; 02149 hd_detail_joystick_t joystick; 02150 } hd_detail_t; 02151 02164 typedef struct hd_manual_s { 02165 struct hd_manual_s *next; 02166 02167 char *unique_id; 02168 char *parent_id; 02169 char *child_ids; 02170 unsigned hw_class; 02171 char *model; 02172 02173 hd_status_t status; 02174 char *config_string; 02175 02176 /* More or less free-form key, value pairs. 02177 * key should not contain '=', however. 02178 */ 02179 str_list_t *key; 02180 str_list_t *value; 02181 } hd_manual_t; 02182 02183 02189 typedef struct s_hd_t { 02190 struct s_hd_t *next; 02196 unsigned idx; 02197 02203 unsigned broken:1; 02204 02208 hd_id_t bus; 02209 02214 unsigned slot; 02215 02219 unsigned func; 02220 02224 hd_id_t base_class; 02225 02229 hd_id_t sub_class; 02230 02234 hd_id_t prog_if; 02235 02242 hd_id_t vendor; 02243 02252 hd_id_t device; 02253 02260 hd_id_t sub_vendor; 02261 02268 hd_id_t sub_device; 02269 02275 hd_id_t revision; 02276 02280 char *serial; 02281 02286 hd_id_t compat_vendor; 02287 02292 hd_id_t compat_device; 02293 02298 hd_hw_item_t hw_class; 02299 02304 unsigned char hw_class_list[(hw_all + 7) / 8]; 02312 char *model; 02313 02319 unsigned attached_to; 02320 02324 char *sysfs_id; 02325 02329 char *sysfs_bus_id; 02330 02334 char *sysfs_device_link; 02335 02341 char *unix_dev_name; 02342 02346 hd_dev_num_t unix_dev_num; 02347 02354 str_list_t *unix_dev_names; 02355 02362 char *unix_dev_name2; 02363 02367 hd_dev_num_t unix_dev_num2; 02368 02375 char *rom_id; 02376 02380 char *udi; 02381 02385 char *parent_udi; 02386 02397 char *unique_id; 02398 02400 str_list_t *unique_ids; 02401 02405 unsigned module; 02406 02410 unsigned line; 02411 02415 unsigned count; 02416 02420 hd_res_t *res; 02421 02426 hd_detail_t *detail; 02427 02433 str_list_t *extra_info; 02434 02440 hd_status_t status; 02441 02448 char *config_string; 02449 02454 hd_hotplug_t hotplug; 02455 02460 unsigned hotplug_slot; 02461 02462 struct is_s { 02463 unsigned agp:1; 02464 unsigned isapnp:1; 02465 unsigned notready:1; 02466 unsigned manual:1; 02467 unsigned softraiddisk:1; 02468 unsigned zip:1; 02469 unsigned cdr:1; 02470 unsigned cdrw:1; 02471 unsigned dvd:1; 02472 unsigned dvdr:1; 02473 unsigned dvdrw:1; 02474 unsigned dvdrdl:1; 02475 unsigned dvdpr:1; 02476 unsigned dvdprw:1; 02477 unsigned dvdprdl:1; 02478 unsigned dvdprwdl:1; 02479 unsigned bd:1; 02480 unsigned bdr:1; 02481 unsigned bdre:1; 02482 unsigned hd:1; 02483 unsigned hdr:1; 02484 unsigned hdrw:1; 02485 unsigned dvdram:1; 02486 unsigned mo:1; 02487 unsigned mrw:1; 02488 unsigned mrww:1; 02489 unsigned pppoe:1; 02490 unsigned wlan:1; 02491 unsigned with_acpi:1; 02492 unsigned hotpluggable:1; 02493 unsigned dualport:1; 02494 } is; 02495 02496 struct tag_s { 02497 unsigned remove:1; 02498 unsigned freeit:1; 02499 unsigned fixed:1; 02500 unsigned skip_mouse:1; 02501 unsigned skip_modem:1; 02502 unsigned skip_braille:1; 02503 unsigned ser_device:2; 02504 } tag; 02505 02511 unsigned char *block0; 02512 02516 char *driver; 02517 02521 char *driver_module; 02522 02526 str_list_t *drivers; 02527 02531 str_list_t *driver_modules; 02532 02540 char *old_unique_id; 02541 02547 char *parent_id; 02548 02554 str_list_t *child_ids; 02555 02560 char *unique_id1; 02561 02568 char *usb_guid; 02569 02570 driver_info_t *driver_info; 02572 str_list_t *requires; 02574 hal_prop_t *hal_prop; 02576 hal_prop_t *persistent_prop; 02578 char *modalias; 02580 /* 02581 * These are used internally for memory management. 02582 * Do not even _think_ of modifying these! 02583 */ 02584 unsigned ref_cnt; 02585 struct s_hd_t *ref; 02586 } hd_t; 02587 02588 02592 typedef struct { 02598 hd_t *hd; 02599 02608 void (*progress)(char *pos, char *msg); 02609 02614 char *log; 02615 02623 unsigned debug; 02624 02630 struct flag_struct { 02631 unsigned internal:1; 02632 unsigned dformat:2; 02633 unsigned no_parport:1; 02634 unsigned iseries:1; 02635 unsigned list_all:1; 02636 unsigned fast:1; 02637 unsigned list_md:1; 02638 unsigned nofork:1; 02639 unsigned nosysfs:1; 02640 unsigned forked:1; 02641 unsigned cpuemu:1; 02642 unsigned udev:1; 02643 unsigned edd_used:1; 02644 unsigned keep_kmods:2; 02645 unsigned nobioscrc:1; 02646 unsigned biosvram:1; 02647 unsigned nowpa:1; 02648 unsigned pata:1; 02649 unsigned vbox:1; 02650 unsigned vmware:1; 02651 unsigned vmware_mouse:1; 02652 } flags; 02653 02654 02659 str_list_t *only; 02660 02661 /* 02662 * The following entries should *not* be accessed outside of libhd! 02663 */ 02664 unsigned char probe[(pr_all + 7) / 8]; 02665 unsigned char probe_set[(pr_all + 7) / 8]; 02666 unsigned char probe_clr[(pr_all + 7) / 8]; 02667 hal_prop_t *probe_val; 02668 unsigned last_idx; 02669 unsigned module; 02670 enum boot_arch boot; 02671 hd_t *old_hd; 02672 pci_t *pci; 02673 isapnp_t *isapnp; 02674 cdrom_info_t *cdrom; 02675 str_list_t *net; 02676 str_list_t *floppy; 02677 misc_t *misc; 02678 serial_t *serial; 02679 scsi_t *scsi; 02680 ser_device_t *ser_mouse; 02681 ser_device_t *ser_modem; 02682 str_list_t *cpu; 02683 str_list_t *klog; 02684 str_list_t *proc_usb; 02685 usb_t *usb; 02686 modinfo_t *modinfo_ext; 02687 modinfo_t *modinfo; 02688 hddb2_data_t *hddb2[2]; 02689 str_list_t *kmods; 02690 uint64_t used_irqs; 02691 uint64_t assigned_irqs; 02692 memory_range_t bios_rom; 02693 memory_range_t bios_ram; 02694 memory_range_t bios_ebda; 02695 unsigned display; 02696 unsigned color_code; 02697 char *cmd_line; 02698 str_list_t *xtra_hd; 02699 devtree_t *devtree; 02700 unsigned kernel_version; 02701 hd_t *manual; 02702 str_list_t *disks; 02703 str_list_t *partitions; 02704 str_list_t *cdroms; 02705 hd_smbios_t *smbios; 02706 struct { 02707 unsigned ok:1; 02708 unsigned size; 02709 unsigned used; 02710 void *data; 02711 int id; 02712 int updated; 02713 } shm; 02714 unsigned pci_config_type; 02715 hd_udevinfo_t *udevinfo; 02716 hd_sysfsdrv_t *sysfsdrv; 02717 uint64_t sysfsdrv_id; 02718 str_list_t *scanner_db; 02719 edd_info_t edd[0x80]; 02720 hal_device_t *hal; 02721 str_list_t *lsscsi; 02722 struct vm_s *vm; 02723 size_t log_size; 02724 size_t log_max; 02725 str_list_t *klog_raw; 02726 } hd_data_t; 02727 02728 02729 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 02730 * 02731 * libhd interface functions 02732 * 02733 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 02734 */ 02735 02736 /* implemented in hd.c */ 02737 02739 void hd_scan(hd_data_t *hd_data); 02740 02742 hd_data_t *hd_free_hd_data(hd_data_t *hd_data); 02743 02745 hd_t *hd_free_hd_list(hd_t *hd); 02746 02747 void hd_set_probe_feature(hd_data_t *hd_data, enum probe_feature feature); 02748 void hd_clear_probe_feature(hd_data_t *hd_data, enum probe_feature feature); 02749 int hd_probe_feature(hd_data_t *hd_data, enum probe_feature feature); 02750 void hd_set_probe_feature_hw(hd_data_t *hd_data, hd_hw_item_t item); 02751 02752 enum probe_feature hd_probe_feature_by_name(char *name); 02753 char *hd_probe_feature_by_value(enum probe_feature feature); 02754 02755 int hd_module_is_active(hd_data_t *hd_data, char *mod); 02756 02757 hd_t *hd_base_class_list(hd_data_t *hd_data, unsigned base_class); 02758 hd_t *hd_sub_class_list(hd_data_t *hd_data, unsigned base_class, unsigned sub_class); 02759 hd_t *hd_bus_list(hd_data_t *hd_data, unsigned bus); 02760 const char* hd_busid_to_hwcfg(int busid); 02761 hd_t *hd_list(hd_data_t *hd_data, hd_hw_item_t item, int rescan, hd_t *hd_old); 02762 hd_t *hd_list_with_status(hd_data_t *hd_data, hd_hw_item_t item, hd_status_t status); 02763 hd_t *hd_list2(hd_data_t *hd_data, hd_hw_item_t *items, int rescan); 02764 hd_t *hd_list_with_status2(hd_data_t *hd_data, hd_hw_item_t *items, hd_status_t status); 02765 02766 void hd_add_driver_data(hd_data_t *hd_data, hd_t *hd); 02767 02768 int hd_has_pcmcia(hd_data_t *hd_data); 02769 #if 0 02770 02774 int hd_apm_enabled(hd_data_t *hd_data); 02775 #endif 02776 int hd_usb_support(hd_data_t *hd_data); 02777 int hd_smp_support(hd_data_t *hd_data); 02778 int hd_mac_color(hd_data_t *hd_data); 02779 int hd_color(hd_data_t *hd_data); 02780 int hd_is_uml(hd_data_t *hd_data); 02781 int hd_is_xen(hd_data_t *hd_data); 02782 unsigned hd_display_adapter(hd_data_t *hd_data); 02783 unsigned hd_boot_disk(hd_data_t *hd_data, int *matches); 02784 enum cpu_arch hd_cpu_arch(hd_data_t *hd_data); 02785 enum boot_arch hd_boot_arch(hd_data_t *hd_data); 02786 02787 hd_t *hd_get_device_by_idx(hd_data_t *hd_data, unsigned idx); 02788 02789 void hd_set_hw_class(hd_t *hd, hd_hw_item_t hw_class); 02790 int hd_is_hw_class(hd_t *hd, hd_hw_item_t hw_class); 02791 02792 int hd_is_sgi_altix(hd_data_t *hd_data); 02793 02794 char *hd_version(void); 02795 02796 hal_prop_t *hd_free_hal_properties(hal_prop_t *prop); 02797 hal_prop_t *hd_read_properties(const char *udi); 02798 int hd_write_properties(const char *udi, hal_prop_t *prop); 02799 02800 int hd_change_status(const char *id, hd_status_t status, const char *config_string); 02801 int hd_change_config_status(hd_data_t *hd_data, const char *id, hd_status_t status, const char *config_string); 02802 int hd_read_mmap(hd_data_t *hd_data, char *name, unsigned char *buf, off_t start, unsigned size); 02803 02804 /* implemented in hddb.c */ 02805 02809 str_list_t *hddb_get_packages(hd_data_t *hd_data); 02810 void hddb_add_info(hd_data_t *hd_data, hd_t *hd); 02811 02812 void hddb_dump_raw(hddb2_data_t *hddb, FILE *f); 02813 void hddb_dump(hddb2_data_t *hddb, FILE *f); 02814 02815 02816 /* implemented in hdp.c */ 02817 void hd_dump_entry(hd_data_t *hd_data, hd_t *hd, FILE *f); 02818 02819 /* implemented in cdrom.c */ 02820 cdrom_info_t *hd_read_cdrom_info(hd_data_t *hd_data, hd_t *hd); 02821 02829 hd_manual_t *hd_manual_read_entry(hd_data_t *hd_data, const char *id); 02830 int hd_manual_write_entry(hd_data_t *hd_data, hd_manual_t *entry); 02831 hd_manual_t *hd_free_manual(hd_manual_t *manual); 02832 hd_t *hd_read_config(hd_data_t *hd_data, const char *id); 02833 int hd_write_config(hd_data_t *hd_data, hd_t *hd); 02834 char *hd_hw_item_name(hd_hw_item_t item); 02835 hd_hw_item_t hd_hw_item_type(char *name); 02836 char *hd_status_value_name(hd_status_value_t status); 02837 02848 #define CDBISDN_VERSION 0x0101 02849 02850 #ifndef PCI_ANY_ID 02851 #define PCI_ANY_ID 0xffff 02852 #endif 02853 02854 #define CDBISDN_P_NONE 0x0 02855 #define CDBISDN_P_IRQ 0x1 02856 #define CDBISDN_P_MEM 0x2 02857 #define CDBISDN_P_IO 0x3 02858 02860 typedef struct { 02861 char *name; 02862 char *shortname; 02863 int vnr; 02864 int refcnt; 02865 } cdb_isdn_vendor; 02866 02867 typedef struct { 02868 int handle; 02869 int vhandle; 02870 char *name; 02871 char *lname; 02872 char *Class; 02873 char *bus; 02874 int revision; 02875 int vendor; 02876 int device; 02877 int subvendor; 02879 int subdevice; 02881 unsigned int features; 02882 int line_cnt; 02883 int vario_cnt; 02884 int vario; 02885 } cdb_isdn_card; 02886 02887 typedef struct { 02888 int handle; 02889 int next_vario; 02890 int drvid; 02891 int typ; 02892 int subtyp; 02893 int smp; 02894 char *mod_name; 02895 char *para_str; 02896 char *mod_preload; 02897 char *cfg_prog; 02898 char *firmware; 02899 char *description; 02900 char *need_pkg; 02901 char *info; 02902 char *protocol; 02903 char *interface; 02904 char *io; 02905 char *irq; 02906 char *membase; 02907 char *features; 02908 int card_ref; 02909 char *name; 02910 } cdb_isdn_vario; 02911 02912 02913 extern cdb_isdn_vendor *hd_cdbisdn_get_vendor(int); 02914 extern cdb_isdn_card *hd_cdbisdn_get_card(int); 02915 extern cdb_isdn_vario *hd_cdbisdn_get_vario_from_type(int, int); 02916 extern cdb_isdn_card *hd_cdbisdn_get_card_from_type(int, int); 02917 extern cdb_isdn_card *hd_cdbisdn_get_card_from_id(int, int, int, int); 02918 extern cdb_isdn_vario *hd_cdbisdn_get_vario(int); 02919 extern int hd_cdbisdn_get_version(void); 02920 extern int hd_cdbisdn_get_db_version(void); 02921 extern char *hd_cdbisdn_get_db_date(void); 02922 02928 #ifdef __cplusplus 02929 } 02930 #endif 02931 02934 #endif /* _HD_H */