aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-01-07phy: add phydev_name() wrapperAndrew Lunn22-34/+34
Add a phydev_name() function, to help with moving some structure members from phy_device. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-07phy: Use phy_read() instead of mdiobus_read()Andrew Lunn1-68/+36
Since we have a phydev, make use of it and the phy_read() function. This will help with later refactoring. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-06Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2-2/+8
2016-01-06fsl/fman: double free on probe failureDan Carpenter1-1/+0
"priv" is allocated with devm_kzalloc() so freeing it here with kfree() will lead to a double free. Fixes: 3933961682a3 ('fsl/fman: Add FMan MAC driver') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-06fsl/fman: fix the pause_time testDan Carpenter1-1/+1
pause_time is unsigned so it can't be less than zero. The bug means that we allow invalid pause-times. Fixes: 57ba4c9b56d8 ('fsl/fman: Add FMan MAC support') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-06mlxsw: core: remove an unnecessary conditionDan Carpenter1-1/+1
We checked "err" on the lines before so we know it's zero here. These cause a static checker warning because checking known things can indicate a bug. Maybe there is a missing assignment or we are checking the wrong variable. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-06ethernet/atheros/alx: sanitize buffer sizing and paddingJarod Wilson3-12/+14
This is based on the work done by Przemek Rudy in bug 70761 at bugzilla.kernel.org, but with some work done to disentagle and clarify things a bit. Similar to Przemek's work and other drivers, we're adding a padding of 16 here, but we're also disentangling mtu size calculations from max buffer size calculations a bit, and adding ETH_HLEN to the value written into ALX_MTU. Hopefully, with a bit more consistency and clarity, things behave better here. Sadly, I can only test in my alx-driven E2200, which worked just fine before this patch. In comment #58 of bug 70761, Eugene A. Shatokhin reports that this patch does help considerably for a ROSA Linux user of his with an AR8162 network adapter when patched into a 4.1.x-based kernel, with several days of normal operation where wired network previously wasn't usable without setting MTU to 9000 as a work-around. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70761 CC: "Eugene A. Shatokhin" <eugene.shatokhin@rosalab.ru> CC: Przemek Rudy <prudy1@o2.pl> CC: Jay Cliburn <jcliburn@gmail.com> CC: Chris Snook <chris.snook@gmail.com> CC: netdev@vger.kernel.org Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-06mlxsw: Remember untagged VLANsElad Raz3-1/+17
When a vlan is been configured, remeber the untagged mode of the vlan. When displaying the list of configured VLANs, show the untagged attribute. Signed-off-by: Elad Raz <eladr@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-06mlxsw: Disable vlan_filtering for non .1D bridgeElad Raz1-0/+21
When a port is bridged, the bridge must be vlan aware bridge (.1Q) or the bridging should be on top of VLAN interfaces (.1D bridge). Signed-off-by: Elad Raz <eladr@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-06mlxsw: Renaming local variable names for consistencyElad Raz1-3/+3
Signed-off-by: Elad Raz <eladr@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-06mlxsw: Fixing vlans init rangeElad Raz1-1/+2
Initialize VLANs 0..4095 (Remove init for VID 4096). Signed-off-by: Elad Raz <eladr@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-06mlxsw: pci: Adjust value of CPU egress traffic classIdo Schimmel1-1/+1
During initialization, when creating the send descriptor queues (SDQs), we specify the CPU egress traffic class of each SDQ. The maximum number of classes of this type is different in the two ASICs supported by this PCI driver. New firmware versions check this value is set correctly, which causes errors on the Spectrum ASIC, as its max exposed egress traffic class is lower than 7. Solve this by setting this field to 3, which is an acceptable value for both ASICs. Note that we currently do not expose the QoS capabilities of the ASICs, so setting this to an hardcoded value is OK for now. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-06net: hns: avoid uninitialized variable warning:Arnd Bergmann1-25/+22
gcc fails to see that the use of the 'last_offset' variable in hns_nic_reuse_page() is used correctly and issues a bogus warning: drivers/net/ethernet/hisilicon/hns/hns_enet.c: In function 'hns_nic_reuse_page': drivers/net/ethernet/hisilicon/hns/hns_enet.c:541:6: warning: 'last_offset' may be used uninitialized in this function [-Wmaybe-uninitialized] This simplifies the function to make it more obvious what is going on to both readers and compilers, which makes the warning go away. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-05net/mlx5e: Add PTP Hardware Clock (PHC) supportEran Ben Elisha4-1/+106
Add a PHC support to the mlx5_en driver. Use reader/writer spinlocks to protect the timecounter since every packet received needs to call timecounter_cycle2time() when timestamping is enabled. This can become a performance bottleneck with RSS and multiple receive queues if normal spinlocks are used. The driver has been tested with both Documentation/ptp/testptp and the linuxptp project (http://linuxptp.sourceforge.net/) on a Mellanox ConnectX-4 card. Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Acked-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-05net/mlx5e: Add HW timestamping (TS) supportEran Ben Elisha7-2/+279
Add support for enable/disable HW timestamping for incoming and/or outgoing packets. To enable/disable HW timestamping appropriate ioctl should be used. Currently HWTSTAMP_FILTER_ALL/NONE and HWTSAMP_TX_ON/OFF only are supported. Make all relevant changes in RX/TX flows to consider TS request and plant HW timestamps into relevant structures. Add internal clock for converting hardware timestamp to nanoseconds. In addition, add a service task to catch internal clock overflow, to make sure timestamping is accurate. Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Acked-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-05net/mlx5_core: Introduce access function to read internal timerEran Ben Elisha2-0/+14
A preparation step which adds support for reading the hardware internal timer and the hardware timestamping from the CQE. In addition, advertize device_frequency_khz HCA capability. Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-05net/mlx5e: Do not modify the TX SKBAchiad Shochat3-34/+49
If the SKB is cloned, or has an elevated users count, someone else can be looking at it at the same time. Signed-off-by: Achiad Shochat <achiad@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04mlxsw: spectrum: Change bridge port attributes only when bridgedIdo Schimmel2-6/+14
Bridge port attributes are offloaded to hardware when invoked with SELF flag set, but it really makes no sense to reflect them when port is not bridged. Allow a user to change these attribute only when port is bridged and initialize them correctly when joining or leaving a bridge. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04mlxsw: spectrum: Set bridge status in appropriate functionsIdo Schimmel1-10/+5
Set the bridge status of physical ports in the appropriate functions, to be consistent with LAG join/leave and vPorts joining/leaving bridge. Also, remove the error messages in these two functions, as we already emit errors in both the single functions they call. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04mlxsw: spectrum: Return NOTIFY_BAD on bridge failureIdo Schimmel1-3/+7
It is possible for us to fail when joining or leaving a bridge, so let the user know about that by returning NOTIFY_BAD, as already done for LAG join/leave and 802.1D bridges. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04mlxsw: spectrum: Initialize PVID only onceIdo Schimmel1-1/+0
We set PVID to 1 in mlxsw_sp_port_vlan_init(), so we can remove this statement. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04chelsio: constify cphy_ops structuresJulia Lawall8-14/+14
The cphy_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04fsl/fman: allow modular buildArnd Bergmann1-1/+2
ARM allmodconfig fails because of the addition of the FMAN driver: drivers/built-in.o: In function `dtsec_restart_autoneg': binder.c:(.text+0x173328): undefined reference to `mdiobus_read' binder.c:(.text+0x173348): undefined reference to `mdiobus_write' drivers/built-in.o: In function `dtsec_config': binder.c:(.text+0x173d24): undefined reference to `of_phy_find_device' drivers/built-in.o: In function `init_phy': binder.c:(.text+0x1763b0): undefined reference to `of_phy_connect' drivers/built-in.o: In function `stop': binder.c:(.text+0x176014): undefined reference to `phy_stop' drivers/built-in.o: In function `start': binder.c:(.text+0x176078): undefined reference to `phy_start' The reason is that the driver uses PHYLIB, but that is a loadable module here, and fman itself is built-in. This patch makes it possible to configure fman as a module as well so we don't change the status of PHYLIB in an allmodconfig kernel, and it adds a 'select PHYLIB' statement to ensure that phylib is always built-in when fman is. The driver uses "builtin_platform_driver(fman_driver);", which means it cannot be unloaded, but it's still possible to have it as a loadable module that gets loaded once and never removed. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 5adae51a64b8 ("fsl/fman: Add FMan MURAM support") Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04cxgb4: correctly handling failed allocationInsu Yun1-0/+4
Since t4_alloc_mem can be failed in memory pressure, if not properly handled, NULL dereference could be happened. Signed-off-by: Insu Yun <wuninsu@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04qlcnic: correctly handle qlcnic_alloc_mbx_argsInsu Yun1-2/+4
Since qlcnic_alloc_mbx_args can be failed, return value should be checked. Signed-off-by: Insu Yun <wuninsu@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04r8169:Correct the way of setting RTL8168DP ephyChun-Hao Lin1-11/+4
The original way is wrong, it always writes ephy reg 0x03. Signed-off-by: Chunhao Lin <hau@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04r8169:Fix typo in setting RTL8168H PHY PFM mode.Chun-Hao Lin1-2/+2
The PHY PFM register is in PHY page 0x0a44 register 0x11, not 0x14. Signed-off-by: Chunhao Lin <hau@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04r8169:Fix typo in setting RTL8168EP and RTL8168H D3cold PFM modeChun-Hao Lin1-3/+3
The register for setting D3code PFM mode is MISC_1, not DLLPR. Signed-off-by: Chunhao Lin <hau@realtek.com> Reviewed-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04sh_eth: get rid of {cpu|edmac}_to_{edmac|cpu}()Sergei Shtylyov1-43/+29
Now that {cpu|edmac}_to_{edmac|cpu}() functions boiled down to the mere {cpu|le32}_to_{le32|cpu}() calls, there's no need for these functions anymore, so just get rid of them. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Acked-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04sh_eth: remove EDMAC_BIG_ENDIANSergei Shtylyov2-17/+2
Commit 71557a37adb5 ("[netdrvr] sh_eth: Add SH7619 support") added support for the big-endian EDMAC descriptors. However, it was never used and never worked right until the recent driver fixes. I think we now can just remove this support, it was only burdening the driver from the start. It should be easy to do without disturbing the SH platform code, at least for now... Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Acked-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04tilepro: use to_delayed_workGeliang Tang1-2/+1
Use to_delayed_work() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04bnxt_en: Modify ethtool -l|-L to support combined or rx/tx rings.Michael Chan1-12/+45
The driver can support either all combined or all rx/tx rings. The default is combined, but the user can now select rx/tx rings. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04bnxt_en: Modify init sequence to support shared or non shared rings.Michael Chan1-10/+32
Modify ring memory allocation and MSIX setup to support shared or non shared rings and do the proper mapping. Default is still to use shared rings. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04bnxt_en: Modify bnxt_get_max_rings() to support shared or non shared rings.Michael Chan3-25/+79
Add logic to calculate how many shared or non shared rings can be supported. Default is to use shared rings. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04bnxt_en: Re-structure ring indexing and mapping.Michael Chan2-38/+55
In order to support dedicated or shared completion rings, the ring indexing and mapping are re-structured as below: 1. bp->grp_info[] array index is 1:1 with bp->bnapi[] array index and completion ring index. 2. rx rings 0 to n will be mapped to completion rings 0 to n. 3. If tx and rx rings share completion rings, then tx rings 0 to m will be mapped to completion rings 0 to m. 4. If tx and rx rings use dedicated completion rings, then tx rings 0 to m will be mapped to completion rings n + 1 to n + m. 5. Each tx or rx ring will use the corresponding completion ring index for doorbell mapping and MSIX mapping. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04bnxt_en: Check for NULL rx or tx ring.Michael Chan1-5/+22
Each bnxt_napi structure may no longer be having both an rx ring and a tx ring. Check for a valid ring before using it. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04bnxt_en: Separate bnxt_{rx|tx}_ring_info structs from bnxt_napi struct.Michael Chan2-86/+70
Currently, an rx and a tx ring are always paired with a completion ring. We want to restructure it so that it is possible to have a dedicated completion ring for tx or rx only. The bnxt hardware uses a completion ring for rx and tx events. The driver has to process the completion ring entries sequentially for the rx and tx events. Using a dedicated completion ring for rx only or tx only has these benefits: 1. A burst of rx packets can cause delay in processing tx events if the completion ring is shared. If tx queue is stopped by BQL, this can cause delay in re-starting the tx queue. 2. A completion ring is sized according to the rx and tx ring size rounded up to the nearest power of 2. When the completion ring is shared, it is sized by adding the rx and tx ring sizes and then rounded to the next power of 2, often with a lot of wasted space. 3. Using dedicated completion ring, we can adjust the tx and rx coalescing parameters independently for rx and tx. The first step is to separate the rx and tx ring structures from the bnxt_napi struct. In this patch, an rx ring and a tx ring will point to the same bnxt_napi struct to share the same completion ring. No change in ring assignment and mapping yet. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-04bnxt_en: Refactor bnxt_dbg_dump_states().Michael Chan1-17/+33
By adding 3 separate functions to dump the different ring states. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-12-31Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller13-118/+113
2015-12-31Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netLinus Torvalds10-73/+112
Pull networking fixes from David Miller: 1) Prevent XFRM per-cpu counter updates for one namespace from being applied to another namespace. Fix from DanS treetman. 2) Fix RCU de-reference in iwl_mvm_get_key_sta_id(), from Johannes Berg. 3) Remove ethernet header assumption in nft_do_chain_netdev(), from Pablo Neira Ayuso. 4) Fix cpsw PHY ident with multiple slaves and fixed-phy, from Pascal Speck. 5) Fix use after free in sixpack_close and mkiss_close. 6) Fix VXLAN fw assertion on bnx2x, from Yuval Mintz. 7) natsemi doesn't check for DMA mapping errors, from Alexey Khoroshilov. 8) Fix inverted test in ip6addrlbl_get(), from ANdrey Ryabinin. 9) Missing initialization of needed_headroom in geneve tunnel driver, from Paolo Abeni. 10) Fix conntrack template leak in openvswitch, from Joe Stringer. 11) Mission initialization of wq->flags in sock_alloc_inode(), from Nicolai Stange. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (35 commits) sctp: sctp should release assoc when sctp_make_abort_user return NULL in sctp_close net, socket, socket_wq: fix missing initialization of flags drivers: net: cpsw: fix error return code openvswitch: Fix template leak in error cases. sctp: label accepted/peeled off sockets sctp: use GFP_USER for user-controlled kmalloc qlcnic: fix a loop exit condition better net: cdc_ncm: avoid changing RX/TX buffers on MTU changes geneve: initialize needed_headroom ipv6: honor ifindex in case we receive ll addresses in router advertisements addrconf: always initialize sysctl table data ipv6/addrlabel: fix ip6addrlbl_get() switchdev: bridge: Pass ageing time as clock_t instead of jiffies sh_eth: fix 16-bit descriptor field access endianness too veth: don’t modify ip_summed; doing so treats packets with bad checksums as good. net: usb: cdc_ncm: Adding Dell DW5813 LTE AT&T Mobile Broadband Card net: usb: cdc_ncm: Adding Dell DW5812 LTE Verizon Mobile Broadband Card natsemi: add checks for dma mapping errors rhashtable: Kill harmless RCU warning in rhashtable_walk_init openvswitch: correct encoding of set tunnel action attributes ...
2015-12-30Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queueDavid S. Miller7-32/+62
Jeff Kirsher says: ==================== 10GbE Intel Wired LAN Driver Updates 2015-12-29 This series contains updates to ixgbe and ixgbevf. William Dauchy provides a fix for ixgbevf that was implemented for ixgbe, commit 5d6002b7b822c7 ("ixgbe: Fix handling of NAPI budget when multiple queues are enabled per vector"). The issue was that the polling routine would increase the budget for receive to at least 1 per queue if multiple queues were present, which resulted in receive packets being processed when the budget was 0. Emil provides minor cleanups for ixgbevf, one being that we need to check rx_itr_setting with == and not &, since it is not a mask. Added QSFP PHY support in ixgbe to allow for more accurate reporting of port settings. Fixed the max RSS limit for X550 which is 63, not 64. Veola fixes ixgbe ethtool reporting of backplane type interfaces as 1000/10000baseT link modes, instead, report the media as KR, KX or KX4 based on the backplane interface present. Mark cleans up redundancy in the setting of hw_enc_features that makes it appear that X550 has more encapsulation features than other devices. Also do not set NETIF_F_SG any longer since that is set by the register_netdev() call. Also fixed the X550EM_x revision check, which needs to check a value, not just a bit. Alex Duyck fixes additional bugs in ixgbe_clear_vf_vlans(), one being that the mask was using a divide instead of a modulus, which resulted in the mask bit being incorrectly set to 0 or 1 based on the value of the VF being tested. Alex also found that he was not consistent in using the "word" argument as an offset or as a register offset, so made the code consistently use word as the offset in the array. v2: dropped patch 8 of the original series, as it was undoing a part of the fix Alex Duyck was doing in patch 9 of the original series. Dropped based on feedback from Emil (the author). ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2015-12-30be2net: bump up the driver version to 11.0.0.0Suresh Reddy1-1/+1
Signed-off-by: Suresh Reddy <suresh.reddy@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-12-30be2net: support ethtool get-dump optionVenkat Duvvuru5-57/+71
This patch adds support for ethtool's --get-dump option in be2net, to retrieve FW dump. In the past when this option was not yet available, this feature was supported via the --register-dump option as a workaround. This patch removes support for FW-dump via --register-dump option as it is now available via --get-dump option. Even though the "ethtool --register-dump" cmd which used to work earlier, will now fail with ENOTSUPP error, we feel it is not an issue as this is used only for diagnostics purpose. Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-12-30be2net: fix port-res desc query of GET_PROFILE_CONFIG FW cmdSuresh Reddy4-53/+63
Commit 72ef3a88fa8e ("be2net: set pci_func_num while issuing GET_PROFILE_CONFIG cmd") passed a specific pf_num while issuing a GET_PROFILE_CONFIG cmd as FW returns descriptors for all functions when pf_num is zero. But, when pf_num is set to a non-zero value, FW does not return the Port resource descriptor. This patch fixes this by setting pf_num to 0 while issuing the query cmd and adds code to pick the correct NIC resource descriptor from the list of descriptors returned by FW. Fixes: 72ef3a88fa8e ("be2net: set pci_func_num while issuing GET_PROFILE_CONFIG cmd") Signed-off-by: Suresh Reddy <suresh.reddy@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-12-30be2net: remove unused error variablesVenkat Duvvuru1-4/+0
eeh_error, fw_timeout, hw_error variables in the be_adapter structure are not used anymore. An earlier patch that introduced adapter->err_flags to store this information missed removing these variables. Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-12-30be2net: remove a line of code that has no effectSathya Perla3-4/+3
This patch removes a line of code that changes adapter->recommended_prio value followed by yet another assignment. Also, the variable is used to store the vlan priority value that is already shifted to the PCP bits position in the vlan tag format. Hence, the name of this variable is changed to recommended_prio_bits. Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-12-30be2net: log digital signature errors while flashing FW imageSuresh Reddy2-2/+16
(based on a jumper setting on the adapter.) In this mode, the FW image when flashed is authenticated with a digital signature. This patch logs appropriate error messages and return a status to ethtool when errors relating to FW image authentication occur. Signed-off-by: Suresh Reddy <suresh.reddy@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-12-30be2net: move FW flash cmd code to be_cmds.cSuresh Reddy3-584/+578
All code relating to FW cmds is in be_cmds.[ch] excepting FW flash cmd related code. This patch moves these routines from be_main.c to be_cmds.c Signed-off-by: Suresh Reddy <suresh.reddy@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-12-30be2net: cleanup FW flash image related macro definesSuresh Reddy2-101/+118
Many constant definitions relating to the FW-image layout (such as section offset values) were defined in decimal format rather than hexa-decimal. This makes this part of the code un-readable. Also some defines related to BE2 are labeld "g2" and defines related to BE3 are labeled "g3". This patch cleans up all of this to make this code more readable. Signed-off-by: Suresh Reddy <suresh.reddy@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-12-30be2net: avoid configuring VEPA mode on BE3Suresh Reddy1-0/+3
BE3 chip doesn't support VEPA mode. Signed-off-by: Suresh Reddy <suresh.reddy@avagotech.com> Signed-off-by: Sathya Perla <sathya.perla@avagotech.com> Signed-off-by: David S. Miller <davem@davemloft.net>