dbcce9ddb0
The new implementation of this library provides abstractions for network drivers, and should be used for all network drivers from now on. It provides the following functionality: - a function call table abstraction, hiding the details of the datalink protocol with simple parameters; - a state machine for sending and receiving packets, freeing the actual driver from keeping track of pending requests; - an abstraction for copying data from and to the network driver, freeing the actual driver from dealing with I/O vectors while at the same time providing a copy implementation which is more efficient than most current driver implementations; - a generalized implementation of zero-copy port-based I/O; - a clearer set of policies and defaults. While the concept is very similar to lib{block,char,fs,input}driver, one main difference is that libnetdriver now also takes care of SEF initialization, mainly so that aspects such as recovery policies and live-update aspects can be changed for all network drivers in a single place. As always, for the case that the provided message loop is too restrictive, a set of more low-level message processing functions is provided. The netdriver API has been designed so as to allow alleviation of one current protocol bottleneck: the fact that at most one send request and one receive request may be pending at any time. Changing this aspect will however require a significant rewrite of libnetdriver, and possibly debugging of drivers that are not able to cope with (in particular) queuing multiple packets for transmission at once. Beyond that, the design of the new API is based on the current protocol, and may be changed/extended later to allow for non-ethernet network drivers, exposure of link status, multicast address configuration, suspend and resume, and any other features that are in fact long overdue. Change-Id: I47ec47e05852c42f92af04549d41524f928efec2 |
||
---|---|---|
.. | ||
Makefile | ||
netdriver.c | ||
netdriver.h | ||
portio.c |