libhd  5.0
Data Structures | Data Fields
s_hd_t Struct Reference

Individual hardware item. More...

#include <hd.h>

Data Structures

struct  is_s
 
struct  tag_s
 

Data Fields

struct s_hd_tnext
 Link to next hardware item. More...
 
unsigned idx
 Unique index, starting at 1. More...
 
unsigned broken:1
 Hardware appears to be broken in some way. More...
 
hd_id_t bus
 Bus type (id and name). More...
 
unsigned slot
 Slot and bus number. More...
 
unsigned func
 (PCI) function. More...
 
hd_id_t base_class
 Base class (id and name). More...
 
hd_id_t sub_class
 Sub class (id and name). More...
 
hd_id_t prog_if
 (PCI) programming interface (id and name). More...
 
hd_id_t vendor
 Vendor id and name. More...
 
hd_id_t device
 Device id and name. More...
 
hd_id_t sub_vendor
 Subvendor id and name. More...
 
hd_id_t sub_device
 Subdevice id and name. More...
 
hd_id_t revision
 Revision id or string. More...
 
char * serial
 Serial id. More...
 
hd_id_t compat_vendor
 Vendor id and name of some compatible hardware. More...
 
hd_id_t compat_device
 Device id and name of some compatible hardware. More...
 
hd_hw_item_t hw_class
 Hardware class. More...
 
unsigned char hw_class_list [(hw_all+7)/8]
 Hardware class list. More...
 
char * model
 Model name. More...
 
unsigned attached_to
 Device this hardware is attached to. More...
 
char * sysfs_id
 sysfs entry for this hardware, if any. More...
 
char * sysfs_bus_id
 sysfs bus id for this hardware, if any. More...
 
char * sysfs_device_link
 sysfs device link. More...
 
char * unix_dev_name
 Special device file. More...
 
hd_dev_num_t unix_dev_num
 Device type & number according to sysfs. More...
 
str_list_tunix_dev_names
 List of device names. More...
 
char * unix_dev_name2
 Special device file. More...
 
hd_dev_num_t unix_dev_num2
 Device type & number according to sysfs. More...
 
char * rom_id
 BIOS/PROM id. More...
 
char * udi
 HAL udi. More...
 
char * parent_udi
 udi of parent (attached_to). More...
 
char * unique_id
 Unique id for this hardware. More...
 
str_list_tunique_ids
 List of ids. More...
 
unsigned module
 (Internal) Probing module that created this entry. More...
 
unsigned line
 (Internal) Source code line where this entry was created. More...
 
unsigned count
 (Internal) Counter, used in combination with hd_t::module and hd_t::line. More...
 
hd_res_tres
 Device resources. More...
 
hd_detail_tdetail
 Special info associated with this hardware. More...
 
str_list_textra_info
 (Internal) Unspecific text info. More...
 
hd_status_t status
 Hardware status (if available). More...
 
char * config_string
 Some config info. More...
 
hd_hotplug_t hotplug
 Hotplug controller for this device. More...
 
unsigned hotplug_slot
 Slot the hotplug device is connected to (e.g. More...
 
struct s_hd_t::is_s is
 
struct s_hd_t::tag_s tag
 
unsigned char * block0
 (Internal) First 512 bytes of block devices. More...
 
char * driver
 Currently active driver. More...
 
char * driver_module
 Currently active driver module (if any). More...
 
str_list_tdrivers
 List of currently active drivers. More...
 
str_list_tdriver_modules
 List of currently active driver modules. More...
 
char * old_unique_id
 Old unique_id for compatibility. More...
 
char * parent_id
 unique_id of parent (attached_to). More...
 
str_list_tchild_ids
 unique_ids of children (parent_id). More...
 
char * unique_id1
 (Internal) location independent unique_id part. More...
 
char * usb_guid
 USB Global Unique Identifier. More...
 
driver_info_tdriver_info
 device driver info More...
 
str_list_trequires
 packages/programs required for this hardware More...
 
hal_prop_thal_prop
 hal property list More...
 
hal_prop_tpersistent_prop
 persistent property list More...
 
char * modalias
 module alias More...
 
char * label
 Consistent Device Name (CDN), pci firmware spec 3.1, chapter 4.6.7. More...
 
unsigned ref_cnt
 (Internal) memory reference count. More...
 
struct s_hd_tref
 (Internal) if set, this is only a reference. More...
 

Detailed Description

Individual hardware item.

Every hardware component gets an hd_t entry. A list of all hardware items is in hd_data_t::hd.

Field Documentation

◆ attached_to

unsigned s_hd_t::attached_to

◆ base_class

hd_id_t s_hd_t::base_class

Base class (id and name).

Referenced by add_input_dev(), add_kma(), add_monitor(), add_mv643xx_eth(), add_partitions(), 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(), assign_hw_class(), cmp_hd(), create_model_name(), do_lp(), do_zip(), dump_normal(), free_hd_entry(), get_block_devs(), get_dsl_info(), get_generic_scsi_devs(), get_input_devices(), get_isdn_info(), get_scsi_tape(), get_serial_devs(), get_serial_modem(), get_serial_mouse(), get_usb_devs(), hd2prop(), hd_apm_enabled(), hd_base_class_list(), hd_boot_disk(), hd_color(), hd_cpu_arch(), hd_display_adapter(), hd_dump_entry(), hd_is_uml(), hd_modinfo_db(), hd_pci_complete_data(), hd_read_ibmebus(), hd_read_macio(), hd_read_mdio(), hd_read_mmc(), hd_read_nd(), 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_braille(), hd_scan_cpu(), hd_scan_dsl(), hd_scan_fb(), hd_scan_floppy(), hd_scan_isdn(), hd_scan_kbd(), hd_scan_memory(), hd_scan_misc(), hd_scan_misc2(), hd_scan_monitor(), hd_scan_net(), hd_scan_pppoe(), hd_scan_serial(), hd_scan_sys(), hd_scan_wlan(), hd_scan_xtra(), hd_sub_class_list(), hd_usb_support(), hddb_add_info(), int_cdrom(), int_floppy(), int_media_check(), int_modem(), int_mouse(), int_wlan(), is_audio(), is_modem(), is_pcmcia_ctrl(), is_pppoe(), is_zip(), kbd_driver(), pcmcia_ctrl_read_data(), pcmcia_read_data(), prop2hd(), read_cpuinfo(), and set_class_entries().

◆ block0

unsigned char* s_hd_t::block0

(Internal) First 512 bytes of block devices.

To check accessibility of block devices we read the first block. The data is used to identify the boot device.

Referenced by free_hd_entry(), hd_boot_disk(), hd_scan_misc(), and int_media_check().

◆ broken

unsigned s_hd_t::broken

Hardware appears to be broken in some way.

This was used to indicate broken framebuffer support of some graphics cards. Currently unused.

Referenced by dump_normal(), hd2prop(), and prop2hd().

◆ bus

hd_id_t s_hd_t::bus

◆ child_ids

str_list_t* s_hd_t::child_ids

unique_ids of children (parent_id).

Note
Please do not use it for now.

Referenced by free_hd_entry(), hd2prop(), hd_dump_entry(), hd_scan(), and prop2hd().

◆ compat_device

hd_id_t s_hd_t::compat_device

◆ compat_vendor

hd_id_t s_hd_t::compat_vendor

◆ config_string

char* s_hd_t::config_string

Some config info.

Every hardware item may get some string assigned. This string is stored in files below /var/lib/hardware/unique-keys/. There is no meaning associated with this string.

Referenced by free_hd_entry(), hd2prop(), hd_change_config_status(), hd_dump_entry(), hd_scan_manual(), and prop2hd().

◆ count

unsigned s_hd_t::count

(Internal) Counter, used in combination with hd_t::module and hd_t::line.

Referenced by add_hd_entry(), and hd_dump_entry().

◆ detail

hd_detail_t* s_hd_t::detail

◆ device

hd_id_t s_hd_t::device

◆ driver

char* s_hd_t::driver

Currently active driver.

Referenced by free_hd_entry(), and int_update_driver_data().

◆ driver_info

driver_info_t* s_hd_t::driver_info

◆ driver_module

char* s_hd_t::driver_module

Currently active driver module (if any).

Referenced by dump_normal(), and int_update_driver_data().

◆ driver_modules

str_list_t* s_hd_t::driver_modules

List of currently active driver modules.

Referenced by dump_normal(), free_hd_entry(), and int_update_driver_data().

◆ drivers

str_list_t* s_hd_t::drivers

◆ extra_info

str_list_t* s_hd_t::extra_info

(Internal) Unspecific text info.

It is used to track IDE interfaces and assign them to the correct IDE controllers.

Referenced by free_hd_entry(), hd_dump_entry(), and pcmcia_read_data().

◆ func

unsigned s_hd_t::func

◆ hal_prop

hal_prop_t* s_hd_t::hal_prop

hal property list

Referenced by add_pci(), find_udi(), free_hd_entry(), hd_dump_entry(), int_cdrom(), and int_hotplug().

◆ hotplug

hd_hotplug_t s_hd_t::hotplug

Hotplug controller for this device.

It indicates what kind of hotplug device (if any) this is.

Referenced by assign_hw_class(), dump_normal(), hd2prop(), hd_scan_xtra(), int_hotplug(), pcmcia_ctrl_read_data(), pcmcia_read_data(), and prop2hd().

◆ hotplug_slot

unsigned s_hd_t::hotplug_slot

Slot the hotplug device is connected to (e.g.

PCMCIA socket).

Note
hotplug_slot counts 1-based (0: no information available).

Referenced by dump_normal(), pcmcia_ctrl_read_data(), and pcmcia_read_data().

◆ hw_class

hd_hw_item_t s_hd_t::hw_class

◆ hw_class_list

unsigned char s_hd_t::hw_class_list[(hw_all+7)/8]

Hardware class list.

A device may belong to more than one hardware class.(Internal) bitmask of hw classes.

Referenced by hd2prop(), hd_is_hw_class(), hd_set_hw_class(), and prop2hd().

◆ idx

unsigned s_hd_t::idx

◆ is

struct s_hd_t::is_s s_hd_t::is

◆ label

char* s_hd_t::label

Consistent Device Name (CDN), pci firmware spec 3.1, chapter 4.6.7.

Referenced by dump_normal(), and hd_pci_complete_data().

◆ line

unsigned s_hd_t::line

(Internal) Source code line where this entry was created.

Referenced by add_hd_entry(), cmp_hd(), hd_dump_entry(), and hd_read_config().

◆ modalias

char* s_hd_t::modalias

◆ model

char* s_hd_t::model

Model name.

This is a combination of vendor and device names. Some heuristics is used to make it more presentable. Use this instead of hd_t::vendor and hd_t::device.

Referenced by create_model_name(), dump_normal(), free_hd_entry(), hd2prop(), hddb_add_info(), prop2hd(), and read_usb_lp().

◆ module

unsigned s_hd_t::module

◆ next

struct s_hd_t* s_hd_t::next

Link to next hardware item.

Referenced by add_hd_entry2(), add_kma(), add_monitor(), add_pci(), add_pci_data(), add_uml(), add_xpnet(), do_lp(), do_zip(), exists_hd_entry(), free_devtree(), free_old_hd_entries(), get_block_devs(), get_generic_scsi_devs(), get_input_devices(), get_printer_devs(), get_scsi_tape(), get_serial_devs(), get_serial_modem(), get_serial_mouse(), get_usb_devs(), has_something_attached(), hd_apm_enabled(), hd_base_class_list(), hd_boot_disk(), hd_bus_list(), hd_color(), hd_copy(), hd_cpu_arch(), hd_display_adapter(), hd_dump_entry(), hd_find_sysfs_id(), hd_find_sysfs_id_devname(), hd_free_hd_list(), hd_get_device_by_id(), hd_get_device_by_idx(), hd_has_pcmcia(), hd_is_uml(), hd_list(), hd_list2(), hd_list_with_status(), hd_list_with_status2(), hd_scan(), hd_scan_braille(), hd_scan_cpu(), hd_scan_dsl(), hd_scan_fb(), hd_scan_floppy(), hd_scan_hal_assign_udi(), hd_scan_int(), hd_scan_isdn(), hd_scan_manual(), hd_scan_manual2(), hd_scan_misc(), hd_scan_misc2(), hd_scan_monitor(), hd_scan_net(), hd_scan_no_hal(), hd_scan_pppoe(), hd_scan_serial(), hd_scan_with_hal(), hd_scan_wlan(), hd_scan_xtra(), hd_smp_support(), hd_sub_class_list(), hd_usb_support(), int_add_driver_modules(), int_cdrom(), int_devicenames(), int_find_parent(), int_fix_usb_scsi(), int_floppy(), int_hotplug(), int_media_check(), int_modem(), int_mouse(), int_udev(), int_wlan(), kbd_driver(), pcmcia_ctrl_read_data(), read_properties(), remove_hd_entries(), remove_tagged_hd_entries(), and update_irq_usage().

◆ old_unique_id

char* s_hd_t::old_unique_id

Old unique_id for compatibility.

The calculation of unique ids has changed in libhd v3.17. Basically we no longer use the vendor/device names if there are vendor/device ids. (Otherwise a simple device name database update would change the id, which is really not what you want.)

Referenced by free_hd_entry(), hd_add_id(), hd_dump_entry(), and new_id().

◆ parent_id

char* s_hd_t::parent_id

unique_id of parent (attached_to).

Note
Please do not use it for now.

Referenced by free_hd_entry(), hd2prop(), hd_dump_entry(), hd_scan(), hd_scan_manual(), and prop2hd().

◆ parent_udi

char* s_hd_t::parent_udi

udi of parent (attached_to).

Referenced by add_pci(), hd_dump_entry(), and int_find_parent().

◆ persistent_prop

hal_prop_t* s_hd_t::persistent_prop

◆ prog_if

hd_id_t s_hd_t::prog_if

◆ ref

struct s_hd_t* s_hd_t::ref

(Internal) if set, this is only a reference.

Referenced by free_old_hd_entries(), hd_copy(), hd_free_hd_list(), and hddb_add_info().

◆ ref_cnt

unsigned s_hd_t::ref_cnt

(Internal) memory reference count.

Referenced by free_old_hd_entries(), and hd_copy().

◆ requires

str_list_t* s_hd_t::requires

packages/programs required for this hardware

Referenced by dsl_driver(), dump_normal(), expand_driver_info(), free_hd_entry(), hddb_add_info(), and isdn_driver().

◆ res

hd_res_t* s_hd_t::res

◆ revision

hd_id_t s_hd_t::revision

Revision id or string.

If revision is numerical (e.g. PCI) hd_id_t::id is used. If revision is some char data (e.g. disk drives) it is stored in hd_id_t::name.

Referenced by add_ide_sysfs_info(), add_scsi_sysfs_info(), cmp_hd(), dump_normal(), free_hd_entry(), get_dsl_info(), get_isdn_info(), get_usb_devs(), hd2prop(), hd_add_id(), hd_pci_complete_data(), hddb_add_info(), pcmcia_read_data(), and prop2hd().

◆ rom_id

char* s_hd_t::rom_id

BIOS/PROM id.

Where appropriate, this is a special BIOS/PROM id (e.g. "0x80" for the first harddisk on Intel-PCs). CHPID for s390.

Referenced by add_scsi_sysfs_info(), dump_normal(), free_hd_entry(), hd2prop(), hd_read_vio(), hd_read_xen(), and prop2hd().

◆ serial

char* s_hd_t::serial

◆ slot

unsigned s_hd_t::slot

◆ status

hd_status_t s_hd_t::status

Hardware status (if available).

The status is stored in files below /var/lib/hardware/unique-keys/. Every hardware item gets a file there with its unique id as file name.

Referenced by hd2prop(), hd_change_config_status(), hd_dump_entry(), hd_list(), hd_list2(), hd_list_with_status(), hd_list_with_status2(), hd_scan_manual(), hd_scan_manual2(), hd_scan_xtra(), int_media_check(), and prop2hd().

◆ sub_class

hd_id_t s_hd_t::sub_class

Sub class (id and name).

Referenced by add_disk_size(), add_edid_info(), add_ide_sysfs_info(), add_if_name(), add_input_dev(), add_kma(), add_mv643xx_eth(), add_pci(), add_pci_data(), add_scsi_sysfs_info(), add_serial_console(), add_serial_mouse(), add_uml(), add_xen_network(), add_xen_storage(), add_xpnet(), assign_hw_class(), cmp_hd(), create_model_name(), do_lp(), do_zip(), dump_normal(), free_hd_entry(), get_block_devs(), get_dsl_info(), get_generic_scsi_devs(), get_input_devices(), get_scsi_tape(), get_serial_devs(), get_serial_modem(), get_serial_mouse(), hd2prop(), hd_apm_enabled(), hd_base_class_list(), hd_boot_disk(), hd_color(), hd_cpu_arch(), hd_display_adapter(), hd_dump_entry(), hd_is_uml(), hd_modinfo_db(), hd_pci_complete_data(), hd_read_ibmebus(), hd_read_macio(), hd_read_mdio(), hd_read_nd(), hd_read_of_platform(), hd_read_platform(), hd_read_ps3_system_bus(), hd_read_sdio(), hd_read_vio(), hd_read_virtio(), hd_read_vm(), hd_read_xen(), hd_scan_braille(), hd_scan_cpu(), hd_scan_floppy(), hd_scan_isdn(), hd_scan_kbd(), hd_scan_memory(), hd_scan_misc(), hd_scan_misc2(), hd_scan_monitor(), hd_scan_net(), hd_scan_pppoe(), hd_scan_serial(), hd_scan_sys(), hd_scan_wlan(), hd_scan_xtra(), hd_sub_class_list(), hd_usb_support(), hddb_add_info(), int_cdrom(), int_floppy(), int_media_check(), int_modem(), int_mouse(), int_wlan(), is_audio(), is_modem(), is_pcmcia_ctrl(), is_zip(), kbd_driver(), pcmcia_ctrl_read_data(), pcmcia_read_data(), prop2hd(), read_cpuinfo(), and set_class_entries().

◆ sub_device

hd_id_t s_hd_t::sub_device

Subdevice id and name.

Id is actually a combination of some tag to differentiate the various id types and the real id. Use the ID_VALUE macro to get e.g. the real PCI id value for a PCI device.

Referenced by add_pci(), add_scsi_sysfs_info(), create_model_name(), dump_normal(), free_hd_entry(), get_dsl_info(), get_isdn_info(), hd2prop(), hd_add_id(), hd_modinfo_db(), hd_pci_complete_data(), hd_scan_xtra(), hddb_add_info(), is_zip(), kbd_driver(), prop2hd(), and read_usb_lp().

◆ sub_vendor

hd_id_t s_hd_t::sub_vendor

Subvendor id and name.

Id is actually a combination of some tag to differentiate the various id types and the real id. Use the ID_VALUE macro to get e.g. the real PCI id value for a PCI device.

Referenced by add_pci(), add_scsi_sysfs_info(), cmp_hd(), create_model_name(), dump_normal(), free_hd_entry(), get_dsl_info(), get_isdn_info(), hd2prop(), hd_add_id(), hd_modinfo_db(), hd_pci_complete_data(), hd_scan_xtra(), hddb_add_info(), is_zip(), prop2hd(), and read_usb_lp().

◆ sysfs_bus_id

char* s_hd_t::sysfs_bus_id

◆ sysfs_device_link

char* s_hd_t::sysfs_device_link

◆ sysfs_id

char* s_hd_t::sysfs_id

◆ tag

struct s_hd_t::tag_s s_hd_t::tag

◆ udi

char* s_hd_t::udi

◆ unique_id

char* s_hd_t::unique_id

Unique id for this hardware.

A unique string identifying this hardware. The string consists of two parts separated by a dot ("."). The part before the dot describes the location (where the hardware is attached in the system). The part after the dot identifies the hardware itself. The string must not contain slashes ("/") because we're going to create files with this id as name. Apart from this there are no restrictions on the form of this string.

Referenced by free_hd_entry(), hd2prop(), hd_add_id(), hd_add_old_id(), hd_dump_entry(), hd_get_device_by_id(), hd_scan(), hd_scan_manual(), hd_scan_manual2(), hd_write_config(), int_fix_usb_scsi(), new_id(), prop2hd(), and read_properties().

◆ unique_id1

char* s_hd_t::unique_id1

(Internal) location independent unique_id part.

The speed up some internal searches, we store it here separately.

Referenced by free_hd_entry(), hd_add_id(), and new_id().

◆ unique_ids

str_list_t* s_hd_t::unique_ids

List of ids.

◆ unix_dev_name

char* s_hd_t::unix_dev_name

◆ unix_dev_name2

char* s_hd_t::unix_dev_name2

Special device file.

Device file name to access this hardware. Most hardware only has one device name stored in hd_t::unix_dev_name. But in some cases there's an alternative name.

Referenced by add_input_dev(), dump_normal(), find_udi(), free_hd_entry(), get_block_devs(), get_generic_scsi_devs(), get_input_devices(), hd2prop(), int_mouse(), and prop2hd().

◆ unix_dev_names

str_list_t* s_hd_t::unix_dev_names

List of device names.

Device file names to access this hardware. Normally something below /dev. They should be all equivalent. The preferred name however is hd_t::unix_dev_name.

Referenced by add_if_name(), dump_normal(), find_udi(), free_hd_entry(), get_input_devices(), hd2prop(), int_devicenames(), int_mouse(), int_udev(), and prop2hd().

◆ unix_dev_num

hd_dev_num_t s_hd_t::unix_dev_num

◆ unix_dev_num2

hd_dev_num_t s_hd_t::unix_dev_num2

Device type & number according to sysfs.

Referenced by add_input_dev(), dump_normal(), get_generic_scsi_devs(), and get_input_devices().

◆ usb_guid

char* s_hd_t::usb_guid

USB Global Unique Identifier.

Available for USB devices. This may even be set if hd_t::bus is not bus_usb (e.g. USB storage devices will have hd_t::bus set to bus_scsi due to SCSI emulation).

Referenced by assign_hw_class(), dump_normal(), free_hd_entry(), hd2prop(), int_hotplug(), and prop2hd().

◆ vendor

hd_id_t s_hd_t::vendor

The documentation for this struct was generated from the following file: