RtndInitializeInterface
RtndInitializeInterface 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.
Syntax
INT RtndInitializeInterface ( BOOL fDisplayErrorMessages, CHAR *deviceName, PRTNAL_INTERFACE pNalInterface );
Parameters
fDisplayErrorMessages
Verbose flag. If non-zero then driver has the option to be verbose about errors or warnings. If 0, driver should be silent and simply return the -1 error code on catastrophic errors.
deviceName
The ASCII name for this device. This can be stored in a local configuration structure to help de-reference network device pointer in RtndConfigure.
pNalInterface
An input/output pointer to a RTNAL_INTERFACE structure defined in rtnapi.h
. This structure contains information used by the NAL to bring up the driver. On output the driver should update the structure with actual configuration.
Return Value
A return value of 0 indicates Success, -1 indicates Failure. The possible error codes are:
Error Code | Meaning |
---|---|
ERROR_DEVICE_ENUMERATION_ERROR | The driver did not found a supported device at specified PCI location. |
ERROR_NOT_ENOUGH_MEMORY | The driver could not allocate memory to initialize network interface. |
Remarks
RtndInitializeInterface will be called once and only once per instance of the driver, but may be called multiple times if more than one instance of the driver is needed for more than one NIC. As such, all drivers should keep a local configuration structure array to hold configuration information read in during the RtndInitializeInterface function. The driver then simply increments a local instance count variable to index the array. RtndInitializeInterface should store a copy of the device name and a pointer to a network device data structure in the local configuration structure array slot along with other configuration information, so that RtndConfigure can find the proper slot in the local configuration array.
See the Driver Source files in the RTX64 SDK for samples of network interface drivers and specifically how a driver should keep track of multiple instances of its configuration information.
Process Context
RtndInitializeInterface 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 |
See Also: