From owner-freebsd-current@freebsd.org Fri Aug 7 23:50:24 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACB759B67BC for ; Fri, 7 Aug 2015 23:50:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 8EBE2DCC for ; Fri, 7 Aug 2015 23:50:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 8DEE89B67BA; Fri, 7 Aug 2015 23:50:24 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D6FA9B67B9; Fri, 7 Aug 2015 23:50:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x229.google.com (mail-ig0-x229.google.com [IPv6:2607:f8b0:4001:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B260DCB; Fri, 7 Aug 2015 23:50:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igbpg9 with SMTP id pg9so40880477igb.0; Fri, 07 Aug 2015 16:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=OzeU8n1njMnk2pPFMIzZwSUDGp7D73qsgpUAPMlc/x4=; b=pL/IqpeWOCpXr7Pa5yz8KbzD9Q0j6BSVrV6UUksu8ZehD7Vf7MJ4wXDTeodIBv7Fde OkheeK27Bb0wggVP/g75ci7TdJKV1hifts2hqIvwpLnVaLqfuPIqQ+G3Rl6hMhDS+NBJ J5jAk45V0qvMOe7VeFexeXE+Hrc29P1lpEXpvtMaIkrEmn7lt29cI22ZBPZcn8tGpueV rTzLm0IqYUAt4Ph5yfXSa4/oeG13B64ytV9Ysl9qGPpVdyYUg78UeWjd1AZv1+RbQomA N8O1GCw6xQ+yiOk+2kcEmEc0NHpSz8APSl2nCPlNiT3ppAgRL6Bi9aCoVXk9NXM9zu+j A6pw== MIME-Version: 1.0 X-Received: by 10.50.128.169 with SMTP id np9mr666837igb.37.1438991423768; Fri, 07 Aug 2015 16:50:23 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Fri, 7 Aug 2015 16:50:23 -0700 (PDT) In-Reply-To: <20150807175226.357b5dce.ohartman@zedat.fu-berlin.de> References: <20150806151355.GL889@FreeBSD.org> <20150807175226.357b5dce.ohartman@zedat.fu-berlin.de> Date: Fri, 7 Aug 2015 16:50:23 -0700 Message-ID: Subject: Re: [head up!] WiFi drivers changes From: Adrian Chadd To: "O. Hartmann" Cc: Gleb Smirnoff , "current@freebsd.org" , "net@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Aug 2015 23:50:24 -0000 Hi, Gleb/others doing this: you have 4 days to figure out what's wrong with things, or I'm backing all of this work out. Thanks, -adrian On 7 August 2015 at 08:52, O. Hartmann wrote: > Am Thu, 6 Aug 2015 18:13:55 +0300 > Gleb Smirnoff schrieb: > >> Hi! >> >> As part of the "opaque ifnet project" [1], all 802.11 (WiFi) drivers >> undergo change of not being an interface anymore. Historically in FreeBSD >> 802.11 stack, 802.11 devices called if_attach() and created an interface. >> Later this was generalized and real functioning interface is created by >> net80211 stack. However, remnant of parent interface remained. If you >> are running Intel Centrino wireless, then you got iwn0 interface and >> wlan0 interface. However, the former doesn't do anything. You can't >> assign addresses to it or modify any of it parameters. Or you can >> modify them, but that affects nothing. >> >> This superfluous ifnet on the list entangles the net80211 stack and >> also is on the way of [1]. So, decision was made to remove it. I >> already did preparatory commits back in May, and now it is time to >> finish that. >> >> The patch is: >> >> https://reviews.freebsd.org/D2655 >> >> And the Wiki page for it is: >> >> https://wiki.freebsd.org/projects/ifnet/net80211 >> >> The patch modifies every driver, and diff is bulky. However, changes >> are mechanical and simple, most drivers appeared to work after first >> run. Most converted drivers are tested to work. >> >> This is list of drivers that are not tested, due to lack of testers: >> >> mwl, ipw, bwn, wi, upgt, uath. >> >> But, as said, changes are mechanical and probability is 95% that >> they will work. >> >> The only complex one is ndis(4). It could be broken by conversion. >> Since I already got a tester volunteer, I will fix it quickly if >> anything happens. >> >> Another untrivial one is wtap(4), which is not connected to the >> build and appeared to be broken even before conversion. Anyway, >> I made it compilable. >> >> Now, for the configuration. The sequence of commands you need >> to run to configure a WiFi interface doesn't change. As before >> it is: >> >> ifconfig wlan0 create wlandev iwn0 >> ifconfig wlan0 $foo >> >> Your rc.conf doesn't need any changes. As before: >> >> wlans_iwn0="wlan0" >> ifconfig_wlan0="DHCP WPA" >> >> However, iwn0 disappeared from the 'ifconfig -l'. It is still >> in devinfo, or in dmesg. For the sake of installers or other >> configuration software, a sysctl is provided: >> >> net.wlan.devices: iwn0 >> >> The /etc subsystem needs to be tweaked. Previously the wlan(4) >> interfaces were created in childif_create(), and the script >> did check for presence of parent interface. In my patch I >> provided wlans_up(), that doesn't check. The code in D2655 >> now works correctly both on patched and on unpatched kernel. >> >> Alternatively, I could tweak childif_create() to use net.wlan.devices >> instead of 'ifconfig -l'. Or, to use them both, to work on older >> and on newer kernels? >> >> I am not sure which path with /etc is better, so seeking for >> help with that. >> > > After updating to FreeBSD 11.0-CURRENT #0 r286415: Fri Aug 7 17:22:43 CEST 2015 amd64, > several APs won't startup anymore: > > [...] > Starting hostapd. > Configuration file: /etc/hostapd.conf > bsd_set_if_media: SIOCSIFMEDIA Device not configured > bsd_init: failed to set operation mode > bsd driver initialization failed. > wlan0: interface state UNINITIALIZED->DISABLED > wlan0: AP-DISABLED > hostapd_free_hapd_data: Interface wlan0 wasn't started > ELOOP: remaining socket: sock=5 eloop_data=0x801c47100 user_data=0x0 handler=0x41a0e0 > /etc/rc.d/hostapd: WARNING: failed to start hostapd