aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/octeon/octeon-ethernet.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-01-15staging: octeon: remove redundant license textGreg Kroah-Hartman1-4/+0
Now that the SPDX tag is in all drivers/staging/octeon/ files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-15staging: octeon: add SPDX identifiers.Greg Kroah-Hartman1-0/+1
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Fix up the staging octeon driver to have a proper SPDX identifier, based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-16staging: octeon: Use net_device_stats from struct net_deviceTobias Klauser1-2/+0
Instead of using a private copy of struct net_device_stats in struct octeon_ethernet, use stats from struct net_device. Also remove the now unnecessary .ndo_get_stats function. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02staging: octeon: support enabling multiple rx groupsAaro Koskinen1-1/+1
Support enabling multiple RX groups. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21net: ethernet: octeon: use phydev from struct net_devicePhilippe Reynes1-1/+0
The private structure contain a pointer to phydev, but the structure net_device already contain such pointer. So we can remove the pointer phydev in the private structure, and update the driver to use the one contained in struct net_device. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: octeon: Convert create_singlethread_workqueue()Bhaktipriya Shridhar1-1/+0
With conccurency managed workqueues, use of dedicated workqueues can be replaced by system_wq. Drop cvm_oct_poll_queue by using system_wq. There are multiple work items per cvm_oct_poll_queue (viz. cvm_oct_rx_refill_work, port_periodic_work) and different cvm_oct_poll_queues need not be be ordered. Hence, concurrency can be increased by switching to system_wq. All work items are sync canceled in cvm_oct_remove() so it is guaranteed that no work is in flight by the time exit path runs. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11staging: octeon: refactor rgmii 10 mbps preamble error checkingAaro Koskinen1-3/+1
Refactor RGMII 10 Mbps preamble error checking. The current implementation does not work correctly in phydev mode since only the link status changes trigger the callback, and if we stay on 10 Mbps operation the periodic checks for error counters are never done. Provide a periodic worker also during the phydev operation, and notify the link status changes through the phydev instead of the inband status change interrupt. This also has the benefit that we don't need to use legacy CVMX MDIO calls to check the PHY state, and we can avoid races that trigger bogus "Using 10Mbps with software preamble removal" logs when interfaces are being bringed up. It also avoids some corner-case crashes when the in-band interrupt triggers while the interface is being taken down. Tested on EdgeRouter Lite & D-Link DSR-1000N. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17staging: octeon-ethernet: move cvm_oct_xaui_open()Aaro Koskinen1-1/+0
cvm_oct_xaui_open() is trivial and does not need a dedicated file. Move it to the main file. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17staging: octeon-ethernet: drop poll_now parameter from cvm_oct_common_openAaro Koskinen1-1/+1
Drop redundant poll_now parameter from cvm_oct_common_open. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12staging: octeon-ethernet: xaui: use common initAaro Koskinen1-1/+0
Use common init. Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02Staging: octeon: Use preferred kernel typeAybuke Ozdemir1-1/+1
This patch "uint*_t" type instead of "u*" type was used. checkpatch.pl issue in octeon driver. Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14staging: octeon: Remove unnecessary externsJoe Perches1-11/+11
Using 'extern' is not necessary for function prototypes. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: David Daney <david.daney@cavium.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30staging: octeon-ethernet: update boilerplate commentsAaro Koskinen1-20/+3
Update boilerplate comments to be more terse by removing redundant information. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30staging: octeon-ethernet: sgmii/xaui: make link poll genericAaro Koskinen1-0/+1
Make link poll generic to avoid copy paste. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30staging: octeon-ethernet: consolidate carrier notificationsAaro Koskinen1-0/+4
Always use cvm_oct_note_carrier() to avoid copy-pasted code. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30staging: octeon-ethernet: delete sgmii and xaui specific uninit functionsAaro Koskinen1-2/+0
Delete redundant wrappers. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30staging: octeon-ethernet: consolidate ndo_stop functionsAaro Koskinen1-3/+0
All ndo_stop functions are identical. Get rid of duplicated code. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-30staging: octeon-ethernet: consolidate ndo_open functionsAaro Koskinen1-0/+2
ndo_open for rgmii, sgmii and xaui are almost identical. Put the common code in a single function. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26staging: octeon-ethernet: drop multiple NAPI instancesAaro Koskinen1-1/+0
Octeon Ethernet driver is currently trying to wake up multiple CPU cores for parallel NAPI processing when needed, to cope with the fact that all network interfaces are handled through the same receive queue processed by a single core/interrupt (see http://marc.info/?l=linux-kernel&m=137209784914565&w=2). This partially overlaps with generic RPS functionality. Commit a6a39a7fcff5 ("staging: octeon-ethernet: disable load balance for receiving packet when CONFIG_RPS is enabled") already disabled this when RPS is enabled. Let's delete this code altogether as it has issues like packet reordering and potential problems with CPU offlining/onlining. Tested on EdgeRouter Lite. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Acked-By: David Daney <david.daney@cavium.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19staging: octeon-ethernet: Move PHY activation to .ndo_open().David Daney1-0/+4
This prevents PHY not found types of errors for PHY drivers that are probed after the Ethernet driver is probed, because the ifconfig UP is done from userspace after all drivers have been probed. Also avoid the cvmx-helper-board.c PHY code if a real PHY driver is present, this allows a bootloader supplied device tree to specify the PHY information rather than having to modify the code for each different board. Tested-by: Alex Smith <alex.smith@imgtec.com> Signed-off-by: David Daney <david.daney@cavium.com> Signed-off-by: Alex Smith <alex.smith@imgtec.com> Cc: devel@driverdev.osuosl.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18staging: octeon: octeon-ethernet.h Fix Unnecessary space after function pointer nameAybuke Ozdemir1-1/+1
The patch fixes the following checkpatch.pl warnings: WARNING: Unnecessary space after function pointer name. Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-23staging: octeon_ethernet: Convert to use device tree.David Daney1-0/+3
Get MAC address and PHY connection from the device tree. The driver is converted to a platform driver. Signed-off-by: David Daney <david.daney@cavium.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Cc: linux-mips@linux-mips.org Cc: devicetree-discuss@lists.ozlabs.org Cc: Rob Herring <rob.herring@calxeda.com> Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/3940/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27Staging: Octeon: Reformat a bunch of comments.David Daney1-7/+0
Many of the comments didn't follow kerneldoc guidlines. Signed-off-by: David Daney <ddaney@caviumnetworks.com> To: linux-mips@linux-mips.org To: netdev@vger.kernel.org To: gregkh@suse.de Patchwork: http://patchwork.linux-mips.org/patch/971/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27Staging: Octeon: Free transmit SKBs in a timely mannerDavid Daney1-6/+3
If we wait for the once-per-second cleanup to free transmit SKBs, sockets with small transmit buffer sizes might spend most of their time blocked waiting for the cleanup. Normally we do a cleanup for each transmitted packet. We add a watchdog type timer so that we also schedule a timeout for 150uS after a packet is transmitted. The watchdog is reset for each transmitted packet, so for high packet rates, it never expires. At these high rates, the cleanups are done for each packet so the extra watchdog initiated cleanups are neither needed nor triggered. Signed-off-by: David Daney <ddaney@caviumnetworks.com> To: linux-mips@linux-mips.org To: netdev@vger.kernel.org To: gregkh@suse.de Cc: Eric Dumazet <eric.dumazet@gmail.com> Patchwork: http://patchwork.linux-mips.org/patch/968/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> This version has spelling and comment changes based on feedback from Eric Dumazet.
2010-02-27Staging: Octeon: Run phy bus accesses on a workqueue.David Daney1-0/+4
When directly accessing a phy, we must acquire the mdio bus lock. To do that we cannot be in interrupt context, so we need to move these operations to a workqueue. Signed-off-by: David Daney <ddaney@caviumnetworks.com> To: linux-mips@linux-mips.org To: netdev@vger.kernel.org To: gregkh@suse.de Patchwork: http://patchwork.linux-mips.org/patch/965/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27Staging: Octeon Ethernet: Convert to NAPI.David Daney1-0/+3
Convert the driver to be a reasonably well behaved NAPI citizen. There is one NAPI instance per CPU shared between all input ports. As receive backlog increases, NAPI is scheduled on additional CPUs. Receive buffer refill code factored out so it can also be called from the periodic timer. This is needed to recover from temporary buffer starvation conditions. Signed-off-by: David Daney <ddaney@caviumnetworks.com> To: linux-mips@linux-mips.org To: gregkh@suse.de Patchwork: http://patchwork.linux-mips.org/patch/839/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27Staging: Octeon Ethernet: Rewrite transmit code.David Daney1-0/+4
Stop the queue if too many packets are queued. Restart it from a high resolution timer. Rearrange and simplify locking and SKB freeing code Signed-off-by: David Daney <ddaney@caviumnetworks.com> To: linux-mips@linux-mips.org To: gregkh@suse.de Patchwork: http://patchwork.linux-mips.org/patch/843/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27Staging: Octeon Ethernet: Remove unused code.David Daney1-41/+0
Remove unused code, reindent, and join some spilt strings. Signed-off-by: David Daney <ddaney@caviumnetworks.com> To: linux-mips@linux-mips.org To: gregkh@suse.de Patchwork: http://patchwork.linux-mips.org/patch/842/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2009-12-17Staging: octeon-ethernet: Convert to use PHY Abstraction Layer.David Daney1-3/+3
The octeon-ethernet driver shares an mdio bus with the octeon-mgmt driver. Here we convert the octeon-ethernet driver to use the PHY Abstraction Layer. Signed-off-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2009-06-24Staging: octeon-ethernet: Convert to use net_device_ops.David Daney1-0/+11
Convert the driver to use net_device_ops as it is now mandatory. Also compensate for the removal of struct sk_buff's dst field. The changes are mostly mechanical, the content of ethernet-common.c was moved to ethernet.c and ethernet-common.{c,h} are removed. Signed-off-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2009-06-17Staging: Add octeon-ethernet driver files.David Daney1-0/+127
The octeon-ethernet driver supports the sgmii, rgmii, spi, and xaui ports present on the Cavium OCTEON family of SOCs. These SOCs are multi-core mips64 processors with existing support over in arch/mips. The driver files can be categorized into three basic groups: 1) Register definitions, these are named cvmx-*-defs.h 2) Main driver code, these have names that don't start cvmx-. 3) Interface specific functions and other utility code, names starting with cvmx- Signed-off-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>