diff -ru _/uip-1.0/apps/resolv/resolv.c uip-1.0/apps/resolv/resolv.c --- _/uip-1.0/apps/resolv/resolv.c 2006-06-12 17:22:48.000000000 +0900 +++ uip-1.0/apps/resolv/resolv.c 2009-11-11 00:00:00.000000000 +0900 @@ -115,6 +115,10 @@ u8_t retries; u8_t seqno; u8_t err; +#if 0 +#else /* patch */ + u8_t pad; +#endif char name[32]; uip_ipaddr_t ipaddr; }; @@ -147,6 +151,12 @@ do { n = *query++; +#if 0 +#else /* patch */ + if (n >= 0xc0) { + break; + } +#endif while(n > 0) { /* printf("%c", *query);*/ diff -ru _/uip-1.0/apps/webclient/webclient.c uip-1.0/apps/webclient/webclient.c --- _/uip-1.0/apps/webclient/webclient.c 2006-06-12 17:22:48.000000000 +0900 +++ uip-1.0/apps/webclient/webclient.c 2009-11-11 00:00:00.000000000 +0900 @@ -227,7 +227,11 @@ while(len > 0 && s.httpheaderlineptr < sizeof(s.httpheaderline)) { s.httpheaderline[s.httpheaderlineptr] = *(char *)uip_appdata; +#if 0 ++((char *)uip_appdata); +#else /* patch */ + uip_appdata = (char *)uip_appdata + 1; +#endif --len; if(s.httpheaderline[s.httpheaderlineptr] == ISO_nl) { @@ -295,7 +299,11 @@ while(len > 0 && s.httpheaderlineptr < sizeof(s.httpheaderline)) { s.httpheaderline[s.httpheaderlineptr] = *(char *)uip_appdata; +#if 0 ++((char *)uip_appdata); +#else /* patch */ + uip_appdata = (char *)uip_appdata + 1; +#endif --len; if(s.httpheaderline[s.httpheaderlineptr] == ISO_nl) { /* We have an entire HTTP header line in s.httpheaderline, so diff -ru _/uip-1.0/uip/uip.c uip-1.0/uip/uip.c --- _/uip-1.0/uip/uip.c 2006-06-12 17:22:48.000000000 +0900 +++ uip-1.0/uip/uip.c 2011-01-11 00:00:00.000000000 +0900 @@ -200,7 +200,11 @@ #define TCP_PSH 0x08 #define TCP_ACK 0x10 #define TCP_URG 0x20 +#if 0 #define TCP_CTL 0x3f +#else /* patch */ +#define TCP_CTL (0x3f & ~TCP_PSH) +#endif #define TCP_OPT_END 0 /* End of TCP options list */ #define TCP_OPT_NOOP 1 /* "No-operation" TCP option */ @@ -690,6 +694,10 @@ #endif /* UIP_UDP */ uip_sappdata = uip_appdata = &uip_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN]; +#if 0 +#else /* patch */ + uip_appdata = (char *)uip_appdata + (BUF->tcpoffset >> 4) * 4 - UIP_TCPH_LEN; +#endif /* Check if we were invoked because of a poll request for a particular connection. */ diff -ru _/uip-1.0/testarm/main.c uip-1.0/testarm/main.c --- _/uip-1.0/testarm/main.c 2006-06-12 17:22:48.000000000 +0900 +++ uip-1.0/testarm/main.c 2011-01-11 00:00:00.000000000 +0900 @@ -41,6 +41,20 @@ #include "tapdev.h" #include "timer.h" +#if 0 +#else /* patch */ +#if defined(ENABLE_INTERRUPT) +#include "device.h" +#include "yk0a.h" +#include "yk0a_interrupt.h" +#include "yk0a_setup.h" +#endif +#endif +#if 0 +#else /* patch */ +#include "start_setup.h" +yk0a_uint8_t main_stack[MAIN_STACK_SIZE] __attribute__((aligned(YK0A_STACK_ALIGN))); +#endif #define BUF ((struct uip_eth_hdr *)&uip_buf[0]) @@ -58,17 +72,36 @@ timer_set(&periodic_timer, CLOCK_SECOND / 2); timer_set(&arp_timer, CLOCK_SECOND * 10); +#if 0 +#else /* patch */ +#if defined(ENABLE_INTERRUPT) + *(volatile unsigned int *)DEVICE_RTC_HZ = 2; +#endif +#endif tapdev_init(); uip_init(); +#if 0 uip_ipaddr(ipaddr, 192,168,0,2); +#else /* patch */ + uip_ipaddr(ipaddr, 10,0,0,1); +#endif uip_sethostaddr(ipaddr); +#if 0 uip_ipaddr(ipaddr, 192,168,0,1); +#else /* patch */ + uip_ipaddr(ipaddr, 10,0,0,254); +#endif uip_setdraddr(ipaddr); +#if 0 uip_ipaddr(ipaddr, 255,255,255,0); +#else /* patch */ + uip_ipaddr(ipaddr, 255,0,0,0); +#endif uip_setnetmask(ipaddr); +#if 0 httpd_init(); /* telnetd_init();*/ @@ -92,10 +125,28 @@ uip_ipaddr(ipaddr, 195,54,122,204); resolv_conf(ipaddr); resolv_query("www.sics.se");*/ +#else /* patch */ + webclient_init(); + resolv_init(); + uip_ipaddr(ipaddr, 192,168,0,1); + resolv_conf(ipaddr); + resolv_query("yana.jp"); +#endif while(1) { +#if 0 +#else /* patch */ +#if defined(ENABLE_INTERRUPT) + yk0a_flag_t f; + yk0a_interrupt_bit_mask(0, DEVICE_INTERRUPT_RTC | DEVICE_INTERRUPT_ETHER, NULL); + yk0a_listen(YK0A_SETUP_INTERRUPT_PORT, ~YK0A_FLAG_KERNEL_RECEIVER, &f); + if (f & DEVICE_INTERRUPT_RTC) { + *(volatile unsigned int *)DEVICE_RTC_INTERRUPT_ACK; + } +#endif +#endif uip_len = tapdev_read(); if(uip_len > 0) { if(BUF->type == htons(UIP_ETHTYPE_IP)) { @@ -172,7 +223,11 @@ htons(ipaddr[0]) & 0xff, htons(ipaddr[1]) >> 8, htons(ipaddr[1]) & 0xff); +#if 0 /* webclient_get("www.sics.se", 80, "/~adam/uip");*/ +#else /* patch */ + webclient_get("yana.jp", 80, "/"); +#endif } } #ifdef __DHCPC_H__ diff -ru _/uip-1.0/testarm/uip-conf.h uip-1.0/testarm/uip-conf.h --- _/uip-1.0/testarm/uip-conf.h 2006-06-12 17:22:48.000000000 +0900 +++ uip-1.0/testarm/uip-conf.h 2009-11-11 00:00:00.000000000 +0900 @@ -56,6 +56,10 @@ #define __UIP_CONF_H__ #include +#if 0 +#else /* patch */ +#include +#endif /** * 8 bit datatype @@ -64,7 +68,10 @@ * * \hideinitializer */ +#if 0 typedef uint8_t u8_t; +#else /* patch */ +#endif /** * 16 bit datatype @@ -73,7 +80,10 @@ * * \hideinitializer */ +#if 0 typedef uint16_t u16_t; +#else /* patch */ +#endif /** * Statistics datatype @@ -104,7 +114,11 @@ * * \hideinitializer */ +#if 0 #define UIP_CONF_BUFFER_SIZE 420 +#else /* patch */ +#define UIP_CONF_BUFFER_SIZE 0x4000 +#endif /** * CPU byte order. @@ -125,7 +139,11 @@ * * \hideinitializer */ +#if 0 #define UIP_CONF_UDP 0 +#else /* patch */ +#define UIP_CONF_UDP 1 +#endif /** * UDP checksums on or off @@ -143,6 +161,7 @@ /* Here we include the header file for the application(s) we use in our project. */ +#if 0 /*#include "smtp.h"*/ /*#include "hello-world.h"*/ /*#include "telnetd.h"*/ @@ -150,6 +169,10 @@ /*#include "dhcpc.h"*/ /*#include "resolv.h"*/ /*#include "webclient.h"*/ +#else /* patch */ +#include "resolv.h" +#include "webclient.h" +#endif #endif /* __UIP_CONF_H__ */ diff -ru _/uip-1.0/testmips/main.c uip-1.0/testmips/main.c --- _/uip-1.0/testmips/main.c 2006-06-12 17:22:48.000000000 +0900 +++ uip-1.0/testmips/main.c 2011-01-11 00:00:00.000000000 +0900 @@ -41,6 +41,20 @@ #include "tapdev.h" #include "timer.h" +#if 0 +#else /* patch */ +#if defined(ENABLE_INTERRUPT) +#include "device.h" +#include "yk0a.h" +#include "yk0a_interrupt.h" +#include "yk0a_setup.h" +#endif +#endif +#if 0 +#else /* patch */ +#include "start_setup.h" +yk0a_uint8_t main_stack[MAIN_STACK_SIZE] __attribute__((aligned(YK0A_STACK_ALIGN))); +#endif #define BUF ((struct uip_eth_hdr *)&uip_buf[0]) @@ -58,17 +72,36 @@ timer_set(&periodic_timer, CLOCK_SECOND / 2); timer_set(&arp_timer, CLOCK_SECOND * 10); +#if 0 +#else /* patch */ +#if defined(ENABLE_INTERRUPT) + *(volatile unsigned int *)DEVICE_RTC_HZ = 2; +#endif +#endif tapdev_init(); uip_init(); +#if 0 uip_ipaddr(ipaddr, 192,168,0,2); +#else /* patch */ + uip_ipaddr(ipaddr, 10,0,0,1); +#endif uip_sethostaddr(ipaddr); +#if 0 uip_ipaddr(ipaddr, 192,168,0,1); +#else /* patch */ + uip_ipaddr(ipaddr, 10,0,0,254); +#endif uip_setdraddr(ipaddr); +#if 0 uip_ipaddr(ipaddr, 255,255,255,0); +#else /* patch */ + uip_ipaddr(ipaddr, 255,0,0,0); +#endif uip_setnetmask(ipaddr); +#if 0 httpd_init(); /* telnetd_init();*/ @@ -92,10 +125,28 @@ uip_ipaddr(ipaddr, 195,54,122,204); resolv_conf(ipaddr); resolv_query("www.sics.se");*/ +#else /* patch */ + webclient_init(); + resolv_init(); + uip_ipaddr(ipaddr, 192,168,0,1); + resolv_conf(ipaddr); + resolv_query("yana.jp"); +#endif while(1) { +#if 0 +#else /* patch */ +#if defined(ENABLE_INTERRUPT) + yk0a_flag_t f; + yk0a_interrupt_bit_mask(0, DEVICE_INTERRUPT_RTC | DEVICE_INTERRUPT_ETHER, NULL); + yk0a_listen(YK0A_SETUP_INTERRUPT_PORT, ~YK0A_FLAG_KERNEL_RECEIVER, &f); + if (f & DEVICE_INTERRUPT_RTC) { + *(volatile unsigned int *)DEVICE_RTC_INTERRUPT_ACK; + } +#endif +#endif uip_len = tapdev_read(); if(uip_len > 0) { if(BUF->type == htons(UIP_ETHTYPE_IP)) { @@ -172,7 +223,11 @@ htons(ipaddr[0]) & 0xff, htons(ipaddr[1]) >> 8, htons(ipaddr[1]) & 0xff); +#if 0 /* webclient_get("www.sics.se", 80, "/~adam/uip");*/ +#else /* patch */ + webclient_get("yana.jp", 80, "/"); +#endif } } #ifdef __DHCPC_H__ diff -ru _/uip-1.0/testmips/uip-conf.h uip-1.0/testmips/uip-conf.h --- _/uip-1.0/testmips/uip-conf.h 2006-06-12 17:22:48.000000000 +0900 +++ uip-1.0/testmips/uip-conf.h 2009-11-11 00:00:00.000000000 +0900 @@ -56,6 +56,10 @@ #define __UIP_CONF_H__ #include +#if 0 +#else /* patch */ +#include +#endif /** * 8 bit datatype @@ -64,7 +68,10 @@ * * \hideinitializer */ +#if 0 typedef uint8_t u8_t; +#else /* patch */ +#endif /** * 16 bit datatype @@ -73,7 +80,10 @@ * * \hideinitializer */ +#if 0 typedef uint16_t u16_t; +#else /* patch */ +#endif /** * Statistics datatype @@ -104,7 +114,11 @@ * * \hideinitializer */ +#if 0 #define UIP_CONF_BUFFER_SIZE 420 +#else /* patch */ +#define UIP_CONF_BUFFER_SIZE 0x4000 +#endif /** * CPU byte order. @@ -125,7 +139,11 @@ * * \hideinitializer */ +#if 0 #define UIP_CONF_UDP 0 +#else /* patch */ +#define UIP_CONF_UDP 1 +#endif /** * UDP checksums on or off @@ -143,6 +161,7 @@ /* Here we include the header file for the application(s) we use in our project. */ +#if 0 /*#include "smtp.h"*/ /*#include "hello-world.h"*/ /*#include "telnetd.h"*/ @@ -150,6 +169,10 @@ /*#include "dhcpc.h"*/ /*#include "resolv.h"*/ /*#include "webclient.h"*/ +#else /* patch */ +#include "resolv.h" +#include "webclient.h" +#endif #endif /* __UIP_CONF_H__ */