Upper layer functions are called by drivers to deliver received packets or transmission completion status back up into the network stack.
These functions are defined by the hardware independent upper layers of the networking driver support. They are present to hide the interfaces to the actual networking stack so that the hardware drivers may be used by different network stack implementations without change.
These functions require a pointer to a struct eth_drv_sc which describes the interface at a logical level. It is assumed that the low level hardware driver will keep track of this pointer so it may be passed “up” as appropriate.
void (sc->funs->eth_drv->init)( struct eth_drv_sc *sc, unsigned char *enaddr) |
void (sc->funs->eth_drv->tx_done)( struct eth_drv_sc *sc, unsigned long key, int status) |
It should be called from the deliver function (see the Section called Deliver function) or poll function (see the Section called Poll function).
void (sc->funs->eth_drv->recv)(struct eth_drv_sc *sc, int len) |
It should be called from the deliver function (see the Section called Deliver function) or poll function (see the Section called Poll function).