Commit c47ddd2a authored by Vraliens's avatar Vraliens Committed by li hongming

Try to merge proposed_master.

parent ba69f77a
......@@ -32,7 +32,7 @@ static void arp_init(void)
saddr.ethertype = htons(0x0806); /* ARP */
arp_socket = ptpd_netif_create_socket(&__static_arp_socket, &saddr,
PTPD_SOCK_RAW_ETHERNET, 0);
PTPD_SOCK_RAW_ETHERNET, 0);
}
static int process_arp(uint8_t * buf, int len)
......@@ -51,30 +51,29 @@ static int process_arp(uint8_t * buf, int len)
getIP(myIP);
if ( ((buf[ARP_OPER + 1] != 1)||memcmp(buf + ARP_TPA, myIP, 4)) == 0 )
{
memcpy(hisMAC, buf + ARP_SHA, 6);
memcpy(hisIP, buf + ARP_SPA, 4);
// ------------- ARP ------------
// HW ethernet
buf[ARP_HTYPE + 0] = 0;
buf[ARP_HTYPE + 1] = 1;
// proto IP
buf[ARP_PTYPE + 0] = 8;
buf[ARP_PTYPE + 1] = 0;
// lengths
buf[ARP_HLEN] = 6;
buf[ARP_PLEN] = 4;
// Response
buf[ARP_OPER + 0] = 0;
buf[ARP_OPER + 1] = 2;
// my MAC+IP
get_mac_addr(buf + ARP_SHA);
memcpy(buf + ARP_SPA, myIP, 4);
// his MAC+IP
memcpy(buf + ARP_THA, hisMAC, 6);
memcpy(buf + ARP_TPA, hisIP, 4);
return ARP_END;
memcpy(hisMAC, buf + ARP_SHA, 6);
memcpy(hisIP, buf + ARP_SPA, 4);
// ------------- ARP ------------
// HW ethernet
buf[ARP_HTYPE + 0] = 0;
buf[ARP_HTYPE + 1] = 1;
// proto IP
buf[ARP_PTYPE + 0] = 8;
buf[ARP_PTYPE + 1] = 0;
// lengths
buf[ARP_HLEN] = 6;
buf[ARP_PLEN] = 4;
// Response
buf[ARP_OPER + 0] = 0;
buf[ARP_OPER + 1] = 2;
// my MAC+IP
get_mac_addr(buf + ARP_SHA);
memcpy(buf + ARP_SPA, myIP, 4);
// his MAC+IP
memcpy(buf + ARP_THA, hisMAC, 6);
memcpy(buf + ARP_TPA, hisIP, 4);
return ARP_END;
}
return 0;
......@@ -90,7 +89,7 @@ static int arp_poll(void)
return 0; /* can't do ARP w/o an address... */
if ((len = ptpd_netif_recvfrom(arp_socket,
&addr, buf, sizeof(buf), 0)) > 0) {
&addr, buf, sizeof(buf), 0)) > 0) {
if ((len = process_arp(buf, len)) > 0)
ptpd_netif_sendto(arp_socket, &addr, buf, len, 0);
return 1;
......
......@@ -87,7 +87,7 @@ static void ipv4_init(void)
/* time (rdate): UDP */
rdate_socket = ptpd_netif_create_socket(&__static_rdate_socket, NULL,
PTPD_SOCK_UDP, 37 /* time */);
PTPD_SOCK_UDP, 37 /* time */);
/* remote update (rmupdate): UDP */
rmupdate_socket = ptpd_netif_create_socket(&__static_rmupdate_socket, NULL,
......@@ -97,7 +97,7 @@ static void ipv4_init(void)
memset(&saddr, 0, sizeof(saddr));
saddr.ethertype = htons(0x0800);
icmp_socket = ptpd_netif_create_socket(&__static_icmp_socket, &saddr,
PTPD_SOCK_RAW_ETHERNET, 0);
PTPD_SOCK_RAW_ETHERNET, 0);
syslog_init();
}
......@@ -297,7 +297,7 @@ void setIP(unsigned char *IP)
{
uint8_t tmp[4];
// volatile unsigned int *eb_ip =
// (unsigned int *)(BASE_ETHERBONE_CFG + EB_IPV4);
// (unsigned int *)(BASE_ETHERBONE_CFG + EB_IPV4);
// unsigned int ip;
// while (*eb_ip != ip)
// *eb_ip = ip;
......
......@@ -28,7 +28,6 @@ static int cmd_init(const char *args[])
shell_show_build_init();
storage_init_show();
} else if (args[0] && !strcasecmp(args[0], "boot")) {
spll_very_init();
shell_boot_script();
}
......
......@@ -2,12 +2,11 @@
declare -A err
HOW="grep -wi error $file"
for n in ko-build*; do
test -d $n || continue
file=$n/build
S=$($HOW | sort | md5sum | awk '{print $1}')
S=$(grep -wi error $file | sort | md5sum | awk '{print $1}')
err[$S]=$n
done
for n in ${err[*]}; do
......
......@@ -3,12 +3,11 @@
declare -A warn
HOW="grep -wi warning $file"
for n in warn-build*; do
test -d $n || continue
file=$n/build
S=$($HOW | sort | md5sum | awk '{print $1}')
S=$(grep -wi warning $file | sort | md5sum | awk '{print $1}')
warn[$S]=$n
done
for n in ${warn[*]}; do
......
This diff is collapsed.
......@@ -63,7 +63,9 @@ static void wrc_initialize(void)
timer_init(1);
get_hw_name(wrc_hw_name);
#ifdef CONFIG_SDB_STORAGE
storage_read_hdl_cfg();
#endif
wrpc_w1_init();
wrpc_w1_bus.detail = ONEWIRE_PORT;
w1_scan_bus(&wrpc_w1_bus);
......@@ -91,7 +93,6 @@ static void wrc_initialize(void)
net_rst();
ep_init(mac_addr);
/* Sleep for 1s to make sure WRS v4.2 always realizes that
* the link is down */
timer_delay_ms(200);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment