X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/blobdiff_plain/b3c271b232e8f73e50efb422b844167550267024..b29b333865c98b5e48073731980fa6c3cc58f1eb:/rtems/gw/system_opt/networkconfig.h diff --git a/rtems/gw/system_opt/networkconfig.h b/rtems/gw/system_opt/networkconfig.h new file mode 100644 index 0000000..a162114 --- /dev/null +++ b/rtems/gw/system_opt/networkconfig.h @@ -0,0 +1,57 @@ +#ifndef __NETWORKCONFIG_H__ +#define __NETWORKCONFIG_H__ + +#include +#include + +/* This was taken from existing example, driver failed to provide its own, so why not. */ +static char ethernet_address[6] = {0x00, 0x04, 0x9F, 0x00, 0x27, 0x50 }; + +extern void rtems_bsdnet_loopattach(); + +/* config for loopback device */ +static struct rtems_bsdnet_ifconfig loopback_config = { + "lo0", + rtems_bsdnet_loopattach, + NULL, + "127.0.0.1", + "255.0.0.0" + /* Rest of the struct is set to 0 (is defaulted) */ +}; + +/* config for ethernet */ +static struct rtems_bsdnet_ifconfig netdriver_config = { + RTEMS_BSP_NETWORK_DRIVER_NAME, + RTEMS_BSP_NETWORK_DRIVER_ATTACH, + &loopback_config, /* link to next interface */ + "192.168.2.3", /* IP address */ + "255.255.255.0", /* IP address net mask */ + ethernet_address /* ethernet hardware address, 0 - supplied by driver according to documentation, but it caused error when tested */ + + /* rest of the struct is set to 0 (is defaulted) */ +}; + +/* Main config. */ +struct rtems_bsdnet_config rtems_bsdnet_config = { + &netdriver_config, /* This entry points to the head of the ifconfig chain. */ + NULL, /* rtems_bsdnet_do_bootp if it should use bootp, null otherwise */ + /* From here on, zero means default value. */ + 100, /* network task priority (default 100) */ + 65792, /* mbuf bytecount (default 64kbytes) */ + /* Using default sizes stops RTEMS from answering to pings. (Probably because it allocates too few buffer for an answer.). */ + 263168, //180584, /* mbuf cluster bytecount (default 128kbytes) */ + "midam_deska", /* hostname (default BOOTP) */ + "testdomain", /* domain name (default BOOTP) */ + "192.168.2.2", /* gateway (default BOOTP) */ + "192.168.2.2", /* log_host (default BOOTP) */ + { "192.168.2.2", }, /* name_server[3] (default BOOTP) */ + { "192.168.2.2", }, /* ntp_server[3] (default BOOTP) */ + 0, /* sb efficiency (default 2) */ + 0, /* udp tx buf size (default 9216 bytes) */ + 0, /* udp rx buf size (default 40 * (1024 + sizeof(struct sockaddr_in) bytes) */ + 0, /* tcp tx buf size (default 16 * 1024 bytes) */ + 0 /* tcp rx buf size (default 16 * 1024 bytes) */ +}; + +#endif +