mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 15:41:40 +00:00
net: cosmetic: Rename parameter len to payload_len
This name more explicitly claims that it does not include the header size Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
e0a630795b
commit
206d07fd7c
2 changed files with 18 additions and 9 deletions
|
@ -466,9 +466,17 @@ extern void NetSetTimeout(ulong, thand_f *);/* Set timeout handler */
|
||||||
/* Transmit "NetTxPacket" */
|
/* Transmit "NetTxPacket" */
|
||||||
extern void NetSendPacket(uchar *, int);
|
extern void NetSendPacket(uchar *, int);
|
||||||
|
|
||||||
/* Transmit UDP packet, performing ARP request if needed */
|
/*
|
||||||
|
* Transmit UDP packet, performing ARP request if needed
|
||||||
|
*
|
||||||
|
* @param ether Raw packet buffer
|
||||||
|
* @param dest IP address to send the datagram to
|
||||||
|
* @param dport Destination UDP port
|
||||||
|
* @param sport Source UDP port
|
||||||
|
* @param payload_len Length of data after the UDP header
|
||||||
|
*/
|
||||||
extern int NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport,
|
extern int NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport,
|
||||||
int sport, int len);
|
int sport, int payload_len);
|
||||||
|
|
||||||
/* Processes a received packet */
|
/* Processes a received packet */
|
||||||
extern void NetReceive(uchar *, int);
|
extern void NetReceive(uchar *, int);
|
||||||
|
|
15
net/net.c
15
net/net.c
|
@ -591,8 +591,8 @@ NetSendPacket(uchar *pkt, int len)
|
||||||
(void) eth_send(pkt, len);
|
(void) eth_send(pkt, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport,
|
||||||
NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport, int len)
|
int payload_len)
|
||||||
{
|
{
|
||||||
uchar *pkt;
|
uchar *pkt;
|
||||||
|
|
||||||
|
@ -618,14 +618,14 @@ NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport, int len)
|
||||||
pkt = NetArpWaitTxPacket;
|
pkt = NetArpWaitTxPacket;
|
||||||
pkt += NetSetEther(pkt, NetArpWaitPacketMAC, PROT_IP);
|
pkt += NetSetEther(pkt, NetArpWaitPacketMAC, PROT_IP);
|
||||||
|
|
||||||
NetSetIP(pkt, dest, dport, sport, len);
|
NetSetIP(pkt, dest, dport, sport, payload_len);
|
||||||
memcpy(pkt + IP_UDP_HDR_SIZE, (uchar *)NetTxPacket +
|
memcpy(pkt + IP_UDP_HDR_SIZE, (uchar *)NetTxPacket +
|
||||||
(pkt - (uchar *)NetArpWaitTxPacket) +
|
(pkt - (uchar *)NetArpWaitTxPacket) +
|
||||||
IP_UDP_HDR_SIZE, len);
|
IP_UDP_HDR_SIZE, payload_len);
|
||||||
|
|
||||||
/* size of the waiting packet */
|
/* size of the waiting packet */
|
||||||
NetArpWaitTxPacketSize = (pkt - NetArpWaitTxPacket) +
|
NetArpWaitTxPacketSize = (pkt - NetArpWaitTxPacket) +
|
||||||
IP_UDP_HDR_SIZE + len;
|
IP_UDP_HDR_SIZE + payload_len;
|
||||||
|
|
||||||
/* and do the ARP request */
|
/* and do the ARP request */
|
||||||
NetArpWaitTry = 1;
|
NetArpWaitTry = 1;
|
||||||
|
@ -638,8 +638,9 @@ NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport, int len)
|
||||||
|
|
||||||
pkt = (uchar *)NetTxPacket;
|
pkt = (uchar *)NetTxPacket;
|
||||||
pkt += NetSetEther(pkt, ether, PROT_IP);
|
pkt += NetSetEther(pkt, ether, PROT_IP);
|
||||||
NetSetIP(pkt, dest, dport, sport, len);
|
NetSetIP(pkt, dest, dport, sport, payload_len);
|
||||||
eth_send(NetTxPacket, (pkt - NetTxPacket) + IP_UDP_HDR_SIZE + len);
|
eth_send(NetTxPacket, (pkt - NetTxPacket) + IP_UDP_HDR_SIZE +
|
||||||
|
payload_len);
|
||||||
|
|
||||||
return 0; /* transmitted */
|
return 0; /* transmitted */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue