From owner-freebsd-wireless@freebsd.org Wed Oct 12 20:32:17 2016 Return-Path: Delivered-To: freebsd-wireless@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 95477C0FE6A for ; Wed, 12 Oct 2016 20:32:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84B3D118 for ; Wed, 12 Oct 2016 20:32:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u9CKWGJj061765 for ; Wed, 12 Oct 2016 20:32:17 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-wireless@FreeBSD.org Subject: [Bug 213207] ath: Unable to set device MAC in FreeBSD 11 Date: Wed, 12 Oct 2016 20:32:16 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: wireless X-Bugzilla-Version: 11.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: adrian@freebsd.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-wireless@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 20:32:17 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D213207 Adrian Chadd changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adrian@freebsd.org --- Comment #11 from Adrian Chadd --- So, the challenge is thus. The device has a MAC address. There's a BSSID and a macaddress field. then, when creating say, cloned AP vaps, the isn't a list of MACs that the NIC ha= s - the reason they're typically only a small difference is there's a BSSID /ma= sk/ field for matching against. look at if_ath.c:assign_address() - and that on= ly happens for hostap and mbss modes. Now, before glebius removed the device entries from ifconfig, changing the parent device MAC would change what's effectively now ic->ic_macaddr. When= you create a new VAP, it clones ic->ic_macaddr unless you provide IEEE80211_CLONE_MACADDR as an argument and a separate MAC address. In that instance, the VAP is created with a completely different MAC address. Now t= hat there's no parent ifnet, there's no easy (ie, same for all devices) way of modifying ic_macaddr and having that programmed into the hardware for subsequent device updates. So here's what's going on: * the device will read its MAC from EEPROM, etc, and feed it into ic_macaddr * when creating VAPs, net80211 will use ic_macaddr unless given IEEE80211_CLONE_MACADDR as an argument - at which point it'll use a complet= ely separate MAC address for that argument. * trouble is, that won't really help with STA mode (at least on ath(4)) as there is only one MAC address, and that is what's prgorammed in via ath_hal_setmac() * when cloning AP VAPs, if_ath.c:assign_address() will update the chipset B= SSID mask, so multiple sequential MACs are accepted as "local" * .. but that doesn't do anything useful for STA mode, so setting the VAP M= AC address to anything that isn't ic_macaddr won't affect anything useful. Ok, so what we really need is: * fix up the hint.ath.X.macaddr thing to work right if it doesn't * figure out a generic way to fetch a wifi device mac address, now that 'ifconfig' can't do it; * figure out a generic way to re-program the device MAC address when the fi= rst VAP is created if it has changed, so the first VAP creation can be given an ethernet address and it will actually program the device; or * .. document one way (eg andriy's way, where setting the wlanaddr on the f= irst VAP will program the NIC MAC, and any subsequent creations can only vary depending upon what the hardware will provide) - and then audit /all/ drive= rs to make sure that method works. I think andriy's way is fine, and we just need to document it in the manpage/docbook and then audit every wifi driver. But I'd still like some generic way to fetch ic_macaddr from a device - eg by sysctl, or if we can = do it via an existing device ioctl, that. --=20 You are receiving this mail because: You are the assignee for the bug.=