Netdev List
 help / color / mirror / Atom feed
From: Birger Koblitz <mail@birger-koblitz.de>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	 Russell King <linux@armlinux.org.uk>,
	Andrew Lunn <andrew@lunn.ch>,
	 Heiner Kallweit <hkallweit1@gmail.com>
Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org,
	 linux-kernel@vger.kernel.org,
	Birger Koblitz <mail@birger-koblitz.de>,
	 Jianhui Xu <neuromoments@gmail.com>
Subject: [PATCH net-next v9 05/15] ax88179_178a: Add netdev2data() convenience function
Date: Wed, 02 Sep 2026 18:57:19 +0200	[thread overview]
Message-ID: <20260902-ax88179a-v9-5-8e6d7710a2ae@birger-koblitz.de> (raw)
In-Reply-To: <20260902-ax88179a-v9-0-8e6d7710a2ae@birger-koblitz.de>

Add a convenience function for the ethtool ops that use
phylink and need to retrieve the ax88179_data structure from
net_device.

Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/usb/ax88179_lib.c | 7 +++++++
 drivers/net/usb/ax88179_lib.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/drivers/net/usb/ax88179_lib.c b/drivers/net/usb/ax88179_lib.c
index 761701ebc0692338b5c0a9f73d0b6965cda87d6e..ea36aef3d3e45ee4f84362a1b87628a12a355bbf 100644
--- a/drivers/net/usb/ax88179_lib.c
+++ b/drivers/net/usb/ax88179_lib.c
@@ -128,6 +128,13 @@ int ax88179_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
 	return ret;
 }
 
+struct ax88179_data *netdev2data(struct net_device *net)
+{
+	struct usbnet *dev = netdev_priv(net);
+
+	return dev->driver_priv;
+}
+
 void ax88179_status(struct usbnet *dev, struct urb *urb)
 {
 	struct ax88179_int_data *event;
diff --git a/drivers/net/usb/ax88179_lib.h b/drivers/net/usb/ax88179_lib.h
index b2ee1356727cf4b3fa05f0b0d5fd863ac3f9a87d..9ff2a94a6fb2de4ee85f25e913ae2fe263bcea7c 100644
--- a/drivers/net/usb/ax88179_lib.h
+++ b/drivers/net/usb/ax88179_lib.h
@@ -181,6 +181,7 @@ void ax88179_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 index,
 			     u16 size, void *data);
 int ax88179_mdio_read(struct net_device *netdev, int phy_id, int loc);
 void ax88179_mdio_write(struct net_device *netdev, int phy_id, int loc, int val);
+struct ax88179_data *netdev2data(struct net_device *net);
 void ax88179_status(struct usbnet *dev, struct urb *urb);
 void ax88179_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo);
 int ax88179_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo);

-- 
2.47.3


  parent reply	other threads:[~2026-09-02 16:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 16:57 [PATCH net-next v9 00/15] ax88179_178a: Add support for AX88179A-based chips Birger Koblitz
2026-09-02 16:57 ` [PATCH net-next v9 01/15] phylink: Add phylink_mac_interrupt Birger Koblitz
2026-09-02 16:57 ` [PATCH net-next v9 02/15] phylib: Add support for PHYs with broken forced mode Birger Koblitz
2026-09-02 16:57 ` [PATCH net-next v9 03/15] ax88179_178a: Fix endianness of pause watermark register Birger Koblitz
2026-09-02 16:57 ` [PATCH net-next v9 04/15] ax88179_178a: Split driver into library and device specific code Birger Koblitz
2026-09-02 16:57 ` Birger Koblitz [this message]
2026-09-02 16:57 ` [PATCH net-next v9 06/15] ax88179_178a: Add HW support for AX179A-based chips Birger Koblitz
2026-09-02 20:54   ` Andrew Lunn
2026-09-02 16:57 ` [PATCH net-next v9 07/15] ax88179_178a: Add EEE configuration support for AX88179A MACs Birger Koblitz
2026-09-02 16:57 ` [PATCH net-next v9 08/15] ax88179_178a: Add EEE configuration support for AX88179A PHYs Birger Koblitz
2026-09-02 16:57 ` [PATCH net-next v9 09/15] ax88179_178a: Add VLAN offload support for AX88179A Birger Koblitz
2026-09-02 16:57 ` [PATCH net-next v9 10/15] ax88179_178a: Add AX179A/AX279 multicast configuration Birger Koblitz
2026-09-02 16:57 ` [PATCH net-next v9 11/15] ax88179_178a: Add Suspend/resume support for AX88179A/772D/279 Birger Koblitz
2026-09-02 16:57 ` [PATCH net-next v9 12/15] ax88179_178a: Add ethtool get_drvinfo Birger Koblitz
2026-09-02 16:57 ` [PATCH net-next v9 13/15] ax88179_178a: Update driver name and information Birger Koblitz
2026-09-02 16:57 ` [PATCH net-next v9 14/15] ax88179_178a: Add support for AX88179A/772D/279 EEPROM access Birger Koblitz
2026-09-02 16:57 ` [PATCH net-next v9 15/15] ax88796b: Add support for AX88772D, AX88179A and AX88279 Birger Koblitz
2026-09-02 20:56   ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260902-ax88179a-v9-5-8e6d7710a2ae@birger-koblitz.de \
    --to=mail@birger-koblitz.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=neuromoments@gmail.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox