Network devices are specified and configured by declaring and initializing a
struct rtems_bsdnet_ifconfig
structure for each network device.
The structure entries are described in the following table. An application which uses a single network interface, gets network configuration information from a BOOTP/DHCP server, and uses the default values for all driver parameters needs to initialize only the first two entries in the structure.
char *name
"scc1"
).
The bsp.h
include file usually defines RTEMS_BSP_NETWORK_DRIVER_NAME as
the name of the primary (or only) network driver.
int (*attach)(struct rtems_bsdnet_ifconfig *conf)
attach
function. The network
initialization function calls this function to configure the driver and
attach it to the network stack.
The bsp.h
include file usually defines RTEMS_BSP_NETWORK_DRIVER_ATTACH as
the name of the attach function of the primary (or only) network driver.
struct rtems_bsdnet_ifconfig *next
NULL
if this is the configuration structure of the
last network interface.
char *ip_address
129.128.4.2
) form, or NULL
if the device configuration information is being obtained from a
BOOTP/DHCP server.
char *ip_netmask
255.255.255.0
) form, or NULL
if the device configuration information is being obtained from a
BOOTP/DHCP server.
void *hardware_address
NULL
if the driver is
to obtain the hardware address in some other way (usually by reading
it from the device or from the bootstrap ROM).
int ignore_broadcast
int mtu
int rbuf_count
int xbuf_count
A complete network configuration specification can be as simple as the one shown in the following example. This configuration uses a single network interface, gets network configuration information from a BOOTP/DHCP server, and uses the default values for all driver parameters.
static struct rtems_bsdnet_ifconfig netdriver_config = { RTEMS_BSP_NETWORK_DRIVER_NAME, RTEMS_BSP_NETWORK_DRIVER_ATTACH }; struct rtems_bsdnet_config rtems_bsdnet_config = { &netdriver_config, rtems_bsdnet_do_bootp, };
Copyright © 1988-2008 OAR Corporation