* [PATCH net-next] net: usb: sr9700: remove code to drive nonexistent multicast filter
@ 2026-01-23 6:58 Ethan Nelson-Moore
2026-01-26 13:42 ` Simon Horman
2026-01-27 3:26 ` Jakub Kicinski
0 siblings, 2 replies; 6+ messages in thread
From: Ethan Nelson-Moore @ 2026-01-23 6:58 UTC (permalink / raw)
To: netdev, linux-usb
Cc: Ethan Nelson-Moore, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Peter Korsgaard
Several registers referenced in this driver's source code do not
actually exist (they are not writable and read as zero in my testing).
They exist in this driver because it originated as a copy of the dm9601
driver. Notably, these include the multicast filter registers - this
causes the driver to not support multicast packets correctly. Remove
the multicast filter code and instead set the chip to receive all
multicast filter packets when any multicast addresses are in the list.
Also take the opportunity to remove definitions for a few other
nonexistent registers, and a couple pointless comments.
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
drivers/net/usb/sr9700.c | 26 ++++----------------------
drivers/net/usb/sr9700.h | 19 +++----------------
2 files changed, 7 insertions(+), 38 deletions(-)
diff --git a/drivers/net/usb/sr9700.c b/drivers/net/usb/sr9700.c
index 9c7cd0db1768..19c36b0d441c 100644
--- a/drivers/net/usb/sr9700.c
+++ b/drivers/net/usb/sr9700.c
@@ -17,7 +17,6 @@
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/usb.h>
-#include <linux/crc32.h>
#include <linux/usb/usbnet.h>
#include "sr9700.h"
@@ -231,31 +230,14 @@ static const struct ethtool_ops sr9700_ethtool_ops = {
static void sr9700_set_multicast(struct net_device *netdev)
{
struct usbnet *dev = netdev_priv(netdev);
- /* We use the 20 byte dev->data for our 8 byte filter buffer
- * to avoid allocating memory that is tricky to free later
- */
- u8 *hashes = (u8 *)&dev->data;
- /* rx_ctl setting : enable, disable_long, disable_crc */
u8 rx_ctl = RCR_RXEN | RCR_DIS_CRC | RCR_DIS_LONG;
- memset(hashes, 0x00, SR_MCAST_SIZE);
- /* broadcast address */
- hashes[SR_MCAST_SIZE - 1] |= SR_MCAST_ADDR_FLAG;
- if (netdev->flags & IFF_PROMISC) {
+ if (netdev->flags & IFF_PROMISC)
rx_ctl |= RCR_PRMSC;
- } else if (netdev->flags & IFF_ALLMULTI ||
- netdev_mc_count(netdev) > SR_MCAST_MAX) {
- rx_ctl |= RCR_RUNT;
- } else if (!netdev_mc_empty(netdev)) {
- struct netdev_hw_addr *ha;
-
- netdev_for_each_mc_addr(ha, netdev) {
- u32 crc = ether_crc(ETH_ALEN, ha->addr) >> 26;
- hashes[crc >> 3] |= 1 << (crc & 0x7);
- }
- }
+ else if (netdev->flags & IFF_ALLMULTI || netdev_mc_count(netdev) > 0)
+ /* The chip has no multicast filter */
+ rx_ctl |= RCR_ALL;
- sr_write_async(dev, SR_MAR, SR_MCAST_SIZE, hashes);
sr_write_reg_async(dev, SR_RCR, rx_ctl);
}
diff --git a/drivers/net/usb/sr9700.h b/drivers/net/usb/sr9700.h
index 3212859830dc..51c696108d80 100644
--- a/drivers/net/usb/sr9700.h
+++ b/drivers/net/usb/sr9700.h
@@ -8,8 +8,6 @@
#ifndef _SR9700_H
#define _SR9700_H
-/* sr9700 spec. register table on Linux platform */
-
/* Network Control Reg */
#define SR_NCR 0x00
#define NCR_RST (1 << 0)
@@ -101,9 +99,7 @@
#define WCR_LINKEN (1 << 5)
/* Physical Address Reg */
#define SR_PAR 0x10 /* 0x10 ~ 0x15 6 bytes for PAR */
-/* Multicast Address Reg */
-#define SR_MAR 0x16 /* 0x16 ~ 0x1D 8 bytes for MAR */
-/* 0x1e unused */
+/* 0x16 --> 0x1E unused */
/* Phy Reset Reg */
#define SR_PRR 0x1F
#define PRR_PHY_RST (1 << 0)
@@ -123,10 +119,7 @@
#define SR_RRPAL 0x26
/* Rx sdram Read Pointer Address High */
#define SR_RRPAH 0x27
-/* Vendor ID register */
-#define SR_VID 0x28 /* 0x28 ~ 0x29 2 bytes for VID */
-/* Product ID register */
-#define SR_PID 0x2A /* 0x2A ~ 0x2B 2 bytes for PID */
+/* 0x28 --> 0x2B unused */
/* CHIP Revision register */
#define SR_CHIPR 0x2C
/* 0x2D --> 0xEF unused */
@@ -143,10 +136,7 @@
#define TXC_USBS_EP1RDY (1 << 5)
#define TXC_USBS_SUSFLAG (1 << 6)
#define TXC_USBS_RXFAULT (1 << 7)
-/* USB Control register */
-#define SR_USBC 0xF4
-#define USBC_EP3NAK (1 << 4)
-#define USBC_EP3ACK (1 << 5)
+/* 0xF4 --> 0xFF unused */
/* Register access commands and flags */
#define SR_RD_REGS 0x00
@@ -158,9 +148,6 @@
/* parameters */
#define SR_EEPROM_TIMEOUT 1000
#define SR_EEPROM_LEN 256
-#define SR_MCAST_SIZE 8
-#define SR_MCAST_ADDR_FLAG 0x80
-#define SR_MCAST_MAX 64
#define SR_TX_OVERHEAD 2 /* 2bytes header */
#define SR_RX_OVERHEAD 7 /* 3bytes header + 4crc tail */
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] net: usb: sr9700: remove code to drive nonexistent multicast filter
2026-01-23 6:58 [PATCH net-next] net: usb: sr9700: remove code to drive nonexistent multicast filter Ethan Nelson-Moore
@ 2026-01-26 13:42 ` Simon Horman
2026-01-27 5:37 ` Ethan Nelson-Moore
2026-01-27 3:26 ` Jakub Kicinski
1 sibling, 1 reply; 6+ messages in thread
From: Simon Horman @ 2026-01-26 13:42 UTC (permalink / raw)
To: Ethan Nelson-Moore
Cc: netdev, linux-usb, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Peter Korsgaard
On Thu, Jan 22, 2026 at 10:58:32PM -0800, Ethan Nelson-Moore wrote:
> Several registers referenced in this driver's source code do not
> actually exist (they are not writable and read as zero in my testing).
> They exist in this driver because it originated as a copy of the dm9601
> driver. Notably, these include the multicast filter registers - this
> causes the driver to not support multicast packets correctly. Remove
> the multicast filter code and instead set the chip to receive all
> multicast filter packets when any multicast addresses are in the list.
> Also take the opportunity to remove definitions for a few other
> nonexistent registers, and a couple pointless comments.
>
> Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
I would slightly lean towards splitting this patch up,
say one for the multicast changes and removal of related #defines,
and another for the remainder of the #define clean-up.
But that notwithstanding this looks good to me.
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] net: usb: sr9700: remove code to drive nonexistent multicast filter
2026-01-23 6:58 [PATCH net-next] net: usb: sr9700: remove code to drive nonexistent multicast filter Ethan Nelson-Moore
2026-01-26 13:42 ` Simon Horman
@ 2026-01-27 3:26 ` Jakub Kicinski
2026-01-27 4:17 ` Ethan Nelson-Moore
1 sibling, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2026-01-27 3:26 UTC (permalink / raw)
To: Ethan Nelson-Moore
Cc: netdev, linux-usb, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, Simon Horman, Peter Korsgaard
On Thu, 22 Jan 2026 22:58:32 -0800 Ethan Nelson-Moore wrote:
> + else if (netdev->flags & IFF_ALLMULTI || netdev_mc_count(netdev) > 0)
nit: netdev_mc_empty()
--
pw-bot: cr
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] net: usb: sr9700: remove code to drive nonexistent multicast filter
2026-01-27 3:26 ` Jakub Kicinski
@ 2026-01-27 4:17 ` Ethan Nelson-Moore
0 siblings, 0 replies; 6+ messages in thread
From: Ethan Nelson-Moore @ 2026-01-27 4:17 UTC (permalink / raw)
To: Jakub Kicinski
Cc: netdev, linux-usb, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, Simon Horman, Peter Korsgaard
On Mon, Jan 26, 2026 at 7:26 PM Jakub Kicinski <kuba@kernel.org> wrote:
> > + else if (netdev->flags & IFF_ALLMULTI || netdev_mc_count(netdev) > 0)
>
> nit: netdev_mc_empty()
Hi, Jakub,
Thanks for noticing - I don't know how I missed that, given that the
original code was using it.
I have adjusted this patch to use netdev_mc_empty. It is now part of a
series of sr9700 patches I'm still working on, and the multicast
filter removal is separate from the other changes.
Ethan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] net: usb: sr9700: remove code to drive nonexistent multicast filter
2026-01-26 13:42 ` Simon Horman
@ 2026-01-27 5:37 ` Ethan Nelson-Moore
2026-01-27 12:56 ` Simon Horman
0 siblings, 1 reply; 6+ messages in thread
From: Ethan Nelson-Moore @ 2026-01-27 5:37 UTC (permalink / raw)
To: Simon Horman
Cc: netdev, linux-usb, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Peter Korsgaard
On Mon, Jan 26, 2026 at 5:42 AM Simon Horman <horms@kernel.org> wrote:
> I would slightly lean towards splitting this patch up,
> say one for the multicast changes and removal of related #defines,
> and another for the remainder of the #define clean-up.
>
> But that notwithstanding this looks good to me.
>
> Reviewed-by: Simon Horman <horms@kernel.org>
Hi, Simon,
Thanks for your feedback.
Would it be appropriate for me to reuse your Reviewed-by tag for my
split patch? (The only other change is to use netdev_mc_empty instead
of checking if netdev_mc_count > 0.)
Ethan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] net: usb: sr9700: remove code to drive nonexistent multicast filter
2026-01-27 5:37 ` Ethan Nelson-Moore
@ 2026-01-27 12:56 ` Simon Horman
0 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2026-01-27 12:56 UTC (permalink / raw)
To: Ethan Nelson-Moore
Cc: netdev, linux-usb, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Peter Korsgaard
On Mon, Jan 26, 2026 at 09:37:48PM -0800, Ethan Nelson-Moore wrote:
> On Mon, Jan 26, 2026 at 5:42 AM Simon Horman <horms@kernel.org> wrote:
> > I would slightly lean towards splitting this patch up,
> > say one for the multicast changes and removal of related #defines,
> > and another for the remainder of the #define clean-up.
> >
> > But that notwithstanding this looks good to me.
> >
> > Reviewed-by: Simon Horman <horms@kernel.org>
>
> Hi, Simon,
>
> Thanks for your feedback.
> Would it be appropriate for me to reuse your Reviewed-by tag for my
> split patch? (The only other change is to use netdev_mc_empty instead
> of checking if netdev_mc_count > 0.)
Yes, that is fine.
Thanks for asking.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-01-27 12:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-23 6:58 [PATCH net-next] net: usb: sr9700: remove code to drive nonexistent multicast filter Ethan Nelson-Moore
2026-01-26 13:42 ` Simon Horman
2026-01-27 5:37 ` Ethan Nelson-Moore
2026-01-27 12:56 ` Simon Horman
2026-01-27 3:26 ` Jakub Kicinski
2026-01-27 4:17 ` Ethan Nelson-Moore
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox