|
|
#include <sys/types.h> #include <sys/stream.h> #include <sys/mdi.h> #include <sys/ddi.h>
MDI version 2 drivers can be implemented with either ``DDI interface versioning''DDI version 7 or DDI version 8. The set of supported entry points in these two DDI versions is different. The following table compares the entry point routine set in DDI 7 and DDI 8.
Comparison of DDI 7 and DDI 8 entry point routines (MDI drivers)
Routine | Context | DDI 7 | DDI 8 | Notes |
close(D2mdi) | blockable | r | r | changed syntax |
config(D2mdi) | blockable | -- | r | |
devinfo(D2mdi) | blockable | -- | r | changed syntax |
init(D2mdi) | initialization | o | -- | use _load(D2mdi) for dynamically loadable drivers |
halt(D2mdi) | non-blockable | r | -- | see CFG_SUSPEND subfunction to config(D2) |
intr(D2mdi) | interrupt | r | r | changed syntax |
_load(D2mdi) | blockable | r | r | |
open(D2mdi) | blockable | r | r | note different syntax; see open(D2str). |
_unload(D2mdi) | blockable | r | r | |
_verify(D2mdi) | blockable | o | -- | see CFG_VERIFY subfunction to config(D2) |
uwput(D2mdi) | interrupt | r | r |
DDI 7 drivers declare their entry point routines in a streamtab(D4str) structure and a driver wrapper; see _load(D2) concerning the different wrapper types.
DDI 8 STREAMS drivers use the drvops(D4) structure to declare all entry point routines except for the put(D2str) and srv(D2str) routines that are used only in STREAMS drivers and are declared in a streamtab structure. The drvops structure includes a pointer to the driver's streamtab structure. The driver must call the drv_attach(D3) function from its _load(D2) routine to attach the drvops structure.
_load(D2mdi), _unload(D2mdi), _verify(D2mdi), close(D2mdi), config(D2mdi), devinfo(D2mdi), halt(D2mdi), intr(D2mdi), open(D2mdi), uwput(D2mdi),
Developing MDI network adapter drivers in Developing MDI network adapter drivers