bindings-libpci-0.4.0.1: Low level bindings to libpci
Safe HaskellSafe-Inferred
LanguageHaskell2010

Bindings.Libpci.Pci

Synopsis

Documentation

data C'id_entry Source #

Constructors

C'id_entry 

data C'id_bucket Source #

Constructors

C'id_bucket 

data C'udev Source #

Constructors

C'udev 

data C'udev_hwdb Source #

Constructors

C'udev_hwdb 

c'PCI_ACCESS_AUTO :: Num a => a Source #

Autodetection

c'PCI_ACCESS_SYS_BUS_PCI :: Num a => a Source #

Linux sysbus/pci

c'PCI_ACCESS_PROC_BUS_PCI :: Num a => a Source #

Linux procbus/pci

c'PCI_ACCESS_I386_TYPE1 :: Num a => a Source #

i386 ports, type 1

c'PCI_ACCESS_I386_TYPE2 :: Num a => a Source #

i386 ports, type 2

c'PCI_ACCESS_FBSD_DEVICE :: Num a => a Source #

FreeBSD devpci

c'PCI_ACCESS_AIX_DEVICE :: Num a => a Source #

devpci0, devbus0, etc.

c'PCI_ACCESS_NBSD_LIBPCI :: Num a => a Source #

NetBSD libpci

c'PCI_ACCESS_OBSD_DEVICE :: Num a => a Source #

OpenBSD devpci

c'PCI_ACCESS_DUMP :: Num a => a Source #

Dump file

data C'pci_access Source #

PCI Access Structure

Access method

Open in read/write mode

Bus-centric view of the world

Name of ID list file (use pci_set_name_list_path())

Set if id_file_name is malloced

Enforce PCI_LOOKUP_NUMERIC (>1 => PCI_LOOKUP_MIXED)

pci_lookup_mode flags which are set automatically Default: PCI_LOOKUP_CACHE

Turn on debugging messages

Write error message and quit

Write a warning message

Write a debugging message

Devices found on this bus

names.c

0=not read, 1=read, 2=dirty

names-hwdb.c

proc/sys: fd for config space

proc/sys: fd opened read-write

proc/sys: current position

sys: fd for VPD

proc/sys: device the fds are for

c'pci_alloc :: IO (Ptr C'pci_access) Source #

Initialize PCI access

p'pci_cleanup :: FunPtr (Ptr C'pci_access -> IO ()) Source #

Scanning of devices

p'pci_scan_bus :: FunPtr (Ptr C'pci_access -> IO ()) Source #

Raw access to specified device

p'pci_free_dev :: FunPtr (Ptr C'pci_dev -> IO ()) Source #

Names of access methods | Returns -1 if not found

p'pci_lookup_method :: FunPtr (CString -> IO CInt) Source #

Returns "" if unavailable, NULL if index out of range

p'pci_access'buscentric :: Ptr C'pci_access -> Ptr CInt Source #

Please use pci_walk_params() for traversing the list

p'pci_access'error :: Ptr C'pci_access -> Ptr (FunPtr (CString -> IO ())) Source #

Explanation of the parameter

p'pci_get_param :: FunPtr (Ptr C'pci_access -> CString -> IO CString) Source #

0 on success, -1 if no such parameter

p'pci_set_param :: FunPtr (Ptr C'pci_access -> CString -> CString -> IO CInt) Source #

To traverse the list, call pci_walk_params repeatedly, first with prev=NULL, and do not modify the parameters during traversal

data C'pci_dev Source #

Devices

Next device in the chain

16-bit version of the PCI domain for backward compatibility

Bus inside domain, device and function

These fields are set by pci_fill_info() | Set of info fields already known (see pci_fill_info())

Identity of the device

Identity of the device

PCI device class

IRQ number

Base addresses including flags in lower bits

Region sizes

Expansion ROM base address

Expansion ROM size

List of capabilities

Physical slot

Linux kernel module alias

Device name as exported by BIOS

NUMA node

PCI_IORESOURCE_* flags for regions

PCI_IORESOURCE_* flags for expansion ROM

PCI domain (host bridge)

Cached config registers

Cached low 7 bits of header type, -1 if unknown

Auxiliary data for use by the back-end

Instances

Instances details
Eq C'pci_dev Source # 
Instance details

Defined in Bindings.Libpci.Pci

Show C'pci_dev Source # 
Instance details

Defined in Bindings.Libpci.Pci

Storable C'pci_dev Source # 
Instance details

Defined in Bindings.Libpci.Pci

c'pci_read_byte :: Ptr C'pci_dev -> CInt -> IO CUChar Source #

Access to configuration space

c'pci_fill_info :: Ptr C'pci_dev -> CInt -> IO CInt Source #

Most device properties take some effort to obtain, so libpci does not initialize them during default bus scan. Instead, you have to call pci_fill_info() with the proper PCI_FILL_xxx constants OR'ed together.

Some properties are stored directly in the pci_dev structure. The remaining ones can be accessed through pci_get_string_property().

pci_fill_info() returns the current value of pci_dev->known_fields. This is a bit mask of all fields, which were already obtained during the lifetime of the device. This includes fields which are not supported by the particular device -- in that case, the field is left at its default value, which is 0 for integer fields and NULL for pointers. On the other hand, we never consider known fields unsupported by the current back-end; such fields always contain the default value.

XXX: flags and the result should be unsigned, but we do not want to break the ABI.

p'pci_dev'access :: Ptr C'pci_dev -> Ptr (Ptr C'pci_access) Source #

Position in the config space

p'pci_dev'cache :: Ptr C'pci_dev -> Ptr (Ptr CUChar) Source #

Traditional PCI capabilities

p'pci_dev'cache_len :: Ptr C'pci_dev -> Ptr CInt Source #

PCIe extended capabilities

p'pci_filter'domain :: Ptr C'pci_filter -> Ptr CInt Source #

Conversion of PCI ID's to names (according to the pci.ids file) Call pci_lookup_name() to identify different types of ID's: VENDOR(vendorID) -> vendor DEVICE(vendorID, deviceID) -> device VENDOR | DEVICE(vendorID, deviceID) -> combined vendor and device SUBSYSTEM | VENDOR(subvendorID) -> subsystem vendor SUBSYSTEM | DEVICE(vendorID, deviceID, subvendorID, subdevID) -> subsystem device SUBSYSTEM | VENDOR | DEVICE(vendorID, deviceID, subvendorID, subdevID) -> combined subsystem v+d SUBSYSTEM | ...(-1, -1, subvendorID, subdevID) -> generic subsystem CLASS(classID) -> class PROGIF(classID, progif) -> programming interface

p'pci_lookup_name :: FunPtr (Ptr C'pci_access -> CString -> CInt -> CUInt -> CInt -> CInt -> CInt -> CInt -> IO CString) Source #

Called automatically by pci_lookup_*() when needed; returns success

p'pci_filter'device_class :: Ptr C'pci_filter -> Ptr CInt Source #

Called automatically by pci_cleanup

c'PCI_LOOKUP_VENDOR :: Num a => a Source #

1 Vendor name (args: vendorID)

c'PCI_LOOKUP_DEVICE :: Num a => a Source #

2 Device name (args: vendorID, deviceID)

c'PCI_LOOKUP_CLASS :: Num a => a Source #

4 Device class (args: classID)

c'PCI_LOOKUP_PROGIF :: Num a => a Source #

16 Programming interface (args: classID, prog_if)

c'PCI_LOOKUP_NUMERIC :: Num a => a Source #

0x10000 Want only formatted numbers; default if access->numeric_id is set

c'PCI_LOOKUP_NO_NUMBERS :: Num a => a Source #

0x20000 Return NULL if not found in the database; default is to print numerically

c'PCI_LOOKUP_MIXED :: Num a => a Source #

0x40000 Include both numbers and names

c'PCI_LOOKUP_NETWORK :: Num a => a Source #

0x80000 Try to resolve unknown ID's by DNS

c'PCI_LOOKUP_SKIP_LOCAL :: Num a => a Source #

0x100000 Do not consult local database

c'PCI_LOOKUP_CACHE :: Num a => a Source #

0x200000 Consult the local cache before using DNS

c'PCI_LOOKUP_REFRESH_CACHE :: Num a => a Source #

0x400000 Forget all previously cached entries, but still allow updating the cache

c'PCI_LOOKUP_NO_HWDB :: Num a => a Source #

0x800000 Do not ask udev's hwdb