libhd 5.0
Implementation internals

various functions commmon to all probing modules More...

Topics

 Hardware abstraction (HAL) information
 Bus scanning code
 Device handling
 Information gathering
 Hardware DB (HDDB)
 Hardware DB functions.
 Hardware scan console output
 Hardware scan console output functions.
 Internal utilities
 Internal utility functions.
 UDI manual hardware
 Manual hardware information functions (/var/lib/hardware/udi/).

Data Structures

struct  disk_s
struct  pr_flags_t
struct  s_mod_names

Macros

#define u64   uint64_t
#define BLKSSZGET   _IO(0x12,104)
#define INT_CRC(a, b)
#define STR_CRC(a, b)

Typedefs

typedef struct disk_s disk_t

Functions

static pr_flags_tpr_flags_by_name (char *name)
static pr_flags_tpr_flags_by_id (enum probe_feature feature)
static int set_probe_val (hd_data_t *hd_data, enum probe_feature feature, char *val)
static void fix_probe_features (hd_data_t *hd_data)
static void set_probe_feature (hd_data_t *hd_data, enum probe_feature feature, unsigned val)
static void free_old_hd_entries (hd_data_t *hd_data)
static hd_tfree_hd_entry (hd_t *hd)
static hd_tadd_hd_entry2 (hd_t **hd, hd_t *new_hd)
static void timeout_alarm_handler (int signal)
static void get_probe_env (hd_data_t *hd_data)
static void hd_scan_xtra (hd_data_t *hd_data)
static hd_thd_get_device_by_id (hd_data_t *hd_data, char *id)
static int has_item (hd_hw_item_t *items, hd_hw_item_t item)
static int has_hw_class (hd_t *hd, hd_hw_item_t *items)
static void hd_scan_with_hal (hd_data_t *hd_data)
static void hd_scan_no_hal (hd_data_t *hd_data)
static void test_read_block0_open (void *arg)
static void get_kernel_version (hd_data_t *hd_data)
static int is_modem (hd_data_t *hd_data, hd_t *hd)
static int is_audio (hd_data_t *hd_data, hd_t *hd)
static int is_pppoe (hd_data_t *hd_data, hd_t *hd)
static void assign_hw_class (hd_data_t *hd_data, hd_t *hd)
static void short_vendor (char *vendor)
static void create_model_name (hd_data_t *hd_data, hd_t *hd)
static void copy_log2shm (hd_data_t *hd_data)
static void sigchld_handler (int)
static void sigusr1_handler (int)
static char * hd_shm_add_str (hd_data_t *hd_data, char *str)
static str_list_thd_shm_add_str_list (hd_data_t *hd_data, str_list_t *sl)
static hd_udevinfo_thd_free_udevinfo (hd_udevinfo_t *ui)
static hd_sysfsdrv_thd_free_sysfsdrv (hd_sysfsdrv_t *sf)
int get_probe_val_int (hd_data_t *hd_data, enum probe_feature feature)
char * get_probe_val_str (hd_data_t *hd_data, enum probe_feature feature)
str_list_tget_probe_val_list (hd_data_t *hd_data, enum probe_feature feature)
API_SYM void hd_set_probe_feature (hd_data_t *hd_data, enum probe_feature feature)
API_SYM void hd_clear_probe_feature (hd_data_t *hd_data, enum probe_feature feature)
API_SYM int hd_probe_feature (hd_data_t *hd_data, enum probe_feature feature)
API_SYM void hd_set_probe_feature_hw (hd_data_t *hd_data, hd_hw_item_t item)
API_SYM hd_data_thd_free_hd_data (hd_data_t *hd_data)
 Free all data.
API_SYM hal_prop_thd_free_hal_properties (hal_prop_t *prop)
hal_device_thd_free_hal_devices (hal_device_t *dev)
driver_info_tfree_driver_info (driver_info_t *di)
int exists_hd_entry (hd_data_t *hd_data, hd_t *old_hd, hd_t *hd_ex)
API_SYM hd_thd_free_hd_list (hd_t *hd)
 Free hardware items returned by e.g. hd_list().
hd_detail_tfree_hd_detail (hd_detail_t *d)
misc_tfree_misc (misc_t *m)
scsi_tfree_scsi (scsi_t *scsi, int free_all)
API_SYM hd_manual_thd_free_manual (hd_manual_t *manual)
void * new_mem (size_t size)
void * resize_mem (void *p, size_t n)
void * add_mem (void *p, size_t elem_size, size_t n)
char * new_str (const char *s)
void * free_mem (void *p)
void join_res_io (hd_res_t **res1, hd_res_t *res2)
void join_res_irq (hd_res_t **res1, hd_res_t *res2)
void join_res_dma (hd_res_t **res1, hd_res_t *res2)
int have_common_res (hd_res_t *res1, hd_res_t *res2)
hd_res_tfree_res_list (hd_res_t *res)
hd_res_tadd_res_entry (hd_res_t **res, hd_res_t *new_res)
API_SYM hd_thd_add_hd_entry (hd_data_t *hd_data, unsigned line, unsigned count)
API_SYM void hd_scan (hd_data_t *hd_data)
 the actual hardware scan
char * isa_id2str (unsigned id)
char * eisa_vendor_str (unsigned v)
API_SYM unsigned hd_name2eisa_id (char *s)
char * canon_str (char *s, int len)
int hex (char *s, int n)
int str2float (char *s, int n)
char * float2str (int f, int n)
API_SYM hd_thd_get_device_by_idx (hd_data_t *hd_data, unsigned idx)
char * mod_name_by_idx (unsigned idx)
void hd_log (hd_data_t *hd_data, char *buf, ssize_t len)
API_SYM void hd_log_printf (hd_data_t *hd_data, char *format,...)
void hd_log_hex (hd_data_t *hd_data, int with_ascii, unsigned data_len, unsigned char *data)
void str_printf (char **buf, int offset, char *format,...)
void hexdump (char **buf, int with_ascii, unsigned data_len, unsigned char *data)
API_SYM str_list_thd_read_file (char *file_name, unsigned start_line, unsigned lines)
API_SYM str_list_thd_read_dir (char *dir_name, int type)
str_list_tread_dir_canonical (char *dir_name, int type)
API_SYM char * hd_read_sysfs_link (char *base_dir, char *link_name)
str_list_tsubcomponent_list (str_list_t *list, char *comp, int max)
int has_subcomponent (str_list_t *list, char *comp)
void progress (hd_data_t *hd_data, unsigned pos, unsigned count, char *msg)
API_SYM enum probe_feature hd_probe_feature_by_name (char *name)
API_SYM char * hd_probe_feature_by_value (enum probe_feature feature)
void remove_hd_entries (hd_data_t *hd_data)
void remove_tagged_hd_entries (hd_data_t *hd_data)
API_SYM int hd_module_is_active (hd_data_t *hd_data, char *mod)
API_SYM int hd_has_pcmcia (hd_data_t *hd_data)
int hd_apm_enabled (hd_data_t *hd_data)
API_SYM int hd_usb_support (hd_data_t *hd_data)
API_SYM int hd_smp_support (hd_data_t *hd_data)
API_SYM int hd_color (hd_data_t *hd_data)
API_SYM int hd_mac_color (hd_data_t *hd_data)
API_SYM unsigned hd_display_adapter (hd_data_t *hd_data)
API_SYM enum cpu_arch hd_cpu_arch (hd_data_t *hd_data)
API_SYM enum boot_arch hd_boot_arch (hd_data_t *hd_data)
API_SYM int hd_is_uml (hd_data_t *hd_data)
API_SYM int hd_is_sgi_altix (hd_data_t *hd_data)
API_SYM int hd_is_xen (hd_data_t *hd_data)
void hd_copy (hd_t *dst, hd_t *src)
API_SYM hd_thd_list (hd_data_t *hd_data, hd_hw_item_t item, int rescan, hd_t *hd_old)
API_SYM hd_thd_list_with_status (hd_data_t *hd_data, hd_hw_item_t item, hd_status_t status)
API_SYM hd_thd_list2 (hd_data_t *hd_data, hd_hw_item_t *items, int rescan)
API_SYM hd_thd_list_with_status2 (hd_data_t *hd_data, hd_hw_item_t *items, hd_status_t status)
API_SYM hd_thd_base_class_list (hd_data_t *hd_data, unsigned base_class)
API_SYM hd_thd_sub_class_list (hd_data_t *hd_data, unsigned base_class, unsigned sub_class)
API_SYM hd_thd_bus_list (hd_data_t *hd_data, unsigned bus)
API_SYM const char * hd_busid_to_hwcfg (int busid)
int hd_timeout (void(*func)(void *), void *arg, int timeout)
str_list_tread_kmods (hd_data_t *hd_data)
str_list_tget_cmdline (hd_data_t *hd_data, char *key)
char * get_cmd_param (hd_data_t *hd_data, int field)
unsigned get_disk_crc (unsigned char *data, unsigned len)
disk_tadd_disk_entry (disk_t **dl, disk_t *new_dl)
disk_tfree_disk_list (disk_t *dl)
int dev_name_duplicate (disk_t *dl, char *dev_name)
API_SYM unsigned hd_boot_disk (hd_data_t *hd_data, int *matches)
void update_irq_usage (hd_data_t *hd_data)
int run_cmd (hd_data_t *hd_data, char *cmd)
int probe_module (hd_data_t *hd_data, char *module)
int load_module_with_params (hd_data_t *hd_data, char *module, char *params)
int load_module (hd_data_t *hd_data, char *module)
int unload_module (hd_data_t *hd_data, char *module)
int cmp_hd (hd_t *hd1, hd_t *hd2)
unsigned has_something_attached (hd_data_t *hd_data, hd_t *hd)
void crc64 (uint64_t *id, void *p, int len)
char * numid2str (uint64_t id, int len)
void hd_add_old_id (hd_t *hd)
void hd_add_id (hd_data_t *hd_data, hd_t *hd)
devtree_tfree_devtree (hd_data_t *hd_data)
unsigned char * read_block0 (hd_data_t *hd_data, char *dev, int *timeout)
char * vend_id2str (unsigned vend)
API_SYM int hd_change_config_status (hd_data_t *hd_data, const char *id, hd_status_t status, const char *config_string)
API_SYM int hd_change_status (const char *id, hd_status_t status, const char *config_string)
int hd_getdisksize (hd_data_t *hd_data, char *dev, int fd, hd_res_t **geo, hd_res_t **size)
API_SYM str_list_thd_split (char del, const char *str)
API_SYM char * hd_join (char *del, str_list_t *str)
int is_pcmcia_ctrl (hd_data_t *hd_data, hd_t *hd)
API_SYM void hd_set_hw_class (hd_t *hd, hd_hw_item_t hw_class)
API_SYM int hd_is_hw_class (hd_t *hd, hd_hw_item_t hw_class)
void hd_fork (hd_data_t *hd_data, int timeout, int total_timeout)
void hd_fork_done (hd_data_t *hd_data)
void hd_shm_init (hd_data_t *hd_data)
void hd_shm_clean (hd_data_t *hd_data)
void hd_shm_done (hd_data_t *hd_data)
void * hd_shm_add (hd_data_t *hd_data, void *ptr, unsigned len)
int hd_is_shm_ptr (hd_data_t *hd_data, void *ptr)
void hd_move_to_shm (hd_data_t *hd_data)
void read_udevinfo (hd_data_t *hd_data)
API_SYM char * hd_version ()
hd_thd_find_sysfs_id (hd_data_t *hd_data, char *id)
hd_thd_find_sysfs_id_devname (hd_data_t *hd_data, char *id, char *devname)
void hd_sysfs_driver_list (hd_data_t *hd_data)
int hd_report_this (hd_data_t *hd_data, hd_t *hd)
str_list_thd_module_list (hd_data_t *hd_data, unsigned id)
API_SYM int hd_read_mmap (hd_data_t *hd_data, char *name, unsigned char *buf, off_t start, unsigned size)
char * hd_get_hddb_dir ()
char * hd_get_hddb_path (char *sub)
int hd_attr_uint (char *attr, uint64_t *u, int base)
str_list_thd_attr_list (char *str)
char * hd_sysfs_id (char *path)
char * hd_sysfs_name2_dev (char *str)
char * hd_sysfs_dev2_name (char *str)
char * get_sysfs_attr (const char *bus, const char *device, const char *attr)
char * get_sysfs_attr_by_path (const char *path, const char *attr)
char * get_sysfs_attr_by_path2 (const char *path, const char *attr, unsigned *len)
int hd_mod_cmp (char *str1, char *str2)
str_list_tsort_str_list (str_list_t *sl0, int(*cmp_func)(const void *, const void *))
API_SYM str_list_thd_search_str_list (str_list_t *sl, char *str)
 Search a string list for a string.
API_SYM str_list_thd_add_str_list (str_list_t **sl, char *str)
 Add a string to a string list.
API_SYM str_list_thd_free_str_list (str_list_t *list)
 Free the memory allocated by a string list.
API_SYM str_list_thd_reverse_str_list (str_list_t *list)
 Reverse string list.

Variables

static pid_t child_id
static volatile pid_t child
static hd_data_thd_data_sig
static struct s_mod_names pr_modules []
static pr_flags_t pr_flags []

Detailed Description

various functions commmon to all probing modules

Macro Definition Documentation

◆ BLKSSZGET

#define BLKSSZGET   _IO(0x12,104)

Referenced by hd_getdisksize().

◆ INT_CRC

#define INT_CRC ( a,
b )
Value:
crc64(&a, &hd->b, sizeof hd->b);
void crc64(uint64_t *id, void *p, int len)
Definition hd.c:4209

Referenced by hd_add_id(), and hd_add_old_id().

◆ STR_CRC

#define STR_CRC ( a,
b )
Value:
if(hd->b) crc64(&a, hd->b, strlen(hd->b) + 1);

Referenced by hd_add_id(), and hd_add_old_id().

◆ u64

#define u64   uint64_t

Referenced by dump_normal().

Typedef Documentation

◆ disk_t

typedef struct disk_s disk_t

Function Documentation

◆ add_disk_entry()

disk_t * add_disk_entry ( disk_t ** dl,
disk_t * new_dl )

References add_disk_entry(), and disk_s::next.

Referenced by add_disk_entry(), and hd_boot_disk().

◆ add_hd_entry2()

◆ add_mem()

void * add_mem ( void * p,
size_t elem_size,
size_t n )

References add_mem().

Referenced by add_mem(), read_dmas(), read_ioports(), and read_irqs().

◆ add_res_entry()

◆ assign_hw_class()

void assign_hw_class ( hd_data_t * hd_data,
hd_t * hd )
static

References assign_hw_class(), s_hd_t::base_class, bc_bluetooth, bc_braille, bc_bridge, bc_camera, bc_chipcard, bc_display, bc_dsl, bc_dvb, bc_fingerprint, bc_framebuffer, bc_hub, bc_i2o, bc_internal, bc_isdn, bc_joystick, bc_keyboard, bc_mmc_ctrl, bc_monitor, bc_mouse, bc_multimedia, bc_network, bc_network_interface, bc_partition, bc_printer, bc_scanner, bc_serial, bc_storage, bc_storage_device, bc_tv, s_hd_t::bus, bus_ide, bus_isa, bus_nvme, bus_pci, bus_scsi, bus_usb, hd_is_hw_class(), hd_set_hw_class(), s_hd_t::hotplug, hp_cardbus, hp_pcmcia, hw_all, hw_bios, hw_block, hw_bluetooth, hw_braille, hw_bridge, hw_camera, hw_cdrom, hw_chipcard, s_hd_t::hw_class, hw_cpu, hw_disk, hw_display, hw_dsl, hw_dvb, hw_fingerprint, hw_floppy, hw_framebuffer, hw_hotplug, hw_hotplug_ctrl, hw_hub, hw_ide, hw_ieee1394, hw_ieee1394_ctrl, hw_isapnp, hw_isdn, hw_joystick, hw_keyboard, hw_manual, hw_memory, hw_mmc_ctrl, hw_modem, hw_monitor, hw_mouse, hw_network, hw_network_ctrl, hw_none, hw_nvme, hw_partition, hw_pci, hw_pcmcia, hw_pcmcia_ctrl, hw_pppoe, hw_printer, hw_redasd, hw_scanner, hw_scsi, hw_sound, hw_storage_ctrl, hw_sys, hw_tape, hw_tv, hw_unknown, hw_usb, hw_usb_ctrl, hw_vbe, hw_wlan, hw_zip, hd_id_t::id, s_hd_t::is, is_audio(), is_modem(), is_pcmcia_ctrl(), is_pppoe(), s_hd_t::is_s::isapnp, sc_int_bios, sc_int_cpu, sc_int_main_mem, sc_int_sys, sc_multi_video, sc_sdev_cdrom, sc_sdev_disk, sc_sdev_floppy, sc_sdev_tape, sc_ser_fiber, sc_ser_fire, sc_ser_infiniband, sc_ser_usb, s_hd_t::sub_class, s_hd_t::usb_guid, and s_hd_t::is_s::wlan.

Referenced by assign_hw_class(), and hd_scan().

◆ canon_str()

◆ cmp_hd()

◆ copy_log2shm()

◆ crc64()

void crc64 ( uint64_t * id,
void * p,
int len )

References crc64().

Referenced by crc64(), and hd_sysfs_driver_list().

◆ create_model_name()

◆ dev_name_duplicate()

int dev_name_duplicate ( disk_t * dl,
char * dev_name )

◆ eisa_vendor_str()

char * eisa_vendor_str ( unsigned v)

◆ exists_hd_entry()

int exists_hd_entry ( hd_data_t * hd_data,
hd_t * old_hd,
hd_t * hd_ex )

◆ fix_probe_features()

void fix_probe_features ( hd_data_t * hd_data)
static

◆ float2str()

char * float2str ( int f,
int n )

References float2str().

Referenced by dump_normal(), float2str(), and str_printf().

◆ free_devtree()

◆ free_disk_list()

disk_t * free_disk_list ( disk_t * dl)

◆ free_driver_info()

◆ free_hd_detail()

hd_detail_t * free_hd_detail ( hd_detail_t * d)

References hd_detail_t::bios, cpu_info_t::bugs, usb_s::c, isapnp_dev_t::card, isapnp_card_t::card_regs, hd_detail_t::ccw, hd_detail_t::cdrom, usb_s::cloned, hd_detail_t::cpu, usb_s::d, hd_detail_bios_t::data, hd_detail_ccw_t::data, hd_detail_cdrom_t::data, hd_detail_cpu_t::data, hd_detail_floppy_t::data, hd_detail_isapnp_t::data, hd_detail_joystick_t::data, hd_detail_monitor_s::data, hd_detail_pci_t::data, hd_detail_prom_t::data, hd_detail_scsi_t::data, hd_detail_sys_t::data, hd_detail_usb_t::data, isapnp_res_t::data, memory_range_t::data, usb_s::driver, usb_s::e, cdrom_info_s::el_torito, cpu_info_t::features, hd_detail_t::floppy, sys_info_t::formfactor, free_hd_detail(), free_mem(), free_scsi(), free_str_list, sys_info_t::generation, hd_detail_bios, hd_detail_ccw, hd_detail_cdrom, hd_detail_cpu, hd_detail_devtree, hd_detail_floppy, hd_detail_isapnp, hd_detail_joystick, hd_detail_monitor, hd_detail_pci, hd_detail_prom, hd_detail_scsi, hd_detail_sys, hd_detail_usb, usb_s::i, hd_detail_t::isapnp, cdrom_info_s::iso9660, hd_detail_t::joystick, sys_info_t::lang, bios_info_t::lcd, isapnp_card_t::ldev_regs, s_pci_t::log, usb_s::manufact, vbe_info_t::mode, sys_info_t::model, cpu_info_t::model_name, hd_detail_t::monitor, bios_info_t::mouse, cdrom_info_s::name, monitor_info_t::name, hd_detail_monitor_s::next, vbe_info_t::oem_name, usb_s::p, hd_detail_t::pci, cpu_info_t::platform, cpu_info_t::power_management, usb_s::product, vbe_info_t::product_name, vbe_info_t::product_revision, hd_detail_t::prom, usb_s::raw_descr, isapnp_dev_t::ref, isapnp_card_t::res, isapnp_card_t::res_len, usb_s::s, hd_detail_t::scsi, isapnp_card_t::serial, monitor_info_t::serial, sys_info_t::serial, usb_s::serial, hd_detail_t::sys, s_pci_t::sysfs_bus_id, s_pci_t::sysfs_id, sys_info_t::system_type, usb_s::t, hd_detail_t::type, hd_detail_t::usb, bios_info_t::vbe, cpu_info_t::vend_name, monitor_info_t::vendor, sys_info_t::vendor, and vbe_info_t::vendor_name.

Referenced by add_cdrom_info(), add_hd_entry(), add_joystick_details(), free_hd_detail(), free_hd_entry(), and hd_read_cdrom_info().

◆ free_hd_entry()

◆ free_mem()

void * free_mem ( void * p)

References free_mem().

Referenced by _read_klog(), add_disk_size(), add_edid_info(), add_entry(), add_ide_sysfs_info(), add_if_name(), add_input_dev(), add_mv643xx_eth(), add_other_sysfs_info(), add_pci_data(), add_scsi_sysfs_info(), add_serial_console(), add_serial_mouse(), all_bits(), canon_str(), contains_word(), create_model_name(), do_lp(), do_zip(), dsl_driver(), dump_bios(), dump_cpu(), dump_normal(), dump_pci_data(), expand_driver_info(), free_devtree(), free_disk_list(), free_driver_info(), free_hd_detail(), free_hd_entry(), free_mem(), free_misc(), free_old_hd_entries(), free_res_list(), free_scsi(), get_block_devs(), get_cmdline(), get_generic_scsi_devs(), get_input_devices(), get_input_devs(), get_phwaddr(), get_printer_devs(), get_probe_env(), get_scsi_tape(), get_serial_devs(), get_serial_modem(), get_usb_devs(), guess_modem_name(), hal_invalidate(), hd2prop(), hd_boot_disk(), hd_change_config_status(), hd_change_status(), hd_dump_entry(), hd_fork(), hd_free_hal_devices(), hd_free_hal_properties(), hd_free_hd_data(), hd_free_hd_list(), s_str_list_t::hd_free_str_list(), hd_free_sysfsdrv(), hd_free_udevinfo(), hd_module_is_active(), hd_open_properties(), hd_pci_read_data(), hd_read_cdrom_info(), hd_read_dir(), hd_read_ibmebus(), hd_read_iscsi(), hd_read_macio(), hd_read_mdio(), hd_read_mmc(), hd_read_nd(), hd_read_nvmeof(), hd_read_of_platform(), hd_read_platform(), hd_read_properties(), hd_read_ps3_system_bus(), hd_read_sdio(), hd_read_sysfs_link(), hd_read_uisvirtpci(), hd_read_vio(), hd_read_virtio(), hd_read_visorbus(), hd_read_vm(), hd_read_xen(), hd_scan(), hd_scan_dsl(), hd_scan_floppy(), hd_scan_isdn(), hd_scan_manual(), hd_scan_misc(), hd_scan_modem(), hd_scan_mouse(), hd_scan_net(), hd_scan_pppoe(), hd_scan_serial(), hd_split(), hd_sysfs_dev2_name(), hd_sysfs_driver_list(), hd_sysfs_name2_dev(), hddb_add_info(), hddb_init_external(), hddb_init_pci(), hddb_to_device_driver(), int_fix_usb_network(), int_fix_usb_scsi(), int_modem(), int_mouse(), int_update_driver_data(), isdn_driver(), kbd_driver(), load_module_with_params(), new_id(), parse_line(), parse_modinfo(), pcmcia_ctrl_read_data(), pcmcia_read_data(), probe_module(), read_block0(), read_dir_canonical(), read_partitions(), read_udevinfo(), read_usb_lp(), reorder_x11(), run_cmd(), smbios_dump(), smbios_free(), and unload_module().

◆ free_misc()

◆ free_old_hd_entries()

◆ free_res_list()

◆ free_scsi()

◆ get_cmd_param()

char * get_cmd_param ( hd_data_t * hd_data,
int field )

◆ get_cmdline()

◆ get_disk_crc()

unsigned get_disk_crc ( unsigned char * data,
unsigned len )

References get_disk_crc().

Referenced by get_disk_crc(), and hd_boot_disk().

◆ get_kernel_version()

◆ get_probe_env()

◆ get_probe_val_int()

◆ get_probe_val_list()

◆ get_probe_val_str()

char * get_probe_val_str ( hd_data_t * hd_data,
enum probe_feature feature )

◆ get_sysfs_attr()

char * get_sysfs_attr ( const char * bus,
const char * device,
const char * attr )

References device, and get_sysfs_attr().

Referenced by get_sysfs_attr().

◆ get_sysfs_attr_by_path()

◆ get_sysfs_attr_by_path2()

char * get_sysfs_attr_by_path2 ( const char * path,
const char * attr,
unsigned * len )

◆ has_hw_class()

int has_hw_class ( hd_t * hd,
hd_hw_item_t * items )
static

◆ has_item()

int has_item ( hd_hw_item_t * items,
hd_hw_item_t item )
static

References has_item().

Referenced by has_item(), and hd_list2().

◆ has_something_attached()

◆ has_subcomponent()

int has_subcomponent ( str_list_t * list,
char * comp )

◆ have_common_res()

◆ hd_add_hd_entry()

◆ hd_add_id()

◆ hd_add_old_id()

void hd_add_old_id ( hd_t * hd)

◆ hd_add_str_list()

API_SYM str_list_t * hd_add_str_list ( str_list_t ** sl,
char * str )
related

Add a string to a string list.

The new string (str) will be copied!

References API_SYM, new_mem(), new_str(), next, and str.

◆ hd_apm_enabled()

◆ hd_attr_list()

str_list_t * hd_attr_list ( char * str)

◆ hd_attr_uint()

◆ hd_base_class_list()

◆ hd_boot_arch()

API_SYM enum boot_arch hd_boot_arch ( hd_data_t * hd_data)

References API_SYM, hd_data_t::boot, and hd_boot_arch().

Referenced by hd_boot_arch().

◆ hd_boot_disk()

◆ hd_bus_list()

API_SYM hd_t * hd_bus_list ( hd_data_t * hd_data,
unsigned bus )

◆ hd_busid_to_hwcfg()

API_SYM const char * hd_busid_to_hwcfg ( int busid)

References API_SYM, and hd_busid_to_hwcfg().

Referenced by hd_busid_to_hwcfg().

◆ hd_change_config_status()

◆ hd_change_status()

API_SYM int hd_change_status ( const char * id,
hd_status_t status,
const char * config_string )

◆ hd_clear_probe_feature()

◆ hd_color()

◆ hd_copy()

◆ hd_cpu_arch()

◆ hd_display_adapter()

◆ hd_find_sysfs_id()

◆ hd_find_sysfs_id_devname()

hd_t * hd_find_sysfs_id_devname ( hd_data_t * hd_data,
char * id,
char * devname )

◆ hd_fork()

◆ hd_fork_done()

◆ hd_free_hal_devices()

◆ hd_free_hal_properties()

◆ hd_free_hd_data()

◆ hd_free_hd_list()

◆ hd_free_manual()

API_SYM hd_manual_t * hd_free_manual ( hd_manual_t * manual)

References API_SYM, and hd_free_manual().

Referenced by hd_free_manual(), and hd_reverse_str_list().

◆ hd_free_str_list()

API_SYM str_list_t * hd_free_str_list ( str_list_t * list)
related

Free the memory allocated by a string list.

References API_SYM, free_mem(), next, and str.

◆ hd_free_sysfsdrv()

◆ hd_free_udevinfo()

◆ hd_get_device_by_id()

hd_t * hd_get_device_by_id ( hd_data_t * hd_data,
char * id )
static

◆ hd_get_device_by_idx()

◆ hd_get_hddb_dir()

char * hd_get_hddb_dir ( void )

◆ hd_get_hddb_path()

◆ hd_getdisksize()

◆ hd_has_pcmcia()

API_SYM int hd_has_pcmcia ( hd_data_t * hd_data)

◆ hd_is_hw_class()

◆ hd_is_sgi_altix()

API_SYM int hd_is_sgi_altix ( hd_data_t * hd_data)

References API_SYM, and hd_is_sgi_altix().

Referenced by hd_is_sgi_altix(), and hd_scan_net().

◆ hd_is_shm_ptr()

int hd_is_shm_ptr ( hd_data_t * hd_data,
void * ptr )

References hd_is_shm_ptr(), and hd_data_t::shm.

Referenced by hd_is_shm_ptr(), and hd_shm_clean().

◆ hd_is_uml()

◆ hd_is_xen()

API_SYM int hd_is_xen ( hd_data_t * hd_data)

References API_SYM, and hd_is_xen().

Referenced by hd_is_xen(), and hd_read_xen().

◆ hd_join()

◆ hd_list()

◆ hd_list2()

◆ hd_list_with_status()

◆ hd_list_with_status2()

◆ hd_log()

void hd_log ( hd_data_t * hd_data,
char * buf,
ssize_t len )

◆ hd_log_hex()

◆ hd_log_printf()

API_SYM void hd_log_printf ( hd_data_t * hd_data,
char * format,
... )

References API_SYM, hd_log(), and hd_log_printf().

Referenced by hd_log_printf(), and hd_log_printf().

◆ hd_mac_color()

API_SYM int hd_mac_color ( hd_data_t * hd_data)

References API_SYM, hd_color(), and hd_mac_color().

Referenced by hd_mac_color().

◆ hd_mod_cmp()

int hd_mod_cmp ( char * str1,
char * str2 )

References hd_mod_cmp().

Referenced by hd_mod_cmp(), and hd_modinfo_db().

◆ hd_module_is_active()

◆ hd_module_list()

◆ hd_move_to_shm()

◆ hd_name2eisa_id()

API_SYM unsigned hd_name2eisa_id ( char * s)

References API_SYM, hd_name2eisa_id(), MAKE_ID, and TAG_EISA.

Referenced by hd_name2eisa_id().

◆ hd_probe_feature()

◆ hd_probe_feature_by_name()

API_SYM enum probe_feature hd_probe_feature_by_name ( char * name)

◆ hd_probe_feature_by_value()

API_SYM char * hd_probe_feature_by_value ( enum probe_feature feature)

◆ hd_read_dir()

API_SYM str_list_t * hd_read_dir ( char * dir_name,
int type )

◆ hd_read_file()

API_SYM str_list_t * hd_read_file ( char * file_name,
unsigned start_line,
unsigned lines )

References API_SYM, hd_read_file(), new_mem(), and new_str().

Referenced by hd_read_file().

◆ hd_read_mmap()

API_SYM int hd_read_mmap ( hd_data_t * hd_data,
char * name,
unsigned char * buf,
off_t start,
unsigned size )

References ADD2LOG, API_SYM, and hd_read_mmap().

Referenced by hd_read_mmap().

◆ hd_read_sysfs_link()

◆ hd_report_this()

◆ hd_reverse_str_list()

API_SYM str_list_t * hd_reverse_str_list ( str_list_t * list)
related

Reverse string list.

References API_SYM, and next.

◆ hd_scan()

API_SYM void hd_scan ( hd_data_t * hd_data)

the actual hardware scan

References ADD2LOG, add_str_list, API_SYM, assign_hw_class(), s_hd_t::attached_to, hd_data_t::flag_struct::biosvram, s_hd_t::child_ids, hd_data_t::flag_struct::cpuemu, create_model_name(), hd_data_t::debug, dump_klog(), fix_probe_features(), s_hd_t::tag_s::fixed, hd_data_t::flags, free_mem(), free_str_list, get_kernel_version(), get_probe_env(), get_probe_val_int(), get_probe_val_list(), get_probe_val_str(), hd_data_t::hal, hd_data_t::hd, hd_add_id(), hd_get_device_by_id(), hd_get_device_by_idx(), hd_get_hddb_dir(), hd_join(), hd_probe_feature(), hd_scan(), hd_scan_hal_basic(), hd_scan_int(), hd_scan_manual2(), hd_scan_no_hal(), hd_scan_with_hal(), hd_set_probe_feature(), hd_shm_init(), HD_VERSION_STRING, hddb_init(), s_hd_t::idx, hd_data_t::flag_struct::internal, hd_data_t::klog, hd_data_t::kmods, hd_data_t::last_idx, mod_manual, mod_none, hd_data_t::module, pr_flags_t::name, new_str(), s_hd_t::next, s_str_list_t::next, hd_data_t::flag_struct::nobioscrc, hd_data_t::flag_struct::nofork, hd_data_t::flag_struct::nosysfs, hd_data_t::only, p_int32, p_list, p_string, s_hd_t::parent_id, hd_data_t::flag_struct::pata, pr_bios_acpi, pr_bios_crc, pr_bios_vram, pr_cpuemu, pr_default, pr_flags_by_id(), pr_fork, pr_int, pr_modules_pata, pr_sysfs, pr_udev, pr_x86emu, hd_data_t::probe, PROC_MODULES, read_file, remove_hd_entries(), set_probe_val(), hd_data_t::shm, s_str_list_t::str, str_printf(), s_hd_t::tag, pr_flags_t::type, hd_data_t::flag_struct::udev, s_hd_t::unique_id, update_irq_usage(), and hd_data_t::used_irqs.

Referenced by hd_list(), hd_list2(), hd_list_with_status(), hd_list_with_status2(), and hd_scan().

◆ hd_scan_no_hal()

◆ hd_scan_with_hal()

◆ hd_scan_xtra()

◆ hd_search_str_list()

API_SYM str_list_t * hd_search_str_list ( str_list_t * sl,
char * str )
related

Search a string list for a string.

References API_SYM, next, and str.

◆ hd_set_hw_class()

◆ hd_set_probe_feature()

◆ hd_set_probe_feature_hw()

◆ hd_shm_add()

void * hd_shm_add ( hd_data_t * hd_data,
void * ptr,
unsigned len )

◆ hd_shm_add_str()

char * hd_shm_add_str ( hd_data_t * hd_data,
char * str )
static

◆ hd_shm_add_str_list()

str_list_t * hd_shm_add_str_list ( hd_data_t * hd_data,
str_list_t * sl )
static

◆ hd_shm_clean()

◆ hd_shm_done()

void hd_shm_done ( hd_data_t * hd_data)

References hd_shm_done(), and hd_data_t::shm.

Referenced by hd_free_hd_data(), and hd_shm_done().

◆ hd_shm_init()

◆ hd_smp_support()

◆ hd_split()

◆ hd_sub_class_list()

API_SYM hd_t * hd_sub_class_list ( hd_data_t * hd_data,
unsigned base_class,
unsigned sub_class )

◆ hd_sysfs_dev2_name()

char * hd_sysfs_dev2_name ( char * str)

◆ hd_sysfs_driver_list()

◆ hd_sysfs_id()

◆ hd_sysfs_name2_dev()

char * hd_sysfs_name2_dev ( char * str)

◆ hd_timeout()

int hd_timeout ( void(* func )(void *),
void * arg,
int timeout )

◆ hd_usb_support()

◆ hd_version()

API_SYM char * hd_version ( void )

References API_SYM, hd_version(), and HD_VERSION_STRING.

Referenced by hd_version().

◆ hex()

int hex ( char * s,
int n )

References hex().

Referenced by add_hd_entry(), hd_boot_disk(), hex(), and prop2hd().

◆ hexdump()

void hexdump ( char ** buf,
int with_ascii,
unsigned data_len,
unsigned char * data )

References hexdump(), and str_printf().

Referenced by hd_log_hex(), hexdump(), smbios_dump(), and str_printf().

◆ is_audio()

◆ is_modem()

int is_modem ( hd_data_t * hd_data,
hd_t * hd )
static

◆ is_pcmcia_ctrl()

◆ is_pppoe()

int is_pppoe ( hd_data_t * hd_data,
hd_t * hd )
static

◆ isa_id2str()

char * isa_id2str ( unsigned id)

References isa_id2str(), and new_mem().

Referenced by add_hd_entry(), dump_bios(), and isa_id2str().

◆ join_res_dma()

◆ join_res_io()

◆ join_res_irq()

◆ load_module()

◆ load_module_with_params()

int load_module_with_params ( hd_data_t * hd_data,
char * module,
char * params )

◆ mod_name_by_idx()

char * mod_name_by_idx ( unsigned idx)

◆ new_mem()

void * new_mem ( size_t size)

References new_mem().

Referenced by _read_klog(), add_cdrom_info(), add_edid_info(), add_entry(), add_ide_sysfs_info(), add_if_name(), add_joystick_details(), add_kma(), add_lcd_info(), add_monitor_res(), add_pci(), add_pci_data(), add_scsi_sysfs_info(), add_serial_console(), add_serial_modem(), add_uml(), add_xpnet(), canon_str(), do_lp(), dsl_driver(), gather_resources(), get_dsl_info(), get_isdn_info(), get_linkstate(), get_phwaddr(), get_serial_info(), get_serial_modem(), get_serial_mouse(), get_sysfs_attr_by_path2(), get_usb_devs(), hal_add_new(), hal_get_new(), hd_add_hd_entry(), s_str_list_t::hd_add_str_list(), hd_base_class_list(), hd_boot_disk(), hd_bus_list(), hd_change_status(), hd_getdisksize(), hd_join(), hd_list(), hd_list2(), hd_list_with_status(), hd_list_with_status2(), hd_manual_read_entry_old(), hd_modinfo_db(), hd_module_list(), hd_pci_complete_data(), hd_pci_read_data(), hd_read_cdrom_info(), hd_read_config(), hd_read_dir(), hd_read_file(), hd_read_iscsi(), hd_read_nvmeof(), hd_read_properties(), hd_scan_fb(), hd_scan_floppy(), hd_scan_isdn(), hd_scan_memory(), hd_scan_misc(), hd_scan_misc2(), hd_scan_net(), hd_scan_pppoe(), hd_scan_serial(), hd_scan_sys(), hd_scan_wlan(), hd_sub_class_list(), hd_sysfs_driver_list(), hddb_init_external(), hddb_to_device_driver(), isa_id2str(), isdn_driver(), join_res_dma(), join_res_io(), join_res_irq(), kbd_driver(), monitor_driver(), new_cdrom_entry(), new_mem(), parse_modinfo(), prop2hd(), read_block0(), read_cpuinfo(), read_hal(), read_udevinfo(), reorder_x11(), and smbios_parse().

◆ new_str()

char * new_str ( const char * s)

References new_str().

Referenced by add_edid_info(), add_if_name(), add_input_dev(), add_kma(), add_lcd_info(), add_mv643xx_eth(), add_other_sysfs_info(), add_pci(), add_pci_data(), add_scsi_sysfs_info(), add_serial_console(), add_serial_modem(), add_serial_mouse(), add_uml(), add_xen_network(), add_xen_storage(), add_xpnet(), canon_str(), contains_word(), create_model_name(), do_lp(), do_zip(), dsl_driver(), expand_driver_info(), find_udi(), get_block_devs(), get_cmd_param(), get_cmdline(), get_generic_scsi_devs(), get_input_devices(), get_input_devs(), get_phwaddr(), get_printer_devs(), get_probe_env(), get_scsi_tape(), get_serial_devs(), get_serial_info(), get_serial_modem(), get_serial_mouse(), get_string(), get_usb_devs(), guess_modem_name(), hal_get_new(), hd2prop_add_str(), hd_add_id(), s_str_list_t::hd_add_str_list(), hd_change_config_status(), hd_dump_entry(), hd_module_is_active(), hd_open_properties(), hd_pci_read_data(), hd_read_dir(), hd_read_file(), hd_read_ibmebus(), hd_read_iscsi(), hd_read_macio(), hd_read_mdio(), hd_read_mmc(), hd_read_nd(), hd_read_nvmeof(), hd_read_of_platform(), hd_read_platform(), hd_read_ps3_system_bus(), hd_read_sdio(), hd_read_uisvirtpci(), hd_read_vio(), hd_read_virtio(), hd_read_visorbus(), hd_read_vm(), hd_read_xen(), hd_scan(), hd_scan_braille(), hd_scan_fb(), hd_scan_manual(), hd_scan_net(), hd_scan_serial(), hd_scan_sys(), hd_scan_xtra(), hd_split(), hd_sysfs_dev2_name(), hd_sysfs_driver_list(), hd_sysfs_name2_dev(), hddb_add_info(), hddb_to_device_driver(), int_modem(), int_mouse(), int_udev(), int_update_driver_data(), isdn_driver(), kbd_driver(), new_str(), parse_line(), parse_modinfo(), parse_property(), pcmcia_ctrl_read_data(), pcmcia_read_data(), prop2hd_str(), read_cdroms(), read_cpuinfo(), read_dir_canonical(), read_dmas(), read_hal(), read_ioports(), read_irqs(), read_partitions(), read_udevinfo(), read_usb_lp(), reorder_x11(), set_probe_val(), and smbios_id2str().

◆ numid2str()

char * numid2str ( uint64_t id,
int len )

References numid2str().

Referenced by hd_add_id(), hd_add_old_id(), and numid2str().

◆ pr_flags_by_id()

◆ pr_flags_by_name()

pr_flags_t * pr_flags_by_name ( char * name)
static

◆ probe_module()

int probe_module ( hd_data_t * hd_data,
char * module )

◆ progress()

void progress ( hd_data_t * hd_data,
unsigned pos,
unsigned count,
char * msg )

◆ read_block0()

unsigned char * read_block0 ( hd_data_t * hd_data,
char * dev,
int * timeout )

◆ read_dir_canonical()

str_list_t * read_dir_canonical ( char * dir_name,
int type )

◆ read_kmods()

◆ read_udevinfo()

◆ remove_hd_entries()

◆ remove_tagged_hd_entries()

◆ resize_mem()

void * resize_mem ( void * p,
size_t n )

◆ run_cmd()

◆ set_probe_feature()

◆ set_probe_val()

◆ short_vendor()

void short_vendor ( char * vendor)
static

References short_vendor(), and vendor.

Referenced by create_model_name(), and short_vendor().

◆ sigchld_handler()

void sigchld_handler ( int num)
static

References child, child_id, and sigchld_handler().

Referenced by hd_fork(), and sigchld_handler().

◆ sigusr1_handler()

void sigusr1_handler ( int num)
static

◆ sort_str_list()

str_list_t * sort_str_list ( str_list_t * sl0,
int(* cmp_func )(const void *, const void *) )

◆ str2float()

int str2float ( char * s,
int n )

References str2float().

Referenced by hd_scan_floppy(), str2float(), and str_printf().

◆ str_printf()

◆ subcomponent_list()

str_list_t * subcomponent_list ( str_list_t * list,
char * comp,
int max )

◆ test_read_block0_open()

void test_read_block0_open ( void * arg)
static

◆ timeout_alarm_handler()

void timeout_alarm_handler ( int signal)
static

◆ unload_module()

int unload_module ( hd_data_t * hd_data,
char * module )

◆ update_irq_usage()

◆ vend_id2str()

char * vend_id2str ( unsigned vend)

Variable Documentation

◆ child

volatile pid_t child
static

Referenced by hd_fork(), and sigchld_handler().

◆ child_id

pid_t child_id
static

Referenced by hd_fork(), and sigchld_handler().

◆ hd_data_sig

hd_data_t* hd_data_sig
static

Referenced by hd_fork(), and sigusr1_handler().

◆ pr_flags

◆ pr_modules

struct s_mod_names pr_modules[]
static

Referenced by mod_name_by_idx().