RtndConfigure

RtndConfigure is called for each instance of the driver when the driver should configure the NIC hardware. This function should set up receive buffers, transmit buffers, card modes, events, etc.

NOTE: The driver should NOT enable interrupts or packet reception on the NIC withinRtndConfigure. The driver should wait until the RtndUpDown routine is called before enabling interrupts or packet reception. However some RTX64 network drivers enable interrupts in RtndConfigure and simply return 0 to bring the device up in RtndUpDown.

Syntax

INT RtndConfigure (
    VOID *ndp
);

Parameters

ndp

Network Device Pointer. Opaque network device identifier.

Return Value

A return value of 0 indicates Success, -1 indicates Failure. The possible error codes are:

Error Code Meaning
ERROR_ADAP_HDW_ERR Error configuring adapter hardware.
ERROR_ALREADY_ASSIGNED The device is already configured.
ERROR_BAD_ARGUMENTS Invalid interface index or queue number.
ERROR_NOT_ENOUGH_MEMORY Could not allocate memory to configure the device.
RT_ERROR_FAILED_TO_ATTACH_INTERRUPT Failed to attach the interrupt.
RT_ERROR_INCORRECT_INTERRUPT_TYPE The device does not support requested interrupt type.

Remarks

The RtndConfigure function may be called more than once for a given driver. The RtndConfigure function will be called for every device the driver needs to service. The driver can use the RtnGetDeviceName function to retrieve the ASCII device name used for a given instance of the driver.  It can then match this device name with those stored in the local configuration array to find its local configuration data. The driver should then store the appropriate index to its local configuration array in the network device data structure pointer, parameter ndp, by using RtnSetDataLong with offset 0. This will allow the driver to quickly locate its local configuration data in all other RTND functions by using RtnGetDataLong with offset 0, instead of matching the device name.

The RtndConfigure routine must use the RtnSetLinkAddress function to notify the NAL of the Ethernet address for the NIC associated with this instance of the driver. RtndConfigure should also create any events it will need, along with creating and starting necessary threads.  

Process Context

RtndConfigure is always called from within the process context of the RTX64Nal process.

Requirements

Minimum Supported Version RTX64 4.0
Header RtnApi.h
Library RTX64Nal.lib