NetBSD-Bugs archive

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

Re: kern/57645: bridge does not work on raspberry pi



The following reply was made to PR kern/57645; it has been noted by GNATS.

From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
To: sc.dying%gmail.com@localhost
Cc: gnats-bugs%NetBSD.org@localhost, Martin Husemann <martin%duskware.de@localhost>,
	Michael van Elst <mlelstv%serpens.de@localhost>
Subject: Re: kern/57645: bridge does not work on raspberry pi
Date: Sat, 7 Oct 2023 23:33:57 +0000

 This is a multi-part message in MIME format.
 --=_k+R2A0jPCfl/fFvU84G4E4n02s6AxFtx
 
 Correction -- try this patch instead?
 
 --=_k+R2A0jPCfl/fFvU84G4E4n02s6AxFtx
 Content-Type: text/plain; charset="ISO-8859-1"; name="pr57646-usbnet-reinit-v2"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="pr57646-usbnet-reinit-v2.patch"
 
 From c7f5d719c0e8bea099b28f2d57dfe7c8fa980c7e Mon Sep 17 00:00:00 2001
 From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
 Date: Sat, 7 Oct 2023 23:09:16 +0000
 Subject: [PATCH] usbnet(4): On if_init, stop/init if IFF_RUNNING -- not noo=
 p.
 
 ether_ioctl(9) relies on this to reinitialize an interface when a
 flags change returns ENETRESET.
 
 PR kern/57645
 
 XXX pullup-10
 ---
  sys/dev/usb/usbnet.c | 13 ++++++++-----
  1 file changed, 8 insertions(+), 5 deletions(-)
 
 diff --git a/sys/dev/usb/usbnet.c b/sys/dev/usb/usbnet.c
 index c77e08e07f7e..8daa904752cf 100644
 --- a/sys/dev/usb/usbnet.c
 +++ b/sys/dev/usb/usbnet.c
 @@ -1112,6 +1112,7 @@ usbnet_stop(struct usbnet *un, struct ifnet *ifp, int=
  disable)
  	USBNETHIST_FUNC(); USBNETHIST_CALLED();
 =20
  	KASSERTMSG(IFNET_LOCKED(ifp), "%s", ifp->if_xname);
 +	KASSERTMSG(ifp->if_flags & IFF_RUNNING, "%s", ifp->if_xname);
 =20
  	/*
  	 * For drivers with hardware multicast filter update callbacks:
 @@ -1300,14 +1301,16 @@ usbnet_if_init(struct ifnet *ifp)
  		return EIO;
 =20
  	/*
 -	 * If we're already running, nothing to do.
 +	 * If we're already running, stop the interface first -- we're
 +	 * reinitializing it.
  	 *
 -	 * XXX This should be an assertion, but it may require some
 -	 * analysis -- and possibly some tweaking -- of sys/net to
 -	 * ensure.
 +	 * XXX Grody for sys/net to call if_init to reinitialize.  This
 +	 * should be an assertion, not a branch, but it will require
 +	 * some tweaking of sys/net to avoid.
  	 */
  	if (ifp->if_flags & IFF_RUNNING)
 -		return 0;
 +		usbnet_stop(un, ifp, /*disable*/1/*XXX???*/);
 +	KASSERTMSG((ifp->if_flags & IFF_RUNNING) =3D=3D 0, "%s", ifp->if_xname);
 =20
  	error =3D uno_init(un, ifp);
  	if (error)
 
 --=_k+R2A0jPCfl/fFvU84G4E4n02s6AxFtx--
 


Home | Main Index | Thread Index | Old Index