source: network-demos/networkconfig-qemu.h @ ab15736

4.11network-demos-4-10-branch
Last change on this file since ab15736 was 83dbe37, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 10, 2009 at 6:24:02 PM

2009-02-10 Joel Sherrill <joel.sherrill@…>

  • networkconfig-qemu.h: Add option for qemu to use PCI i82551 NIC.
  • Property mode set to 100644
File size: 4.8 KB
Line 
1/*
2 * Network configuration -- QEMU NOT using DHCP
3 *
4 ************************************************************
5 * EDIT THIS FILE TO REFLECT YOUR NETWORK CONFIGURATION     *
6 * BEFORE RUNNING ANY RTEMS PROGRAMS WHICH USE THE NETWORK! *
7 ************************************************************
8 *
9 *  networkconfig.h,v 1.8 2001/08/31 18:11:43 joel Exp
10 */
11
12#ifndef _RTEMS_NETWORKCONFIG_H_
13#define _RTEMS_NETWORKCONFIG_H_
14
15/*
16 *  The following will normally be set by the BSP if it supports
17 *  a single network device driver.  In the event, it supports
18 *  multiple network device drivers, then the user's default
19 *  network device driver will have to be selected by a BSP
20 *  specific mechanism.
21 */
22
23#undef RTEMS_BSP_NETWORK_DRIVER_NAME
24#undef RTEMS_BSP_NETWORK_DRIVER_ATTACH
25#if 0
26#define RTEMS_BSP_NETWORK_DRIVER_NAME    "ne1"
27#define RTEMS_BSP_NETWORK_DRIVER_ATTACH  rtems_ne_driver_attach
28#else
29int
30rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching);
31#define RTEMS_BSP_NETWORK_DRIVER_NAME    "fxp1"
32#define RTEMS_BSP_NETWORK_DRIVER_ATTACH  rtems_fxp_attach
33#endif
34
35
36#ifdef RTEMS_USE_BOOTP
37#undef RTEMS_USE_BOOTP
38#endif
39
40/*
41 * If you use DHCP on the QEMU instance, there is less configuration
42 */
43// #define RTEMS_USE_BOOTP
44
45#include <bsp.h>
46
47/*
48 * Define RTEMS_SET_ETHERNET_ADDRESS if you want to specify the
49 * Ethernet address here.  If RTEMS_SET_ETHERNET_ADDRESS is not
50 * defined the driver will choose an address.
51 */
52//#define RTEMS_SET_ETHERNET_ADDRESS
53#ifdef RTEMS_SET_ETHERNET_ADDRESS
54#undef RTEMS_SET_ETHERNET_ADDRESS
55#endif
56
57#if (defined (RTEMS_SET_ETHERNET_ADDRESS))
58/* static char ethernet_address[6] = { 0x08, 0x00, 0x3e, 0x12, 0x28, 0xb1 }; */
59static char ethernet_address[6] = { 0x00, 0x80, 0x7F, 0x22, 0x61, 0x77 };
60#endif
61
62#ifdef RTEMS_USE_LOOPBACK
63/*
64 * Loopback interface
65 */
66extern void rtems_bsdnet_loopattach();
67static struct rtems_bsdnet_ifconfig loopback_config = {
68        "lo0",                          /* name */
69        rtems_bsdnet_loopattach,        /* attach function */
70        NULL,                           /* link to next interface */
71        "127.0.0.1",                    /* IP address */
72        "255.0.0.0",                    /* IP net mask */
73};
74#endif
75
76/*
77 * Default network interface
78 */
79static struct rtems_bsdnet_ifconfig netdriver_config = {
80        RTEMS_BSP_NETWORK_DRIVER_NAME,          /* name */
81        RTEMS_BSP_NETWORK_DRIVER_ATTACH,        /* attach function */
82
83#ifdef RTEMS_USE_LOOPBACK
84        &loopback_config,               /* link to next interface */
85#else
86        NULL,                           /* No more interfaces */
87#endif
88
89#if (defined (RTEMS_USE_BOOTP))
90        NULL,                           /* BOOTP supplies IP address */
91        NULL,                           /* BOOTP supplies IP net mask */
92#else
93        "10.0.2.5",                     /* IP address */
94        "255.255.255.0",                /* IP net mask */
95#endif /* !RTEMS_USE_BOOTP */
96
97#if (defined (RTEMS_SET_ETHERNET_ADDRESS))
98        ethernet_address,               /* Ethernet hardware address */
99#else
100        NULL,                           /* Driver supplies hardware address */
101#endif
102        0,                              /* Use default driver parameters */
103        0, /* mtu */
104        0, /* rbuf_count */
105        0, /* xbuf_count */
106        0, /* port */
107        9 /* irq */
108};
109
110/*
111 * Network configuration
112 */
113struct rtems_bsdnet_config rtems_bsdnet_config = {
114        &netdriver_config,
115
116#if (defined (RTEMS_USE_BOOTP))
117        rtems_bsdnet_do_bootp,
118#else
119        NULL,
120#endif
121        0,                      /* Default network task priority */
122        256 * 1024,             /* 256K - not default mbuf capacity */
123        256 * 1024,             /* 256K - not default mbuf cluster capacity */
124#if (!defined (RTEMS_USE_BOOTP))
125        "rtems",        /* Host name */
126        "",             /* Domain name */
127        "10.0.2.1",     /* Gateway */
128        "10.0.0.1",     /* Log host */
129        {"10.0.2.3" },  /* Name server(s) */
130        {"" },          /* NTP server(s) */
131#else
132      #error "Fill me in"
133#endif /* !RTEMS_USE_BOOTP */
134        1,                   /* sb_efficiency */
135        0,                   /* udp_tx_buf_size */
136        0,                   /* udp_rx_buf_size */
137        0,                   /* tcp_tx_buf_size */
138        0                    /* tcp_rx_buf_size */
139
140};
141
142/*
143 * For TFTP test application
144 */
145#if (defined (RTEMS_USE_BOOTP))
146#define RTEMS_TFTP_TEST_HOST_NAME "BOOTP_HOST"
147#define RTEMS_TFTP_TEST_FILE_NAME "BOOTP_FILE"
148#else
149#define RTEMS_TFTP_TEST_HOST_NAME "XXX.YYY.ZZZ.XYZ"
150#define RTEMS_TFTP_TEST_FILE_NAME "tftptest"
151#endif
152
153/*
154 * For NFS test application
155 *
156 * NFS mount and a directory to ls once mounted
157 */
158#define RTEMS_NFS_SERVER      "192.168.1.210"
159#define RTEMS_NFS_SERVER_PATH "/home"
160#define RTEMS_NFS_LS_PATH     "/mnt/nfstest"
161
162#endif /* _RTEMS_NETWORKCONFIG_H_ */
Note: See TracBrowser for help on using the repository browser.