RtndInitDriver

RtndInitDriver initializes the driver and exchanges global information between the driver and the Network Link Layer (NL2).

Syntax

Copy
BOOL RtndInitDriver(
  [in]    const RTND_CALLBACKS *pCallbacks,
  [in]    ULONG CallbacksStructSize,
  [in]    RTND_DRIVER_INFO *pDriverInfo, 
  [in]    ULONG DriverInfoStructSize
);

Parameters

[in] pCallbacks

The address of the structure that contains the function pointers.

[in] CallbackStructSize

The size of the structure pointed to by pCallbacks.

[in] pDriverInfo

The address of the RTND_DRIVER_INFO structure to be populated by the driver.

[in] DriverInfoStructSize

The size of the structure pointed by parameter pDriverInfo.

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

RTND_ERROR_BAD_REQUEST

An indispensable callback is missing from the structure supplied in parameter. The driver requires a newer version of the NL2.

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.

To ensure backward and forward compatibility, the NL2 always uses sizeof to get the size of the RTND_CALLBACKS structure at compilation time and zeros out the structure before populating it and calling this function.

Note: The NL2 calls this function for each interface it starts. If multiple interfaces use the same driver, the NL2 will call this function multiple times. The driver must be prepared for this scenario and should not fail when it happens.

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: