Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src-draft/trunk]: src/sys/dev/usb No HW MCAST filter in this driver currently.



details:   https://anonhg.NetBSD.org/src-all/rev/79313139a215
branches:  trunk
changeset: 371711:79313139a215
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Mon Oct 03 11:56:25 2022 +0200

description:
No HW MCAST filter in this driver currently.

Add #if 0 example code showing what would need to be done to iterate
all configured MCAST addresses.

diffstat:

 sys/dev/usb/if_urtwn.c |  30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diffs (40 lines):

diff -r 4306e847b415 -r 79313139a215 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Mon Oct 03 11:52:31 2022 +0200
+++ b/sys/dev/usb/if_urtwn.c    Mon Oct 03 11:56:25 2022 +0200
@@ -663,7 +663,35 @@
 static void
 urtwn_update_mcast(struct ieee80211com *ic)
 {
-       printf("urtwn_update_mcast: empty implementation\n");
+/*
+ * XXX this driver does not use any MCAST filter currently.
+ */
+#if 0
+       struct ether_multi *enm;
+       struct ether_multistep step;
+       struct ethercom *ec;
+       struct ieee80211vap *vap;
+       char adr_from[3*ETHER_ADDR_LEN], adr_to[3*ETHER_ADDR_LEN];
+
+       IEEE80211_LOCK(ic);
+       printf("urtwn_update_mcast: need to program the HW MCAST filter\n");
+       TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
+               ec = &vap->iv_ethercom;
+               ETHER_LOCK(ec);
+               ETHER_FIRST_MULTI(step, ec, enm);
+               while (enm != NULL) {
+                       ether_snprintf(adr_from, sizeof(adr_from),
+                           enm->enm_addrlo);
+                       ether_snprintf(adr_to, sizeof(adr_to),
+                           enm->enm_addrhi);
+                       printf("%s: mcast from %s to %s\n",
+                           vap->iv_ifp->if_xname, adr_from, adr_to);
+                       ETHER_NEXT_MULTI(step, enm);
+               }
+               ETHER_UNLOCK(ec);
+       }
+       IEEE80211_UNLOCK(ic);
+#endif
 }
 
 static void



Home | Main Index | Thread Index | Old Index