From owner-freebsd-current@freebsd.org Thu Aug 6 15:14:06 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 2E30A9B4221 for ; Thu, 6 Aug 2015 15:14:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) 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 12E8819CC for ; Thu, 6 Aug 2015 15:14:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: by mailman.ysv.freebsd.org (Postfix) id 122AB9B421F; Thu, 6 Aug 2015 15:14:06 +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 11A3D9B421D; Thu, 6 Aug 2015 15:14:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A77519CB; Thu, 6 Aug 2015 15:14:04 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id t76FDupU049382 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 6 Aug 2015 18:13:56 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id t76FDu0r049381; Thu, 6 Aug 2015 18:13:56 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 6 Aug 2015 18:13:55 +0300 From: Gleb Smirnoff To: current@FreeBSD.org, net@FreeBSD.org Subject: [head up!] WiFi drivers changes Message-ID: <20150806151355.GL889@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) 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: Thu, 06 Aug 2015 15:14:06 -0000 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. -- Totus tuus, Glebius.