diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2012-05-15 08:59:04 +0000 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2012-05-15 17:10:04 -0500 |
commit | db288a96027fa1cb3f8a53f330724f864224a56c (patch) | |
tree | 03b8f695f2789f2ede97f17858b4e892c19bf422 /net | |
parent | 0a6deb3251a68b5be640ab1b848ca67e906b75ce (diff) | |
download | u-boot-db288a96027fa1cb3f8a53f330724f864224a56c.zip u-boot-db288a96027fa1cb3f8a53f330724f864224a56c.tar.gz u-boot-db288a96027fa1cb3f8a53f330724f864224a56c.tar.bz2 |
net: Remove volatile from net API
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/bootp.c | 4 | ||||
-rw-r--r-- | net/eth.c | 12 | ||||
-rw-r--r-- | net/net.c | 34 | ||||
-rw-r--r-- | net/rarp.c | 2 | ||||
-rw-r--r-- | net/tftp.c | 6 |
5 files changed, 28 insertions, 30 deletions
diff --git a/net/bootp.c b/net/bootp.c index 9e32476..35654b4 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -586,7 +586,7 @@ static int BootpExtended (u8 * e) void BootpRequest (void) { - volatile uchar *pkt, *iphdr; + uchar *pkt, *iphdr; Bootp_t *bp; int ext_len, pktlen, iplen; @@ -839,7 +839,7 @@ static int DhcpMessageType(unsigned char *popt) static void DhcpSendRequestPkt(Bootp_t *bp_offer) { - volatile uchar *pkt, *iphdr; + uchar *pkt, *iphdr; Bootp_t *bp; int pktlen, iplen, extlen; IPaddr_t OfferedIP; @@ -82,8 +82,6 @@ int cpu_eth_init(bd_t *bis) __attribute__((weak, alias("__def_eth_init"))); int board_eth_init(bd_t *bis) __attribute__((weak, alias("__def_eth_init"))); #ifdef CONFIG_API -extern void (*push_packet)(volatile void *, int); - static struct { uchar data[PKTSIZE]; int length; @@ -407,7 +405,7 @@ void eth_halt(void) eth_current->state = ETH_STATE_PASSIVE; } -int eth_send(volatile void *packet, int length) +int eth_send(void *packet, int length) { if (!eth_current) return -1; @@ -424,9 +422,9 @@ int eth_rx(void) } #ifdef CONFIG_API -static void eth_save_packet(volatile void *packet, int length) +static void eth_save_packet(void *packet, int length) { - volatile char *p = packet; + char *p = packet; int i; if ((eth_rcv_last+1) % PKTBUFSRX == eth_rcv_current) @@ -442,9 +440,9 @@ static void eth_save_packet(volatile void *packet, int length) eth_rcv_last = (eth_rcv_last + 1) % PKTBUFSRX; } -int eth_receive(volatile void *packet, int length) +int eth_receive(void *packet, int length) { - volatile char *p = packet; + char *p = packet; void *pp = push_packet; int i; @@ -152,7 +152,7 @@ IPaddr_t NetOurIP; /* Server IP addr (0 = unknown) */ IPaddr_t NetServerIP; /* Current receive packet */ -volatile uchar *NetRxPacket; +uchar *NetRxPacket; /* Current rx packet length */ int NetRxPacketLen; /* IP packet ID */ @@ -161,7 +161,7 @@ unsigned NetIPID; uchar NetBcastAddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; uchar NetEtherNullAddr[6]; #ifdef CONFIG_API -void (*push_packet)(volatile void *, int len) = 0; +void (*push_packet)(void *, int len) = 0; #endif #if defined(CONFIG_CMD_CDP) /* Ethernet bcast address */ @@ -208,10 +208,10 @@ void NcStart(void); int nc_input_packet(uchar *pkt, unsigned dest, unsigned src, unsigned len); #endif -volatile uchar PktBuf[(PKTBUFSRX+1) * PKTSIZE_ALIGN + PKTALIGN]; +uchar PktBuf[(PKTBUFSRX+1) * PKTSIZE_ALIGN + PKTALIGN]; /* Receive packet */ -volatile uchar *NetRxPackets[PKTBUFSRX]; +uchar *NetRxPackets[PKTBUFSRX]; /* Current RX packet handler */ static rxhand_f *packetHandler; @@ -225,7 +225,7 @@ static ulong timeStart; /* Current timeout value */ static ulong timeDelta; /* THE transmit packet */ -volatile uchar *NetTxPacket; +uchar *NetTxPacket; static int net_check_prereq(enum proto_t protocol); @@ -246,7 +246,7 @@ int NetArpWaitTry; void ArpRequest(void) { - volatile uchar *pkt; + uchar *pkt; ARP_t *arp; debug("ARP broadcast %d\n", NetArpWaitTry); @@ -705,7 +705,7 @@ NetSetTimeout(ulong iv, thand_f *f) void -NetSendPacket(volatile uchar *pkt, int len) +NetSendPacket(uchar *pkt, int len) { (void) eth_send(pkt, len); } @@ -768,8 +768,8 @@ static ushort PingSeqNo; int PingSend(void) { static uchar mac[6]; - volatile IP_t *ip; - volatile ushort *s; + IP_t *ip; + ushort *s; uchar *pkt; /* XXX always send arp request */ @@ -784,7 +784,7 @@ int PingSend(void) pkt = NetArpWaitTxPacket; pkt += NetSetEther(pkt, mac, PROT_IP); - ip = (volatile IP_t *)pkt; + ip = (IP_t *)pkt; /* * Construct an IP and ICMP header. @@ -936,9 +936,9 @@ static ushort CDP_compute_csum(const uchar *buff, ushort len) int CDPSendTrigger(void) { - volatile uchar *pkt; - volatile ushort *s; - volatile ushort *cp; + uchar *pkt; + ushort *s; + ushort *cp; Ethernet_t *et; int len; ushort chksum; @@ -965,7 +965,7 @@ int CDPSendTrigger(void) /* CDP header */ *pkt++ = 0x02; /* CDP version 2 */ *pkt++ = 180; /* TTL */ - s = (volatile ushort *)pkt; + s = (ushort *)pkt; cp = s; /* checksum (0 for later calculation) */ *s++ = htons(0); @@ -1439,7 +1439,7 @@ static void receive_icmp(IP_t *ip, int len, IPaddr_t src_ip, Ethernet_t *et) } void -NetReceive(volatile uchar *inpkt, int len) +NetReceive(uchar *inpkt, int len) { Ethernet_t *et; IP_t *ip; @@ -1918,7 +1918,7 @@ NetEthHdrSize(void) } int -NetSetEther(volatile uchar *xet, uchar * addr, uint prot) +NetSetEther(uchar *xet, uchar * addr, uint prot) { Ethernet_t *et = (Ethernet_t *)xet; ushort myvlanid; @@ -1943,7 +1943,7 @@ NetSetEther(volatile uchar *xet, uchar * addr, uint prot) } void -NetSetIP(volatile uchar *xip, IPaddr_t dest, int dport, int sport, int len) +NetSetIP(uchar *xip, IPaddr_t dest, int dport, int sport, int len) { IP_t *ip = (IP_t *)xip; @@ -71,7 +71,7 @@ void RarpRequest (void) { int i; - volatile uchar *pkt; + uchar *pkt; ARP_t * rarp; printf("RARP broadcast %d\n", ++RarpTry); @@ -310,9 +310,9 @@ static void TftpSend(void) { uchar *pkt; - volatile uchar *xp; - int len = 0; - volatile ushort *s; + uchar *xp; + int len = 0; + ushort *s; #ifdef CONFIG_MCAST_TFTP /* Multicast TFTP.. non-MasterClients do not ACK data. */ |