From: Nicolai Buchwitz <nb@tipi-net.de>
To: Birger Koblitz <mail@birger-koblitz.de>
Cc: 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>,
linux-usb@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Jianhui Xu <neuromoments@gmail.com>
Subject: Re: [PATCH net-next v11 06/15] ax88179_178a: Add HW support for AX179A-based chips
Date: Mon, 14 Sep 2026 16:12:46 +0200 [thread overview]
Message-ID: <18c931ca985a82a044c9269743fb4fb7@tipi-net.de> (raw)
In-Reply-To: <20260914-ax88179a-v11-6-5ea7a925ba6d@birger-koblitz.de>
Hi Birger
On 14.9.2026 14:46, Birger Koblitz wrote:
> This adds bindings and HW support for AX179A-based USB-Ethernet
> controllers. The AX179A-family of chips consists of the
> AX88279 (2.5GBit PHY)
> AX88179A/B (1GBit PHY, B variant has wider temperature range)
> AX772D/E (100Mbit PHY)
>
> The controllers all have the same vendor and device ID
> (0x0b95, 0x1790) and are distinguished by their BCD device versions,
> which are
> 2.00 AX88179A/B
> 3.00 AX88772D/E
> 4.00 AX88279
>
> For all chips, the driver calls the same ax88179a_bind() function
> and the chips are then distinguished by the chip version and
> BCD device ID. The AX179A-based chips all provide both a CDC-NCM
> compatible USB interface, and a proprietary vendor interface. By
> default,
> the proprietary vendor interface is not active and Linux will load the
> CDC-NCM driver to support the devices. If the ax88179_178a module is
> configured by the OS to have precedence over CDC-NCM, then this driver
> will switch the device to use the vendor interface, and the device will
> be controlled by the ax88179_178a driver when the device is probed
> again
> after an automatic reset by the device.
>
> Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> ---
> [...]
> diff --git a/drivers/net/usb/ax88179_178a.c
> b/drivers/net/usb/ax88179_178a.c
> index
> 6aa35c8eb594fda38f7680f8801f0d82090c1efd..33be9ef73e73dd550402692e96605d22c481c7ec
> 100644
> --- a/drivers/net/usb/ax88179_178a.c
> +++ b/drivers/net/usb/ax88179_178a.c
> @@ -1270,6 +1270,18 @@ static const struct driver_info
> at_umc2000sp_info = {
>
> static const struct usb_device_id products[] = {
> {
> + /* ASIX AX88179A USB 3.2 1000Mbit Ethernet */
> + USB_DEVICE_VER(0x0b95, 0x1790, 0, 0x0200),
USB_DEVICE_VER(0x0b95, 0x1790, 0x0200, 0x0200),
Otherwise it would select the wrong callback the existing AX88179
(0x0100)?
> + .driver_info = (unsigned long)&ax88179a_info,
> +}, {
> + /* ASIX AX88772D USB 2.0 100Mbit Ethernet */
> + USB_DEVICE_VER(0x0b95, 0x1790, 0x0300, 0x0300),
> + .driver_info = (unsigned long)&ax88772d_info,
> +}, {
> + /* ASIX AX88279 USB 3.2 2500Mbit Ethernet */
> + USB_DEVICE_VER(0x0b95, 0x1790, 0, 0x0400),
USB_DEVICE_VER(0x0b95, 0x1790, 0x0400, 0x0400),
Same as with AX88179 above.
> [...]
> diff --git a/drivers/net/usb/ax88179a_devices.c
> b/drivers/net/usb/ax88179a_devices.c
> new file mode 100644
> index
> 0000000000000000000000000000000000000000..21ca71cba52ca84883a05d8be869115395c82af1
> --- /dev/null
> +++ b/drivers/net/usb/ax88179a_devices.c
> [...]
> +static const struct net_device_ops ax88179a_netdev_ops = {
> + .ndo_open = usbnet_open,
> + .ndo_stop = usbnet_stop,
> + .ndo_start_xmit = usbnet_start_xmit,
> + .ndo_tx_timeout = usbnet_tx_timeout,
> + .ndo_get_stats64 = dev_get_tstats64,
> + .ndo_change_mtu = ax88179_change_mtu,
> + .ndo_set_mac_address = ax88179_set_mac_addr,
> + .ndo_validate_addr = eth_validate_addr,
> + .ndo_eth_ioctl = usbnet_mii_ioctl,
dev->mii.mdio_read is never initialized for ax88179a, so
dev->mii.mdio_read()
through usbnet_mii_ioctl() is a NULL function pointer.
Something like:
static int ax88179a_mii_ioctl(...)
{
struct ax88179_data *data = netdev2data(net);
return phylink_mii_ioctl(data->phylink, ifr, cmd);
}
> [...]
> +static int ax88179a_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
> +{
> [...]
> +
> + if (pkt_desc & AX179A_RX_PD_VLAN) {
> + vlan_tag = pkt_desc >> AX179A_RX_PD_VLAN_SHIFT;
> + __vlan_hwaccel_put_tag(ax_skb, htons(ETH_P_8021Q),
> + vlan_tag & VLAN_VID_MASK);
Drop the mask and pass the complete vlan_tag, so priority is preserved?
> + }
> +
> + usbnet_skb_return(dev, ax_skb);
> + skb_pull(skb, pkt_len_plus_padd);
> +
> + /* Next RX Packet Header */
> + pkt_desc_ptr++;
> + }
> +
> + return 1;
> +
> +err:
> + return 0;
> +}
> +
> +static struct sk_buff *ax88179a_tx_fixup(struct usbnet *dev, struct
> sk_buff *skb, gfp_t flags)
> +{
> + u64 tx_desc = skb->len & AX179A_TX_DESC_LEN_MASK;
> + int frame_size = dev->maxpacket;
> + struct sk_buff *ax_skb;
> + u64 *tx_desc_ptr;
> + int padding_size;
> + int headroom;
> + int tailroom;
> + u16 tci = 0;
> +
> + /* TSO MSS */
> + tx_desc |= ((u64)(skb_shinfo(skb)->gso_size &
> AX179A_TX_DESC_MSS_MASK)) <<
> + AX179A_TX_DESC_MSS_SHIFT;
> +
> + headroom = (skb->len + sizeof(tx_desc)) % 8;
> + padding_size = headroom ? 8 - headroom : 0;
> +
> + if (((skb->len + sizeof(tx_desc) + padding_size) % frame_size) == 0)
> {
> + padding_size += 8;
> + tx_desc |= AX179A_TX_DESC_DROP_PADD;
> + }
> +
> + if ((dev->net->features & NETIF_F_HW_VLAN_CTAG_TX) &&
> (vlan_get_tag(skb, &tci) >= 0)) {
> + tx_desc |= AX179A_TX_DESC_VLAN;
> + tx_desc |= ((u64)tci & AX179A_TX_DESC_VLAN_MASK) <<
> AX179A_TX_DESC_VLAN_SHIFT;
> + }
> +
> + if (!dev->can_dma_sg && (dev->net->features & NETIF_F_SG) &&
> skb_linearize(skb))
> + return NULL;
Call dev_kfree_skb_any() before returning, so the skb can't leak when
skb_linearize() fails.
> [...]
Thanks
Nicolai
next prev parent reply other threads:[~2026-09-14 14:12 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 12:46 [PATCH net-next v11 00/15] ax88179_178a: Add support for AX88179A-based chips Birger Koblitz
2026-09-14 12:46 ` [PATCH net-next v11 01/15] phylink: Add phylink_mac_interrupt Birger Koblitz
2026-09-14 14:13 ` Nicolai Buchwitz
2026-09-16 6:47 ` netdev-bot+sashiko
2026-09-14 12:46 ` [PATCH net-next v11 02/15] phylib: Add support for PHYs with broken forced mode Birger Koblitz
2026-09-14 14:14 ` Nicolai Buchwitz
2026-09-16 6:47 ` netdev-bot+sashiko
2026-09-14 12:46 ` [PATCH net-next v11 03/15] ax88179_178a: Fix endianness of pause watermark register Birger Koblitz
2026-09-14 12:46 ` [PATCH net-next v11 04/15] ax88179_178a: Split driver into library and device specific code Birger Koblitz
2026-09-14 14:15 ` Nicolai Buchwitz
2026-09-16 6:47 ` netdev-bot+sashiko
2026-09-14 12:46 ` [PATCH net-next v11 05/15] ax88179_178a: Add netdev2data() convenience function Birger Koblitz
2026-09-16 6:47 ` netdev-bot+sashiko
2026-09-14 12:46 ` [PATCH net-next v11 06/15] ax88179_178a: Add HW support for AX179A-based chips Birger Koblitz
2026-09-14 14:12 ` Nicolai Buchwitz [this message]
2026-09-14 16:53 ` Andrew Lunn
2026-09-15 0:01 ` Birger Koblitz
2026-09-15 12:07 ` Andrew Lunn
2026-09-16 0:12 ` Birger Koblitz
2026-09-15 5:28 ` Birger Koblitz
2026-09-16 6:47 ` netdev-bot+sashiko
2026-09-14 12:46 ` [PATCH net-next v11 07/15] ax88179_178a: Add EEE configuration support for AX88179A MACs Birger Koblitz
2026-09-16 6:47 ` netdev-bot+sashiko
2026-09-14 12:46 ` [PATCH net-next v11 08/15] ax88179_178a: Add EEE configuration support for AX88179A PHYs Birger Koblitz
2026-09-14 14:17 ` Nicolai Buchwitz
2026-09-16 6:47 ` netdev-bot+sashiko
2026-09-14 12:46 ` [PATCH net-next v11 09/15] ax88179_178a: Add VLAN offload support for AX88179A Birger Koblitz
2026-09-16 6:47 ` netdev-bot+sashiko
2026-09-14 12:46 ` [PATCH net-next v11 10/15] ax88179_178a: Add AX179A/AX279 multicast configuration Birger Koblitz
2026-09-16 6:47 ` netdev-bot+sashiko
2026-09-14 12:46 ` [PATCH net-next v11 11/15] ax88179_178a: Add Suspend/resume support for AX88179A/772D/279 Birger Koblitz
2026-09-16 6:47 ` netdev-bot+sashiko
2026-09-14 12:46 ` [PATCH net-next v11 12/15] ax88179_178a: Add ethtool get_drvinfo Birger Koblitz
2026-09-14 14:16 ` Nicolai Buchwitz
2026-09-16 6:47 ` netdev-bot+sashiko
2026-09-14 12:46 ` [PATCH net-next v11 13/15] ax88179_178a: Update driver name and information Birger Koblitz
2026-09-14 14:17 ` Nicolai Buchwitz
2026-09-16 6:47 ` netdev-bot+sashiko
2026-09-14 12:46 ` [PATCH net-next v11 14/15] ax88179_178a: Add support for AX88179A/772D/279 EEPROM access Birger Koblitz
2026-09-16 6:47 ` netdev-bot+sashiko
2026-09-14 12:46 ` [PATCH net-next v11 15/15] ax88796b: Add support for AX88772D, AX88179A and AX88279 Birger Koblitz
2026-09-16 6:47 ` netdev-bot+sashiko
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=18c931ca985a82a044c9269743fb4fb7@tipi-net.de \
--to=nb@tipi-net.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=mail@birger-koblitz.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.