Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2234492/?format=api
{ "id": 2234492, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2234492/?format=api", "web_url": "http://patchwork.ozlabs.org/project/hostap/patch/20260507192335.f4aeb39e5c73.I00c6f374083c341bad0850abe9458dc1a4e0defb@changeid/", "project": { "id": 22, "url": "http://patchwork.ozlabs.org/api/1.2/projects/22/?format=api", "name": "HostAP Development", "link_name": "hostap", "list_id": "hostap.lists.infradead.org", "list_email": "hostap@lists.infradead.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260507192335.f4aeb39e5c73.I00c6f374083c341bad0850abe9458dc1a4e0defb@changeid>", "list_archive_url": null, "date": "2026-05-07T17:21:28", "name": "[v3,01/12] common: put hostapd_set_freq_params() inputs into a struct", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "551120318d99a644df8520ea17bffcb25f0827cc", "submitter": { "id": 265, "url": "http://patchwork.ozlabs.org/api/1.2/people/265/?format=api", "name": "Johannes Berg", "email": "johannes@sipsolutions.net" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/hostap/patch/20260507192335.f4aeb39e5c73.I00c6f374083c341bad0850abe9458dc1a4e0defb@changeid/mbox/", "series": [ { "id": 503235, "url": "http://patchwork.ozlabs.org/api/1.2/series/503235/?format=api", "web_url": "http://patchwork.ozlabs.org/project/hostap/list/?series=503235", "date": "2026-05-07T17:21:28", "name": "some UHR support", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/503235/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2234492/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2234492/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=P956FpFH;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n secure) header.d=sipsolutions.net header.i=@sipsolutions.net\n header.a=rsa-sha256 header.s=mail header.b=CoxWsDek;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gBJzS6J3Lz1yKd\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 03:25:08 +1000 (AEST)", "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux))\n\tid 1wL2Rv-00000004SQX-2jf3;\n\tThu, 07 May 2026 17:23:47 +0000", "from s3.sipsolutions.net ([2a01:4f8:242:246e::2]\n helo=sipsolutions.net)\n\tby bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux))\n\tid 1wL2Rt-00000004SPC-261o\n\tfor hostap@lists.infradead.org;\n\tThu, 07 May 2026 17:23:46 +0000", "by sipsolutions.net with esmtpsa\n (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim 4.98.2)\n\t(envelope-from <johannes@sipsolutions.net>)\n\tid 1wL2Rq-000000045pG-1SKr;\n\tThu, 07 May 2026 19:23:42 +0200" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=P9G/UkoXhL9J7e+IN/43yRI3YFoMOSbBnMi+n9dh6eQ=; b=P956FpFHAguumi\n\tFTqzndz4PcuwHYKHOU5eCLu+3oNlvv3SikQTKFLpXANntUMYYnTF4P0OAViV8daYoyD3kEVl//yoQ\n\tj9OCHsTX3lQ6YZKo0gh/Ajow1E6Aapl5NxFLm02SjZZ0rJW4zs9o7Iac3wACOXDyRgZlDCo2+Y+FC\n\t0GhmKD9pJ7SL7bSF3qMXlQNnIAYBmMfvTmBzAvkUbziirezT66Zq+/cB/Z4uk/sz+shW0jElEzINi\n\thQbTJ2zSGHwVEldqtX7l/SS/KyxJbI8twSiKMb+ZMMpVZVvYNi6H+FecU9P9908r0CwI2H90UCGEw\n\tlMpiBrFyd6ZBKRvB0Bcg==;", "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version:\n\tReferences:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender\n\t:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To:\n\tResent-Cc:Resent-Message-ID; bh=FIOD1i8GL7SyUl7zt3ijh4cXF6inHHNJTZVCesCqW/Q=;\n\tt=1778174625; x=1779384225; b=CoxWsDek3m6UuDNM8lURtOrKqphKAEBnWWYRkXTg2EtjthD\n\th3q4gAxxYFys7PVqHj7Fi7bzJ/LkBE2sWZn1x60Rx06EJnffSBgj0012xXjK+jVcpyvoHpSFL3cx+\n\tspSgbV/tMq9qaJUwfUWARsG69hRPWAZfAsaybRikEpn0gRZb9VRrgPnASxipYchAeVGl0hmOd383W\n\tUXMqk8H4dIJ1Kqb6Bh5FjgeNLyIduwCmaGQYnKhd6Ple0db21z4ZtShgVn92pH+lNCmJWlldwuHTv\n\teImlVg7qY2dY2wFkQpO2Ft0FCgE6QdDMugqmhL+uOnfK7dcSdSNGfjRkE7EO7C9Q==;" ], "From": "Johannes Berg <johannes@sipsolutions.net>", "To": "hostap@lists.infradead.org", "Cc": "Johannes Berg <johannes.berg@intel.com>", "Subject": "[PATCH v3 01/12] common: put hostapd_set_freq_params() inputs into a\n struct", "Date": "Thu, 7 May 2026 19:21:28 +0200", "Message-ID": "\n <20260507192335.f4aeb39e5c73.I00c6f374083c341bad0850abe9458dc1a4e0defb@changeid>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260507172335.546456-14-johannes@sipsolutions.net>", "References": "<20260507172335.546456-14-johannes@sipsolutions.net>", "MIME-Version": "1.0", "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 ", "X-CRM114-CacheID": "sfid-20260507_102345_831850_35D9B88A ", "X-CRM114-Status": "GOOD ( 17.88 )", "X-Spam-Score": "-2.1 (--)", "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam. The original\n message has been attached to this so you can view it or label\n similar future email. If you have any questions, see\n the administrator of that system for details.\n Content preview: From: Johannes Berg <johannes.berg@intel.com> This function\n prototype has grown unchecked,\n and really isn't sustainable any longer. Move\n all the arguments into a struct. type=cleanup ticket=none\n Content analysis details: (-2.1 points, 5.0 required)\n pts rule name description\n ---- ----------------------\n --------------------------------------------------\n 0.0 SPF_NONE SPF: sender does not publish an SPF Record\n 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record\n -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from\n envelope-from domain\n -0.1 DKIM_VALID Message has at least one valid DKIM or DK\n signature\n -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n author's\n domain\n 0.1 DKIM_SIGNED Message has a DKIM or DK signature,\n not necessarily valid\n -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%\n [score: 0.0000]\n -0.0 DMARC_PASS DMARC pass policy", "X-BeenThere": "hostap@lists.infradead.org", "X-Mailman-Version": "2.1.34", "Precedence": "list", "List-Id": "<hostap.lists.infradead.org>", "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/hostap>,\n <mailto:hostap-request@lists.infradead.org?subject=unsubscribe>", "List-Archive": "<http://lists.infradead.org/pipermail/hostap/>", "List-Post": "<mailto:hostap@lists.infradead.org>", "List-Help": "<mailto:hostap-request@lists.infradead.org?subject=help>", "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/hostap>,\n <mailto:hostap-request@lists.infradead.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "\"Hostap\" <hostap-bounces@lists.infradead.org>", "Errors-To": "hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org" }, "content": "From: Johannes Berg <johannes.berg@intel.com>\n\nThis function prototype has grown unchecked, and really isn't\nsustainable any longer. Move all the arguments into a struct.\n\ntype=cleanup\nticket=none\n\nSigned-off-by: Johannes Berg <johannes.berg@intel.com>\n---\n src/ap/ap_drv_ops.c | 59 +++++++++++++++++++++------------\n src/ap/beacon.c | 36 ++++++++++++--------\n src/ap/dfs.c | 39 ++++++++++++----------\n src/ap/hostapd.c | 41 +++++++++++++----------\n src/common/hw_features_common.c | 29 ++++++++++------\n src/common/hw_features_common.h | 54 ++++++++++++++++++++++++------\n wpa_supplicant/mesh.c | 40 +++++++++++-----------\n wpa_supplicant/wpa_supplicant.c | 29 +++++++++++-----\n 8 files changed, 206 insertions(+), 121 deletions(-)", "diff": "diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c\nindex 61b823abe138..dc46b599cfb1 100644\n--- a/src/ap/ap_drv_ops.c\n+++ b/src/ap/ap_drv_ops.c\n@@ -654,18 +654,27 @@ int hostapd_set_freq(struct hostapd_data *hapd, enum hostapd_hw_mode mode,\n {\n \tstruct hostapd_freq_params data;\n \tstruct hostapd_hw_modes *cmode = hapd->iface->current_mode;\n+\tstruct hostapd_channel_info info = {\n+\t\t.mode = mode,\n+\t\t.freq = freq,\n+\t\t.channel = channel,\n+\t\t.edmg.enabled = edmg,\n+\t\t.edmg.channel = edmg_channel,\n+\t\t.ht.enabled = ht_enabled,\n+\t\t.vht.enabled = vht_enabled,\n+\t\t.he.enabled = he_enabled,\n+\t\t.eht.enabled = eht_enabled,\n+\t\t.ht.sec_channel_offset = sec_channel_offset,\n+\t\t.oper_chwidth = oper_chwidth,\n+\t\t.center_segment0 = center_segment0,\n+\t\t.center_segment1 = center_segment1,\n+\t\t.vht.caps = cmode ? cmode->vht_capab : 0,\n+\t\t.he.cap = cmode ? &cmode->he_capab[IEEE80211_MODE_AP] : NULL,\n+\t\t.eht.cap = cmode ? &cmode->eht_capab[IEEE80211_MODE_AP] : NULL,\n+\t\t.eht.punct_bitmap = hostapd_get_punct_bitmap(hapd),\n+\t};\n \n-\tif (hostapd_set_freq_params(&data, mode, freq, channel, edmg,\n-\t\t\t\t edmg_channel, ht_enabled,\n-\t\t\t\t vht_enabled, he_enabled, eht_enabled,\n-\t\t\t\t sec_channel_offset, oper_chwidth,\n-\t\t\t\t center_segment0, center_segment1,\n-\t\t\t\t cmode ? cmode->vht_capab : 0,\n-\t\t\t\t cmode ?\n-\t\t\t\t &cmode->he_capab[IEEE80211_MODE_AP] : NULL,\n-\t\t\t\t cmode ?\n-\t\t\t\t &cmode->eht_capab[IEEE80211_MODE_AP] :\n-\t\t\t\t NULL, hostapd_get_punct_bitmap(hapd)))\n+\tif (hostapd_set_freq_params(&data, &info))\n \t\treturn -1;\n \n \tif (hapd->driver == NULL)\n@@ -1084,6 +1093,23 @@ int hostapd_start_dfs_cac(struct hostapd_iface *iface,\n \tstruct hostapd_freq_params data;\n \tint res;\n \tstruct hostapd_hw_modes *cmode = iface->current_mode;\n+\tstruct hostapd_channel_info info = {\n+\t\t.mode = mode,\n+\t\t.freq = freq,\n+\t\t.channel = channel,\n+\t\t.ht.enabled = ht_enabled,\n+\t\t.vht.enabled = vht_enabled,\n+\t\t.he.enabled = he_enabled,\n+\t\t.eht.enabled = eht_enabled,\n+\t\t.ht.sec_channel_offset = sec_channel_offset,\n+\t\t.oper_chwidth = oper_chwidth,\n+\t\t.center_segment0 = center_segment0,\n+\t\t.center_segment1 = center_segment1,\n+\t\t.vht.caps = cmode ? cmode->vht_capab : 0,\n+\t\t.he.cap = cmode ? &cmode->he_capab[IEEE80211_MODE_AP] : NULL,\n+\t\t.eht.cap = cmode ? &cmode->eht_capab[IEEE80211_MODE_AP] : NULL,\n+\t\t.eht.punct_bitmap = hostapd_get_punct_bitmap(hapd),\n+\t};\n \n \tif (!hapd->driver || !hapd->driver->start_dfs_cac || !cmode)\n \t\treturn 0;\n@@ -1094,16 +1120,7 @@ int hostapd_start_dfs_cac(struct hostapd_iface *iface,\n \t\treturn -1;\n \t}\n \n-\tif (hostapd_set_freq_params(&data, mode, freq, channel, 0, 0,\n-\t\t\t\t ht_enabled,\n-\t\t\t\t vht_enabled, he_enabled, eht_enabled,\n-\t\t\t\t sec_channel_offset,\n-\t\t\t\t oper_chwidth, center_segment0,\n-\t\t\t\t center_segment1,\n-\t\t\t\t cmode->vht_capab,\n-\t\t\t\t &cmode->he_capab[IEEE80211_MODE_AP],\n-\t\t\t\t &cmode->eht_capab[IEEE80211_MODE_AP],\n-\t\t\t\t hostapd_get_punct_bitmap(hapd))) {\n+\tif (hostapd_set_freq_params(&data, &info)) {\n \t\twpa_printf(MSG_ERROR, \"Can't set freq params\");\n \t\treturn -1;\n \t}\ndiff --git a/src/ap/beacon.c b/src/ap/beacon.c\nindex 059d22862087..fba6a473396f 100644\n--- a/src/ap/beacon.c\n+++ b/src/ap/beacon.c\n@@ -2733,6 +2733,7 @@ static int __ieee802_11_set_beacon(struct hostapd_data *hapd)\n \tbool twt_he_responder = false;\n \tint res, ret = -1, i;\n \tstruct hostapd_hw_modes *mode;\n+\tstruct hostapd_channel_info info;\n \n \tif (!hapd->drv_priv) {\n \t\twpa_printf(MSG_ERROR, \"Interface is disabled\");\n@@ -2802,20 +2803,27 @@ static int __ieee802_11_set_beacon(struct hostapd_data *hapd)\n \tparams.punct_bitmap = iconf->punct_bitmap;\n #endif /* CONFIG_IEEE80211BE */\n \n-\tif (cmode &&\n-\t hostapd_set_freq_params(&freq, iconf->hw_mode, iface->freq,\n-\t\t\t\t iconf->channel, iconf->enable_edmg,\n-\t\t\t\t iconf->edmg_channel, iconf->ieee80211n,\n-\t\t\t\t iconf->ieee80211ac, iconf->ieee80211ax,\n-\t\t\t\t iconf->ieee80211be,\n-\t\t\t\t iconf->secondary_channel,\n-\t\t\t\t hostapd_get_oper_chwidth(iconf),\n-\t\t\t\t hostapd_get_oper_centr_freq_seg0_idx(iconf),\n-\t\t\t\t hostapd_get_oper_centr_freq_seg1_idx(iconf),\n-\t\t\t\t cmode->vht_capab,\n-\t\t\t\t &cmode->he_capab[IEEE80211_MODE_AP],\n-\t\t\t\t &cmode->eht_capab[IEEE80211_MODE_AP],\n-\t\t\t\t hostapd_get_punct_bitmap(hapd)) == 0) {\n+\tinfo = (struct hostapd_channel_info) {\n+\t\t.mode = iconf->hw_mode,\n+\t\t.freq = iface->freq,\n+\t\t.channel = iconf->channel,\n+\t\t.edmg.enabled = iconf->enable_edmg,\n+\t\t.edmg.channel = iconf->edmg_channel,\n+\t\t.ht.enabled = iconf->ieee80211n,\n+\t\t.vht.enabled = iconf->ieee80211ac,\n+\t\t.he.enabled = iconf->ieee80211ax,\n+\t\t.eht.enabled = iconf->ieee80211be,\n+\t\t.ht.sec_channel_offset = iconf->secondary_channel,\n+\t\t.oper_chwidth = hostapd_get_oper_chwidth(iconf),\n+\t\t.center_segment0 = hostapd_get_oper_centr_freq_seg0_idx(iconf),\n+\t\t.center_segment1 = hostapd_get_oper_centr_freq_seg1_idx(iconf),\n+\t\t.vht.caps = cmode ? cmode->vht_capab : 0,\n+\t\t.he.cap = cmode ? &cmode->he_capab[IEEE80211_MODE_AP] : NULL,\n+\t\t.eht.cap = cmode ? &cmode->eht_capab[IEEE80211_MODE_AP] : NULL,\n+\t\t.eht.punct_bitmap = hostapd_get_punct_bitmap(hapd),\n+\t};\n+\n+\tif (cmode && hostapd_set_freq_params(&freq, &info) == 0) {\n \t\tfreq.link_id = -1;\n #ifdef CONFIG_IEEE80211BE\n \t\tif (hapd->conf->mld_ap)\ndiff --git a/src/ap/dfs.c b/src/ap/dfs.c\nindex d72c8ddb4464..8b85a25558b4 100644\n--- a/src/ap/dfs.c\n+++ b/src/ap/dfs.c\n@@ -983,6 +983,7 @@ static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,\n \tunsigned int i;\n \tunsigned int num_err = 0;\n \tu8 op_class, chan;\n+\tstruct hostapd_channel_info info;\n \n \twpa_printf(MSG_DEBUG, \"DFS will switch to a new channel %d\", channel);\n \twpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_NEW_CHANNEL\n@@ -1012,24 +1013,28 @@ static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface,\n \tif (iface->mconf)\n \t\tieee80211_mode = IEEE80211_MODE_MESH;\n #endif /* CONFIG_MESH */\n-\terr = hostapd_set_freq_params(&csa_settings.freq_params,\n-\t\t\t\t iface->conf->hw_mode,\n-\t\t\t\t freq, channel,\n-\t\t\t\t iface->conf->enable_edmg,\n-\t\t\t\t iface->conf->edmg_channel,\n-\t\t\t\t iface->conf->ieee80211n,\n-\t\t\t\t iface->conf->ieee80211ac,\n-\t\t\t\t iface->conf->ieee80211ax,\n-\t\t\t\t iface->conf->ieee80211be,\n-\t\t\t\t secondary_channel,\n-\t\t\t\t new_vht_oper_chwidth,\n-\t\t\t\t oper_centr_freq_seg0_idx,\n-\t\t\t\t oper_centr_freq_seg1_idx,\n-\t\t\t\t cmode->vht_capab,\n-\t\t\t\t &cmode->he_capab[ieee80211_mode],\n-\t\t\t\t &cmode->eht_capab[ieee80211_mode],\n-\t\t\t\t hostapd_get_punct_bitmap(iface->bss[0]));\n \n+\tinfo = (struct hostapd_channel_info) {\n+\t\t.mode = iface->conf->hw_mode,\n+\t\t.freq = freq,\n+\t\t.channel = channel,\n+\t\t.edmg.enabled = iface->conf->enable_edmg,\n+\t\t.edmg.channel = iface->conf->edmg_channel,\n+\t\t.ht.enabled = iface->conf->ieee80211n,\n+\t\t.vht.enabled = iface->conf->ieee80211ac,\n+\t\t.he.enabled = iface->conf->ieee80211ax,\n+\t\t.eht.enabled = iface->conf->ieee80211be,\n+\t\t.ht.sec_channel_offset = secondary_channel,\n+\t\t.oper_chwidth = new_vht_oper_chwidth,\n+\t\t.center_segment0 = oper_centr_freq_seg0_idx,\n+\t\t.center_segment1 = oper_centr_freq_seg1_idx,\n+\t\t.vht.caps = cmode->vht_capab,\n+\t\t.he.cap = &cmode->he_capab[ieee80211_mode],\n+\t\t.eht.cap = &cmode->eht_capab[ieee80211_mode],\n+\t\t.eht.punct_bitmap = hostapd_get_punct_bitmap(iface->bss[0]),\n+\t};\n+\n+\terr = hostapd_set_freq_params(&csa_settings.freq_params, &info);\n \tif (err) {\n \t\twpa_printf(MSG_ERROR,\n \t\t\t \"DFS failed to calculate CSA freq params\");\ndiff --git a/src/ap/hostapd.c b/src/ap/hostapd.c\nindex 72a0bf503efe..703dadf85e7d 100644\n--- a/src/ap/hostapd.c\n+++ b/src/ap/hostapd.c\n@@ -4522,23 +4522,30 @@ int hostapd_change_config_freq(struct hostapd_data *hapd,\n \tmode = hapd->iface->current_mode;\n \n \t/* if a pointer to old_params is provided we save previous state */\n-\tif (old_params &&\n-\t hostapd_set_freq_params(old_params, conf->hw_mode,\n-\t\t\t\t hostapd_hw_get_freq(hapd, conf->channel),\n-\t\t\t\t conf->channel, conf->enable_edmg,\n-\t\t\t\t conf->edmg_channel, conf->ieee80211n,\n-\t\t\t\t conf->ieee80211ac, conf->ieee80211ax,\n-\t\t\t\t conf->ieee80211be, conf->secondary_channel,\n-\t\t\t\t hostapd_get_oper_chwidth(conf),\n-\t\t\t\t hostapd_get_oper_centr_freq_seg0_idx(conf),\n-\t\t\t\t hostapd_get_oper_centr_freq_seg1_idx(conf),\n-\t\t\t\t conf->vht_capab,\n-\t\t\t\t mode ? &mode->he_capab[IEEE80211_MODE_AP] :\n-\t\t\t\t NULL,\n-\t\t\t\t mode ? &mode->eht_capab[IEEE80211_MODE_AP] :\n-\t\t\t\t NULL,\n-\t\t\t\t hostapd_get_punct_bitmap(hapd)))\n-\t\treturn -1;\n+\tif (old_params) {\n+\t\tstruct hostapd_channel_info info = {\n+\t\t\t.mode = conf->hw_mode,\n+\t\t\t.freq = hostapd_hw_get_freq(hapd, conf->channel),\n+\t\t\t.channel = conf->channel,\n+\t\t\t.edmg.enabled = conf->enable_edmg,\n+\t\t\t.edmg.channel = conf->edmg_channel,\n+\t\t\t.ht.enabled = conf->ieee80211n,\n+\t\t\t.vht.enabled = conf->ieee80211ac,\n+\t\t\t.he.enabled = conf->ieee80211ax,\n+\t\t\t.eht.enabled = conf->ieee80211be,\n+\t\t\t.ht.sec_channel_offset = conf->secondary_channel,\n+\t\t\t.oper_chwidth = hostapd_get_oper_chwidth(conf),\n+\t\t\t.center_segment0 = hostapd_get_oper_centr_freq_seg0_idx(conf),\n+\t\t\t.center_segment1 = hostapd_get_oper_centr_freq_seg1_idx(conf),\n+\t\t\t.vht.caps = conf->vht_capab,\n+\t\t\t.he.cap = mode ? &mode->he_capab[IEEE80211_MODE_AP] : NULL,\n+\t\t\t.eht.cap = mode ? &mode->eht_capab[IEEE80211_MODE_AP] : NULL,\n+\t\t\t.eht.punct_bitmap = hostapd_get_punct_bitmap(hapd),\n+\t\t};\n+\n+\t\tif (hostapd_set_freq_params(old_params, &info))\n+\t\t\treturn -1;\n+\t}\n \n \tswitch (params->bandwidth) {\n \tcase 0:\ndiff --git a/src/common/hw_features_common.c b/src/common/hw_features_common.c\nindex e928738ee568..ea5d24300048 100644\n--- a/src/common/hw_features_common.c\n+++ b/src/common/hw_features_common.c\n@@ -476,18 +476,25 @@ void punct_update_legacy_bw(u16 bitmap, u8 pri, enum oper_chan_width *width,\n \n \n int hostapd_set_freq_params(struct hostapd_freq_params *data,\n-\t\t\t enum hostapd_hw_mode mode,\n-\t\t\t int freq, int channel, int enable_edmg,\n-\t\t\t u8 edmg_channel, int ht_enabled,\n-\t\t\t int vht_enabled, int he_enabled,\n-\t\t\t bool eht_enabled, int sec_channel_offset,\n-\t\t\t enum oper_chan_width oper_chwidth,\n-\t\t\t int center_segment0,\n-\t\t\t int center_segment1, u32 vht_caps,\n-\t\t\t struct he_capabilities *he_cap,\n-\t\t\t struct eht_capabilities *eht_cap,\n-\t\t\t u16 punct_bitmap)\n+\t\t\t const struct hostapd_channel_info *info)\n {\n+\tenum hostapd_hw_mode mode = info->mode;\n+\tint freq = info->freq;\n+\tint channel = info->channel;\n+\tint enable_edmg = info->edmg.enabled;\n+\tu8 edmg_channel = info->edmg.channel;\n+\tint ht_enabled = info->ht.enabled;\n+\tint vht_enabled = info->vht.enabled;\n+\tint he_enabled = info->he.enabled;\n+\tbool eht_enabled = info->eht.enabled;\n+\tint sec_channel_offset = info->ht.sec_channel_offset;\n+\tenum oper_chan_width oper_chwidth = info->oper_chwidth;\n+\tint center_segment0 = info->center_segment0;\n+\tint center_segment1 = info->center_segment1;\n+\tu32 vht_caps = info->vht.caps;\n+\tconst struct he_capabilities *he_cap = info->he.cap;\n+\tconst struct eht_capabilities *eht_cap = info->eht.cap;\n+\tu16 punct_bitmap = info->eht.punct_bitmap;\n \tenum oper_chan_width oper_chwidth_legacy;\n \tu8 seg0_legacy, seg1_legacy;\n \ndiff --git a/src/common/hw_features_common.h b/src/common/hw_features_common.h\nindex 80e33adf2d5c..62c9ac0df018 100644\n--- a/src/common/hw_features_common.h\n+++ b/src/common/hw_features_common.h\n@@ -37,18 +37,50 @@ int check_40mhz_2g4(struct hostapd_hw_modes *mode,\n \t\t int sec_chan);\n void punct_update_legacy_bw(u16 bitmap, u8 pri_chan,\n \t\t\t enum oper_chan_width *width, u8 *seg0, u8 *seg1);\n+\n+/* Channel information to derive freq params from */\n+struct hostapd_channel_info {\n+\tenum hostapd_hw_mode mode;\n+\n+\tint freq;\n+\tint channel;\n+\tenum oper_chan_width oper_chwidth;\n+\n+\t/* EDMG */\n+\tstruct {\n+\t\tint enabled;\n+\t\tu8 channel;\n+\t} edmg;\n+\n+\tstruct {\n+\t\tint enabled;\n+\t\tint sec_channel_offset;\n+\t} ht;\n+\n+\tint center_segment0;\n+\n+\t/* Only valid for 80+80 */\n+\tint center_segment1;\n+\n+\tstruct {\n+\t\tint enabled;\n+\t\tu32 caps;\n+\t} vht;\n+\n+\tstruct {\n+\t\tint enabled;\n+\t\tconst struct he_capabilities *cap;\n+\t} he;\n+\n+\tstruct {\n+\t\tint enabled;\n+\t\tconst struct eht_capabilities *cap;\n+\t\tu16 punct_bitmap;\n+\t} eht;\n+};\n+\n int hostapd_set_freq_params(struct hostapd_freq_params *data,\n-\t\t\t enum hostapd_hw_mode mode,\n-\t\t\t int freq, int channel, int edmg, u8 edmg_channel,\n-\t\t\t int ht_enabled,\n-\t\t\t int vht_enabled, int he_enabled,\n-\t\t\t bool eht_enabled, int sec_channel_offset,\n-\t\t\t enum oper_chan_width oper_chwidth,\n-\t\t\t int center_segment0,\n-\t\t\t int center_segment1, u32 vht_caps,\n-\t\t\t struct he_capabilities *he_caps,\n-\t\t\t struct eht_capabilities *eht_cap,\n-\t\t\t u16 punct_bitmap);\n+\t\t\t const struct hostapd_channel_info *info);\n void set_disable_ht40(struct ieee80211_ht_capabilities *htcaps,\n \t\t int disabled);\n int ieee80211ac_cap_check(u32 hw, u32 conf);\ndiff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c\nindex 8f7143f6ea63..f49ce68db65b 100644\n--- a/wpa_supplicant/mesh.c\n+++ b/wpa_supplicant/mesh.c\n@@ -190,28 +190,26 @@ static int wpas_mesh_update_freq_params(struct wpa_supplicant *wpa_s)\n {\n \tstruct wpa_driver_mesh_join_params *params = wpa_s->mesh_params;\n \tstruct hostapd_iface *ifmsh = wpa_s->ifmsh;\n-\tstruct he_capabilities *he_capab = NULL;\n+\tstruct hostapd_channel_info info = {\n+\t\t.mode = ifmsh->conf->hw_mode,\n+\t\t.freq = ifmsh->freq,\n+\t\t.channel = ifmsh->conf->channel,\n+\t\t.edmg.enabled = ifmsh->conf->enable_edmg,\n+\t\t.edmg.channel = ifmsh->conf->edmg_channel,\n+\t\t.ht.enabled = ifmsh->conf->ieee80211n,\n+\t\t.vht.enabled = ifmsh->conf->ieee80211ac,\n+\t\t.he.enabled = ifmsh->conf->ieee80211ax,\n+\t\t.eht.enabled = ifmsh->conf->ieee80211be,\n+\t\t.ht.sec_channel_offset = ifmsh->conf->secondary_channel,\n+\t\t.oper_chwidth = hostapd_get_oper_chwidth(ifmsh->conf),\n+\t\t.center_segment0 = hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf),\n+\t\t.center_segment1 = hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf),\n+\t\t.vht.caps = ifmsh->conf->vht_capab,\n+\t\t.he.cap = ifmsh->current_mode ?\n+\t\t\t&ifmsh->current_mode->he_capab[IEEE80211_MODE_MESH] : NULL,\n+\t};\n \n-\tif (ifmsh->current_mode)\n-\t\the_capab = &ifmsh->current_mode->he_capab[IEEE80211_MODE_MESH];\n-\n-\tif (hostapd_set_freq_params(\n-\t\t ¶ms->freq,\n-\t\t ifmsh->conf->hw_mode,\n-\t\t ifmsh->freq,\n-\t\t ifmsh->conf->channel,\n-\t\t ifmsh->conf->enable_edmg,\n-\t\t ifmsh->conf->edmg_channel,\n-\t\t ifmsh->conf->ieee80211n,\n-\t\t ifmsh->conf->ieee80211ac,\n-\t\t ifmsh->conf->ieee80211ax,\n-\t\t ifmsh->conf->ieee80211be,\n-\t\t ifmsh->conf->secondary_channel,\n-\t\t hostapd_get_oper_chwidth(ifmsh->conf),\n-\t\t hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf),\n-\t\t hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf),\n-\t\t ifmsh->conf->vht_capab,\n-\t\t he_capab, NULL, 0)) {\n+\tif (hostapd_set_freq_params(¶ms->freq, &info)) {\n \t\twpa_printf(MSG_ERROR, \"Error updating mesh frequency params\");\n \t\twpa_supplicant_mesh_deinit(wpa_s, true);\n \t\treturn -1;\ndiff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c\nindex 5414eab0fba2..c9dfe41bca41 100644\n--- a/wpa_supplicant/wpa_supplicant.c\n+++ b/wpa_supplicant/wpa_supplicant.c\n@@ -3351,6 +3351,7 @@ static bool ibss_mesh_select_80_160mhz(struct wpa_supplicant *wpa_s,\n \t};\n \n \tstruct hostapd_freq_params vht_freq;\n+\tstruct hostapd_channel_info info;\n \tint i;\n \tunsigned int j, k;\n \tint chwidth, seg0, seg1;\n@@ -3515,15 +3516,25 @@ static bool ibss_mesh_select_80_160mhz(struct wpa_supplicant *wpa_s,\n \t}\n \n skip_80mhz:\n-\tif (hostapd_set_freq_params(&vht_freq, mode->mode, freq->freq,\n-\t\t\t\t freq->channel, ssid->enable_edmg,\n-\t\t\t\t ssid->edmg_channel, freq->ht_enabled,\n-\t\t\t\t freq->vht_enabled, freq->he_enabled,\n-\t\t\t\t freq->eht_enabled,\n-\t\t\t\t freq->sec_channel_offset,\n-\t\t\t\t chwidth, seg0, seg1, vht_caps,\n-\t\t\t\t &mode->he_capab[ieee80211_mode],\n-\t\t\t\t &mode->eht_capab[ieee80211_mode], 0) != 0)\n+\tinfo = (struct hostapd_channel_info) {\n+\t\t.mode = mode->mode,\n+\t\t.freq = freq->freq,\n+\t\t.channel = freq->channel,\n+\t\t.edmg.enabled = ssid->enable_edmg,\n+\t\t.edmg.channel = ssid->edmg_channel,\n+\t\t.ht.enabled = freq->ht_enabled,\n+\t\t.vht.enabled = freq->vht_enabled,\n+\t\t.he.enabled = freq->he_enabled,\n+\t\t.eht.enabled = freq->eht_enabled,\n+\t\t.ht.sec_channel_offset = freq->sec_channel_offset,\n+\t\t.oper_chwidth = chwidth,\n+\t\t.center_segment0 = seg0,\n+\t\t.center_segment1 = seg1,\n+\t\t.vht.caps = vht_caps,\n+\t\t.he.cap = &mode->he_capab[ieee80211_mode],\n+\t\t.eht.cap = &mode->eht_capab[ieee80211_mode],\n+\t};\n+\tif (hostapd_set_freq_params(&vht_freq, &info))\n \t\treturn false;\n \n \t*freq = vht_freq;\n", "prefixes": [ "v3", "01/12" ] }