|
|
In most cases, it is easier to modify an existing sample MDI driver to support your network adapter than to port a DLPI driver to MDI. The hardware-specific portions, such as the interrupt routine and transmit code, may be reused with some modifications.
If you want to port a SVR5 1 or 2 DLPI driver to SVR5 MDI, the following steps may help:
See the sample source code that is provided in the ndsample package for examples of how these coding changes are implemented.
Be sure that all hardware configuration is done using the appropriate DDI functions. Cards that run on an ISA bus will also require a _verify(D2mdi) entry point routine for DDI 7 or a CFG_VERIFY subfunction to the config(D2mdi) entry point routine. Additional hardware configuration information can be supplied by specifying parameters in the bcfg(DSP/4dsp) file.
DDI 8 MDI drivers can also do this initialization in the CFG_ADD and CFG_MODIFY subfunctions to the config(D2mdi) entry point routine, but they must also fully reinitialize the hardware across close( ) and open( ) operations. This allows the autorestart code (txmon) to reinitialize the hardware when a problem is detected by sending a MAC_HWFAIL_IND(D7mdi) message. The dlpid utility either starts a failover if there is a backup device configured or it closes and reopens the MDI driver.