Partager via


HalGetBusData (Windows Embedded CE 6.0)

1/6/2010

This function retrieves configuration information about a specified slot or address on a I/O bus.

Syntax

ULONG HalGetBusData( 
  BUS_DATA_TYPE BusDataType, 
  ULONG BusNumber, 
  ULONG SlotNumber, 
  PVOID Buffer, 
  ULONG Length 
);

Parameters

  • BusDataType
    [in] Type of bus data to be retrieved. The upper bound on the types supported is always MaximumBusDataType from the BUS_DATA_TYPE enumeration. Implementation of bus routines is OEM-specific. The default CEDDK.dll returns 0 for this function. The CEDDK.dll for a CEPC supports PNPISAConfiguration and PCIConfiguration bus configurations.
  • BusNumber
    [in] Zero-based and system-assigned number of the bus in systems with several buses of the same BusDataType.
  • SlotNumber
    [in] Logical slot number or location of the device. If PCIConfiguration is specified as the BusDataType, this value a PCI_SLOT_NUMBER value, which is the slot and function numbers combined.
  • Buffer
    [in] Pointer to a caller-supplied buffer for configuration information specific to BusDataType. If you specify PCIConfiguration, the buffer contains the PCI_COMMON_CONFIG information for the specified SlotNumber and function number.
  • Length
    [in] Maximum number of bytes to return in Buffer.

Return Value

Returns the number of bytes of data it wrote in the specified buffer. If the specifed BusDataType is not valid for the current platform, this function returns 0.

The following table shows the return values for this function that indicate errors when the input BusType is PCIConfiguration.

Value Description

0

The specified PCI bus does not exist.

2

The specified PCI bus exists, but there is no device at the specified PCI SlotNumber. The Buffer also contains the PCI_INVALID_VENDOR_ID value for the VendorId member of PCI_COMMON_CONFIG.

Remarks

Device drivers call this function during initialization to locate their devices on a particular I/O bus. You can use the returned configuration data, which is specific to the bus type, in later calls to other configuration and initialization functions, such as HalTranslateBusAddress.

For supported buses, HalGetBusData calls HalGetBusDataByOffset with an Offset of 0, which retrieves configuration information for the device starting at Offset 0.

Requirements

Header ceddk.h
Library CEDDK.lib
Windows Embedded CE Windows CE 2.10 and later

See Also

Reference

CEDDK Dynamic-Link Library Bus Access Functions
BUS_DATA_TYPE
HalGetBusDataByOffset
HalSetBusData
HalSetBusDataByOffset
HalTranslateBusAddress
PCI_COMMON_CONFIG