Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp739763rwd; Thu, 8 Jun 2023 07:10:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6nsPJxH/dJh/mXzJ6i2O92K7vyVc59oa+5JNF2ahS1GdHEIReQn3hSdTjhk/kLIZ1zhDNw X-Received: by 2002:a17:90b:2306:b0:258:ddc1:f3a9 with SMTP id mt6-20020a17090b230600b00258ddc1f3a9mr2497696pjb.17.1686233434055; Thu, 08 Jun 2023 07:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686233434; cv=none; d=google.com; s=arc-20160816; b=wfpU5oR4+djnN2QV5kib/e5GUr9urfCJ9EviC1EFvZUCt9fmbaTNZhjCGFQWsJLRjQ 919Ayx5QsSZB/+IMzXojdHMDZ+799mZZIQ2FccTBFcbZuGgBTnT3Bq6AvHEvyR3rcHnT Ukg3enWc5bHaVGPaQ7wZaSP7Ngxn8fp42GR+X9Qqa3ZcPPBl2wGmKoF+ds8U28FSlRvH 5/jifRnxZQszVJR4ik2TfiQQhD22VCqeLcSXhBFOrxyrghhc4uriVHxeJOReIkMLupnj bfhZlzhECsoh+NDWI0tPoD3ZZQRuoiBBVqJNqJJ4LXjGvsuc2qmpLZU4syNIOaQ7nPcI /Tsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UwY+dCIAy5IywQIYQCYIcg2U/7IOiOoDm9pHl4Ek+q0=; b=ViyvifD9owDBIKhSGrEXVr0b0lE9AcBp59McIsk403J2KMW5IXyPUqh4HPhx+Hzy8y CyVxaAttCZZoVbvjBNcrwQYdlsYV9u4d5CXcOZhTp235aub4fMHx/JW9Wp4zlQZyuUqQ SWD/RH4JSDAK9SQ1KPlfM09ca+lSVet7G4EgnwjxYSQ5t4oDDJ9NwStUNlHFC8cuE36A +hIH5WPQzsn1L9kgkQNzMrwfRgmJcO9GdBYazbMK63rvYyOHB+erG3XK5H/n3lwrhlTB 2cyX4NqfyDSaVRp6r0k0cSP0wuYzG6P2oRyxAqnnrmhHIGGXI04zEvoreBpDbqlVS2ET c9pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RxAnqlTC; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cv16-20020a17090afd1000b002565ad7d177si1116565pjb.93.2023.06.08.07.10.25; Thu, 08 Jun 2023 07:10:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RxAnqlTC; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236857AbjFHOHY (ORCPT + 61 others); Thu, 8 Jun 2023 10:07:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236835AbjFHOHP (ORCPT ); Thu, 8 Jun 2023 10:07:15 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC69C26AD for ; Thu, 8 Jun 2023 07:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686233234; x=1717769234; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OhFpFWrk6tYA6L0xTgfTzoFw9oV/QpDxC5iZDJQVL+0=; b=RxAnqlTCp6yqyp20fLSGn18p1cs07JInjSRdmWxABcBYViXwnvp8udku MsYOnPlhGhfMQJNf9IoJ+yTd4Oocw00q0mXW8yIwBhuk6fihqvMGuF4V0 7qvMMGyvWBlrqrv8miJINJzd6A/7F1M8/KuFI11suA8mBcomh05oscxmc ACn2Yrz6LGGL9Y0qOekc8fTZQA6TMuA+S9kR9Hg0pNNkxuZSavHPxjBop SwiKjWYKFlnoOlfw9t32mcbnXOHAdTNJHo1C7nS054QCz7d2Srzj8tgfl XrxDjuGYE8TwXNwQm0s9i+S9B+ugKQww2/lzTB6R9uLAo2TeqjKV3TDqW w==; X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="423176237" X-IronPort-AV: E=Sophos;i="6.00,226,1681196400"; d="scan'208";a="423176237" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 06:36:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="956706249" X-IronPort-AV: E=Sophos;i="6.00,226,1681196400"; d="scan'208";a="956706249" Received: from unknown (HELO ggreenma-mobl2.intel.com) ([10.249.94.100]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 06:36:39 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 08/15] wifi: cfg80211: remove links only on AP Date: Thu, 8 Jun 2023 16:36:04 +0300 Message-Id: <20230608163202.ed65b94916fa.I2458c46888284cc5ce30715fe642bc5fc4340c8f@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230608133611.1303724-1-gregory.greenman@intel.com> References: <20230608133611.1303724-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg Since links are only controlled by userspace via cfg80211 in AP mode, also only remove them from the driver in that case. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- net/wireless/util.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/net/wireless/util.c b/net/wireless/util.c index 3bc0c3072e78..9755ef281040 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -5,7 +5,7 @@ * Copyright 2007-2009 Johannes Berg * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright 2017 Intel Deutschland GmbH - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation */ #include #include @@ -2558,6 +2558,13 @@ void cfg80211_remove_links(struct wireless_dev *wdev) { unsigned int link_id; + /* + * links are controlled by upper layers (userspace/cfg) + * only for AP mode, so only remove them here for AP + */ + if (wdev->iftype != NL80211_IFTYPE_AP) + return; + wdev_lock(wdev); if (wdev->valid_links) { for_each_valid_link(wdev, link_id) -- 2.38.1