Received: by 10.213.65.68 with SMTP id h4csp1722432imn; Mon, 19 Mar 2018 11:26:57 -0700 (PDT) X-Google-Smtp-Source: AG47ELu/jvyCc/7DIi5VJ4+Yo9NO5oP9N63LOc8hWcwM2hk9oc91Huf46dMgLazIF6EYSg16EWGQ X-Received: by 2002:a17:902:8481:: with SMTP id c1-v6mr3376544plo.304.1521484017215; Mon, 19 Mar 2018 11:26:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521484017; cv=none; d=google.com; s=arc-20160816; b=bCr1TTiNLlAvFmAjNw1THSq0l7Q2U4GNqKkzlKVhnZugzufbfxdjGHnwcB8J28sflf OYJKdil0oIcU3SoDCMGiSJirkN0w29owRcgAXOAFEJjTJAPABOUBaL1H1uNrVIkJ+KTm +c6gY4W1VyGxWxRuwY81h2vSw5+EmsqBl2evDHcPE6WMggH/MlJS8HxbMAD51rTOAuMP gGRcbHIgiFA9Ll+sT12JRV9Ywb1gAxFYV+s5jwUc9lG7/RQey4M+fpjpCu6gWfs43eck 3cxZZ6FYq56vCfBD8oNNZ6DjY/OMa4SJXS8woWvYzXTQYDjhmXic7bycZMnqLanWPv3i LViw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=xM5QaWEK+6CuKtfAO1tHklt4/z8Foo1EufC6fSGh0Xw=; b=trjnsAkWydqe2NCYks9eV2rFwi+lH4DlUTAORDSlt37aTBPJQBxIyC61FGkVkAnc36 pXaB5p9I8P/6MLzzllc0a+lormQ2tzbh3wKsxOoe3rDBuqglL3deutgNiXfDOLqplkfA 4uSQdu1bMwxKbbk4z1wactH/t1zweWCL6BD7hE025JZlW09bYo9IrM/QjLh6u+Efywht r7E+6ccAtxbN6DR/hYgF+4vjQV2aXGA77+CoheSrJsjkdFA4z8Ens6bZodWIQgflNL2O skmLKmMvSmbwdHawZS/xDJwsLQEYSdMhuwq6uOF+4gP3K6OYPpEQLFlcrpLXlAkg65JS Wmbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t61-v6si435801plb.195.2018.03.19.11.26.42; Mon, 19 Mar 2018 11:26:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031614AbeCSSZP (ORCPT + 99 others); Mon, 19 Mar 2018 14:25:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50192 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030932AbeCSSZA (ORCPT ); Mon, 19 Mar 2018 14:25:00 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CF46C100B; Mon, 19 Mar 2018 18:24:59 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg , Sasha Levin Subject: [PATCH 4.9 158/241] mac80211_hwsim: use per-interface power level Date: Mon, 19 Mar 2018 19:07:03 +0100 Message-Id: <20180319180757.708132844@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johannes Berg [ Upstream commit 1d5e9f80ab021e3e1f9436627a4ad07a143ccb2c ] When channel contexts are used, there's no global power level (the power_level is always 0). Use the per-interface TX power in mac80211_hwsim to have a proper setting for both cases. This fixes the bgscan_simple and bgscan_learn test cases when the number of channels advertised by hwsim is >1 by default. Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/mac80211_hwsim.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -552,8 +552,6 @@ struct mac80211_hwsim_data { /* wmediumd portid responsible for netgroup of this radio */ u32 wmediumd; - int power_level; - /* difference between this hw's clock and the real clock, in usecs */ s64 tsf_offset; s64 bcn_delta; @@ -1208,7 +1206,9 @@ static bool mac80211_hwsim_tx_frame_no_n if (info->control.rates[0].flags & IEEE80211_TX_RC_SHORT_GI) rx_status.flag |= RX_FLAG_SHORT_GI; /* TODO: simulate real signal strength (and optional packet loss) */ - rx_status.signal = data->power_level - 50; + rx_status.signal = -50; + if (info->control.vif) + rx_status.signal += info->control.vif->bss_conf.txpower; if (data->ps != PS_DISABLED) hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM); @@ -1607,7 +1607,6 @@ static int mac80211_hwsim_config(struct WARN_ON(data->channel && data->use_chanctx); - data->power_level = conf->power_level; if (!data->started || !data->beacon_int) tasklet_hrtimer_cancel(&data->beacon_timer); else if (!hrtimer_is_queued(&data->beacon_timer.timer)) { @@ -2212,7 +2211,6 @@ static const char mac80211_hwsim_gstring "d_tx_failed", "d_ps_mode", "d_group", - "d_tx_power", }; #define MAC80211_HWSIM_SSTATS_LEN ARRAY_SIZE(mac80211_hwsim_gstrings_stats) @@ -2249,7 +2247,6 @@ static void mac80211_hwsim_get_et_stats( data[i++] = ar->tx_failed; data[i++] = ar->ps; data[i++] = ar->group; - data[i++] = ar->power_level; WARN_ON(i != MAC80211_HWSIM_SSTATS_LEN); }