aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/asix_devices.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * net: asix: Fix AX88772_suspend() USB vendor commands failure issuesallan2016-12-011-3/+3
| | | | | | | | | | | | | | | | | | The change fixes AX88772_suspend() USB vendor commands failure issues. Signed-off-by: Allan Chou <[email protected]> Tested-by: Allan Chou <[email protected]> Tested-by: Jon Hunter <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* | net: use core MTU range checking in USB NIC driversJarod Wilson2016-10-201-3/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | usbnet: - Remove stale new_mtu <= 0 check in usbnet.c - Set min_mtu = 0, max_mtu = 65535 (sub-drivers must set their own max_mtu and/or min_mtu as needed) r8152: - Set appropriate max_mtu for different variants (1500 or 9194) lan78xx: - Set max_mtu = 9000 asix_driver: - max_mtu = 16384 for ax88178 variant ax88179: - max_mtu = 4088 cdc_ncm: - max_mtu from hardware cdc-phonet: - min_mtu = 6, max_mtu = 65541 sierra_net: - max_mtu = 1500, call usbnet_change_mtu directly - sierra_net_change_mtu checked for MTU > 1500, then called usbnet_change_mtu, but if we set max_mtu to let the network core handle the range check, then we can simply call usbnet_change_mtu directly smsc75xx: - max_mtu = 9000 CC: [email protected] CC: Woojung Huh <[email protected]> CC: Microchip Linux Driver Support <[email protected]> CC: Hayes Wang <[email protected]> CC: Oliver Neukum <[email protected]> CC: Steve Glendinning <[email protected]> Signed-off-by: Jarod Wilson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* net: asix: autoneg will set WRITE_MEDIUM regRobert Foss2016-09-011-4/+1
| | | | | | | | | | | | | | | | | | From: Grant Grundler <[email protected]> The miii_nway_restart() causes a PHY link change activity and ax88772_link_reset will be called. link_reset will set AX_CMD_WRITE_MEDIUM_MODE register correctly. The asix_write_medium_mode in reset() fills in a default value to the register which may be different from the negotiation result. So do this first. Ignore the ret value since it's ignored in XXX_link_reset() functions. Signed-off-by: Grant Grundler <[email protected]> Signed-off-by: Robert Foss <[email protected]> Tested-by: Robert Foss <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* net: asix: see 802.3 spec for phy resetRobert Foss2016-09-011-3/+24
| | | | | | | | | | | | | | | From: Grant Grundler <[email protected]> https://lkml.org/lkml/2014/11/11/947 Ben Hutchings is correct. IEEE 802.3 spec section "22.2.4.1.1 Reset" requires up to 500ms delay. Mitigate the "max" delay by polling the phy until BCM_RESET bit is clear. Signed-off-by: Grant Grundler <[email protected]> Signed-off-by: Robert Foss <[email protected]> Tested-by: Robert Foss <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* net: asix: Fix AX88772x resume failuresRobert Foss2016-09-011-1/+46
| | | | | | | | | | | | | | From: Allan Chou <[email protected]> The change fixes AX88772x resume failure by - Restore incorrect AX88772A PHY registers when resetting - Need to stop MAC operation when suspending - Need to restart MII when restoring PHY Signed-off-by: Allan Chou <[email protected]> Signed-off-by: Robert Foss <[email protected]> Tested-by: Robert Foss <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* net: asix: Avoid looping when the device is disconnectedRobert Foss2016-09-011-0/+2
| | | | | | | | | | | | From: Vincent Palatin <[email protected]> Check the answers from the USB stack and avoid re-sending multiple times the request if the device has disappeared. Signed-off-by: Vincent Palatin <[email protected]> Signed-off-by: Robert Foss <[email protected]> Tested-by: Robert Foss <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* net: asix: Add in_pm parameterRobert Foss2016-09-011-83/+290
| | | | | | | | | | | | | | | | | | From: Freddy Xin <[email protected]> In order to R/W registers in suspend/resume functions, in_pm flags are added to some functions to determine whether the nopm version of usb functions is called. Save BMCR and ANAR PHY registers in suspend function and restore them in resume function. Reset HW in resume function to ensure the PHY works correctly. Signed-off-by: Freddy Xin <[email protected]> Signed-off-by: Robert Foss <[email protected]> Tested-by: Robert Foss <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* net: asix: add support for the Billionton GUSB2AM-1G-B USB adapterChia-Sheng Chang2015-10-191-0/+4
| | | | | | | | | | | | | | | | | Just another AX88178-based 10/100/1000 USB-to-Ethernet dongle. This one shows up in lsusb as: "ID 08dd:0114 Billionton Systems, Inc". Signed-off-by: Chia-Sheng Chang <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Luca Ceresoli <[email protected]> Cc: Christoph Jaeger <[email protected]> Cc: "[email protected]" <[email protected]> Cc: Matthew Garrett <[email protected]> Cc: Markus Elfring <[email protected]> Cc: Charles Keepax <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
* net: asix: add support for the Sitecom LN-028 USB adapterLuca Ceresoli2015-02-271-0/+4
| | | | | | | | | | | | Just another AX88178-based 10/100/1000 USB-to-Ethernet dongle. This one shows up in lsusb as: "Sitecom Europe B.V. LN-028 Network USB 2.0 Adapter". Signed-off-by: Luca Ceresoli <[email protected]> Cc: Francois Romieu <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
* net: USB: Deletion of unnecessary checks before the function call "kfree"Markus Elfring2014-11-211-2/+1
| | | | | | | | | | The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* asix: Do full reset during ax88772_bindCharles Keepax2014-11-071-13/+1
| | | | | | | | | | | | | | | | | | | | | | commit 3cc81d85ee01 ("asix: Don't reset PHY on if_up for ASIX 88772") causes the ethernet on Arndale to no longer function. This appears to be because the Arndale ethernet requires a full reset before it will function correctly, however simply reverting the above patch causes problems with ethtool settings getting reset. It seems the problem is that the ethernet is not properly reset during bind, and indeed the code in ax88772_bind that resets the device is a very small subset of the actual ax88772_reset function. This patch uses ax88772_reset in place of the existing reset code in ax88772_bind which removes some code duplication and fixes the ethernet on Arndale. It is still possible that the original patch causes some issues with suspend and resume but that seems like a separate issue and I haven't had a chance to test that yet. Signed-off-by: Charles Keepax <[email protected]> Tested-by: Riku Voipio <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* asix: Don't reset PHY on if_up for ASIX 88772Michel Stam2014-10-031-1/+1
| | | | | | | | | | | | | | | | I've noticed every time the interface is set to 'up,', the kernel reports that the link speed is set to 100 Mbps/Full Duplex, even when ethtool is used to set autonegotiation to 'off', half duplex, 10 Mbps. It can be tested by: ifconfig eth0 down ethtool -s eth0 autoneg off speed 10 duplex half ifconfig eth0 up Then checking 'dmesg' for the link speed. Signed-off-by: Michel Stam <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* net: asix: add missing flag to struct driver_infoEmil Goode2014-02-141-1/+2
| | | | | | | | | | | | | The struct driver_info ax88178_info is assigned the function asix_rx_fixup_common as it's rx_fixup callback. This means that FLAG_MULTI_PACKET must be set as this function is cloning the data and calling usbnet_skb_return. Not setting this flag leads to usbnet_skb_return beeing called a second time from within the rx_process function in the usbnet module. Signed-off-by: Emil Goode <[email protected]> Reported-by: Bjørn Mork <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* usb: Fix FSF address in file headersJeff Kirsher2013-12-061-2/+1
| | | | | | | | | | | | | Several files refer to an old address for the Free Software Foundation in the file header comment. Resolve by replacing the address with the URL <http://www.gnu.org/licenses/> so that we do not have to keep updating the header comments anytime the address changes. CC: Oliver Neukum <[email protected]> CC: Steve Glendinning <[email protected]> CC: Oliver Neukum <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* net: asix: Move declaration of ax88172a_info to shared headerMark Brown2013-08-131-2/+0
| | | | | | | | | | Ensure that the definition of ax88172a_info matches the declaration seen by users and silence sparse warnings about symbols without declarations in the global namespace by moving the declaration into the shared header asix.h. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* USBNET: centralize computing of max rx/tx qlenMing Lei2013-07-281-0/+3
| | | | | | | | | | | | | | | | | | | | This patch centralizes computing of max rx/tx qlen, because: - RX_QLEN()/TX_QLEN() is called in hot path - computing depends on device's usb speed, now we have ls/fs, hs, ss, so more checks need to be involved - in fact, max rx/tx qlen should not only depend on device USB speed, but also depend on ethernet link speed, so we need to consider that in future. - if SG support is done, max tx qlen may need change too Generally, hard_mtu and rx_urb_size are changed in bind(), reset() and link_reset() callback, and change mtu network operation, this patches introduces the API of usbnet_update_max_qlen(), and calls it in above path. Signed-off-by: Ming Lei <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* usbnet: asix: apply usbnet_link_changeMing Lei2013-04-111-5/+1
| | | | | | | Use usbnet_link_change to handle link change centrally. Signed-off-by: Ming Lei <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* usb/net/asix_devices: Add USBNET HG20F9 ethernet dongleGlen Turner2013-02-271-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | This USB ethernet adapter was purchased in anodyne packaging from the computer store adjacent to linux.conf.au 2013 in Canberra (Australia). A web search shows other recent purchasers in Lancaster (UK) and Seattle (USA). Just like an emergent virus, our age of e-commerce and airmail allows underdocumented hardware to spread around the world instantly using the vector of ridiculously low prices. Paige Thompson, infected via eBay, discovered that the HG20F9 is a copy of the Asix 88772B; many viruses copy the RNA of other viruses. See Paige's work at <https://github.com/paigeadele/HG20F9>. This patch uses her discovery to update the restructured Asix driver in the current kernel. Just as some viruses inhabit seemingly-healthy cells, the HG20F9 uses the Vendor ID 0x066b assigned to Linksys Inc. For the present there is no clash of Product ID 0x20f9. Signed-off-by: Glen Turner <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* net: asix: ax88772_unbind() can be staticWu Fengguang2013-01-191-1/+1
| | | | | Signed-off-by: Fengguang Wu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* net: asix: handle packets crossing URB boundariesLucas Stach2013-01-181-3/+20
| | | | | | | | | ASIX AX88772B started to pack data even more tightly. Packets and the ASIX packet header may now cross URB boundaries. To handle this we have to introduce some state between individual calls to asix_rx_fixup(). Signed-off-by: Lucas Stach <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* net: asix: init ASIX AX88772B MAC from EEPROMLucas Stach2013-01-181-3/+27
| | | | | | | | The device comes up with a MAC address of all zeros. We need to read the initial device MAC from EEPROM so it can be set properly later. Signed-off-by: Lucas Stach <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* asix: use ramdom hw addr if the one read is not validJean-Christophe PLAGNIOL-VILLARD2012-11-231-3/+16
| | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
* asix: Adds support for Lenovo 10/100 USB dongle.Quinlan Pfiffer2012-10-011-0/+4
| | | | | | | | This dongle ships with the X1 Carbon, and has an AX88772B usb to ethernet chip in it. Signed-off-by: Quinlan Pfiffer <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2012-09-281-0/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/net/team/team.c drivers/net/usb/qmi_wwan.c net/batman-adv/bat_iv_ogm.c net/ipv4/fib_frontend.c net/ipv4/route.c net/l2tp/l2tp_netlink.c The team, fib_frontend, route, and l2tp_netlink conflicts were simply overlapping changes. qmi_wwan and bat_iv_ogm were of the "use HEAD" variety. With help from Antonio Quartulli. Signed-off-by: David S. Miller <[email protected]>
| * asix: Support DLink DUB-E100 H/W Ver C1Søren holm2012-09-191-0/+4
| | | | | | | | | | | | Signed-off-by: Søren Holm <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
* | USB: remove dbg() usage in USB networking driversGreg Kroah-Hartman2012-09-201-16/+20
|/ | | | | | | | | | | | | | The dbg() USB macro is so old, it predates me. The USB networking drivers are the last hold-out using this macro, and we want to get rid of it, so replace the usage of it with the proper netdev_dbg() or dev_dbg() (depending on the context) calls. Some places we end up using a local variable for the debug call, so also convert the other existing dev_* calls to use it as well, to save tiny amounts of code space. Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* asix: Add support for programming the EEPROMChristian Riesch2012-07-191-0/+3
| | | | | | | | This patch adds the asix_set_eeprom() function to provide support for programming the configuration EEPROM via ethtool. Signed-off-by: Christian Riesch <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* asix: Rework reading from EEPROMChristian Riesch2012-07-191-9/+0
| | | | | | | | | | | | | | | | The current code for reading the EEPROM via ethtool in the asix driver has a few issues. It cannot handle odd length values (accesses must be aligned at 16 bit boundaries) and interprets the offset provided by ethtool as 16 bit word offset instead as byte offset. The new code for asix_get_eeprom() introduced by this patch is modeled after the code in drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c and provides read access to the entire EEPROM with arbitrary offsets and lengths. Signed-off-by: Christian Riesch <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* asix: Add a new driver for the AX88172AChristian Riesch2012-07-171-0/+6
| | | | | | | | | | | The Asix AX88172A is a USB 2.0 Ethernet interface that supports both an internal PHY as well as an external PHY (connected via MII). This patch adds a driver for the AX88172A and provides support for both modes and the phylib. Signed-off-by: Christian Riesch <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* asix: Factor out common codeChristian Riesch2012-07-171-659/+1
| | | | | | | | Allow the new driver for the AX88172A to share code with the existing drivers for ASIX devices. Signed-off-by: Christian Riesch <[email protected]> Signed-off-by: David S. Miller <[email protected]>
* asix: Rename asix.c to asix_devices.cChristian Riesch2012-07-171-0/+1680
This patch further creates two additional copies of asix.c. In another patch these copies will be used to factor out common code. Signed-off-by: Christian Riesch <[email protected]> Signed-off-by: David S. Miller <[email protected]>