From patchwork Fri Feb 15 08:46:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Pillai X-Patchwork-Id: 10814377 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9CF8C1390 for ; Fri, 15 Feb 2019 08:58:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43A062D76C for ; Fri, 15 Feb 2019 08:58:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 375A62EADB; Fri, 15 Feb 2019 08:58:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D96FE2D76C for ; Fri, 15 Feb 2019 08:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=zo/B/F9Pkd/pP1jigbB9udx7EXar9R5dvWsMY1KxSPM=; b=ikI Sbu1X72MvaL6D3fmWNKfMYvbg6FepLdIIQ0rHr+7Was6oe8suQ8GL8c1rfV0r0wFXlRADHdZxk6KP hE/jX/Q/6CbTwcfLFDTTPCfZNmuheJPW4YzSRSaSzYDMo+x4hmZTojSiGsyS/KIHMnE0CAnnJ22JI 2q6SNU9PnGxX4Crnqm8/jtkhu0FF9R1Lv6+QvR6/Y/GsKUqiJNdIYm0ks1voHl5Gdsg0MD91Fcgro yIhIDQxmLbFCauF7TgcQCOMjnFcFBFD260RTBNLdo/9ecib/cZ6V+I3KBSug00bV04VYfM/XNi4is y6YktN1eFzI06K5v5XotkVcZLRcmjhQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1guZKC-0000hn-6Q; Fri, 15 Feb 2019 08:58:24 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1guZK9-0000hB-A9 for ath10k@lists.infradead.org; Fri, 15 Feb 2019 08:58:22 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B501F60A44; Fri, 15 Feb 2019 08:46:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550221096; bh=8uMc//+b3pGm0fSbwJy9xlfOHtzKzrL3aCXgxiRM+0k=; h=From:To:Cc:Subject:Date:From; b=PQagIF5M381Wa6nPbnWPXAMbWbMKsGAVoZS29QavJXd3jHdd5DT8lNpLfc1DACXOK G71lHuSS3EvuD2xEEcAOupSLOkOdXoRC/QDyhzGFRSUQCjXx267DLc8s7dRnYR65DC Q9W2zo+WGDqwKMDu2JjYupsOgjsD7CwU9CYNsIg0= Received: from pillair-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pillair@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 32E9760AA2; Fri, 15 Feb 2019 08:46:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550220385; bh=8uMc//+b3pGm0fSbwJy9xlfOHtzKzrL3aCXgxiRM+0k=; h=From:To:Cc:Subject:Date:From; b=LiWGnQUkTONyWThYySBhnNpQ3yFlpx2KW0M7lZZQhVy9qj6VPAoM1RmM/zATAHep2 LK+T+3ngqfJ4bUMhXQwqLhYIryy8VwcnG3mOHq6ezyX7fZOo6wDVgM/y98xDu+4AIf tfuFCEvz2qT4+e3g70hZgzPr09r7zcetn+LUVrhU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 32E9760AA2 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=pillair@codeaurora.org From: Rakesh Pillai To: ath10k@lists.infradead.org Subject: [PATCH] mac80211: Restore vif beacon interval if start ap fails Date: Fri, 15 Feb 2019 14:16:02 +0530 Message-Id: <1550220362-5573-1-git-send-email-pillair@codeaurora.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190215_005821_385115_0F39F52C X-CRM114-Status: GOOD ( 11.74 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rakesh Pillai , linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The starting of AP interface can fail due to invalid beacon interval, which does not match the minimum gcd requirement set by the wifi driver. In such case, the beacon interval of that interface gets updated with that invalid beacon interval. The next time that interface is brought up in AP mode, an interface combination check is performed and the beacon interval is taken from the previously set value. In a case where an invalid beacon interval, i.e. a beacon interval value which does not satisfy the minimum gcd criteria set by the driver, is set, all the subsequent trials to bring that interface in AP mode will fail, even if the subsequent trials have a valid beacon interval. To avoid this, in case of a failure in bringing up an interface in AP mode due to interface combination error, the interface beacon interval which is stored in bss conf, needs to be restored with the last working value of beacon interval. Tested on ath10k using WCN3990. Fixes: 0c317a02ca98 ("cfg80211: support virtual interfaces with different beacon intervals") Signed-off-by: Rakesh Pillai --- net/mac80211/cfg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index d65aa01..09dd1c2 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -941,6 +941,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, BSS_CHANGED_P2P_PS | BSS_CHANGED_TXPOWER; int err; + int prev_beacon_int; old = sdata_dereference(sdata->u.ap.beacon, sdata); if (old) @@ -963,6 +964,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, sdata->needed_rx_chains = sdata->local->rx_chains; + prev_beacon_int = sdata->vif.bss_conf.beacon_int; sdata->vif.bss_conf.beacon_int = params->beacon_interval; if (params->he_cap) @@ -974,8 +976,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, if (!err) ieee80211_vif_copy_chanctx_to_vlans(sdata, false); mutex_unlock(&local->mtx); - if (err) + if (err) { + sdata->vif.bss_conf.beacon_int = prev_beacon_int; return err; + } /* * Apply control port protocol, this allows us to