This is Unofficial EPICS BASE Doxygen Site
rtems_netconfig.c
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2002 The University of Saskatchewan
3 * EPICS BASE is distributed subject to a Software License Agreement found
4 * in file LICENSE that is included with this distribution.
5 \*************************************************************************/
6 /*
7  * RTEMS network configuration for EPICS
8  * Author: W. Eric Norum
9  * eric.norum@usask.ca
10  * (306) 966-5394
11  *
12  * This file can be copied to an application source dirctory
13  * and modified to override the values shown below.
14  */
15 #include <stdio.h>
16 #include <bsp.h>
17 #include <rtems/rtems_bsdnet.h>
18 
19 extern void rtems_bsdnet_loopattach();
20 static struct rtems_bsdnet_ifconfig loopback_config = {
21  "lo0", /* name */
22  (int (*)(struct rtems_bsdnet_ifconfig *, int))rtems_bsdnet_loopattach, /* attach function */
23  NULL, /* link to next interface */
24  "127.0.0.1", /* IP address */
25  "255.0.0.0", /* IP net mask */
26 };
27 
28 /*
29  * The following conditionals select the network interface card.
30  *
31  * On RTEMS-pc386 targets all network drivers which support run-time
32  * probing are linked.
33  * On other targets the network interface specified by the board-support
34  * package is used.
35  * To use a different NIC for a particular application, copy this file to the
36  * application directory and make the appropriate changes.
37  */
38 #if defined(__i386__)
39 
40 extern int
41 rtems_ne2kpci_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach);
42 static struct rtems_bsdnet_ifconfig ne2k_driver_config = {
43  "ne2", /* name */
44  rtems_ne2kpci_driver_attach, /* attach function */
45  &loopback_config, /* link to next interface */
46 };
47 extern int rtems_fxp_attach (struct rtems_bsdnet_ifconfig *, int);
48 static struct rtems_bsdnet_ifconfig fxp_driver_config = {
49  "fxp1", /* name */
50  rtems_fxp_attach, /* attach function */
51  &ne2k_driver_config, /* link to next interface */
52 };
53 extern int rtems_3c509_driver_attach (struct rtems_bsdnet_ifconfig *, int);
54 static struct rtems_bsdnet_ifconfig e3c509_driver_config = {
55  "ep0", /* name */
56  rtems_3c509_driver_attach, /* attach function */
57  &fxp_driver_config, /* link to next interface */
58 };
59 #define FIRST_DRIVER_CONFIG &e3c509_driver_config
60 #else
61 
62 # if defined(__PPC)
63  /*
64  * FIXME: This really belongs in the BSP
65  */
66 # ifndef RTEMS_BSP_NETWORK_DRIVER_NAME
67 # define RTEMS_BSP_NETWORK_DRIVER_NAME "dc1"
68 # endif
69 # ifndef RTEMS_BSP_NETWORK_DRIVER_ATTACH
70 # define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_dec21140_driver_attach
71  extern int rtems_dec21140_driver_attach();
72 # endif
73 # endif
74 
75 static struct rtems_bsdnet_ifconfig bsp_driver_config = {
76  RTEMS_BSP_NETWORK_DRIVER_NAME, /* name */
77  RTEMS_BSP_NETWORK_DRIVER_ATTACH, /* attach function */
78  &loopback_config, /* link to next interface */
79 };
80 #define FIRST_DRIVER_CONFIG &bsp_driver_config
81 
82 #endif
83 
84 /*
85  * Allow configure/os/CONFIG_SITE.Common.RTEMS to provide domain name
86  */
87 #ifdef RTEMS_NETWORK_CONFIG_DNS_DOMAINNAME
88 # define XSTR(x) STR(x)
89 # define STR(x) #x
90 # define MY_DOMAINNAME XSTR(RTEMS_NETWORK_CONFIG_DNS_DOMAINNAME)
91 #else
92 # define MY_DOMAINNAME NULL
93 #endif
94 
95 /*
96  * Allow non-BOOTP network configuration
97  */
98 #ifndef MY_DO_BOOTP
99 # define MY_DO_BOOTP rtems_bsdnet_do_bootp
100 #endif
101 
102 /*
103  * Allow site- and BSP-specific network buffer space configuration.
104  * The macro values are specified in KBytes.
105  */
106 #ifndef RTEMS_NETWORK_CONFIG_MBUF_SPACE
107 # define RTEMS_NETWORK_CONFIG_MBUF_SPACE 180
108 #endif
109 #ifndef RTEMS_NETWORK_CONFIG_CLUSTER_SPACE
110 # define RTEMS_NETWORK_CONFIG_CLUSTER_SPACE 350
111 #endif
112 
113 /*
114  * Network configuration
115  */
117  FIRST_DRIVER_CONFIG, /* Link to next interface */
118  MY_DO_BOOTP, /* How to find network config */
119  10, /* If 0 then the network daemons will run at a */
120  /* priority just less than the lowest-priority */
121  /* EPICS scan thread. */
122  /* If non-zero then the network daemons will run */
123  /* at this *RTEMS* priority */
126  NULL, /* Host name */
127  MY_DOMAINNAME, /* Domain name */
128 };
void rtems_bsdnet_loopattach()
#define NULL
Definition: catime.c:38
struct rtems_bsdnet_config rtems_bsdnet_config
#define MY_DOMAINNAME
#define RTEMS_NETWORK_CONFIG_MBUF_SPACE
int rtems_ne2kpci_driver_attach(struct rtems_bsdnet_ifconfig *config, int attach)
Definition: ne2kpci.c:28
#define FIRST_DRIVER_CONFIG
#define MY_DO_BOOTP
#define RTEMS_NETWORK_CONFIG_CLUSTER_SPACE