Save the length when it is computed instead of forgetting it and
subtracting pointers to figure it out again.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Share more of the code that is common between ARP vs not.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
ICMP (ping) was reimplementing IP header code... it now shares code.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Clearer constant name.
Also remove related BOOTP_SIZE which was unused and doesn't take
into account VLAN packets.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Make the comment more accurate about the header including SNAP
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
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>
Add a structure that only contains IP header fields to be used by
functions that don't need UDP
Rename IP_HDR_SIZE_NO_UDP to IP_HDR_SIZE
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Rename IP header related things to IP_UDP. The existing definition
of IP_t includes UDP header, so name it to accurately describe the
structure.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Separate this functionality out of the net.c behemoth
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Separate this functionality out of the net.c behemoth
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Make the MAC-seeded random number generator available to /net in
general. MAC-seeded rand will be needed by link-local as well, so
give it an interface.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Some boards claim to need ping, but don't support net.
That makes no sense, and causes problems now that ping
is in a separate file.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
These are all the files which use the API incorrectly but did not get
built using MAKEALL -a powerpc|arm. I have no compiler for them, but
the remaining issues should be far less than without this patch.
Any outstanding issues are left to the maintainers of boards that use
these drivers.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
rtl8169.c: In function 'rtl8169_initialize':
rtl8169.c:907:13: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
pcnet.c: In function 'pcnet_initialize':
pcnet.c:224:13: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
ether_scc.c: In function 'mpc82xx_scc_enet_initialize':
ether_scc.c:377:14: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
xilinx_axi_emac.c: In function 'xilinx_axiemac_initialize':
xilinx_axi_emac.c:646: warning: assignment from incompatible pointer type
Signed-off-by: Stephan Linz <linz@li-pro.net>
Fix this:
xilinx_emaclite.c: In function 'xilinx_emaclite_initialize':
xilinx_emaclite.c:371: warning: assignment from incompatible pointer type
Signed-off-by: Stephan Linz <linz@li-pro.net>
Fix this:
xilinx_ll_temac.c: In function 'xilinx_ll_temac_initialize':
xilinx_ll_temac.c:332: warning: assignment from incompatible pointer type
xilinx_ll_temac.c:340: warning: assignment from incompatible pointer type
Signed-off-by: Stephan Linz <linz@li-pro.net>
Some copy/pasted drivers redefine functions
defined in include/net.h. Remove these so that
the definitions can be changed without error.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Fix this:
uec.c: In function 'uec_initialize':
uec.c:1404:12: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
uli526x.c: In function 'uli526x_initialize':
uli526x.c:243:13: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
tsi108_eth.c: In function 'tsi108_eth_initialize':
tsi108_eth.c:745:13: warning: assignment from incompatible pointer type
tsi108_eth.c: In function 'tsi108_eth_recv':
tsi108_eth.c:989:4: warning: passing argument 1 of 'NetReceive' discards qualifiers from pointer target type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
rtl8139.c: In function 'rtl8139_initialize':
rtl8139.c:234:13: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
ns8382x.c: In function 'ns8382x_initialize':
ns8382x.c:352:13: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
natsemi.c: In function 'natsemi_initialize':
natsemi.c:338:13: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
eth.c: In function 'fm_eth_initialize':
eth.c:651:12: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
e1000.c: In function 'e1000_initialize':
e1000.c:5264:13: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
cpci405.c: In function 'do_get_bpip':
cpci405.c:737:4: warning: format '%ld' expects type 'long int', but argument 3 has type 'IPaddr_t'
cpci405.c:737:4: warning: format '%ld' expects type 'long int', but argument 4 has type 'IPaddr_t'
cpci405.c:737:4: warning: format '%ld' expects type 'long int', but argument 5 has type 'IPaddr_t'
cpci405.c:737:4: warning: format '%ld' expects type 'long int', but argument 6 has type 'IPaddr_t'
cpci405.c:700:8: warning: unused variable 'bd'
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
ether_fcc.c: In function 'fec_initialize':
ether_fcc.c:453:15: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
ether_fcc.c: In function 'fec_initialize':
ether_fcc.c:390:15: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
fec.c: In function 'mpc8220_fec_recv':
fec.c:791:9: warning: passing argument 1 of 'NetReceive' discards qualifiers from pointer target type
include/net.h:438:13: note: expected 'uchar *' but argument is of type 'volatile uchar *'
fec.c: In function 'mpc8220_fec_initialize':
fec.c:839:12: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Fix this:
smc91111.c: In function 'smc91111_initialize':
smc91111.c:1363:12: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Fix this:
macb.c: In function 'macb_eth_initialize':
macb.c:564:15: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Fix this:
lan91c96.c: In function 'lan91c96_initialize':
lan91c96.c:811:12: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Fix this:
ks8695eth.c: In function 'ks8695_eth_initialize':
ks8695eth.c:236:12: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>