LdmPCIDevice

LdmPCIDevice — PCI Device abstraction

Functions

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── LdmDevice
            ╰── LdmPCIDevice

Description

An LdmPCIDevice is a specialised implementation of the LdmDevice which is aware of PCI capabilities and GPU data. This class is never directly created by the user, but is instead returned by the LdmManager.

This class extends the base LdmDevice to add PCI specific data. The primary use case within LDM is to detect GPUs, which will all carry the “device-type” of LDM_DEVICE_TYPE_PCI | LDM_DEVICE_TYPE_GPU.

Users can test if a device is a PCI device without having to cast, by simply checking the “device-type”:

1
2
3
4
5
6
7
8
if (ldm_device_has_type(device, LDM_DEVICE_TYPE_PCI)) {
        g_message("Found PCI device");
}

// Alternatively..
if (LDM_IS_PCI_DEVICE(device)) {
        g_message("Found PCI device through casting");
}

Functions

ldm_pci_device_get_address ()

void
ldm_pci_device_get_address (LdmPCIDevice *device,
                            guint *bus,
                            guint *dev,
                            gint *func);

Store the PCI device address into the provided parameters.

Parameters

bus

Pointer to store the bus identifier in

 

dev

Pointer to store the dev identifier in

 

func

Pointer to store the func identifier in

 

Types and Values

See Also

LdmDevice