Allow network interface card to be selected using site-specific

configuration file.  Provide example selection for RTEMS pc386 target.
This commit is contained in:
W. Eric Norum
2001-04-30 21:03:12 +00:00
parent 057fbc10a0
commit ea74ab6e7a
2 changed files with 35 additions and 5 deletions
@@ -0,0 +1,4 @@
#
# Site-specific overrides for RTEMS-pc386 target
#
TARGET_CFLAGS += -DEPICS_RTEMS_NIC_3C509
+31 -5
View File
@@ -2,8 +2,11 @@
* RTEMS network configuration for EPICS
* $Id$
* Author: W. Eric Norum
* eric@cls.usask.ca
* (306) 966-6055
* eric.norum@usask.ca
* (306) 966-5394
*
* This file can be copied to an application source dirctory
* and modified to override the values shown below.
*/
#include <stdio.h>
#include <bsp.h>
@@ -19,9 +22,33 @@ static struct rtems_bsdnet_ifconfig loopback_config = {
"127.0.0.1", /* IP address */
"255.0.0.0", /* IP net mask */
};
/*
* The following conditionals select the network interface card.
*
* By default the network interface specified by the board-support
* package is used.
* To use a different NIC for a particular application, copy this file to the
* application directory and add the appropriate -Dxxxx to the compiler flag.
* To specify a different NIC on a site-wide basis, add the appropriate
* flags to the site configuration file for the target. For example, to
* specify a 3COM 3C509 for all RTEMS-pc386 targets at your site, add
* TARGET_CFLAGS += -DEPICS_RTEMS_NIC_3C509
* to configure/os/CONFIG_SITE.Common.RTEMS-pc386.
*/
#if defined(EPICS_RTEMS_NIC_3C509) /* 3COM 3C509 */
extern int rtems_3c509_driver_attach (struct rtems_bsdnet_ifconfig *, int);
# define NIC_NAME "en0"
# define NIC_ATTACH rtems_3c509_driver_attach
#else /* Use NIC provided by BSP */
# define NIC_NAME RTEMS_BSP_NETWORK_DRIVER_NAME
# define NIC_ATTACH RTEMS_BSP_NETWORK_DRIVER_ATTACH
#endif
static struct rtems_bsdnet_ifconfig netdriver_config = {
RTEMS_BSP_NETWORK_DRIVER_NAME, /* name */
RTEMS_BSP_NETWORK_DRIVER_ATTACH, /* attach function */
NIC_NAME, /* name */
NIC_ATTACH, /* attach function */
&loopback_config, /* link to next interface */
};
struct rtems_bsdnet_config rtems_bsdnet_config = {
@@ -31,4 +58,3 @@ struct rtems_bsdnet_config rtems_bsdnet_config = {
180*1024, /* MBUF space */
350*1024, /* MBUF cluster space */
};