From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-gw1-out.broadcom.com ([216.31.210.62]:12488 "EHLO mail-gw1-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752595AbbAURyx (ORCPT ); Wed, 21 Jan 2015 12:54:53 -0500 Message-ID: <54BFE7EA.3090402@broadcom.com> (sfid-20150121_185516_973170_27DE98C4) Date: Wed, 21 Jan 2015 18:54:50 +0100 From: Arend van Spriel MIME-Version: 1.0 To: Johannes Berg CC: Emmanuel Grumbach , , Avri Altman Subject: Re: [PATCH] mac80211: tell drivers the user TX power restriction References: <1421784945-7815-1-git-send-email-emmanuel.grumbach@intel.com> <54BEDBBA.2060305@broadcom.com> <1421858816.1900.24.camel@sipsolutions.net> In-Reply-To: <1421858816.1900.24.camel@sipsolutions.net> Content-Type: text/plain; charset="UTF-8"; format=flowed Sender: linux-wireless-owner@vger.kernel.org List-ID: On 01/21/15 17:46, Johannes Berg wrote: > On Tue, 2015-01-20 at 23:50 +0100, Arend van Spriel wrote: >> On 01/20/15 21:15, Emmanuel Grumbach wrote: >>> From: Avri Altman >>> >>> When a tx power restriction is set, mac80211 protects its downstream >>> stack by taking min(user, regulatory, 11h ap). However, we should allow >>> drivers to use that value as it is - on their own risk. >>> This might come handy, when tx power is set per phy. As mac80211 has >>> only a concept of "per-vif" tx power, it iterates over the active vifs, >>> and sets their tx power limit accordingly. Allowing this value to >>> proliferate downstream unchanged, the driver might use this legacy >>> api differently, e.g. to set tx power for the whole device. >> >> Not sure if this really a good idea as default behaviour. Can't we do >> this kind of stuff under some Kconfig. In cfg80211 we have the >> CFG80211_CERTIFICATION_ONUS. > > I don't think this is necessary. After all, it's added in a special > separate field that the driver author must evaluate how to use it. > > In our case, it'll be used (by the driver and firmware) to limit scan TX > power appropriately, for example. Since scanning is done by the firmware > the TX power for the channel cannot be set by the driver, and if we > limit it to the calculated power limit for the (associated) vif then it > might be too low since you might be associated on a low channel. > > But it doesn't have a direct effect on any driver not using it, so I > don't really see why it should be configurable? Okay. Let's forget about the configurable thing. Reading the commit message and I concluded that before the patch it was 'txpwr_limit = min(user, regulatory, ap_11h)'. So for drivers using this value this now changes to 'txpwr_limit = user', right? For those drivers it might be good to have the min() operation added so their behaviour is effectively unchanged by this patch. Regards, Arend > johannes >