From patchwork Thu Dec 1 02:52:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 630632 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74DC7C47088 for ; Thu, 1 Dec 2022 02:52:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229722AbiLACw3 (ORCPT ); Wed, 30 Nov 2022 21:52:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbiLACw1 (ORCPT ); Wed, 30 Nov 2022 21:52:27 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6B64983A8 for ; Wed, 30 Nov 2022 18:52:26 -0800 (PST) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B125LiV032067; Thu, 1 Dec 2022 02:52:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=kEF06RjCjx4psyqvWs/4ymhbm3hsg5iAyoU71u6vdZY=; b=QnjPwVZHJoGfAjGXDUUGlwqD/Mrfc9BsYCX9CoKbecYoLd5yDyyym5dGowMNnko54azt fUZBr5KB8F1J2qN4YixOT/k/LFeuQcAFIgSO8kCrfnHdybkAEFMuVSeYQUmOU3ba7HPZ uNwVgpQnYXJAqFU/zU+YpRZV67mBklutO1VlN/U+y6poLQX7/xQd1FeCu9YgC9NimIN/ vbsnLgsqUC4KQwgeT8Z46nkEXP1CcHr0utP0+WuTWWz7s4skmok9zN3iG03EzW6+RNfP arLNSrmOhHchUaTu0cYFcVJKrx0UFlx5hMP7uhBhVVaAtJ/MefwKZ4GSSFsERKxr8EaA kA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3m6k5t82ug-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Dec 2022 02:52:23 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2B12qMu0020738 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 1 Dec 2022 02:52:22 GMT Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 30 Nov 2022 18:52:22 -0800 From: Aloka Dixit To: , Subject: [PATCH 1/3] wifi: mac80211_hwsim: move beacon transmission to a separate function Date: Wed, 30 Nov 2022 18:52:06 -0800 Message-ID: <20221201025208.23800-2-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221201025208.23800-1-quic_alokad@quicinc.com> References: <20221201025208.23800-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: XAJOqO-vN25bBkcSIywJrilDyb7Eb1y6 X-Proofpoint-ORIG-GUID: XAJOqO-vN25bBkcSIywJrilDyb7Eb1y6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-01_02,2022-11-30_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxlogscore=999 priorityscore=1501 suspectscore=0 spamscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212010015 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Move the beacon transmission to a separate function to facilitate addition of EMA beacon transmission. Signed-off-by: Aloka Dixit --- drivers/net/wireless/mac80211_hwsim.c | 61 ++++++++++++++++----------- 1 file changed, 36 insertions(+), 25 deletions(-) base-commit: eceb024ee3eed1bacb5c32a4847269f2685e2ea4 prerequisite-patch-id: fcf54cc59b71b15010a88a080ee2b5f91d815d51 diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index c57c8903b7c0..b18f992b6276 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -2054,38 +2054,18 @@ static void mac80211_hwsim_tx_frame(struct ieee80211_hw *hw, dev_kfree_skb(skb); } -static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac, - struct ieee80211_vif *vif) +static void __mac80211_hwsim_beacon_tx(struct ieee80211_bss_conf *link_conf, + struct mac80211_hwsim_data *data, + struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct sk_buff *skb) { - struct mac80211_hwsim_link_data *link_data = arg; - u32 link_id = link_data->link_id; - struct ieee80211_bss_conf *link_conf; - struct mac80211_hwsim_data *data = - container_of(link_data, struct mac80211_hwsim_data, - link_data[link_id]); - struct ieee80211_hw *hw = data->hw; struct ieee80211_tx_info *info; struct ieee80211_rate *txrate; struct ieee80211_mgmt *mgmt; - struct sk_buff *skb; /* TODO: get MCS */ int bitrate = 100; - hwsim_check_magic(vif); - - link_conf = rcu_dereference(vif->link_conf[link_id]); - if (!link_conf) - return; - - if (vif->type != NL80211_IFTYPE_AP && - vif->type != NL80211_IFTYPE_MESH_POINT && - vif->type != NL80211_IFTYPE_ADHOC && - vif->type != NL80211_IFTYPE_OCB) - return; - - skb = ieee80211_beacon_get(hw, vif, link_data->link_id); - if (skb == NULL) - return; info = IEEE80211_SKB_CB(skb); if (ieee80211_hw_check(hw, SUPPORTS_RC_TABLE)) ieee80211_get_tx_rates(vif, NULL, skb, @@ -2115,6 +2095,37 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac, mac80211_hwsim_tx_frame(hw, skb, rcu_dereference(link_conf->chanctx_conf)->def.chan); +} + +static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac, + struct ieee80211_vif *vif) +{ + struct mac80211_hwsim_link_data *link_data = arg; + u32 link_id = link_data->link_id; + struct ieee80211_bss_conf *link_conf; + struct mac80211_hwsim_data *data = + container_of(link_data, struct mac80211_hwsim_data, + link_data[link_id]); + struct ieee80211_hw *hw = data->hw; + struct sk_buff *skb; + + hwsim_check_magic(vif); + + link_conf = rcu_dereference(vif->link_conf[link_id]); + if (!link_conf) + return; + + if (vif->type != NL80211_IFTYPE_AP && + vif->type != NL80211_IFTYPE_MESH_POINT && + vif->type != NL80211_IFTYPE_ADHOC && + vif->type != NL80211_IFTYPE_OCB) + return; + + skb = ieee80211_beacon_get(hw, vif, link_id); + if (!skb) + return; + + __mac80211_hwsim_beacon_tx(link_conf, data, hw, vif, skb); while ((skb = ieee80211_get_buffered_bc(hw, vif)) != NULL) { mac80211_hwsim_tx_frame(hw, skb, From patchwork Thu Dec 1 02:52:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 630189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 510BBC4321E for ; Thu, 1 Dec 2022 02:52:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229708AbiLACw2 (ORCPT ); Wed, 30 Nov 2022 21:52:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229513AbiLACw1 (ORCPT ); Wed, 30 Nov 2022 21:52:27 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5C15983AE for ; Wed, 30 Nov 2022 18:52:26 -0800 (PST) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B12iQZV030118; Thu, 1 Dec 2022 02:52:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=d4uXprnrjFdCc0+8JsoIMTr3NRWCjRUfxZlZXrY80Yo=; b=pyAoyBPGbgN4Ht/mXQDHV1gfkAt5VFFxWKW/f2MgKZ2wFEi7/VTovwvpVdaPNs0LxZaD fWMvhZm06jmaI+6OXzKypV8zgBkf0KexnNMp3t/1w2Ca5FgTJDBsKTt81JyrIQeqDu81 G/PCXM7N3RkhVjQpWCbPbApp8eRp5+tZF1F9ievoDSdJDWYYpu3T2ulxdyRjRJKemRhS Po8aqm6rcvpYRBMfqzugRW8rTZOi5t0chb1jqhhnGmCFVZM6Y2cdcUyS97JUxD59q4A4 KaQLYwtF3dd2voJVoFRGqy4V87J8f3l5BL9Z8W5wXEMhPYhU6upfNSluBf0otcKvdGxU AA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3m6k2kr35q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Dec 2022 02:52:23 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2B12qM5c024051 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 1 Dec 2022 02:52:23 GMT Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 30 Nov 2022 18:52:22 -0800 From: Aloka Dixit To: , Subject: [PATCH 2/3] wifi: mac80211_hwsim: Multiple BSSID support Date: Wed, 30 Nov 2022 18:52:07 -0800 Message-ID: <20221201025208.23800-3-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221201025208.23800-1-quic_alokad@quicinc.com> References: <20221201025208.23800-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: Mp3MFmJ6tfXI8awSdRlzK9SZgJOKHsFR X-Proofpoint-GUID: Mp3MFmJ6tfXI8awSdRlzK9SZgJOKHsFR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-01_02,2022-11-30_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxscore=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 adultscore=0 phishscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212010015 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Advertise multiple BSSID support for up to 8 interfaces. Do not send beacons from the non-transmitting interfaces. Signed-off-by: Aloka Dixit --- drivers/net/wireless/mac80211_hwsim.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index b18f992b6276..7cf9a7a364be 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -2121,6 +2121,9 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac, vif->type != NL80211_IFTYPE_OCB) return; + if (vif->mbssid_tx_vif && vif->mbssid_tx_vif != vif) + return; + skb = ieee80211_beacon_get(hw, vif, link_id); if (!skb) return; @@ -4404,6 +4407,8 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, hw->wiphy->n_cipher_suites = param->n_ciphers; } + hw->wiphy->mbssid_max_interfaces = 8; + data->rx_rssi = DEFAULT_RX_RSSI; INIT_DELAYED_WORK(&data->roc_start, hw_roc_start); From patchwork Thu Dec 1 02:52:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 630188 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C119C47089 for ; Thu, 1 Dec 2022 02:52:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229635AbiLACwa (ORCPT ); Wed, 30 Nov 2022 21:52:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229705AbiLACw2 (ORCPT ); Wed, 30 Nov 2022 21:52:28 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73A849839D for ; Wed, 30 Nov 2022 18:52:27 -0800 (PST) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B12kfOI024855; Thu, 1 Dec 2022 02:52:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=Gc2S0dJUIa34vCMw1GHfTu7httUkczYJbzaKcc5c6bc=; b=k+N4Mys+o2xbYJ4zY0Ip7uBCc78AqyvfbA99sOMTwVGYwWX9wlpM8jFXej7Yr3Wnn+Ga 9IDWqa9HCcJ4fT78bu6vZevJsvQiLELTxDJUvzGAoo51fJ47RYQhVhVKQ/7CbNeII+Ub 58Yga761ait88J8IzCqzgqQZNxl0WC3EDLe+AufD9o1AXK587HaGjuMKaajS8tcW8c1U c/6rmh4w7315ckBz3FAcIcWGBfsxU/Qeb09XkZUvlAgHsv4dPg2I2i1ABKqy1hmURwl8 Y74AhL+GhPvaFJ+GySlnl+jOqGiHctBvYW+/AbAhz7cRqiX5DVE2DxbOpzB5QoDt/Glx sg== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3m6k3yg2gj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Dec 2022 02:52:24 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2B12qNbQ014150 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 1 Dec 2022 02:52:23 GMT Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 30 Nov 2022 18:52:22 -0800 From: Aloka Dixit To: , Subject: [PATCH 3/3] wifi: mac80211_hwsim: EMA support Date: Wed, 30 Nov 2022 18:52:08 -0800 Message-ID: <20221201025208.23800-4-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221201025208.23800-1-quic_alokad@quicinc.com> References: <20221201025208.23800-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: C9cHXXuS3fvWGEs8FIA8-s7qbHKYFDaP X-Proofpoint-ORIG-GUID: C9cHXXuS3fvWGEs8FIA8-s7qbHKYFDaP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-01_02,2022-11-30_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 mlxlogscore=925 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212010015 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add support enhanced multi-BSS advertisements (EMA) for profile periodicity up to 3 beacons. Signed-off-by: Aloka Dixit --- v1: depends on following https://patchwork.kernel.org/project/linux-wireless/patch/20221114201912.22893-2-quic_alokad@quicinc.com/ drivers/net/wireless/mac80211_hwsim.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) -- 2.25.1 diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 7cf9a7a364be..00b92d2936de 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -2124,11 +2124,27 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac, if (vif->mbssid_tx_vif && vif->mbssid_tx_vif != vif) return; - skb = ieee80211_beacon_get(hw, vif, link_id); - if (!skb) - return; + if (vif->bss_conf.ema_ap) { + struct ieee80211_ema_beacons *ema; + u8 i = 0; + + ema = ieee80211_beacon_get_template_ema_list(hw, vif, link_id); + if (!ema || !ema->cnt) + return; + + for (i = 0; i < ema->cnt; i++) { + __mac80211_hwsim_beacon_tx(link_conf, data, hw, vif, + ema->bcn[i].skb); + ema->bcn[i].skb = NULL; /* Already freed */ + } + ieee80211_beacon_free_ema_list(ema); + } else { + skb = ieee80211_beacon_get(hw, vif, link_id); + if (!skb) + return; - __mac80211_hwsim_beacon_tx(link_conf, data, hw, vif, skb); + __mac80211_hwsim_beacon_tx(link_conf, data, hw, vif, skb); + } while ((skb = ieee80211_get_buffered_bc(hw, vif)) != NULL) { mac80211_hwsim_tx_frame(hw, skb, @@ -4408,6 +4424,7 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, } hw->wiphy->mbssid_max_interfaces = 8; + hw->wiphy->ema_max_profile_periodicity = 3; data->rx_rssi = DEFAULT_RX_RSSI;