1 | /* |
---|
2 | * Network configuration |
---|
3 | * |
---|
4 | ************************************************************ |
---|
5 | * EDIT THIS FILE TO REFLECT YOUR NETWORK CONFIGURATION * |
---|
6 | * BEFORE RUNNING ANY RTEMS PROGRAMS WHICH USE THE NETWORK! * |
---|
7 | ************************************************************ |
---|
8 | * |
---|
9 | * $Id$ |
---|
10 | */ |
---|
11 | |
---|
12 | #ifndef _RTEMS_NETWORKCONFIG_H_ |
---|
13 | #define _RTEMS_NETWORKCONFIG_H_ |
---|
14 | |
---|
15 | #ifndef RTEMS_BSP_NETWORK_DRIVER_NAME |
---|
16 | #warning "RTEMS_BSP_NETWORK_DRIVER_NAME is not defined" |
---|
17 | #define RTEMS_BSP_NETWORK_DRIVER_NAME "no_network1" |
---|
18 | #endif |
---|
19 | |
---|
20 | #ifndef RTEMS_BSP_NETWORK_DRIVER_ATTACH |
---|
21 | #warning "RTEMS_BSP_NETWORK_DRIVER_ATTACH is not defined" |
---|
22 | #define RTEMS_BSP_NETWORK_DRIVER_ATTACH 0 |
---|
23 | #endif |
---|
24 | |
---|
25 | /* #define RTEMS_USE_BOOTP */ |
---|
26 | |
---|
27 | #include <bsp.h> |
---|
28 | |
---|
29 | /* |
---|
30 | * Define RTEMS_SET_ETHERNET_ADDRESS if you want to specify the |
---|
31 | * Ethernet address here. If RTEMS_SET_ETHERNET_ADDRESS is not |
---|
32 | * defined the driver will choose an address. |
---|
33 | */ |
---|
34 | #define RTEMS_SET_ETHERNET_ADDRESS |
---|
35 | #if (defined (RTEMS_SET_ETHERNET_ADDRESS)) |
---|
36 | /* static char ethernet_address[6] = { 0x08, 0x00, 0x3e, 0x12, 0x28, 0xb1 }; */ |
---|
37 | static char ethernet_address[6] = { 0x00, 0x80, 0x7F, 0x22, 0x61, 0x77 }; |
---|
38 | |
---|
39 | #endif |
---|
40 | |
---|
41 | #ifdef RTEMS_USE_LOOPBACK |
---|
42 | /* |
---|
43 | * Loopback interface |
---|
44 | */ |
---|
45 | extern void rtems_bsdnet_loopattach(); |
---|
46 | static struct rtems_bsdnet_ifconfig loopback_config = { |
---|
47 | "lo0", /* name */ |
---|
48 | rtems_bsdnet_loopattach, /* attach function */ |
---|
49 | |
---|
50 | NULL, /* link to next interface */ |
---|
51 | |
---|
52 | "127.0.0.1", /* IP address */ |
---|
53 | "255.0.0.0", /* IP net mask */ |
---|
54 | }; |
---|
55 | #endif |
---|
56 | |
---|
57 | /* |
---|
58 | * Default network interface |
---|
59 | */ |
---|
60 | static struct rtems_bsdnet_ifconfig netdriver_config = { |
---|
61 | RTEMS_BSP_NETWORK_DRIVER_NAME, /* name */ |
---|
62 | RTEMS_BSP_NETWORK_DRIVER_ATTACH, /* attach function */ |
---|
63 | |
---|
64 | #ifdef RTEMS_USE_LOOPBACK |
---|
65 | &loopback_config, /* link to next interface */ |
---|
66 | #else |
---|
67 | NULL, /* No more interfaces */ |
---|
68 | #endif |
---|
69 | |
---|
70 | #if (defined (RTEMS_USE_BOOTP)) |
---|
71 | NULL, /* BOOTP supplies IP address */ |
---|
72 | NULL, /* BOOTP supplies IP net mask */ |
---|
73 | #else |
---|
74 | "XXX.YYY.ZZZ.XYZ", /* IP address */ |
---|
75 | "255.255.255.0", /* IP net mask */ |
---|
76 | #endif /* !RTEMS_USE_BOOTP */ |
---|
77 | |
---|
78 | #if (defined (RTEMS_SET_ETHERNET_ADDRESS)) |
---|
79 | ethernet_address, /* Ethernet hardware address */ |
---|
80 | #else |
---|
81 | NULL, /* Driver supplies hardware address */ |
---|
82 | #endif |
---|
83 | 0 /* Use default driver parameters */ |
---|
84 | }; |
---|
85 | |
---|
86 | /* |
---|
87 | * Network configuration |
---|
88 | */ |
---|
89 | struct rtems_bsdnet_config rtems_bsdnet_config = { |
---|
90 | &netdriver_config, |
---|
91 | |
---|
92 | #if (defined (RTEMS_USE_BOOTP)) |
---|
93 | rtems_bsdnet_do_bootp, |
---|
94 | #else |
---|
95 | NULL, |
---|
96 | #endif |
---|
97 | |
---|
98 | 0, /* Default network task priority */ |
---|
99 | 0, /* Default mbuf capacity */ |
---|
100 | 0, /* Default mbuf cluster capacity */ |
---|
101 | |
---|
102 | #if (!defined (RTEMS_USE_BOOTP)) |
---|
103 | "rtems_host", /* Host name */ |
---|
104 | "nodomain.com", /* Domain name */ |
---|
105 | "XXX.YYY.ZZZ.1", /* Gateway */ |
---|
106 | "XXX.YYY.ZZZ.1", /* Log host */ |
---|
107 | {"XXX.YYY.ZZZ.1" }, /* Name server(s) */ |
---|
108 | {"XXX.YYY.ZZZ.1" }, /* NTP server(s) */ |
---|
109 | |
---|
110 | /* |
---|
111 | * A real example -- DO NOT USE THIS YOURSELF!!! |
---|
112 | */ |
---|
113 | |
---|
114 | #if 0 |
---|
115 | "dy4", /* Host name */ |
---|
116 | "NOT_oarcorp.com", /* Domain name */ |
---|
117 | "192.168.1.2", /* Gateway */ |
---|
118 | "192.168.1.2", /* Log host */ |
---|
119 | {"192.168.1.2" }, /* Name server(s) */ |
---|
120 | {"192.168.1.2" }, /* NTP server(s) */ |
---|
121 | #endif |
---|
122 | #endif /* !RTEMS_USE_BOOTP */ |
---|
123 | |
---|
124 | }; |
---|
125 | |
---|
126 | /* |
---|
127 | * For TFTP test application |
---|
128 | */ |
---|
129 | #if (!defined (RTEMS_USE_BOOTP)) |
---|
130 | #define RTEMS_TFTP_TEST_HOST_NAME "XXX.YYY.ZZZ.XYZ" |
---|
131 | #define RTEMS_TFTP_TEST_FILE_NAME "tftptest" |
---|
132 | #endif |
---|
133 | |
---|
134 | #endif /* _RTEMS_NETWORKCONFIG_H_ */ |
---|