]> rtime.felk.cvut.cz Git - orte.git/blob - orte/examples/rtems-shell/networkconfig-i386-qemu.h
RTEMS: alternative example network configuration for ne2k card under QEMU.
[orte.git] / orte / examples / rtems-shell / networkconfig-i386-qemu.h
1 #ifndef __NETWORKCONFIG_H__
2 #define __NETWORKCONFIG_H__
3
4 #include <rtems/rtems_bsdnet.h>
5 #include <rtems/rtems_dhcp_failsafe.h>
6 #include <bsp.h>
7
8 static char ethernet_address[6] = {0x00, 0x04, 0x9F, 0x00, 0x27, 0x50 };
9
10 #ifdef RTEMS_USE_LOOPBACK
11
12 int rtems_bsdnet_loopattach(struct rtems_bsdnet_ifconfig *, int);
13
14 #ifdef RTEMS_USE_LOOPBACK_ONLY
15 static struct rtems_bsdnet_ifconfig netdriver_config = {
16 #else
17 static struct rtems_bsdnet_ifconfig loopback_config = {
18 #endif
19         .name = "lo0",
20         .attach = rtems_bsdnet_loopattach,
21         .next = NULL,
22         .ip_address = "127.0.0.1",
23         .ip_netmask = "255.0.0.0",
24 };
25
26 #endif /*RTEMS_USE_LOOPBACK*/
27
28 #ifndef RTEMS_USE_LOOPBACK_ONLY
29 static struct rtems_bsdnet_ifconfig netdriver_config = {
30         .name = BSP_NE2000_NETWORK_DRIVER_NAME,
31         .attach = BSP_NE2000_NETWORK_DRIVER_ATTACH,
32 #ifdef RTEMS_USE_LOOPBACK
33         .next = &loopback_config,
34 #else /*RTEMS_USE_LOOPBACK*/
35         .next = NULL,
36 #endif /*RTEMS_USE_LOOPBACK*/
37         .ip_address = "192.168.3.66",
38         .ip_netmask = "255.255.255.0",
39         .hardware_address = ethernet_address,
40         .ignore_broadcast = 0,
41         .mtu = 0,
42         .rbuf_count = 0,
43         .xbuf_count = 0,
44         .port = 0x300,
45         .irno = 9,
46         .bpar = 0,
47         .drv_ctrl = NULL
48 };
49 #endif /*RTEMS_USE_LOOPBACK_ONLY*/
50
51 struct rtems_bsdnet_config rtems_bsdnet_config = {
52         .ifconfig = &netdriver_config,
53 /*      .bootp = rtems_bsdnet_do_bootp,*/
54 /*      .bootp = rtems_bsdnet_do_dhcp,*/
55         .bootp = rtems_bsdnet_do_dhcp_failsafe,
56         .network_task_priority = 0,             /* 100        */
57         .mbuf_bytecount = 256 * 1024,           /* 64 kbytes  */
58         .mbuf_cluster_bytecount = 256 * 1024,   /* 128 kbytes */
59         .hostname = NULL,
60         .domainname = NULL,
61         .gateway = "192.168.3.1",
62         .log_host = NULL,
63         .name_server = { "NULL" },
64         .ntp_server = { "NULL" },
65         .sb_efficiency = 0,
66         .udp_tx_buf_size = 0,                   /* UDP TX: 9216 bytes */
67         .udp_rx_buf_size = 0,                   /* UDP RX: 40 * (1024 + sizeof(struct sockaddr_in)) */
68         .tcp_tx_buf_size = 0,                   /* TCP TX: 16 * 1024 bytes */
69         .tcp_rx_buf_size = 0,                   /* TCP TX: 16 * 1024 bytes */
70 };
71
72 #endif
73