Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp94556lqh; Mon, 6 May 2024 12:20:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUvIP6N+/QVVz4rvzz74O+2280WQX9834ds0ggUcRyW9N/ddG2SIKHM1ez5Wkc6Rj2hjitBmdjeC8E2R9Yv+EQvAOz+bnvFIoOaNysXkA== X-Google-Smtp-Source: AGHT+IGR3JxeLMJMHoiY5gnNse1RIIPSQ63gPPmbHdWBS19grSBt+37M/chxXsdPtfEAoTjnl+OA X-Received: by 2002:a05:6a20:9f9a:b0:1a7:8610:bccd with SMTP id mm26-20020a056a209f9a00b001a78610bccdmr14791197pzb.57.1715023220560; Mon, 06 May 2024 12:20:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715023220; cv=pass; d=google.com; s=arc-20160816; b=aCV2emHFvdwjkcYlFStsEEPIbBraSFlrcpsCNpxBAnsHQjCZMZtuTYb8cwHiEwPJt4 cZ63BVeghE+f/EmBs+4HItwANJlX39pQMhx/OvA7M88ttkhzOZDLb68d0EH8AOLtkmTQ +tQtEABZMX/wLpEJP/1zBMeVnVrGUMWm9qXrCyuDMfPvzfy4tnXk86I71rR6A6vSbvzU UkP3ufTVwKF1fNcAz6epMaAnPtYeGMoGYbbaUwZx99TkP8v8DLL/V6fVUinTnA4CoT8u OeAHAPLlrXKknF7bhf7Xdki7IHVFoTr1r5zgCcqLc/IjN65JqD+wYpAvWIWuz1Gst46L Q8fA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=rtblHLXMoIuLQOqJcXFxi4KtnNHksMzzdAa3PnppvpA=; fh=0ZKV22Mpi0Z+/zRlCC9GRUAKl0wLMxmYgR1nXO1NAEs=; b=nzpJe8qeIBVtiZWUhVRTqcRU1APTyE/0/EzeYmgt0r3JaZoZ5EfdfToAE0ALJDGf+1 A+Wovoz7UUBWYcPpDCu0Icbyy80qIw1AYQ3sEut3b3Bh3yIahuqN8W0lwXdai4n9QNfM ZFCOV+FfknpW5vn5388r5Q98h3gD4MLaPo0lOko8HVzvjxCjpoZKf9NsKMGR2jqmJyzs UJ2VFPYbXdXnbSvelrYoHyPvZ2wACLluMgZaxTzX80tw2LzoZSUWMCLTCeXSinZoPqag TNJ4R8Gy3MVC9h9NvKdkZs67RFjcUT94qH2y6pIDOEfH+BRv5LVT/GTiFVU865xv5QgZ 6UuQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=SHXULqIb; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-7243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7243-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id b7-20020a056a000cc700b006f4595981e0si5509238pfv.209.2024.05.06.12.20.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 12:20:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=SHXULqIb; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-7243-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7243-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1E9B828437C for ; Mon, 6 May 2024 19:19:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B68B13DDD8; Mon, 6 May 2024 19:19:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="SHXULqIb" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D841A13C69F for ; Mon, 6 May 2024 19:19:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715023181; cv=none; b=BrUsbdV03hR/tWB7BIROosvE3U9xCSsz1Yfmzezp5XHU560WKoatAS39Q0QbMm/9VZ0PC0NlIHVDgPVws1EXW5XJgiSNAP7DCh32BhWagLn6wp952JDMX8VRBFWpQnraph+3nDi4+kYR5+3qbb9EiuPxjDBuJG28nx9fOgjjpDQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715023181; c=relaxed/simple; bh=I2jxgKXaZiWm56yioXnPJyVLju5sjHSKYM3jexzR4v0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nUGxIO4RGMj2gElinV5Ibfo/1L+JkOz7y+9oA6p7zyIMgGG2pYw6X+Ync+VonNpXN4q5gs42KL+fegpl37AICoKa2BKCukr5jfxM9m0/hEe3OK0/gUF2jfoKLBhJfFl5HNcPX/3yFXaGGXkISGd6qH95287wRvMjitFQLcyttfg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=SHXULqIb; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=rtblHLXMoIuLQOqJcXFxi4KtnNHksMzzdAa3PnppvpA=; t=1715023179; x=1716232779; b=SHXULqIbiX/jSYQnsm5o0FCq49kAMN1SjEIKuKQ07SzeIcdl7DjrrsfeHg6iq2HQYyXhKoZe0v9 jQjBWc+7sQ5w9j5MjYEkIstZjzht19NsjDhCE3Plf5ZKnk1xJEAYA8yHIWFRqqEWAtk1MBGoT5mrB juBPDvCqnxTneM9tdLGSuLhlSPUY0y6Y0z6UQu2+4vqn1GCVl4FzLWgjiB5YSpMAOKe13girP1AAs MvtEkO+Z3TH3uV9Cp4xJg+cQe3cdNPOrGTzcAmq0fMhPCKvYSYalVdvFafFqvXexepfdwoJTJ+Bwe 69Gi+HVUkZ/ijVJ6TiNVuCPQx9/2XVvdH1qA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1s43s8-00000008AR0-38ZJ; Mon, 06 May 2024 21:19:36 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg , Miriam Rachel Korenblit Subject: [PATCH] wifi: mac80211: remove extra link STA functions Date: Mon, 6 May 2024 21:19:34 +0200 Message-ID: <20240506211934.9759564a25f4.I88d43aa459d15c1d6230152e76b7757c2cdd6085@changeid> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg There's no need to have a lockdep assert and then call another function, just move everything into one place. Reviewed-by: Miriam Rachel Korenblit Signed-off-by: Johannes Berg --- net/mac80211/cfg.c | 69 ++++++++++++++++------------------------------ 1 file changed, 23 insertions(+), 46 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index bbb07ba8793b..0ed7e8bbf5c0 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -4974,13 +4974,17 @@ static void ieee80211_del_intf_link(struct wiphy *wiphy, ieee80211_vif_set_links(sdata, wdev->valid_links, 0); } -static int sta_add_link_station(struct ieee80211_local *local, - struct ieee80211_sub_if_data *sdata, - struct link_station_parameters *params) +static int +ieee80211_add_link_station(struct wiphy *wiphy, struct net_device *dev, + struct link_station_parameters *params) { + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + struct ieee80211_local *local = wiphy_priv(wiphy); struct sta_info *sta; int ret; + lockdep_assert_wiphy(local->hw.wiphy); + sta = sta_info_get_bss(sdata, params->mld_mac); if (!sta) return -ENOENT; @@ -5005,51 +5009,35 @@ static int sta_add_link_station(struct ieee80211_local *local, return ieee80211_sta_activate_link(sta, params->link_id); } -static int -ieee80211_add_link_station(struct wiphy *wiphy, struct net_device *dev, - struct link_station_parameters *params) -{ - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); - struct ieee80211_local *local = wiphy_priv(wiphy); - - lockdep_assert_wiphy(sdata->local->hw.wiphy); - - return sta_add_link_station(local, sdata, params); -} - -static int sta_mod_link_station(struct ieee80211_local *local, - struct ieee80211_sub_if_data *sdata, - struct link_station_parameters *params) -{ - struct sta_info *sta; - - sta = sta_info_get_bss(sdata, params->mld_mac); - if (!sta) - return -ENOENT; - - if (!(sta->sta.valid_links & BIT(params->link_id))) - return -EINVAL; - - return sta_link_apply_parameters(local, sta, false, params); -} - static int ieee80211_mod_link_station(struct wiphy *wiphy, struct net_device *dev, struct link_station_parameters *params) { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_local *local = wiphy_priv(wiphy); + struct sta_info *sta; - lockdep_assert_wiphy(sdata->local->hw.wiphy); + lockdep_assert_wiphy(local->hw.wiphy); - return sta_mod_link_station(local, sdata, params); + sta = sta_info_get_bss(sdata, params->mld_mac); + if (!sta) + return -ENOENT; + + if (!(sta->sta.valid_links & BIT(params->link_id))) + return -EINVAL; + + return sta_link_apply_parameters(local, sta, false, params); } -static int sta_del_link_station(struct ieee80211_sub_if_data *sdata, - struct link_station_del_parameters *params) +static int +ieee80211_del_link_station(struct wiphy *wiphy, struct net_device *dev, + struct link_station_del_parameters *params) { + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct sta_info *sta; + lockdep_assert_wiphy(sdata->local->hw.wiphy); + sta = sta_info_get_bss(sdata, params->mld_mac); if (!sta) return -ENOENT; @@ -5066,17 +5054,6 @@ static int sta_del_link_station(struct ieee80211_sub_if_data *sdata, return 0; } -static int -ieee80211_del_link_station(struct wiphy *wiphy, struct net_device *dev, - struct link_station_del_parameters *params) -{ - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); - - lockdep_assert_wiphy(sdata->local->hw.wiphy); - - return sta_del_link_station(sdata, params); -} - static int ieee80211_set_hw_timestamp(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_set_hw_timestamp *hwts) -- 2.44.0