]> rtime.felk.cvut.cz Git - can-benchmark.git/blobdiff - rtems/gw/system_opt/networkconfig.h
Commit adding basic ethernet capability to the GW application - responding to pings.
[can-benchmark.git] / 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 (file)
index 0000000..a162114
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef __NETWORKCONFIG_H__
+#define __NETWORKCONFIG_H__
+
+#include <rtems/rtems_bsdnet.h>
+#include <bsp.h>
+
+/* This was taken from existing example, driver failed to provide its own, so why not. */\r
+static char ethernet_address[6] = {0x00, 0x04, 0x9F, 0x00, 0x27, 0x50 };\r
+\r
+extern void rtems_bsdnet_loopattach();\r
+\r
+/* config for loopback device */\r
+static struct rtems_bsdnet_ifconfig loopback_config = {\r
+       "lo0",\r
+       rtems_bsdnet_loopattach,\r
+       NULL,\r
+       "127.0.0.1",\r
+       "255.0.0.0"\r
+    /* Rest of the struct is set to 0 (is defaulted) */\r
+};\r
+\r
+/* config for ethernet */\r
+static struct rtems_bsdnet_ifconfig netdriver_config = {\r
+       RTEMS_BSP_NETWORK_DRIVER_NAME,\r
+       RTEMS_BSP_NETWORK_DRIVER_ATTACH,\r
+       &loopback_config, /* link to next interface */\r
+       "192.168.2.3", /* IP address */\r
+       "255.255.255.0", /* IP address net mask */\r
+       ethernet_address /* ethernet hardware address, 0 - supplied by driver according to documentation, but it caused error when tested */\r
+    \r
+       /* rest of the struct is set to 0 (is defaulted) */\r
+};\r
+\r
+/* 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. */\r
+    100, /* network task priority (default 100) */
+       65792, /* mbuf bytecount (default 64kbytes) */\r
+    /* 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
+