Return-path: Received: from mail-pg0-f42.google.com ([74.125.83.42]:33544 "EHLO mail-pg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759294AbdAILCN (ORCPT ); Mon, 9 Jan 2017 06:02:13 -0500 Received: by mail-pg0-f42.google.com with SMTP id 204so20788374pge.0 for ; Mon, 09 Jan 2017 03:02:13 -0800 (PST) Subject: Re: [PATCH V6 4/3] brcmfmac: use wiphy_read_of_freq_limits to respect extra limits To: Johannes Berg , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= References: <20170104175832.25996-1-zajec5@gmail.com> <20170104175832.25996-4-zajec5@gmail.com> <3fc87224-7f08-e365-7bbb-a4b8b5746e4f@broadcom.com> <36d2dbd1-bcbe-021b-dd7f-068a5b9739ef@broadcom.com> <1483952320.17582.13.camel@sipsolutions.net> Cc: "linux-wireless@vger.kernel.org" , Martin Blumenstingl , Felix Fietkau , Arend van Spriel , Arnd Bergmann , "devicetree@vger.kernel.org" , Rob Herring , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= From: Arend Van Spriel Message-ID: <684d1aff-a9ce-ae42-0c11-5840d3a92daf@broadcom.com> (sfid-20170109_121900_406996_434611DD) Date: Mon, 9 Jan 2017 12:02:07 +0100 MIME-Version: 1.0 In-Reply-To: <1483952320.17582.13.camel@sipsolutions.net> Content-Type: text/plain; charset=utf-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: On 9-1-2017 9:58, Johannes Berg wrote: > On Sat, 2017-01-07 at 13:58 +0100, Rafał Miłecki wrote: > >>> I indeed prefer to talk about the driver instead of we. Indeed it >>> is true due to the orig_flags behavior although that only seems to >>> involve regulatory code. Could it be that brcmfmac undo that >>> through the notifier? >> >> I guess you could touch orig_flags, but I don't know if it's >> preferred way. This is probably question to Johannes & cfg80211 guys. > > Right now - before the OF patch - there can't really be any orig_flags > with DISABLED since the driver doesn't set flags to DISABLED before > registering, does it? While registering, flags are copied to orig_flags > so the driver can register with flags like DFS or NO_IR already enabled > - say the firmware requires that - and they will never be overwritten > by cfg80211. Actually, in brcmfmac we do set channels to DISABLED before registering. I was blissfully unaware of the orig_flags when I added the channel setup in our probe sequence. > Arguably, what the driver does today - before OF - isn't incorrect > either, since it simply doesn't care about anything it registered with > at all. Given the statement above I think brcmfmac is incorrect. > However, with the OF, I argued (succesfully it seems :P) that the > sensible thing to do was to register with the DISABLED flag and thereby > "permanently" disable the channels that OF didn't think were usable, > but in this case now the driver has to adhere to the cfg80211 logic of > preserving orig_flags forever. By adhere you mean we should not enable channes for which orig_flags indicate DISABLED? Regards, Arend