RtndManageInterface
RtndManageInterface manages an interface on the PCI Bus.
Syntax
BOOL RtndManageInterface(
[in] ULONG PciBusNumber,
[in] PCI_SLOT_NUMBER PciSlotNumber,
[in] RTND_INTERFACE_OBJECT *pNL2Interface,
[in] CHAR *pInterfaceName,
[out] ULONG_PTR *pRtndInterfaceId
);
Parameters
[in] PciBusNumber
The PCI Bus number where the device is located.
[in] PciSlotNumber
The PCI Slot number where the device is located. The number contains the device number and the function number.
[in] pNL2Interface
The opaque pointer used by the NL2 to identify this interface.
[in] pInterfaceName
The address of a null-terminated string containing the name of the interface assigned by the user.
[out] pRtndInterfaceId
The number or pointer used by the NIC driver to identify this interface.
Return Value
If the function succeeds, it returns TRUE. If the function fails, it returns FALSE. To get extended error information, call GetLastError.
Common error codes:
Error code | Meaning |
---|---|
ERROR_OUTOFMEMORY |
Failed to allocate the required memory. |
ERROR_DEVICE_ENUMERATION_ERROR |
There is no device at the supplied PCI Location, or there is a device but it is not supported by this driver. |
RT_ERROR_TRANSLATING_PCI_BUS_ADDRESS |
Failed to translate the address found in the PCI Configuration space of the device. |
RT_ERROR_MAPPING_REGISTERS |
Failed to map the device registers to memory. |
Note: Custom drivers may return other error codes not listed above.
Remarks
The NL2 always calls this function from the main thread of the NL2 process.
This function is expected to read the PCI Configuration Space of the specified device. It may read some registers of the NIC if necessary, but it shall NOT write any register.
This function typically allocates a context for the specified interface, and assigns a number to it, which is returned in pRtndInterfaceId. The NL2 can then use this number to identify this interface in all subsequent function calls.
The pInterfaceName parameter is strictly informational. It is given for convenience if the driver has logging capability, or if it is built in debug mode and wants to print messages on the console output. The driver can copy all string content or reference it as a pointer. The NL2 guarantees that the content at this address will always contain the name of the interface.
Characteristics
Real-time requirements | ||
Deterministic behavior |
Not required |
|
Local memory allocation/deallocation restrictions | ||
Process |
External MSpace |
Internal MSpace |
System |
Allowed |
Allowed |
Process |
Allowed |
Allowed |
Contiguous memory allocation/deallocation restrictions | ||
Contiguous memory |
Allowed |
Requirements
Minimum supported version | Header |
---|---|
eRTOS 1.0 SDK |
Rtnd.h |
See Also: