Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp210855lqr; Wed, 5 Jun 2024 03:58:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVmTDsUB9iDO0q5WRUrrNnNf5QkRUdhmg8X/BbzIuZzDPvFB+3vKa+XN73CsS932ascE39o/nIYzE+8W12YeU/ycVA/jLT1Jp7tmimgZQ== X-Google-Smtp-Source: AGHT+IHFaPJWpwgZ/0WjLshucKN+BYC0JdHjNKppkYZQex78WNx/eGszw/CBbZo30F0/cw9oAPOt X-Received: by 2002:a05:622a:51:b0:43b:9f:5ac8 with SMTP id d75a77b69052e-44029ef09demr38605761cf.31.1717585128458; Wed, 05 Jun 2024 03:58:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717585128; cv=pass; d=google.com; s=arc-20160816; b=M8z8X1uA3abm19rL2yrUGwnPucSTOOVc3/yEyTt4qUiqGAAnf1/lQK29e9ClJHgDiy ae+G7/vnYsb0xSXDneFbp9vcN/NQZavGLlKsKD6cvlK9X0Zpla8Gf5y0RcQDlrWwwADG TPduS70wjfBYWLZnbkmxliTfP4L5XWae8Ikp5DHNtlm1lKILyPmUd2fL2xB22tBi0c4l UX/JxLmKUg6JpChTHbJ5AElVHoBkEbRYUGJrKMUaXrmVemTic/h48zkATIpg7uHkk1zl WUn8BAzyErBExgfB8NZfmNVqNHFhz+wFdk45clWHU0mUducrpqmmISORiX1G3c9QvJrd UnMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=JsycbAq00zbTP9PxUAaSe6ZMFiTbeNlhs0I0bYy9p2o=; fh=g+3Y9uv4pDRPkMKV6d1r8xi8IY9qiW75WcU571FAbLY=; b=OV9O2SaRoK3s2Ftikqm8/H2y44N1PtKaS99Wgz5pCj9QYEGbhYIlYdL9apdY1QxIh5 Mi/3be+8WB7iGdzPBkhXv+LHWwQSl/0n42qwuUUDoBshQ3jRyyf0bfSPekx3PDgKvmFe WL5sdzWwHBR3t+CSqwskQ0m+q1sBpsO0w/Q8SY0wTKJdHC5FvNAkkeyqivXfUbBgxGfH Gogtr6X0soevBxM79/h+gel/m2U8+P6jLhp/rrxCjx5c0chvO9Zn+8LKSpmOzzUvBDv2 nPC49JerlttZC4n7tKT5EnnqeCxu6ewuKEhrJJZIC4lSz+XdfGkqJ6C3qX3iE+V4n/OE uaNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=m6pC4gWG; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-wireless+bounces-8534-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8534-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-4401fe7d5a2si34336541cf.478.2024.06.05.03.58.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 03:58:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8534-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=m6pC4gWG; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-wireless+bounces-8534-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8534-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 183EE1C23A7D for ; Wed, 5 Jun 2024 10:58:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D142E192B87; Wed, 5 Jun 2024 10:57:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="m6pC4gWG" X-Original-To: linux-wireless@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 3786F1922F2 for ; Wed, 5 Jun 2024 10:57:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717585061; cv=none; b=SToeXT0FTtJydSBcs9HWNMVJgeAsY8rnyDZgvBbhd04UEXMGkO8FhigrIIvF1aZ4DLwCZ8Xn7FVbRce3L/B59iNK9PJxYxbCy7hlx6u59jWt1mz2JjZWSJFdaA+V4RdZZzeJlZg0fEFZQRld1F09M8hhADTEtMSf5+R+cI+kz+c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717585061; c=relaxed/simple; bh=rCpk1LBT6PF7wSafOMG3Md14Uqhe/SYjj01iVYfA0iY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UHM8cyGHqE5a4fq56mVNEIAok6YirgX3+F9TpNKuK0DjHSuuEl0IIyZPcKk87hNstP3vlpFC/STSGX3O8X8CqxctS9C7RSuE67doba++bBfoZN27SVLDyxPInPhmMxS6qhAU1SwUj6Joek9/6zn8FJG41yU4qNt+NE2CeGSwByQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=m6pC4gWG; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717585060; x=1749121060; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rCpk1LBT6PF7wSafOMG3Md14Uqhe/SYjj01iVYfA0iY=; b=m6pC4gWG7M9k/rAS3myX1lpfoKDxiaZGoGKM8TFVHN1mdvDkpplTHB1H mhqp2rmJjPIJ7sL4TUBeXiD4T+gw8DQ3lA8tN4RDlV9uMdG/USaPSdGWV 4SX1ra9f3Gh1Ob7MmKStaE6ubTSUGN+K78scfc5x68MpAB8WionIrgQ0Q x5ysEGjwC+A+JJf0Tv6Fd4VwseQD821H2KdME2hCKN88c1wqFywY15ZGN PVHjvcPm7PQp8/xIBdfZtvbcuikb7yjz8fnMx5CkZX0dKCfZ73ixv/trS iRSezvq8fhFLjatyWML9en4GWQpBd/s3pWEnFrKcPOvJ3GxxlHQjb1uA+ Q==; X-CSE-ConnectionGUID: k7j64ZbsTIehTdMMH0rQBQ== X-CSE-MsgGUID: UnS1UbgWRleSAvw0kbkOgA== X-IronPort-AV: E=McAfee;i="6600,9927,11093"; a="11919962" X-IronPort-AV: E=Sophos;i="6.08,216,1712646000"; d="scan'208";a="11919962" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2024 03:57:40 -0700 X-CSE-ConnectionGUID: LD5iPWggTgez6fRxMg61Dw== X-CSE-MsgGUID: MxssnEzWSCusyvm5S/BEOQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,216,1712646000"; d="scan'208";a="37563027" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2024 03:57:39 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Ilan Peer Subject: [PATCH 7/7] wifi: mac80211: Add support for interface usage notification Date: Wed, 5 Jun 2024 13:57:22 +0300 Message-Id: <20240605135233.4d602acf0e65.I01fecab3b41961038f37ca6e0e3039c5fe9bb6bf@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240605105722.2034610-1-miriam.rachel.korenblit@intel.com> References: <20240605105722.2034610-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited Content-Transfer-Encoding: 8bit From: Ilan Peer When user space indicates the intended usage of a network interface, propagate the information to the driver. Signed-off-by: Ilan Peer Signed-off-by: Miri Korenblit --- include/net/mac80211.h | 4 ++++ net/mac80211/cfg.c | 12 ++++++++++++ net/mac80211/driver-ops.h | 14 ++++++++++++++ net/mac80211/trace.h | 23 +++++++++++++++++++++++ 4 files changed, 53 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index ecfa65ade226..047dce69e79b 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -4438,6 +4438,7 @@ struct ieee80211_prep_tx_info { * if the requested TID-To-Link mapping can be accepted or not. * If it's not accepted the driver may suggest a preferred mapping and * modify @ttlm parameter with the suggested TID-to-Link mapping. + * @iface_usage: notify about intended usage of added interfaces. */ struct ieee80211_ops { void (*tx)(struct ieee80211_hw *hw, @@ -4822,6 +4823,9 @@ struct ieee80211_ops { enum ieee80211_neg_ttlm_res (*can_neg_ttlm)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_neg_ttlm *ttlm); + + void (*iface_usage)(struct ieee80211_hw *hw, + struct cfg80211_iface_usage *iface_usage); }; /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 890590146fa4..b121fc65eb09 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -5104,6 +5104,17 @@ ieee80211_set_ttlm(struct wiphy *wiphy, struct net_device *dev, return ieee80211_req_neg_ttlm(sdata, params); } +static void +ieee80211_iface_usage(struct wiphy *wiphy, struct net_device *dev, + struct cfg80211_iface_usage *iface_usage) +{ + struct ieee80211_local *local = wiphy_priv(wiphy); + + lockdep_assert_wiphy(wiphy); + + drv_iface_usage(local, iface_usage); +} + const struct cfg80211_ops mac80211_config_ops = { .add_virtual_intf = ieee80211_add_iface, .del_virtual_intf = ieee80211_del_iface, @@ -5217,4 +5228,5 @@ const struct cfg80211_ops mac80211_config_ops = { .del_link_station = ieee80211_del_link_station, .set_hw_timestamp = ieee80211_set_hw_timestamp, .set_ttlm = ieee80211_set_ttlm, + .iface_usage = ieee80211_iface_usage, }; diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index d4e73d3630e0..ccc697bd98ff 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -1728,4 +1728,18 @@ drv_can_neg_ttlm(struct ieee80211_local *local, return res; } + +static inline void drv_iface_usage(struct ieee80211_local *local, + struct cfg80211_iface_usage *iface_usage) +{ + might_sleep(); + + lockdep_assert_wiphy(local->hw.wiphy); + + trace_drv_iface_usage(local, iface_usage); + if (local->ops->iface_usage) + local->ops->iface_usage(&local->hw, iface_usage); + + trace_drv_return_void(local); +} #endif /* __MAC80211_DRIVER_OPS */ diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h index 8e758b5074bd..b2f2588c7f82 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -3145,6 +3145,29 @@ TRACE_EVENT(drv_neg_ttlm_res, LOCAL_PR_ARG, VIF_PR_ARG, __entry->res ) ); + +TRACE_EVENT(drv_iface_usage, + TP_PROTO(struct ieee80211_local *local, + struct cfg80211_iface_usage *iface_usage), + + TP_ARGS(local, iface_usage), + + TP_STRUCT__entry( + LOCAL_ENTRY + __field(u32, types_mask) + ), + + TP_fast_assign( + LOCAL_ASSIGN; + __entry->types_mask = iface_usage->types_mask; + ), + + TP_printk( + LOCAL_PR_FMT " types_mask=0x%x", + LOCAL_PR_ARG, __entry->types_mask + ) +); + #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */ #undef TRACE_INCLUDE_PATH -- 2.34.1