[PATCH net-next v19 08/13] ax88179_178a: Add AX179A/AX279 multicast configuration
From: Birger Koblitz
Date: Sat Oct 10 2026 - 00:59:31 EST
Add support for conditionally setting the ip_alignement flag
AX_RX_CTL_IPE in AX_RX_CTL and make sure that AX_RX_CTL_DROPCRCERR
is also set to be consistent with the initial configuration in
ax88179_reset()
Signed-off-by: Birger Koblitz <mail@xxxxxxxxxxxxxxxxx>
Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
---
drivers/net/usb/ax88179_lib.c | 16 +++++++++++-----
drivers/net/usb/ax88179a_devices.c | 1 +
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/net/usb/ax88179_lib.c b/drivers/net/usb/ax88179_lib.c
index a314db4c9766679568a036f98acf868784835865..b4b00c8b4b62320471e13ae34a1fed5d02e80441 100644
--- a/drivers/net/usb/ax88179_lib.c
+++ b/drivers/net/usb/ax88179_lib.c
@@ -321,16 +321,21 @@ int ax88179_set_eeprom(struct net_device *net, struct ethtool_eeprom *eeprom, u8
void ax88179_set_multicast(struct net_device *net)
{
struct usbnet *dev = netdev_priv(net);
- struct ax88179_data *data = dev->driver_priv;
u8 *m_filter = ((u8 *)dev->data);
+ struct ax88179_data *data;
+ u16 rxctl = 0;
+
+ data = dev->driver_priv;
- data->rxctl = (AX_RX_CTL_START | AX_RX_CTL_AB | AX_RX_CTL_IPE);
+ rxctl = (AX_RX_CTL_START | AX_RX_CTL_AB | AX_RX_CTL_DROPCRCERR);
+ if (data->ip_align)
+ rxctl |= AX_RX_CTL_IPE;
if (net->flags & IFF_PROMISC) {
- data->rxctl |= AX_RX_CTL_PRO;
+ rxctl |= AX_RX_CTL_PRO;
} else if (net->flags & IFF_ALLMULTI ||
netdev_mc_count(net) > AX_MAX_MCAST) {
- data->rxctl |= AX_RX_CTL_AMALL;
+ rxctl |= AX_RX_CTL_AMALL;
} else if (netdev_mc_empty(net)) {
/* just broadcast and directed */
} else {
@@ -351,9 +356,10 @@ void ax88179_set_multicast(struct net_device *net)
AX_MCAST_FLTSIZE, AX_MCAST_FLTSIZE,
m_filter);
- data->rxctl |= AX_RX_CTL_AM;
+ rxctl |= AX_RX_CTL_AM;
}
+ WRITE_ONCE(data->rxctl, rxctl);
ax88179_write_cmd_async(dev, AX_ACCESS_MAC, AX_RX_CTL,
2, 2, &data->rxctl);
}
diff --git a/drivers/net/usb/ax88179a_devices.c b/drivers/net/usb/ax88179a_devices.c
index 4207d2cc2b865e5780b3c7f5ba2645a6242df477..a6b0a3f47118c46db38d483792c083510aa2641a 100644
--- a/drivers/net/usb/ax88179a_devices.c
+++ b/drivers/net/usb/ax88179a_devices.c
@@ -678,6 +678,7 @@ static const struct net_device_ops ax88179a_netdev_ops = {
.ndo_set_mac_address = ax88179_set_mac_addr,
.ndo_validate_addr = eth_validate_addr,
.ndo_eth_ioctl = ax88179a_mii_ioctl,
+ .ndo_set_rx_mode = ax88179_set_multicast,
.ndo_set_features = ax88179a_set_features,
.ndo_vlan_rx_add_vid = ax88179a_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = ax88179a_vlan_rx_kill_vid,
--
2.47.3