Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1031463rdb; Tue, 30 Jan 2024 06:10:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IH6b47OOqs9VXPmhsIrfe1d2V5sQCT3EFHO/AxUrbBc3Xtdtnb/ymWqNlrDh01O0LdmFAjL X-Received: by 2002:a2e:b8c4:0:b0:2cd:3b6:b3d7 with SMTP id s4-20020a2eb8c4000000b002cd03b6b3d7mr6574590ljp.34.1706623821984; Tue, 30 Jan 2024 06:10:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706623821; cv=pass; d=google.com; s=arc-20160816; b=NRL14U+ALOE8lEYlE1TSA4UWbC+bbQ5sx/aQ7apsP1tolcO9zmKxZqfP/1SP+OHpwD lUGzezwcwrS4eKF/v1LLLu2b3svnz+F3AUEkGOjoFyWvVqWfGIaSJA2dh6ezYSKhqDVq AZCJqUOV0JPRmKmwZWifwRCV4knMHcFXeN7CNso+4V8r8paQFUKxgTp7T4VaNMt8QdfX 44PQxAdYhqS3qFTZFDDNcBabU8t+SJEZPJ7WRxNDsC6MU/XtuHthzN/cQugaeUXxm+jr 3kvgLtAYBUnmAmnd50IEKPT69CkbARCdrO9DUlWI86lL8VwDNxQJp2K7BMlh0yJ0BTTv MOlA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=zV/iQL/TKjestXeL37rW3NBpSqTIlAwAUQrlGdG3L2o=; fh=QXKxzwwaU5r4TinewZ8xfkRqLgvDJekB9tQDjtpqWj4=; b=yI4kGWtk/ZzWZ1PpnJDaCNjqbP907MFAxf2p1tF0Q0yScfHWM4Jv3fNSysBgBc7hdl febyF/Q//bwNE0KxGGmXBa9WyuVtf4O16V0RYQKdhN5PIvdfJ9HwCG1YmFYmJR1Y9p1O Erl588Hu8AxntA+x1x87mk4kZPUnzqWQW/2nypRck4jMSyvlEvr3aCmAlX201AV4sjzb kKsGSp3O+H0+LOOM2ZXRbxkODavTL4UPuPU4WwQ6d0Pnhk6oimezzHSsaipyPvLVZwkB KPiANVb/03xPAgPvWlk9fPiQ9GzvOnotAoTwqyKuVG2oGMugpf5nKF3756U84Y+MyF6U rotw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=cUZiURSZ; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-2819-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2819-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=1; AJvYcCXYSycnd2S9zjFPmEj6Ko/h7ICc0wlN2+en3jRHyEHEZCZVCWdszLHntjB7XEx0YlmW2P8wYNXk67MjrDF6NnDV9uYo6wElufNYusctNA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bl19-20020a056402211300b0055ef9a173fdsi2099597edb.546.2024.01.30.06.10.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 06:10:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2819-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=cUZiURSZ; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-2819-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2819-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8F2A01F262D5 for ; Tue, 30 Jan 2024 14:10:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 586626DD04; Tue, 30 Jan 2024 14:09:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="cUZiURSZ" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 CB4156DD00 for ; Tue, 30 Jan 2024 14:09:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706623793; cv=none; b=KmVyxb46oYrgz5bnlzWD7DVAsb0bCSjeCEPqwRZYjFC+03TFai0nqFO3RPSB6/XOEjZp5JZyLn8xSSCSwwnsCym+QBjfRAU2Y3SgfZXFPRTJP1V+o7ggR1zL6aoDTEzP8qwilhgChvxzJTL5z1KdbTDAjMS8+NnKnkduFO6Fgf0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706623793; c=relaxed/simple; bh=2Vb5PpaA/nZM+7IVvvez4KOOixONpKrnSTklsgX3nKI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FYtBlUO5E7Y1qo2iqRqKe7+zDn3aOmaBRRlouQ5oIR8dc+mzG8LsGIl8LbOQg5+vOOpZWIaOwjOv2kh/Cuf+9HfL76eyxxgjGVWS2calqGDmqsiwlkCWyMZJvtDW6lTorkJssHY8DjEi27z+5wGoe5Q6adGKU8ddvaKmMth+keE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=cUZiURSZ; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40UDvEUs017225; Tue, 30 Jan 2024 14:09:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=zV/iQL/TKjestXeL37rW3NBpSqTIlAwAUQrlGdG3L2o=; b=cU ZiURSZNzuakFgP0RLUlekOe/WvpmzEuwDoGBSfKqNlKVIraxP6+Pq3qfhjTJv+cN RiE/XEdxfvcefjrS2wL1hKuRYM++h073ec6/EVXoN+TIBj+y4IWZ64R89nKLmaG4 2tWuOjkBCokeYo4Wv20DNGbfF9VH8p8XKG/ishL83kzzXvb0uk2DWdM4WxBh+vzO 42ahGEc0Y1B6w1lxEiuYWTM88NBz5mzwSJtdIlBm6aq6qfXfCdEEGMpd4Tqu8XOg EJAFmO+RritgPtM1ikZjVNFu1v5BwWx6m9iXpk6WGHxPuN84lY7jmpd86R5CZQyr iezqjSSpk6Wnii25M8MQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vxupk8ynh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jan 2024 14:09:47 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40UE9lAv030349 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jan 2024 14:09:47 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 30 Jan 2024 06:09:45 -0800 From: Aditya Kumar Singh To: CC: , Aditya Kumar Singh Subject: [PATCH v8 3/5] wifi: mac80211: handle set csa/after_csa beacon on per link basis Date: Tue, 30 Jan 2024 19:39:16 +0530 Message-ID: <20240130140918.1172387-4-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240130140918.1172387-1-quic_adisi@quicinc.com> References: <20240130140918.1172387-1-quic_adisi@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: ebQXggkvB6zoMLL1fldY2A_BlFVeNlBF X-Proofpoint-ORIG-GUID: ebQXggkvB6zoMLL1fldY2A_BlFVeNlBF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-30_07,2024-01-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 malwarescore=0 impostorscore=0 priorityscore=1501 clxscore=1015 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 suspectscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401190000 definitions=main-2401300104 In order to support CSA with MLO, there is a need to handle the functions ieee80211_set_csa_beacon() and ieee80211_set_after_csa_beacon() on a per link basis. Implement this by making the function argument accept the the link data instead of the sdata. Currently, deflink would only be passed. Proper link data will be passed in a subsequent patch. Signed-off-by: Aditya Kumar Singh --- net/mac80211/cfg.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index dd237081dbe3..a5d510932cbe 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3586,20 +3586,21 @@ void ieee80211_channel_switch_disconnect(struct ieee80211_vif *vif, bool block_t } EXPORT_SYMBOL(ieee80211_channel_switch_disconnect); -static int ieee80211_set_after_csa_beacon(struct ieee80211_sub_if_data *sdata, +static int ieee80211_set_after_csa_beacon(struct ieee80211_link_data *link_data, u64 *changed) { + struct ieee80211_sub_if_data *sdata = link_data->sdata; int err; switch (sdata->vif.type) { case NL80211_IFTYPE_AP: - if (!sdata->deflink.u.ap.next_beacon) + if (!link_data->u.ap.next_beacon) return -EINVAL; - err = ieee80211_assign_beacon(sdata, &sdata->deflink, - sdata->deflink.u.ap.next_beacon, + err = ieee80211_assign_beacon(sdata, link_data, + link_data->u.ap.next_beacon, NULL, NULL, changed); - ieee80211_free_next_beacon(&sdata->deflink); + ieee80211_free_next_beacon(link_data); if (err < 0) return err; @@ -3658,7 +3659,7 @@ static int __ieee80211_csa_finalize(struct ieee80211_link_data *link_data) sdata->vif.bss_conf.csa_active = false; - err = ieee80211_set_after_csa_beacon(sdata, &changed); + err = ieee80211_set_after_csa_beacon(&sdata->deflink, &changed); if (err) return err; @@ -3717,18 +3718,19 @@ void ieee80211_csa_finalize_work(struct wiphy *wiphy, struct wiphy_work *work) ieee80211_csa_finalize(link); } -static int ieee80211_set_csa_beacon(struct ieee80211_sub_if_data *sdata, +static int ieee80211_set_csa_beacon(struct ieee80211_link_data *link_data, struct cfg80211_csa_settings *params, u64 *changed) { + struct ieee80211_sub_if_data *sdata = link_data->sdata; struct ieee80211_csa_settings csa = {}; int err; switch (sdata->vif.type) { case NL80211_IFTYPE_AP: - sdata->deflink.u.ap.next_beacon = + link_data->u.ap.next_beacon = cfg80211_beacon_dup(¶ms->beacon_after); - if (!sdata->deflink.u.ap.next_beacon) + if (!link_data->u.ap.next_beacon) return -ENOMEM; /* @@ -3754,7 +3756,7 @@ static int ieee80211_set_csa_beacon(struct ieee80211_sub_if_data *sdata, IEEE80211_MAX_CNTDWN_COUNTERS_NUM) || (params->n_counter_offsets_presp > IEEE80211_MAX_CNTDWN_COUNTERS_NUM)) { - ieee80211_free_next_beacon(&sdata->deflink); + ieee80211_free_next_beacon(link_data); return -EINVAL; } @@ -3764,11 +3766,11 @@ static int ieee80211_set_csa_beacon(struct ieee80211_sub_if_data *sdata, csa.n_counter_offsets_presp = params->n_counter_offsets_presp; csa.count = params->count; - err = ieee80211_assign_beacon(sdata, &sdata->deflink, + err = ieee80211_assign_beacon(sdata, link_data, ¶ms->beacon_csa, &csa, NULL, changed); if (err < 0) { - ieee80211_free_next_beacon(&sdata->deflink); + ieee80211_free_next_beacon(link_data); return err; } @@ -3928,7 +3930,7 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, if (sdata->vif.bss_conf.color_change_active) ieee80211_color_change_abort(sdata); - err = ieee80211_set_csa_beacon(sdata, params, &changed); + err = ieee80211_set_csa_beacon(&sdata->deflink, params, &changed); if (err) { ieee80211_link_unreserve_chanctx(&sdata->deflink); goto out; -- 2.25.1