diff options
author | Christian Pointner <equinox@spreadspace.org> | 2013-06-25 02:07:38 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2013-06-25 02:07:38 +0200 |
commit | cf19e3a8d20d7249ef8ecdb058edc35ba8b79a33 (patch) | |
tree | 125fe163b6b0c677c991c6a482bed7dccd550105 | |
parent | fixed footprint for zigbit module (diff) |
added patch against contiki-2.6 and enabled UIP_ROUTER
-rw-r--r-- | contrib/contiki-2.6.patch | 107 | ||||
-rw-r--r-- | software/dustmap-node/Makefile | 2 |
2 files changed, 108 insertions, 1 deletions
diff --git a/contrib/contiki-2.6.patch b/contrib/contiki-2.6.patch new file mode 100644 index 0000000..f153757 --- /dev/null +++ b/contrib/contiki-2.6.patch @@ -0,0 +1,107 @@ +diff -Nur contiki-2.6.orig/core/net/uip-nd6.c contiki-2.6/core/net/uip-nd6.c +--- contiki-2.6.orig/core/net/uip-nd6.c 2012-07-17 12:11:04.000000000 +0200 ++++ contiki-2.6/core/net/uip-nd6.c 2013-06-25 01:45:38.193233756 +0200 +@@ -120,8 +120,8 @@ + #if !UIP_CONF_ROUTER // TBD see if we move it to ra_input + static uip_nd6_opt_prefix_info *nd6_opt_prefix_info; /** Pointer to prefix information option in uip_buf */ + static uip_ipaddr_t ipaddr; +-static uip_ds6_prefix_t *prefix; /** Pointer to a prefix list entry */ + #endif ++static uip_ds6_prefix_t *prefix; /** Pointer to a prefix list entry */ + static uip_ds6_nbr_t *nbr; /** Pointer to a nbr cache entry*/ + static uip_ds6_defrt_t *defrt; /** Pointer to a router list entry */ + static uip_ds6_addr_t *addr; /** Pointer to an interface address */ +@@ -582,7 +582,7 @@ + #endif /*UIP_CONF_IPV6_CHECKS */ + switch (UIP_ND6_OPT_HDR_BUF->type) { + case UIP_ND6_OPT_SLLAO: +- nd6_opt_llao = UIP_ND6_OPT_HDR_BUF; ++ nd6_opt_llao = (uint8_t *) UIP_ND6_OPT_HDR_BUF; + break; + default: + PRINTF("ND option not supported in RS\n"); +@@ -601,7 +601,7 @@ + if((nbr = uip_ds6_nbr_lookup(&UIP_IP_BUF->srcipaddr)) == NULL) { + /* we need to add the neighbor */ + uip_ds6_nbr_add(&UIP_IP_BUF->srcipaddr, +- &nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET], 0, NBR_STALE); ++ (uip_lladdr_t *)&nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET], 0, NBR_STALE); + } else { + /* If LL address changed, set neighbor state to stale */ + if(memcmp(&nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET], +diff -Nur contiki-2.6.orig/platform/avr-zigbit/contiki-avr-zigbit-main.c contiki-2.6/platform/avr-zigbit/contiki-avr-zigbit-main.c +--- contiki-2.6.orig/platform/avr-zigbit/contiki-avr-zigbit-main.c 2012-07-17 12:11:08.000000000 +0200 ++++ contiki-2.6/platform/avr-zigbit/contiki-avr-zigbit-main.c 2013-06-25 01:56:14.676389906 +0200 +@@ -41,8 +41,8 @@ + #include "loader/symbols-def.h" + #include "loader/symtab.h" + +-#define ANNOUNCE_BOOT 0 //adds about 600 bytes to program size +-#define DEBUG 0 ++#define ANNOUNCE_BOOT 1 //adds about 600 bytes to program size ++#define DEBUG 1 + #if DEBUG + #define PRINTF(FORMAT,args...) printf_P(PSTR(FORMAT),##args) + #define PRINTSHORT(FORMAT,args...) printf_P(PSTR(FORMAT),##args) +@@ -90,17 +90,34 @@ + uint8_t mac_address[8] EEMEM = {0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x55}; + + ++#if UIP_CONF_ROUTER ++ ++#ifndef UIP_ROUTER_MODULE ++#ifdef UIP_CONF_ROUTER_MODULE ++#define UIP_ROUTER_MODULE UIP_CONF_ROUTER_MODULE ++#else /* UIP_CONF_ROUTER_MODULE */ ++#define UIP_ROUTER_MODULE rimeroute ++#endif /* UIP_CONF_ROUTER_MODULE */ ++#endif /* UIP_ROUTER_MODULE */ ++ ++extern const struct uip_router UIP_ROUTER_MODULE; ++ ++#endif /* UIP_CONF_ROUTER */ ++ ++ + void + init_lowlevel(void) + { + + /* Second rs232 port for debugging */ +- rs232_init(RS232_PORT_1, USART_BAUD_115200, ++ rs232_init(RS232_PORT_1, USART_BAUD_57600, + USART_PARITY_NONE | USART_STOP_BITS_1 | USART_DATA_BITS_8); + + /* Redirect stdout to second port */ + rs232_redirect_stdout(RS232_PORT_1); + ++ printf_P(PSTR("\n******** CONTIKI@AVR-Zigbit low level Initalization *********\n")); ++ + /* Clock */ + clock_init(); + +@@ -159,8 +176,6 @@ + #if ANNOUNCE_BOOT + printf_P(PSTR("Routing Enabled\n")); + #endif +- rime_init(rime_udp_init(NULL)); +- uip_router_register(&rimeroute); + #endif + + process_start(&tcpip_process, NULL); +@@ -182,14 +197,14 @@ + /* Initialize hardware */ + init_lowlevel(); + ++ printf_P(PSTR("\n********BOOTING CONTIKI*********\n")); ++ + /* Register initial processes */ + // procinit_init(); + + /* Autostart processes */ + autostart_start(autostart_processes); + +- printf_P(PSTR("\n********BOOTING CONTIKI*********\n")); +- + printf_P(PSTR("System online.\n")); + + /* Main scheduler loop */ diff --git a/software/dustmap-node/Makefile b/software/dustmap-node/Makefile index a511bd9..9f0e909 100644 --- a/software/dustmap-node/Makefile +++ b/software/dustmap-node/Makefile @@ -6,7 +6,7 @@ APPS = serial-shell WITH_UIP=1 UIP_CONF_IPV6=1 UIP_CONF_RPL=1 -#DEFINES=UIP_CONF_ROUTER=1 +DEFINES=UIP_CONF_ROUTER=1 CONTIKI = ../../contrib/contiki-2.6 include $(CONTIKI)/Makefile.include |