summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/aquantia
Commit message (Collapse)AuthorAgeFilesLines
* net: ethernet: aquantia: Copying tx buffers is not needed.Pavel Belous2017-02-203-95/+97
| | | | | | | | This fix removes copying of tx biffers. Now we use ring->buff_fing directly. Signed-off-by: Pavel Belous <pavel.belous@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Fixed memory allocation if AQ_CFG_RX_FRAME_MAX > 1 ↵Pavel Belous2017-02-201-1/+3
| | | | | | | | | | page. We should allocate the number of pages based on the config parameter AQ_CFG_RX_FRAME_MAX. Signed-off-by: Pavel Belous <pavel.belous@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Fixed incorrect buff->len calculation.Pavel Belous2017-02-202-4/+4
| | | | | | | | | rxd_wb->pkt_len is the total length of the packet. If we received a large packet (with length > AQ_CFG_RX_FRAME_MAX) then we will get multiple buffers. We need to fix the length of the last buffer. Signed-off-by: Pavel Belous <pavel.belous@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Call netdev_register after all initialized.Pavel Belous2017-02-202-6/+5
| | | | | | | | | netdev_register should be called when everything is initialized. Also we should use net_device->reg_state field instead own "is_ndev_registered" flag to avoid any race. Signed-off-by: Pavel Belous <pavel.belous@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Null pointer check for aq_nic_ndev_alloc.Pavel Belous2017-02-201-3/+4
| | | | | | | | | We should check for a null pointer for aq_nic_ndev_alloc instead netdev_priv. Signed-off-by: Pavel Belous <pavel.belous@aquantia.com> Reviewed-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Using NETDEV_TX_OK instead 0.Pavel Belous2017-02-201-1/+1
| | | | | | | | Use NETDEV_TX_OK as the return value for successful transmission. Signed-off-by: Pavel Belous <pavel.belous@aquantia.com> Reviewed-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Fixed missing rtnl_unlock.Pavel Belous2017-02-201-2/+3
| | | | | | | | rtnl_unlock should be called if error occurred. Signed-off-by: Pavel Belous <pavel.belous@aquantia.com> Reviewed-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Superfluous initialization of "err".Pavel Belous2017-02-201-7/+1
| | | | | | | | Fixed superfluous initialization of err. Signed-off-by: Pavel Belous <pavel.belous@aquantia.com> Reviewed-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Using module_pci_driver.Pavel Belous2017-02-201-19/+1
| | | | | | | | Remove boilerplate code by using macro module_pci_driver. Signed-off-by: Pavel Belous <pavel.belous@aquantia.com> Reviewed-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Fixes for aq_ndev_change_mtuPavel Belous2017-02-202-11/+2
| | | | | | | | | | | | | | 1)Removed unnecessary comparsion "old_mtu == new_mtu". This check is not needed. Function aq_ndev_change_mtu wont be called if mtu has not changed. 2)Removed extra assignment ndev->mtu = new_mtu; This assignment already done inside __dev_set_mtu(). 3)Use core MTU checking for min_mtu. Signed-off-by: Pavel Belous <pavel.belous@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Removed busy_count field.Pavel Belous2017-02-202-12/+0
| | | | | | | | busy_count field and is_busy flag is not needed at all. Signed-off-by: Pavel Belous <pavel.belous@aquantia.com> Reviewed-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Removed extra assignment for skb->dev.Pavel Belous2017-02-201-1/+0
| | | | | | | | This assignment is not needed. Signed-off-by: Pavel Belous <pavel.belous@aquantia.com> Reviewed-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: aquantia: remove function aq_ring_tx_deinitLino Sanfilippo2017-02-203-39/+11
| | | | | | | | | | | | | | Both functions aq_ring_rx_deinit() and aq_ring_tx_clean() are almost identical aside from an additional check in the latter. Move that check from the function into its caller and replace aq_ring_rx_deinit() with aq_ring_rx_deinit(). By doing this also adjust the functions return value from int to void since it can never fail. Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de> Tested-by: Pavel Belous <pavel.belous@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: switch to pci_alloc_irq_vectorsChristoph Hellwig2017-02-151-76/+25
| | | | | | | | | | pci_enable_msix has been long deprecated, but this driver adds a new instance. Convert it to pci_alloc_irq_vectors so that no new instance of the deprecated function reaches mainline. Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Pavel Belous <pavel.belous@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net:ethernet:aquantia: Add 2500/5000 mbit link modes support.Pavel Belous2017-02-131-37/+59
| | | | | | | | | | | Using new link mode indices instead deprecated SUPPORTED_/ADVERTISED_ macro. Added indication for 2500 and 5000mbit link modes (AQtion adapter already supports these speeds). Signed-off-by: Pavel Belous <pavel.belous@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* ethernet: aquantia: fix dma_mapping_error testDan Carpenter2017-02-011-2/+3
| | | | | | | | dma_mapping_error() returns 1 if there is an error and 0 if not. Fixes: 018423e90bee ("net: ethernet: aquantia: Add ring support code") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: aquantia: atlantic: use new api ethtool_{get|set}_link_ksettingsPhilippe Reynes2017-01-313-31/+49
| | | | | | | | | | | | The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings. As I don't have the hardware, I'd be very pleased if someone may test this patch. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Tested-by: Pavel Belous <pavel.s.belous@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers: net: generalize napi_complete_done()Eric Dumazet2017-01-301-1/+1
| | | | | | | | | | | | napi_complete_done() allows to opt-in for gro_flush_timeout, added back in linux-3.19, commit 3b47d30396ba ("net: gro: add a per device gro flush timer") This allows for more efficient GRO aggregation without sacrifying latencies. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: return -ETIME in macro AQ_HW_WAIT_FORColin Ian King2017-01-291-1/+1
| | | | | | | | | The macro is returning ETIME which means various checks to see if the returned err is less than zero never work. I believe a -ETIME should be returned instead. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: remove another redundant err checkColin Ian King2017-01-291-2/+0
| | | | | | | | The check on err < 0 is redundant and can be removed. Detected by CoverityScan, CID#1398318 ("Logically Dead Code") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: remove redundant err checkColin Ian King2017-01-291-2/+0
| | | | | | | | The check on err < 0 is redundant and can be removed. Detected by CoverityScan, CID#1398321 ("Logically Dead Code") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Receive side scalingDavid VomLehn2017-01-241-0/+26
| | | | | | | | | | | Add definitions that support receive side scaling. Signed-off-by: Alexander Loktionov <Alexander.Loktionov@aquantia.com> Signed-off-by: Dmitrii Tarakanov <Dmitrii.Tarakanov@aquantia.com> Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com> Signed-off-by: Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com> Signed-off-by: David M. VomLehn <vomlehn@texas.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Ethtool supportDavid VomLehn2017-01-242-0/+280
| | | | | | | | | | | Add the driver interfaces required for support by the ethtool utility. Signed-off-by: Alexander Loktionov <Alexander.Loktionov@aquantia.com> Signed-off-by: Dmitrii Tarakanov <Dmitrii.Tarakanov@aquantia.com> Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com> Signed-off-by: Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com> Signed-off-by: David M. VomLehn <vomlehn@texas.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Hardware interface and utility functionsDavid VomLehn2017-01-243-0/+292
| | | | | | | | | | | Add functions to interface with the hardware and some utility functions. Signed-off-by: Alexander Loktionov <Alexander.Loktionov@aquantia.com> Signed-off-by: Dmitrii Tarakanov <Dmitrii.Tarakanov@aquantia.com> Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com> Signed-off-by: Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com> Signed-off-by: David M. VomLehn <vomlehn@texas.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Atlantic hardware abstraction layerDavid VomLehn2017-01-242-0/+780
| | | | | | | | | | | Add common functions for Atlantic hardware abstraction layer. Signed-off-by: Alexander Loktionov <Alexander.Loktionov@aquantia.com> Signed-off-by: Dmitrii Tarakanov <Dmitrii.Tarakanov@aquantia.com> Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com> Signed-off-by: Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com> Signed-off-by: David M. VomLehn <vomlehn@texas.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: PCI operationsDavid VomLehn2017-01-242-0/+379
| | | | | | | | | | | Add functions that handle the PCI bus interface. Signed-off-by: Alexander Loktionov <Alexander.Loktionov@aquantia.com> Signed-off-by: Dmitrii Tarakanov <Dmitrii.Tarakanov@aquantia.com> Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com> Signed-off-by: Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com> Signed-off-by: David M. VomLehn <vomlehn@texas.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Vector operationsDavid VomLehn2017-01-242-0/+434
| | | | | | | | | | | Add functions to manululate the vector of receive and transmit rings. Signed-off-by: Alexander Loktionov <Alexander.Loktionov@aquantia.com> Signed-off-by: Dmitrii Tarakanov <Dmitrii.Tarakanov@aquantia.com> Signed-off-by: Pavel.Belous <Pavel.Belous@aquantia.com> Signed-off-by: Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com> Signed-off-by: David M. VomLehn <vomlehn@texas.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Atlantic A0 and B0 specific functions.David VomLehn2017-01-246-0/+2293
| | | | | | | | | | | Add Atlantic A0 and B0 specific functions. Signed-off-by: Alexander Loktionov <Alexander.Loktionov@aquantia.com> Signed-off-by: Dmitrii Tarakanov <Dmitrii.Tarakanov@aquantia.com> Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com> Signed-off-by: Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com> Signed-off-by: David M. VomLehn <vomlehn@texas.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Support for NIC-specific codeDavid VomLehn2017-01-245-0/+1381
| | | | | | | | | | | Add support for code specific to the Atlantic NIC. Signed-off-by: Alexander Loktionov <Alexander.Loktionov@aquantia.com> Signed-off-by: Dmitrii Tarakanov <Dmitrii.Tarakanov@aquantia.com> Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com> Signed-off-by: Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com> Signed-off-by: David M. VomLehn <vomlehn@texas.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Low-level hardware interfacesDavid VomLehn2017-01-243-0/+4446
| | | | | | | | | | | Add definitions of functions that interface directly with the hardware. Signed-off-by: Alexander Loktionov <Alexander.Loktionov@aquantia.com> Signed-off-by: Dmitrii Tarakanov <Dmitrii.Tarakanov@aquantia.com> Signed-off-by: Pavel.Belous <Pavel.Belous@aquantia.com> Signed-off-by: Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com> Signed-off-by: David M. VomLehn <vomlehn@texas.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Add ring support codeDavid VomLehn2017-01-242-0/+533
| | | | | | | | | | | Add code to support the transmit and receive ring buffers. Signed-off-by: Alexander Loktionov <Alexander.Loktionov@aquantia.com> Signed-off-by: Dmitrii Tarakanov <Dmitrii.Tarakanov@aquantia.com> Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com> Signed-off-by: Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com> Signed-off-by: David M. VomLehn <vomlehn@texas.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Common functions and definitionsDavid VomLehn2017-01-243-0/+150
| | | | | | | | | | | | Add files containing the functions and definitions used in common in different functional areas. Signed-off-by: Alexander Loktionov <Alexander.Loktionov@aquantia.com> Signed-off-by: Dmitrii Tarakanov <Dmitrii.Tarakanov@aquantia.com> Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com> Signed-off-by: Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com> Signed-off-by: David M. VomLehn <vomlehn@texas.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: aquantia: Make and configuration files.David VomLehn2017-01-244-0/+89
Patches to create the make and configuration files. Signed-off-by: Alexander Loktionov <Alexander.Loktionov@aquantia.com> Signed-off-by: Dmitrii Tarakanov <Dmitrii.Tarakanov@aquantia.com> Signed-off-by: Pavel Belous <Pavel.Belous@aquantia.com> Signed-off-by: Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com> Signed-off-by: David M. VomLehn <vomlehn@texas.net> Signed-off-by: David S. Miller <davem@davemloft.net>