From 0adb5b761f4c789ae47d8abb015f5e017263d3f2 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Wed, 8 Apr 2015 01:41:04 -0500 Subject: net: cosmetic: Name ethaddr variables consistently Use "_ethaddr" at the end of variables and drop CamelCase. Make constant values actually 'const'. Signed-off-by: Joe Hershberger Acked-by: Simon Glass --- net/bootp.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'net/bootp.c') diff --git a/net/bootp.c b/net/bootp.c index 9251e91..9b27d4c 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -147,7 +147,8 @@ static void BootpCopyNetParams(struct Bootp_t *bp) net_copy_ip(&tmp_ip, &bp->bp_siaddr); if (tmp_ip.s_addr != 0) net_copy_ip(&net_server_ip, &bp->bp_siaddr); - memcpy(NetServerEther, ((struct ethernet_hdr *)NetRxPacket)->et_src, 6); + memcpy(net_server_ethaddr, ((struct ethernet_hdr *)NetRxPacket)->et_src, + 6); if (strlen(bp->bp_file) > 0) copy_filename(net_boot_file_name, bp->bp_file, sizeof(net_boot_file_name)); @@ -693,7 +694,7 @@ BootpRequest(void) pkt = NetTxPacket; memset((void *)pkt, 0, PKTSIZE); - eth_hdr_size = NetSetEther(pkt, NetBcastAddr, PROT_IP); + eth_hdr_size = NetSetEther(pkt, net_bcast_ethaddr, PROT_IP); pkt += eth_hdr_size; /* @@ -719,7 +720,7 @@ BootpRequest(void) net_write_ip(&bp->bp_yiaddr, zero_ip); net_write_ip(&bp->bp_siaddr, zero_ip); net_write_ip(&bp->bp_giaddr, zero_ip); - memcpy(bp->bp_chaddr, NetOurEther, 6); + memcpy(bp->bp_chaddr, net_ethaddr, 6); copy_filename(bp->bp_file, net_boot_file_name, sizeof(bp->bp_file)); /* Request additional information from the BOOTP/DHCP server */ @@ -734,10 +735,10 @@ BootpRequest(void) * Bootp ID is the lower 4 bytes of our ethernet address * plus the current time in ms. */ - BootpID = ((ulong)NetOurEther[2] << 24) - | ((ulong)NetOurEther[3] << 16) - | ((ulong)NetOurEther[4] << 8) - | (ulong)NetOurEther[5]; + BootpID = ((ulong)net_ethaddr[2] << 24) + | ((ulong)net_ethaddr[3] << 16) + | ((ulong)net_ethaddr[4] << 8) + | (ulong)net_ethaddr[5]; BootpID += get_timer(0); BootpID = htonl(BootpID); bootp_add_id(BootpID); @@ -896,7 +897,7 @@ static void DhcpSendRequestPkt(struct Bootp_t *bp_offer) pkt = NetTxPacket; memset((void *)pkt, 0, PKTSIZE); - eth_hdr_size = NetSetEther(pkt, NetBcastAddr, PROT_IP); + eth_hdr_size = NetSetEther(pkt, net_bcast_ethaddr, PROT_IP); pkt += eth_hdr_size; iphdr = pkt; /* We'll need this later to set proper pkt size */ @@ -918,7 +919,7 @@ static void DhcpSendRequestPkt(struct Bootp_t *bp_offer) zero_ip.s_addr = 0; net_write_ip(&bp->bp_giaddr, zero_ip); - memcpy(bp->bp_chaddr, NetOurEther, 6); + memcpy(bp->bp_chaddr, net_ethaddr, 6); /* * ID is the id of the OFFER packet -- cgit v1.1