Skip to contentSkip to conversation

net: qcom/emac: add ethtool support

PATCH Applied Timur Tabi 2 participants 2 messages Jan 9, 2017 – Jan 10, 2017

Subsystems (3)
lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH v3 1/1 net: qcom/emac: add ethtool support

Add support for some ethtool methods: get/set link settings, get/set message level, get statistics, get link status, get ring params, get pause params, and restart autonegotiation.

The code to collect the hardware statistics is moved into its own function so that it can be used by "get statistics" method.

---

Notes:
I don't trust my implementation of emac_get_pauseparam. I feel like I'm missing something.

v3: rebase onto latest net-next
v2: added emac_get_pauseparam and emac_get_ringparam

 drivers/net/ethernet/qualcomm/emac/Makefile       |   2 +-
 drivers/net/ethernet/qualcomm/emac/emac-ethtool.c | 185 ++++++++++++++++++++++
 drivers/net/ethernet/qualcomm/emac/emac.c         |  52 +++---
 drivers/net/ethernet/qualcomm/emac/emac.h         |   3 +
 4 files changed, 221 insertions(+), 21 deletions(-)
 create mode 100644 drivers/net/ethernet/qualcomm/emac/emac-ethtool.c
drivers/net/ethernet/qualcomm/emac/Makefile +1 -1
index 7a66879..fc57ced 100644
@@ -4,6 +4,6 @@
 
 obj-$(CONFIG_QCOM_EMAC) += qcom-emac.o
 
-qcom-emac-objs := emac.o emac-mac.o emac-phy.o emac-sgmii.o \
+qcom-emac-objs := emac.o emac-mac.o emac-phy.o emac-sgmii.o emac-ethtool.o \
 		  emac-sgmii-fsm9900.o emac-sgmii-qdf2432.o \
 		  emac-sgmii-qdf2400.o
drivers/net/ethernet/qualcomm/emac/emac-ethtool.c new file +185 -0

185 lines not on this page · raw message

drivers/net/ethernet/qualcomm/emac/emac.c +32 -20

83 lines not on this page · raw message

drivers/net/ethernet/qualcomm/emac/emac.h +3 -0
index 0c76e6c..4b8483c 100644
@@ -332,4 +332,7 @@ struct emac_adapter {
 void emac_reg_update32(void __iomem *addr, u32 mask, u32 val);
 irqreturn_t emac_isr(int irq, void *data);
 
+void emac_set_ethtool_ops(struct net_device *netdev);
+void emac_update_hw_stats(struct emac_adapter *adpt);
+
 #endif /* _EMAC_H_ */
Signature · 3 lines
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc.  Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
maintainer Applied
#1 lore raw

From: Timur Tabi <[email protected]>
Date: Mon, 9 Jan 2017 12:03:12 -0600

Quoted 8 lines

Add support for some ethtool methods: get/set link settings, get/set message level, get statistics, get link status, get ring params, get pause params, and restart autonegotiation.

The code to collect the hardware statistics is moved into its own function so that it can be used by "get statistics" method.

Applied, thanks.