summaryrefslogtreecommitdiff
path: root/drivers/usb/eth/smsc95xx.c
Commit message (Collapse)AuthorAgeLines
* net: smsc95xx: Use correct get_unaligned functionsChris Packham2016-08-15-2/+2
| | | | | | | | | The __get_unaligned_le* functions may not be declared on all platforms. Instead, get_unaligned_le* should be used. On many platforms both of these are the same function. Signed-off-by: Chris Packham <judge.packham@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* smsc95xx: fix operation on 64-bit systemsStephen Warren2016-04-01-2/+2
| | | | | | | | | | | | smsc95xx_read_reg() should calculate sizeof(*data) not sizeof(data) since data is a pointer, and the value pointed at is being transferred over USB, not the value of the pointer. This fixes operation of the driver in 64-bit builds, such as the Raspberry Pi 3. Reported-by: Eric Anholt <eric@anholt.net> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* driver: usb: Fix pointer conversion warnings for hikeyPrabhakar Kushwaha2015-11-12-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix below compilation warings happening for hikey_defconfig drivers/usb/eth/smsc95xx.c:698:56: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] debug("** %s(), len %d, buf %#x\n", __func__, length, (int)msg); ^ include/common.h:109:26: note: in definition of macro ‘debug_cond’ printf(pr_fmt(fmt), ##args); \ ^ drivers/usb/eth/smsc95xx.c:698:2: note: in expansion of macro ‘debug’ debug("** %s(), len %d, buf %#x\n", __func__, length, (int)msg); ^ drivers/usb/eth/smsc95xx.c:718:2: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ [-Wformat=] debug("Tx: len = %u, actual = %u, err = %d\n", ^ drivers/usb/eth/smsc95xx.c: In function ‘smsc95xx_recv’: drivers/usb/eth/smsc95xx.c:802:19: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] cur_buf_align = (int)buf_ptr - (int)recv_buf; ^ drivers/usb/eth/smsc95xx.c:802:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] cur_buf_align = (int)buf_ptr - (int)recv_buf; Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
* Merge branch 'master' of git://git.denx.de/u-boot-netTom Rini2015-10-29-19/+4
|\
| * smsc95xx: Use zero length packets when RX fifo is emptyStefan Brüns2015-10-29-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | Using NAKs on empty RX fifo for bulk in transfers is the right choice for a interrupt driven model, but U-Boot uses polling and expects an immediate answer if there is no incoming packet. Using ZLP Bulk In Response (BIR) mode avoids unexpected timeouts in the host controller driver. As ZLP mode is reset default, there is no need to set it. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
| * smsc95xx: Fetch whole burst with 1 URB, avoid framing errorsStefan Brüns2015-10-28-3/+4
| | | | | | | | | | | | | | | | | | | | | | smsc95xx_recv() does not reassemble bursts spread over multiple URBs. If there is a lot of broadcast traffic, the fifo will fill up to the burst cap limit. Lowering the burst cap to the URB size ensures no packet spans multiple urbs. Caveat, lower limit for working burst cap is 5/33 HS/FS packets. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* | dm: Rename dev_get_parentdata() to dev_get_parent_priv()Simon Glass2015-10-23-2/+2
|/ | | | | | | | The current name is inconsistent with other driver model data access functions. Rename it and fix up all users. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* Move ALLOC_CACHE_ALIGN_BUFFER() to the new memalign.h headerSimon Glass2015-09-11-0/+1
| | | | | | | Now that we have a new header file for cache-aligned allocation, we should move the stack-based allocation macro there also. Signed-off-by: Simon Glass <sjg@chromium.org>
* net: smsc95xx: Add driver-model supportSimon Glass2015-08-06-0/+142
| | | | | | | Add support for driver model, so that CONFIG_DM_ETH can be defined and used with this driver. Signed-off-by: Simon Glass <sjg@chromium.org>
* net: smsc95xx: Prepare for conversion to driver modelSimon Glass2015-08-06-122/+150
| | | | | | | | At present struct eth_device is passed around all over the place. This does not exist with driver model. Add explicit arguments instead, so that with driver model we can pass the correct things. Signed-off-by: Simon Glass <sjg@chromium.org>
* net: smsc95xx: Correct the error numbersSimon Glass2015-08-06-22/+26
| | | | | | | Instead of returning -1 on error, we should use a proper error number. Fix the code to conform to this. Signed-off-by: Simon Glass <sjg@chromium.org>
* net: smsc95xx: Rename AX_RX_URB_SIZE to RX_URB_SIZESimon Glass2015-08-06-5/+5
| | | | | | | The AX_ prefix comes from the Asix driver. Since this is not that, we should avoid this confusing prefix. Signed-off-by: Simon Glass <sjg@chromium.org>
* net: smsc95xx: Sort the include filesSimon Glass2015-08-06-2/+3
| | | | | | Tidy up the include file order before adding more. Signed-off-by: Simon Glass <sjg@chromium.org>
* net: cosmetic: Fix var naming net <-> eth driversJoe Hershberger2015-04-18-1/+2
| | | | | | | | | | | | | | | Update the naming convention used in the network stack functions and variables that Ethernet drivers use to interact with it. This cleans up the temporary hacks that were added to this interface along with the DM support. This patch has a few remaining checkpatch.pl failures that would be out of the scope of this patch to fix (drivers that are in gross violation of checkpatch.pl). Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
* net: cosmetic: Name ethaddr variables consistentlyJoe Hershberger2015-04-18-1/+1
| | | | | | | | Use "_ethaddr" at the end of variables and drop CamelCase. Make constant values actually 'const'. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
* net: usb: Add SMSC copyright to smsc95xx driverSimon Glass2014-09-16-0/+1
| | | | | | | | | | | | | | | This driver was upstreamed without an SMSC copyright, even thought it seems that SMSC was the original author. See the kernel version for a code comparison: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2f7ca802bdae2ca41022618391c70c2876d92190 It's not clear who actually moved this code, or whether the kernel was the original source, or somewhere else, but it probably should still have the SMSC copyright. Signed-off-by: Simon Glass <sjg@chromium.org>
* usb: eth: smsc95xx: add LAN9500A device IDIlya Ledvich2014-06-25-0/+1
| | | | | | | | Add LAN9500A product ID (0x9e00) in order to support LAN9500A based dongles. Tested on cm_t335. Signed-off-by: Ilya Ledvich <ilya@compulab.co.il> Acked-by: Marek Vasut <marex@denx.de>
* usb:smsx95xx LED activity for USB net driverSuriyan Ramasami2013-10-20-0/+14
| | | | | | | Add LED activity for SMSX95XX USB Ether driver. Signed-off-by: “Suriyan Ramasami" <suriyan.r@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
* net: smsc95xx: Add support for another SMSC95xx variantStefan Roese2013-08-19-0/+1
| | | | | | | | | This patch adds support for the SMSC9500 with product id 0x9900 which is equipped in the "EXSYS USB 2.0" etherner USB adapter. Tested on omap3_beagle. Signed-off-by: Stefan Roese <sr@denx.de>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-24-16/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* OMAP5: Enable USB Ethernet support with LAN9730Lubomir Popov2013-05-14-0/+1
| | | | | | | | Added the LAN9730 to list of supported devices. This chip is used in the sEVM, uEVM and som5_evb. Tested on the som5_evb with dhcp and ping. Signed-off-by: Lubomir Popov <lpopov@mm-sol.com>
* usb: usbeth: smsc95xx: remove EEPROM loaded checkMichael Spang2013-03-18-4/+0
| | | | | | | | | | | | [port of Linux kernel commit bcd218be5aeb by Steve Glendinning] The eeprom read & write commands currently check the E2P_CMD_LOADED_ bit is set before allowing any operations. This prevents any reading or writing unless a correctly programmed EEPROM is installed. Signed-off-by: Michael Spang <spang@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Marek Vasut <marex@denx.de>
* net: introduce transparent driver private in ueth_dataLucas Stach2012-09-26-14/+35
| | | | | | | | | | Avoid clutter in ueth_data. Individual drivers should not mess with structures belonging to the core like this. Signed-off-by: Lucas Stach <dev@lynxeye.de> Reviewed-by: Marek Vasut <marex@denx.de> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* smsc95xx: align buffers to cache line sizeIlya Yanok2012-07-18-4/+9
| | | | | | | Align buffers passed to the USB code to cache line size so they can be DMAed safely. Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com>
* drivers/usb/eth/smsc95xx.c: Fix GCC 4.6 warningAnatolij Gustschin2012-05-22-2/+1
| | | | | | | | | Fix: smsc95xx.c: In function 'smsc95xx_eth_get_info': smsc95xx.c:869:12: warning: assignment from incompatible pointer type [enabled by default] Signed-off-by: Anatolij Gustschin <agust@denx.de>
* smsc95xx: Debug message cleanupWolfgang Grandegger2011-11-22-7/+3
| | | | | | | | Cc: Simon Glass <sjg@chromium.org> Cc: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Wolfgang Grandegger <wg@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Simon Glass <sjg@chromium.org>
* smsc95xx: Fix MAC address programmingWolfgang Grandegger2011-11-22-3/+3
| | | | | | | | | | | | | Commit 79ad54400932d6484178a372fb3b659e3437473b broke MAC address programming in the SMSC95xx register set. Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Wolfgang Grandegger <wg@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Simon Glass <sjg@chromium.org>
* GCC4.6: Squash warnings in smsc95xx.cMarek Vasut2011-10-27-1/+1
| | | | | | | | | | | smsc95xx.c: In function 'smsc95xx_write_hwaddr': smsc95xx.c:380:2: warning: dereferencing type-punned pointer will break strict-aliasing rules Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Mike Frysinger <vapier@gentoo.org>
* Add support for SMSC95XX USB 2.0 10/100MBit Ethernet AdapterSimon Glass2011-08-08-0/+879
The SMSC95XX is a USB hub with a built-in Ethernet adapter. This adds support for this, using the USB host network framework. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Eric Bénard <eric@eukrea.com>