Re: [U-Boot] [PATCH 01/23] net: cosmetic: Change IPaddr_t to struct in_addr

2015-04-08 Thread Joe Hershberger
Hi Simon,

On Tue, Apr 7, 2015 at 8:26 PM, Simon Glass s...@chromium.org wrote:

 Hi Joe,

 On 3 April 2015 at 15:14, Joe Hershberger joe.hershber...@ni.com wrote:
  This patch is simply clean-up to make the IPv4 type that is used match
  what Linux uses. It also attempts to move all variables that are IP
  addresses use good naming instead of CamelCase. No functional change.
 
  Signed-off-by: Joe Hershberger joe.hershber...@ni.com
  ---

 I see the following breakage on this patch (my build is incomplete,
 but it looks like it is just one problem in cmd_net.c).

Oops... looks like a few errors as a result of the not having some of the
net features enabled on any of the boards I built.

I added most net features to sandbox to prevent such misses in the future.

Thanks,
-Joe
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 01/23] net: cosmetic: Change IPaddr_t to struct in_addr

2015-04-07 Thread Simon Glass
Hi Joe,

On 3 April 2015 at 15:14, Joe Hershberger joe.hershber...@ni.com wrote:
 This patch is simply clean-up to make the IPv4 type that is used match
 what Linux uses. It also attempts to move all variables that are IP
 addresses use good naming instead of CamelCase. No functional change.

 Signed-off-by: Joe Hershberger joe.hershber...@ni.com
 ---

I see the following breakage on this patch (my build is incomplete,
but it looks like it is just one problem in cmd_net.c).

02: net: cosmetic: Change IPaddr_t to struct in_addr
  mips:  +   qemu_mips64el qemu_mips64
  blackfin:  +   bf561-acvilon cm-bf561 bct-brettl2 cm-bf527 ip04
bf537-stamp bf527-ezkit-v2 cm-bf537e tcm-bf518 cm-bf537u bf527-ezkit
cm-bf533 pr1 bf533-ezkit ibf-dsp561 bf537-pnav cm-bf548 bf538f-ezkit
bf548-ezkit tcm-bf537 bf533-stamp bf518f-ezbrd bf526-ezbrd bf561-ezkit
   arm:  +   ethernut5
  m68k:  +   M5329AFEE M5208EVBE M5475FFE M5475GFE M5485BFE
M5329BFEE M5475EFE M5475CFE M5485AFE M5475AFE M5485HFE M5485DFE
M5475DFE M53017EVB M5475BFE M5485GFE M5485EFE M5485FFE M5373EVB
M5485CFE
   powerpc:  +   a4m2k a3m071
-(taihu) powerpc-linux-ld.bfd: section .resetvec loaded at
[fffc,] overlaps section .u_boot_list loaded at
[fd88,0687]
-(taihu) powerpc-linux-ld.bfd: u-boot: section .resetvec lma
0xfffc adjusted to 0x688
-(openrd_base)   actual: 412684 bytes
-(openrd_base)   excess: 19468 bytes
-(taishan) powerpc-linux-ld.bfd: section .bootpg loaded at
[f000,f24f] overlaps section .data loaded at
[d288,f95b]
-(taishan) powerpc-linux-ld.bfd: section .resetvec loaded at
[fffc,] overlaps section .u_boot_list loaded at
[f95c,02cb]
-(taishan) powerpc-linux-ld.bfd: u-boot: section .bootpg lma
0xf000 adjusted to 0xf95c
-(taishan) powerpc-linux-ld.bfd: u-boot: section .u_boot_list lma
0xf95c adjusted to 0xfbac
-(ocotea) powerpc-linux-ld.bfd: section .bootpg loaded at
[f000,f24f] overlaps section .data loaded at
[ccac,f4b3]
-(ocotea) powerpc-linux-ld.bfd: u-boot: section .bootpg lma 0xf000
adjusted to 0xf4b4
-(ocotea) powerpc-linux-ld.bfd: u-boot: section .u_boot_list lma
0xf4b4 adjusted to 0xf704
-(ocotea) powerpc-linux-ld.bfd: u-boot: section .data.init lma
0xfe00 adjusted to 0xff5c
-(openrd_ultimate)   actual: 412736 bytes
-(openrd_ultimate)   excess: 19520 bytes
-(openrd_client)   actual: 412756 bytes
-(openrd_client)   excess: 19540 bytes
-(ebony) powerpc-linux-ld.bfd: section .bootpg loaded at
[f000,f23f] overlaps section .u_boot_list loaded at
[eb28,f37f]
-(ebony) powerpc-linux-ld.bfd: u-boot: section .bootpg lma 0xf000
adjusted to 0xf380
-(ebony) powerpc-linux-ld.bfd: u-boot: section .data.init lma
0xf400 adjusted to 0xf5c0
-(alpr) powerpc-linux-ld.bfd: section .bootpg loaded at
[f000,f27f] overlaps section .data loaded at
[ba08,f0e7]
-(alpr) powerpc-linux-ld.bfd: section .u_boot_list loaded at
[f0e8,f63b] overlaps section .bootpg loaded at
[f000,f27f]
-(alpr) powerpc-linux-ld.bfd: u-boot: section .bootpg lma 0xf000
adjusted to 0xf0e8
-(alpr) powerpc-linux-ld.bfd: u-boot: section .u_boot_list lma
0xf0e8 adjusted to 0xf368
-(alpr) powerpc-linux-ld.bfd: u-boot: section .data.init lma
0xf700 adjusted to 0xf8bc
+(bf561-acvilon,cm-bf561,ip04,bct-brettl2,ibf-dsp561,cm-bf533,bf561-ezkit)
../net/arp.c: In function ‘ArpReceive’:
+(bf561-acvilon,cm-bf561,ip04,bct-brettl2,ibf-dsp561,cm-bf533,bf561-ezkit)
../net/arp.c:196: error: invalid operands to binary == (have ‘struct
in_addr’ and ‘struct in_addr’)
+(bf561-acvilon,cm-bf561,ip04,bct-brettl2,ibf-dsp561,cm-bf533,bf561-ezkit)
make[2]: *** [net/arp.o] Error 1
+(bf561-acvilon,M5329AFEE,cm-bf561,M5208EVBE,a4m2k,ethernut5,ip04,M5485AFE,M5485BFE,M5475EFE,M5475CFE,M53017EVB,M5485HFE,qemu_mips64el,bct-brettl2,ibf-dsp561,M5485DFE,M5475DFE,M5485CFE,M5475FFE,qemu_mips64,M5475BFE,M5485GFE,M5373EVB,M5485EFE,M5485FFE,M5329BFEE,cm-bf533,M5475GFE,M5475AFE,a3m071,bf561-ezkit)
make[1]: *** [net] Error 2
+(M5329AFEE,M5208EVBE,M5485AFE,M5485BFE,M5475EFE,M5475CFE,M53017EVB,M5485HFE,M5485DFE,M5475DFE,M5485CFE,M5475FFE,M5475BFE,M5485GFE,M5373EVB,M5485EFE,M5485FFE,M5329BFEE,M5475GFE,M5475AFE)
../net/net.c: In function 'net_process_received_packet':
+(M5329AFEE,M5208EVBE,M5485AFE,M5485BFE,M5475EFE,M5475CFE,M53017EVB,M5485HFE,M5485DFE,M5475DFE,M5485CFE,M5475FFE,M5475BFE,M5485GFE,M5373EVB,M5485EFE,M5485FFE,M5329BFEE,M5475GFE,M5475AFE)
../net/net.c:1173:4: error: aggregate value used where an integer was
expected
+(M5329AFEE,M5208EVBE,M5485AFE,M5485BFE,M5475EFE,M5475CFE,M53017EVB,M5485HFE,M5485DFE,M5475DFE,M5485CFE,M5475FFE,M5475BFE,M5485GFE,M5373EVB,M5485EFE,M5485FFE,M5329BFEE,M5475GFE,M5475AFE)
../net/net.c:1174:4: error: aggregate value used where an integer was
expected

[U-Boot] [PATCH 01/23] net: cosmetic: Change IPaddr_t to struct in_addr

2015-04-03 Thread Joe Hershberger
This patch is simply clean-up to make the IPv4 type that is used match
what Linux uses. It also attempts to move all variables that are IP
addresses use good naming instead of CamelCase. No functional change.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 common/cmd_net.c  |  50 +--
 common/cmd_pxe.c  |   2 +-
 drivers/net/netconsole.c  |  37 +++---
 drivers/net/sandbox-raw.c |   8 +--
 drivers/net/sandbox.c |  14 +++---
 include/common.h  |   2 +-
 include/net.h |  63 ---
 lib/net_utils.c   |  16 +++---
 net/arp.c |  56 ++---
 net/arp.h |   6 +--
 net/bootp.c   | 125 +-
 net/bootp.h   |   8 +--
 net/dns.c |  18 +++
 net/eth.c |   8 +--
 net/link_local.c  |  21 
 net/net.c |  92 +-
 net/nfs.c |  40 ---
 net/ping.c|  22 
 net/rarp.c|   8 +--
 net/sntp.c|  11 ++--
 net/tftp.c|  69 +
 test/dm/eth.c |  10 ++--
 22 files changed, 354 insertions(+), 332 deletions(-)

diff --git a/common/cmd_net.c b/common/cmd_net.c
index 3f52edc..0a85d72 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -114,13 +114,13 @@ static void netboot_update_env(void)
 {
char tmp[22];
 
-   if (NetOurGatewayIP) {
-   ip_to_string(NetOurGatewayIP, tmp);
+   if (net_gateway.s_addr) {
+   ip_to_string(net_gateway, tmp);
setenv(gatewayip, tmp);
}
 
-   if (NetOurSubnetMask) {
-   ip_to_string(NetOurSubnetMask, tmp);
+   if (net_netmask.s_addr) {
+   ip_to_string(net_netmask, tmp);
setenv(netmask, tmp);
}
 
@@ -130,8 +130,8 @@ static void netboot_update_env(void)
if (NetOurRootPath[0])
setenv(rootpath, NetOurRootPath);
 
-   if (NetOurIP) {
-   ip_to_string(NetOurIP, tmp);
+   if (net_ip.s_addr) {
+   ip_to_string(net_ip, tmp);
setenv(ipaddr, tmp);
}
 #if !defined(CONFIG_BOOTP_SERVERIP)
@@ -139,18 +139,18 @@ static void netboot_update_env(void)
 * Only attempt to change serverip if net/bootp.c:BootpCopyNetParams()
 * could have set it
 */
-   if (NetServerIP) {
-   ip_to_string(NetServerIP, tmp);
+   if (net_server_ip.s_addr) {
+   ip_to_string(net_server_ip, tmp);
setenv(serverip, tmp);
}
 #endif
-   if (NetOurDNSIP) {
-   ip_to_string(NetOurDNSIP, tmp);
+   if (net_dns_server.s_addr) {
+   ip_to_string(net_dns_server, tmp);
setenv(dnsip, tmp);
}
 #if defined(CONFIG_BOOTP_DNS2)
-   if (NetOurDNS2IP) {
-   ip_to_string(NetOurDNS2IP, tmp);
+   if (net_dns_server2.s_addr) {
+   ip_to_string(net_dns_server2, tmp);
setenv(dnsip2, tmp);
}
 #endif
@@ -166,8 +166,8 @@ static void netboot_update_env(void)
 #endif
 #if defined(CONFIG_CMD_SNTP) \
  defined(CONFIG_BOOTP_NTPSERVER)
-   if (NetNtpServerIP) {
-   ip_to_string(NetNtpServerIP, tmp);
+   if (net_ntp_ip.s_addr) {
+   ip_to_string(net_ntp_ip, tmp);
setenv(ntpserverip, tmp);
}
 #endif
@@ -260,8 +260,8 @@ static int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
if (argc  2)
return CMD_RET_USAGE;
 
-   NetPingIP = string_to_ip(argv[1]);
-   if (NetPingIP == 0)
+   net_ping_ip = string_to_ip(argv[1]);
+   if (net_ping_ip.s_addr == 0)
return CMD_RET_USAGE;
 
if (NetLoop(PING)  0) {
@@ -331,14 +331,14 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
char *toff;
 
if (argc  2) {
-   NetNtpServerIP = getenv_IPaddr(ntpserverip);
-   if (NetNtpServerIP == 0) {
+   net_ntp_server = getenv_ip(ntpserverip);
+   if (net_ntp_server.s_addr == 0) {
printf(ntpserverip not set\n);
return CMD_RET_FAILURE;
}
} else {
-   NetNtpServerIP = string_to_ip(argv[1]);
-   if (NetNtpServerIP == 0) {
+   net_ntp_server = string_to_ip(argv[1]);
+   if (net_ntp_server.s_addr == 0) {
printf(Bad NTP server IP address\n);
return CMD_RET_FAILURE;
}
@@ -352,7 +352,7 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
 
if (NetLoop(SNTP)  0) {
printf(SNTP failed: host %pI4 not responding\n,
-   NetNtpServerIP);
+