Thu Mar 3 05:52:55 2022 UTC ()
aue(4): Reduce aue_uno_mcast from aue_uno_init to aue_setiff_locked.

This operation only needs to update the hardware to reflect
SIOCADDMULTI/SIOCDELMULTI.  Not clear that everything in aue(4) needs
to be reset -- in fact I'm pretty sure that's undesirable!

WARNING: I have not tested this with a real aue(4) device.


(riastradh)
diff -r1.177 -r1.178 src/sys/dev/usb/if_aue.c

cvs diff -r1.177 -r1.178 src/sys/dev/usb/if_aue.c (expand / switch to unified diff)

--- src/sys/dev/usb/if_aue.c 2022/03/03 05:52:46 1.177
+++ src/sys/dev/usb/if_aue.c 2022/03/03 05:52:55 1.178
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_aue.c,v 1.177 2022/03/03 05:52:46 riastradh Exp $ */ 1/* $NetBSD: if_aue.c,v 1.178 2022/03/03 05:52:55 riastradh Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997, 1998, 1999, 2000 4 * Copyright (c) 1997, 1998, 1999, 2000
5 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. 5 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -66,27 +66,27 @@ @@ -66,27 +66,27 @@
66/* 66/*
67 * Ported to NetBSD and somewhat rewritten by Lennart Augustsson. 67 * Ported to NetBSD and somewhat rewritten by Lennart Augustsson.
68 */ 68 */
69 69
70/* 70/*
71 * TODO: 71 * TODO:
72 * better error messages from rxstat 72 * better error messages from rxstat
73 * more error checks 73 * more error checks
74 * investigate short rx problem 74 * investigate short rx problem
75 * proper cleanup on errors 75 * proper cleanup on errors
76 */ 76 */
77 77
78#include <sys/cdefs.h> 78#include <sys/cdefs.h>
79__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.177 2022/03/03 05:52:46 riastradh Exp $"); 79__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.178 2022/03/03 05:52:55 riastradh Exp $");
80 80
81#ifdef _KERNEL_OPT 81#ifdef _KERNEL_OPT
82#include "opt_usb.h" 82#include "opt_usb.h"
83#include "opt_inet.h" 83#include "opt_inet.h"
84#endif 84#endif
85 85
86#include <sys/param.h> 86#include <sys/param.h>
87 87
88#include <dev/usb/usbnet.h> 88#include <dev/usb/usbnet.h>
89#include <dev/usb/usbhist.h> 89#include <dev/usb/usbhist.h>
90#include <dev/usb/if_auereg.h> 90#include <dev/usb/if_auereg.h>
91 91
92#ifdef INET 92#ifdef INET
@@ -999,31 +999,27 @@ aue_uno_init(struct ifnet *ifp) @@ -999,31 +999,27 @@ aue_uno_init(struct ifnet *ifp)
999 999
1000 return rv; 1000 return rv;
1001} 1001}
1002 1002
1003static void 1003static void
1004aue_uno_mcast(struct ifnet *ifp) 1004aue_uno_mcast(struct ifnet *ifp)
1005{ 1005{
1006 1006
1007 AUEHIST_FUNC(); 1007 AUEHIST_FUNC();
1008 AUEHIST_CALLARGSN(5, "aue%jd: enter", 1008 AUEHIST_CALLARGSN(5, "aue%jd: enter",
1009 device_unit(((struct usbnet *)(ifp->if_softc))->un_dev), 1009 device_unit(((struct usbnet *)(ifp->if_softc))->un_dev),
1010 0, 0, 0); 1010 0, 0, 0);
1011 1011
1012 /* 1012 aue_setiff_locked(ifp);
1013 * XXX I feel like this is pretty heavy-handed! Maybe we could 
1014 * make do with aue_setiff_locked instead? 
1015 */ 
1016 aue_uno_init(ifp); 
1017} 1013}
1018 1014
1019static void 1015static void
1020aue_uno_stop(struct ifnet *ifp, int disable) 1016aue_uno_stop(struct ifnet *ifp, int disable)
1021{ 1017{
1022 struct usbnet * const un = ifp->if_softc; 1018 struct usbnet * const un = ifp->if_softc;
1023 struct aue_softc * const sc = usbnet_softc(un); 1019 struct aue_softc * const sc = usbnet_softc(un);
1024 1020
1025 AUEHIST_FUNC(); 1021 AUEHIST_FUNC();
1026 AUEHIST_CALLARGSN(5, "aue%jd: enter", device_unit(un->un_dev), 0, 0, 0); 1022 AUEHIST_CALLARGSN(5, "aue%jd: enter", device_unit(un->un_dev), 0, 0, 0);
1027 1023
1028 aue_csr_write_1(sc, AUE_CTL0, 0); 1024 aue_csr_write_1(sc, AUE_CTL0, 0);
1029 aue_csr_write_1(sc, AUE_CTL1, 0); 1025 aue_csr_write_1(sc, AUE_CTL1, 0);