hd_t Struct Reference
[Public interface]

Individual hardware item. More...

#include <hd.h>


Data Fields

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

Data Structures

struct  is_s
struct  tag_s


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

struct s_hd_t* hd_t::next [read]

Link to next hardware item.

unsigned hd_t::idx

Unique index, starting at 1.

Use hd_get_device_by_idx() to look up an hardware entry by index. And don't free the result!

unsigned 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.

hd_id_t hd_t::bus

Bus type (id and name).

unsigned hd_t::slot

Slot and bus number.

Bits 0-7: slot number, 8-31 bus number.

unsigned hd_t::func

(PCI) function.

hd_id_t hd_t::base_class

Base class (id and name).

hd_id_t hd_t::sub_class

Sub class (id and name).

hd_id_t hd_t::prog_if

(PCI) programming interface (id and name).

hd_id_t hd_t::vendor

Vendor 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.

hd_id_t hd_t::device

Device 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.

Note:
If you're looking or something printable, you might want to use hd_t::model instead.

hd_id_t 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.

hd_id_t 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.

hd_id_t 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.

char* hd_t::serial

Serial id.

hd_id_t hd_t::compat_vendor

Vendor id and name of some compatible hardware.

Used mainly for ISA-PnP devices.

hd_id_t hd_t::compat_device

Device id and name of some compatible hardware.

Used mainly for ISA-PnP devices.

hd_hw_item_t hd_t::hw_class

Hardware class.

Not to confuse with base_class!

unsigned char 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.

char* 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.

unsigned hd_t::attached_to

Device this hardware is attached to.

Link to some 'parent' device. Use hd_get_device_by_idx() to get the corresponding hardware entry.

char* hd_t::sysfs_id

sysfs entry for this hardware, if any.

char* hd_t::sysfs_bus_id

sysfs bus id for this hardware, if any.

char* hd_t::sysfs_device_link

sysfs device link.

char* hd_t::unix_dev_name

Special device file.

Device file name to access this hardware. Normally something below /dev. For network interfaces this is the interface name.

hd_dev_num_t hd_t::unix_dev_num

Device type & number according to sysfs.

str_list_t* 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.

char* 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.

hd_dev_num_t hd_t::unix_dev_num2

Device type & number according to sysfs.

char* 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.

char* hd_t::udi

HAL udi.

char* hd_t::parent_udi

udi of parent (attached_to).

char* 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.

str_list_t* hd_t::unique_ids

List of ids.

unsigned hd_t::module

(Internal) Probing module that created this entry.

unsigned hd_t::line

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

unsigned hd_t::count

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

hd_res_t* hd_t::res

Device resources.

hd_detail_t* hd_t::detail

Special info associated with this hardware.

Note:
This is going to change!

str_list_t* hd_t::extra_info

(Internal) Unspecific text info.

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

hd_status_t 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.

char* 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.

hd_hotplug_t hd_t::hotplug

Hotplug controller for this device.

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

unsigned 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).

struct hd_t::is_s hd_t::is

struct hd_t::tag_s hd_t::tag

unsigned char* 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.

char* hd_t::driver

Currently active driver.

char* hd_t::driver_module

Currently active driver module (if any).

str_list_t* hd_t::drivers

List of currently active drivers.

str_list_t* hd_t::driver_modules

List of currently active driver modules.

char* 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.)

char* hd_t::parent_id

unique_id of parent (attached_to).

Note:
Please do not use it for now.

str_list_t* hd_t::child_ids

unique_ids of children (parent_id).

Note:
Please do not use it for now.

char* hd_t::unique_id1

(Internal) location independent unique_id part.

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

char* 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).

driver_info_t* hd_t::driver_info

device driver info

str_list_t* hd_t::requires

packages/programs required for this hardware

hal_prop_t* hd_t::hal_prop

hal property list

hal_prop_t* hd_t::persistent_prop

persistent property list

char* hd_t::modalias

module alias

unsigned hd_t::ref_cnt

(Internal) memory reference count.

struct s_hd_t* hd_t::ref [read]

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


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