Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp496731pxa; Thu, 27 Aug 2020 07:58:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0pyNyAQmUCmyjVUNTp5IiymzLJQAOSmy5wGBbeU645h+22XImjcrW/eWPiWimr8hJOhk0 X-Received: by 2002:aa7:d596:: with SMTP id r22mr20606753edq.204.1598540325159; Thu, 27 Aug 2020 07:58:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598540325; cv=none; d=google.com; s=arc-20160816; b=aUjx48ogGvC6ql9MC6lMobDrvXgaaRiU+nIKkJBwkCmftEQgDsvf8S/lLcBtT8T12H Q773ODupJMXLREFIGq5h/MWc+7bW+RgNET6cLJK51tQBhyRmsRDwYkhsXij+9LSFCw9f 9wR+A78hzzGNM//24ZecJB/jcUHYI/9IchxUcXkyqpyhXcW/ygJ1lejHoXBDIhXPnQ6/ K1gEOMYDboWMosjH6GDVEDfCWTv2CxdPYovsa1WzX0rGME/su439+7oP0zknXpWdxCP5 wbMf1F4KTrrRXnHDgMzNBzZY9/ylwzYdfgSlj5ec8oMOoQUepQhuDMvAgnX3BZexiOzK ERWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=p7Ppz7jDrauG0fRrSpBM5bB6QDcmvT+WN4M+Nm1Dg3c=; b=upBORruTAPAlRj6GKWXsWmpbVFMzlYTls+9+uFrRqVHkZiPaj1SXjwPACrdElJYYaK kvwUHFOVz5zFDm6Sy5OjPFoqiiqJwqJSJtDGv0KuGbuntQbzAlEhmbhl2lm0OK6F8t87 nanPGlx/6tX25CVVbcmF6t9vMkAkHDzXSy8OeyGt1YXTNbYKznqn+Tfz7KlNRBhUuaEy cWqfsBeBFew3+SDm4dVYcVUHYj4/764YGg/NDg97bxOkYIiGxKbcrT5Rw9RdSyW2opTj F4as2cylqJNaujdDN45wSilq7LF3eEOoG1PxY3Z2p2SsI8ywoVc9hM32oi6opoVRflAV BJTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c1si1703423edq.576.2020.08.27.07.58.21; Thu, 27 Aug 2020 07:58:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728197AbgH0Ozz (ORCPT + 99 others); Thu, 27 Aug 2020 10:55:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726825AbgH0NJT (ORCPT ); Thu, 27 Aug 2020 09:09:19 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D4E1C061233 for ; Thu, 27 Aug 2020 06:08:36 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1kBHdq-00BbCo-Oy; Thu, 27 Aug 2020 15:08:34 +0200 Message-ID: <2f1de2e5672f1516ac1d94520f54b00153fd24f3.camel@sipsolutions.net> Subject: Re: [PATCH V3 2/9] mac80211: add multiple bssid support to interface handling From: Johannes Berg To: John Crispin Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org Date: Thu, 27 Aug 2020 15:08:33 +0200 In-Reply-To: <20200812150050.2683396-3-john@phrozen.org> References: <20200812150050.2683396-1-john@phrozen.org> <20200812150050.2683396-3-john@phrozen.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org > + struct { > + struct ieee80211_vif *parent; > + struct list_head list; > + bool non_transmitted; > + } multiple_bssid; Oh, and also - surely parent isn't set for the transmitted BSSID, so the bool non_transmitted is redundant? It's basically the same as !!parent? Which also applies at the cfg80211 level. > +static int ieee80211_set_multiple_bssid_options(struct ieee80211_sub_if_data *sdata, > + struct vif_params *params) > +{ > + struct ieee80211_local *local = sdata->local; > + struct wiphy *wiphy = local->hw.wiphy; > + struct net_device *parent; > + struct ieee80211_sub_if_data *psdata; > + > + if (!ieee80211_hw_check(&local->hw, SUPPORTS_MULTI_BSSID_AP)) > + return 0; That was probably meant to be an error? Otherwise the function can be void. > +++ b/net/mac80211/iface.c > @@ -810,6 +810,13 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, > bool cancel_scan; > struct cfg80211_nan_func *func; > > + if (sdata->vif.type == NL80211_IFTYPE_AP && > + sdata->vif.multiple_bssid.non_transmitted) > + /* make sure the parent is already down */ > + if (sdata->vif.multiple_bssid.parent && > + ieee80211_sdata_running(vif_to_sdata(sdata->vif.multiple_bssid.parent))) > + dev_close(vif_to_sdata(sdata->vif.multiple_bssid.parent)->wdev.netdev); > + > This is nice but somewhere you also need to actually NULL the pointer. As it is now, it seems you could set up two interfaces, say wlan_nontx wlan_tx then ifup both, then delete wlan_tx (forcing wlan_nontx down) and then set wlan_nontx back up and back down or whatever, but the parent pointer wasn't cleared so ... bad things will happen? Maybe this stuff could even happen at the cfg80211 level? Might be useful for others too. johannes