Joe Hershberger [Wed, 23 May 2012 08:01:04 +0000 (08:01 +0000)]
net: Allow filtering on debug traces in the net subsystem
Add several levels of DEBUG prints so that you can limit the noise to
the severety of your problem.
DEBUG_LL_STATE = Link local state machine changes
DEBUG_DEV_PKT = Packets or info directed to the device
DEBUG_NET_PKT = Packets on info on the network at large
DEBUG_INT_STATE = Internal network state changes
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Joe Hershberger [Wed, 23 May 2012 08:00:13 +0000 (08:00 +0000)]
net: Work-around for brain-damaged Cisco equipment with arp-proxy
Cisco's arp-proxy feature fails to ignore the link-local address range
This means that a link-local device on a network with this Cisco
equipment will reply to ARP requests for our device (in addition to
our reply).
If we happen to reply first, the requester's ARP table will be
populated with our MAC address, and one packet will be sent to us...
shortly following this, the requester will get an ARP reply from the
Cisco equipment telling the requester to send packets their way
instead of to our device from now on.
This work-around detects this link-local condition and will delay
replying to the ARP request for 5ms so that the first packet is sent
to the Cisco equipment and all following packets are sent to our
device.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Joe Hershberger [Wed, 23 May 2012 08:00:11 +0000 (08:00 +0000)]
net: Separate ArpRequest() into lower-level func
Link-local support will need to send ARP packets, but needs more
fine-grained control over the contents. Split the implementation
into 2 parts so link-local can share the code.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Joe Hershberger [Wed, 23 May 2012 07:59:18 +0000 (07:59 +0000)]
net: Fix unused variable compile warning
If CONFIG_BOOTP_SERVERIP is not defined, unused variable warning is
reported. This was fixed upstream using a compiler feature instead
of a simple reorder of the statements.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
Joe Hershberger [Wed, 23 May 2012 07:59:16 +0000 (07:59 +0000)]
net: Add net_update_ether() to handle ARP and Ping replies
When the network is VLAN or SNAP, net_update_ether() will preserve
the original Ethernet packet header and simply replace the src and
dest MACs and the protocol
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
Joe Hershberger [Wed, 23 May 2012 07:59:15 +0000 (07:59 +0000)]
net: Refactor to separate the UDP handler from the ARP handler
Call a built-in dummy if none is registered... don't require
protocols to register a handler (eliminating dummies)
NetConsole now uses the ARP handler when waiting on arp
(instead of needing a #define hack in arp.c)
Clear handlers at the end of net loop
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
Joe Hershberger [Wed, 23 May 2012 07:57:58 +0000 (07:57 +0000)]
net: Move MAC-seeded rand out of bootp.c
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>
Joe Hershberger [Tue, 22 May 2012 18:36:19 +0000 (18:36 +0000)]
net: Fix remaining API interface breakage
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:
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
Joe Hershberger [Tue, 22 May 2012 07:56:19 +0000 (07:56 +0000)]
drivers/net/tsi108_eth.c: Fix compile warning
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>
Joe Hershberger [Tue, 22 May 2012 07:56:13 +0000 (07:56 +0000)]
board/esd/cpci405/cpci405.c: Fix compile warning
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:
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>
Joe Hershberger [Mon, 21 May 2012 14:45:25 +0000 (14:45 +0000)]
drivers/net/eepro100.c: Fix compile warning
Fix this:
eepro100.c: In function 'eepro100_initialize':
eepro100.c:464:13: warning: assignment from incompatible pointer type
eepro100.c: In function 'eepro100_recv':
eepro100.c:694:4: 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 u8 *'
The use of a descriptor like this may mean DMA will update this at will
Beware this may be a source of trouble on some boards
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Cc: Joe Hershberger <joe.hershberger@gmail.com>
Joe Hershberger [Mon, 21 May 2012 14:45:20 +0000 (14:45 +0000)]
drivers/net/calxedaxgmac.c: Fix compile warning
Fix this:
calxedaxgmac.c: In function 'xgmac_rx':
calxedaxgmac.c:479:2: 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 unsigned char *'
calxedaxgmac.c: In function 'calxedaxgmac_initialize':
calxedaxgmac.c:547:12: warning: assignment from incompatible pointer type
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Cc: Joe Hershberger <joe.hershberger@gmail.com>
Joe Hershberger [Mon, 21 May 2012 05:54:01 +0000 (05:54 +0000)]
davinci: Fix Ethernet driver interface warning
Fixes:
davinci_emac.c: In function 'davinci_emac_initialize':
davinci_emac.c:796:12: warning: assignment from incompatible pointer type [enabled by default]
Tested on da850_am18xxevm
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Cc: Joe Hershberger <joe.hershberger@gmail.com>
Wolfgang Denk [Sun, 20 May 2012 21:14:54 +0000 (21:14 +0000)]
MPC8xx: fix "Remove volatile from net API" aftermath
Commit db288a9 "net: Remove volatile from net API" caused a number of
build warnings:
fec.c: In function 'fec_initialize':
fec.c:183:13: warning: assignment from incompatible pointer type [enabled by default]
fec.c: In function 'fec_recv':
fec.c:284:5: warning: passing argument 1 of 'NetReceive' discards 'volatile' qualifier from pointer target type [enabled by default]
/home/wd/git/u-boot/work/include/net.h:433:13: note: expected 'uchar *' but argument is of type 'volatile uchar *'
scc.c: In function 'scc_initialize':
scc.c:85:14: warning: assignment from incompatible pointer type [enabled by default]
Fix these.
Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com>
Aaron Williams [Sat, 19 May 2012 07:20:40 +0000 (07:20 +0000)]
fat: fix FAT sector offsets overflow on large FAT partitions
This patch fixes several issues where sector offsets can overflow due
to being limited to 16-bits. The cases where an overflow can happen
when accessing large FAT32 partitions are:
- length of FAT in sectors
- start sector of root directory
- the sector of the first cluster
These issues were observed when reading files from a 64GB FAT32
filesystem.
Wolfgang Denk [Sun, 20 May 2012 20:51:41 +0000 (22:51 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-usb
* 'master' of git://git.denx.de/u-boot-usb:
USB: S5P: Add ehci support
usb:udc:samsung Add functions for storing private gadget data in UDC driver
usb:gadget:composite: Support for composite at gadget.h
usb:gadget:composite USB composite gadget support
usb:udc:samsung:cleanup Replace DEBUG_* macros with debug_cond() calls
usb:udc: Remove duplicated USB definitions from include/linux/usb/ch9.h file
USB: Document the QH and qTD antics in EHCI-HCD
USB: Drop cache flush bloat in EHCI-HCD
USB: Drop ehci_alloc/ehci_free in ehci-hcd
USB: Align buffers at cacheline
usb: use noinline define