From patchwork Wed May 6 15:30:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 6350451 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 52BA89F373 for ; Wed, 6 May 2015 15:31:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74C2E202F8 for ; Wed, 6 May 2015 15:31:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7DBFA20304 for ; Wed, 6 May 2015 15:31:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752877AbbEFPbh (ORCPT ); Wed, 6 May 2015 11:31:37 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:38061 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752878AbbEFPb1 (ORCPT ); Wed, 6 May 2015 11:31:27 -0400 Received: by wiun10 with SMTP id n10so27018023wiu.1 for ; Wed, 06 May 2015 08:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hki1JcOsf9xZ/9yPtTrY4dHCdzlcDsHVE3yNklQ4+Rc=; b=zW4oyNDh8bdcMgRZf+kTonXPo8QNmnG+9Rg12pcwfdzgP1w4qVrslHyN0wRrr0LGx+ lYd087Mk6uK0iovm5NOulEDT5BK11mwYPQw2rqgVt0Mbeei7c/NQU9SI5ifiGSDKBWiI ysmGt0IUKODQkkHzC7wMgrBN4Txt2kFoV8tTBBH78j+KNxwErR9wjk11LlRi4d+Tn57T GMm5Be6mG+Zc3zO24bBrJjg0wRGxQgzwkoZT+yHPeqG9tv/FqH3e/4qIgfN7cOap/SA3 eWBQC8W4vz51VP9jYSb73RXSbmMMbuKEpd2/HMWLPhHl6gsiEouIUCQaqz8mNYuoIDB1 ofvg== X-Received: by 10.194.57.209 with SMTP id k17mr61398449wjq.33.1430926286313; Wed, 06 May 2015 08:31:26 -0700 (PDT) Received: from localhost ([80.246.137.198]) by mx.google.com with ESMTPSA id pz6sm3245934wjc.43.2015.05.06.08.30.59 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 06 May 2015 08:31:00 -0700 (PDT) From: andrei.otc@gmail.com X-Google-Original-From: andrei.otcheretianski@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, emmanuel.grumbach@intel.com, Andrei Otcheretianski Subject: [PATCH v3 5/7] mac80211: Adjust reserved chan_ctx when assigned to vif Date: Wed, 6 May 2015 18:30:50 +0300 Message-Id: <1430926250-14732-1-git-send-email-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.0 In-Reply-To: <1430916630.1954.2.camel@sipsolutions.net> References: <1430916630.1954.2.camel@sipsolutions.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andrei Otcheretianski When a vif starts using a reserved channel context (during CSA, for example) the required chandef was recalculated, however it was never applied. This could result in using chanctx with narrower width than actually required. Fix this by calling ieee80211_change_chanctx with the recalculated chandef. This both changes the chanctx's width and recalcs min_def. Signed-off-by: Andrei Otcheretianski Reviewed-by: Luciano Coelho --- net/mac80211/chan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index 5bcd4e5..0fd9274 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -1008,6 +1008,8 @@ ieee80211_vif_use_reserved_reassign(struct ieee80211_sub_if_data *sdata) if (WARN_ON(!chandef)) return -EINVAL; + ieee80211_change_chanctx(local, new_ctx, chandef); + vif_chsw[0].vif = &sdata->vif; vif_chsw[0].old_ctx = &old_ctx->conf; vif_chsw[0].new_ctx = &new_ctx->conf; @@ -1079,6 +1081,8 @@ ieee80211_vif_use_reserved_assign(struct ieee80211_sub_if_data *sdata) if (WARN_ON(!chandef)) return -EINVAL; + ieee80211_change_chanctx(local, new_ctx, chandef); + list_del(&sdata->reserved_chanctx_list); sdata->reserved_chanctx = NULL;