Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jun 2013 08:40:01 GMT
From:      Daan Vreeken <Daan@vitsch.nl>
To:        freebsd-arm@FreeBSD.org
Subject:   Re: arm/179532: wireless networking on ARM
Message-ID:  <201306140840.r5E8e114033082@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR arm/179532; it has been noted by GNATS.

From: Daan Vreeken <Daan@vitsch.nl>
To: Guillaume Bibaut <yom@iaelu.net>
Cc: freebsd-arm@freebsd.org, freebsd-gnats-submit@freebsd.org,
        Adrian Chadd <adrian@freebsd.org>
Subject: Re: arm/179532: wireless networking on ARM
Date: Fri, 14 Jun 2013 10:33:51 +0200

 --Boundary-00=_vVtuRrItZym7Bc8
 Content-Type: text/plain;
   charset="iso-8859-1"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 Hi again,
 
 On Friday 14 June 2013 10:02:54 Daan Vreeken wrote:
 > Hi Guillaume,
 >
 > On Thursday 13 June 2013 11:40:44 Guillaume Bibaut wrote:
 > > >Number:         179532
 > > >Category:       arm
 > > >Synopsis:       wireless networking on ARM
 ...
 > > >Description:
 > >
 > > FreeBSD is crashing when wpa_supplicant is called upon boot on the Genesi
 > > Efika MX smartbook.
 ...
 
 > I think we might have hit this same bug at work and have a local patch that
 > fixes it. I'll see if I can dust it off and post a patch here. I believe it
 > was only a 3-line patch to if_run.c
 
 See the attachments. These patches fix two bugs:
 o A crash in if_run when using VNET in the kernel.
 o The correctness of the information passed to the radiotap code in if_run.
 
 I think the last patch may fix the crash you are seeing with if_run and 
 wpa_supplicant. If you only want to test that part, you just have to patch 
 if_run.c with the file 'if_run_2013_01_19_radiotap_fix_only.diff' .
 
 In case the attachments get mangled in the email, you can also download these 
 files from : http://www.vitsch.nl/pub_diffs/
 The following files should be attached to this email :
 	if_run_2013_01_19_radiotap_fix_only.diff
 	if_run_2013_01_19_vnet_fix.diff
 	if_run_2013_01_19_vnet_plus_radiotap_fix.diff
 
 All patches are:
 Sponsored by: Vitsch Electronics
 
 
 Regards,
 -- 
 Ing. Daan Vreeken
 Vitsch Electronics
 http://Vitsch.nl/
 http://VitschVPN.nl/
 tel: +31-(0)40-7113051
 KvK nr: 17174380
 --
 Machines en netwerken op afstand beheren? Vitsch VPN oplossing!
 Kijk voor meer informatie op: http://www.VitschVPN.nl/
 
 --Boundary-00=_vVtuRrItZym7Bc8
 Content-Type: text/x-diff;
   charset="iso-8859-1";
   name="if_run_2013_01_19_radiotap_fix_only.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="if_run_2013_01_19_radiotap_fix_only.diff"
 
 --- if_run.c.fix2_vnet_plus_radiotap	2013-06-14 10:15:34.890774314 +0200
 +++ if_run.c.fix1_vnet	2013-06-14 10:12:49.786774072 +0200
 @@ -2536,10 +2536,13 @@
  	m->m_pkthdr.rcvif = ifp;
  	m->m_pkthdr.len = m->m_len = len;
  
 -	/*
 -	 * DAAN: fill-in tap header BEFORE calling ieee80211_input*() so the
 -	 * user will see the actual data that belongs to THIS packet..
 -	 */
 +	if (ni != NULL) {
 +		(void)ieee80211_input(ni, m, rssi, nf);
 +		ieee80211_free_node(ni);
 +	} else {
 +		(void)ieee80211_input_all(ic, m, rssi, nf);
 +	}
 +
  	if (__predict_false(ieee80211_radiotap_active(ic))) {
  		struct run_rx_radiotap_header *tap = &sc->sc_rxtap;
  
 @@ -2576,13 +2579,6 @@
  			break;
  		}
  	}
 -
 -	if (ni != NULL) {
 -		(void)ieee80211_input(ni, m, rssi, nf);
 -		ieee80211_free_node(ni);
 -	} else {
 -		(void)ieee80211_input_all(ic, m, rssi, nf);
 -	}
  }
  
  static void
 
 --Boundary-00=_vVtuRrItZym7Bc8
 Content-Type: text/x-diff;
   charset="iso 8859-15";
   name="if_run_2013_01_19_vnet_fix.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="if_run_2013_01_19_vnet_fix.diff"
 
 Index: if_run.c
 ===================================================================
 --- if_run.c	(revision 251736)
 +++ if_run.c	(working copy)
 @@ -52,6 +52,7 @@
  #include <net/if_dl.h>
  #include <net/if_media.h>
  #include <net/if_types.h>
 +#include <net/vnet.h>
  
  #include <netinet/in.h>
  #include <netinet/in_systm.h>
 @@ -606,9 +607,12 @@
  
  	RUN_UNLOCK(sc);
  
 +	CURVNET_SET(vnet0);
 +
  	ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211);
  	if (ifp == NULL) {
  		device_printf(sc->sc_dev, "can not if_alloc()\n");
 +		CURVNET_RESTORE();
  		goto detach;
  	}
  	ic = ifp->if_l2com;
 @@ -702,6 +706,8 @@
  	if (bootverbose)
  		ieee80211_announce(ic);
  
 +	CURVNET_RESTORE();
 +
  	return (0);
  
  detach:
 @@ -739,8 +745,10 @@
  		usb_callout_drain(&sc->ratectl_ch);
  		ieee80211_draintask(ic, &sc->cmdq_task);
  		ieee80211_draintask(ic, &sc->ratectl_task);
 +		CURVNET_SET(ifp->if_vnet);
  		ieee80211_ifdetach(ic);
  		if_free(ifp);
 +		CURVNET_RESTORE();
  	}
  
  	mtx_destroy(&sc->sc_mtx);
 
 --Boundary-00=_vVtuRrItZym7Bc8
 Content-Type: text/x-diff;
   charset="iso 8859-15";
   name="if_run_2013_01_19_vnet_plus_radiotap_fix.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="if_run_2013_01_19_vnet_plus_radiotap_fix.diff"
 
 Index: if_run.c
 ===================================================================
 --- if_run.c	(revision 251736)
 +++ if_run.c	(working copy)
 @@ -52,6 +52,7 @@
  #include <net/if_dl.h>
  #include <net/if_media.h>
  #include <net/if_types.h>
 +#include <net/vnet.h>
  
  #include <netinet/in.h>
  #include <netinet/in_systm.h>
 @@ -606,9 +607,12 @@
  
  	RUN_UNLOCK(sc);
  
 +	CURVNET_SET(vnet0);
 +
  	ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211);
  	if (ifp == NULL) {
  		device_printf(sc->sc_dev, "can not if_alloc()\n");
 +		CURVNET_RESTORE();
  		goto detach;
  	}
  	ic = ifp->if_l2com;
 @@ -702,6 +706,8 @@
  	if (bootverbose)
  		ieee80211_announce(ic);
  
 +	CURVNET_RESTORE();
 +
  	return (0);
  
  detach:
 @@ -739,8 +745,10 @@
  		usb_callout_drain(&sc->ratectl_ch);
  		ieee80211_draintask(ic, &sc->cmdq_task);
  		ieee80211_draintask(ic, &sc->ratectl_task);
 +		CURVNET_SET(ifp->if_vnet);
  		ieee80211_ifdetach(ic);
  		if_free(ifp);
 +		CURVNET_RESTORE();
  	}
  
  	mtx_destroy(&sc->sc_mtx);
 @@ -2528,13 +2536,10 @@
  	m->m_pkthdr.rcvif = ifp;
  	m->m_pkthdr.len = m->m_len = len;
  
 -	if (ni != NULL) {
 -		(void)ieee80211_input(ni, m, rssi, nf);
 -		ieee80211_free_node(ni);
 -	} else {
 -		(void)ieee80211_input_all(ic, m, rssi, nf);
 -	}
 -
 +	/*
 +	 * DAAN: fill-in tap header BEFORE calling ieee80211_input*() so the
 +	 * user will see the actual data that belongs to THIS packet..
 +	 */
  	if (__predict_false(ieee80211_radiotap_active(ic))) {
  		struct run_rx_radiotap_header *tap = &sc->sc_rxtap;
  
 @@ -2571,6 +2576,13 @@
  			break;
  		}
  	}
 +
 +	if (ni != NULL) {
 +		(void)ieee80211_input(ni, m, rssi, nf);
 +		ieee80211_free_node(ni);
 +	} else {
 +		(void)ieee80211_input_all(ic, m, rssi, nf);
 +	}
  }
  
  static void
 
 --Boundary-00=_vVtuRrItZym7Bc8--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306140840.r5E8e114033082>