[U-Boot-Users] [PATCH] ARP/TFTP disengagement.

Pantelis Antoniou panto at intracom.gr
Tue Apr 22 12:05:05 CEST 2003


Wolfang Hi.

In U-boot currently ARP is use for the single purpose, of providing
the MAC address of the TFTP server.

This make it impossible to use ARP for communicating with any other
host or protocol.

Also it muddles the tftp code since in order to begin
the TFTP request, we don't call TftpStart rather we call
ArpRequest and the tftp request is started explicitly upon
reception of the ARP reply.
 
The following patch fixes these problems.

Instead of the TFTP code using NetSendPacket it uses now
a new function called NetSendUDPPacket.

  int NetSendUDPPacket(uchar *ether, IPaddr_t dest,
                       int dport, int sport, int len);

The argument are as follows;

 uchar *ether    - pointer to MAC address of the server/or gateway.
                  
   If the MAC address is zero, an ARP request is made and the packet
   is saved for transmition upon the reception of the ARP reply.
   Must point to a global or static variable for proper operation.

 IPaddr_t dest   - destination ip address
 int dport       - destination port
 int sport       - source port
 int len         - the length of the data.

The actual contents of the transmitted packet
are expected to be at NetTxPacket + ETHER_HDR_SIZE + IP_HDR_SIZE.

The major change of this patch is the elimination of the files
arp.c & arp.h.

ARP is not really a proper protocol, and their functionality is
placed directly in net.c

Tested both in manual tftp mode and DHCP auto-start mode...

Awaiting comments...

  Regards

  Pantelis



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: u-boot-0.3.0-arpfix.patch
Url: http://lists.denx.de/pipermail/u-boot/attachments/20030422/d31aaf9c/attachment.txt 


More information about the U-Boot mailing list