Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2229901/?format=api
{ "id": 2229901, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229901/?format=api", "web_url": "http://patchwork.ozlabs.org/project/hostap/patch/20260428200639.40243-95-andrei.otcheretianski@intel.com/", "project": { "id": 22, "url": "http://patchwork.ozlabs.org/api/1.1/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": "" }, "msgid": "<20260428200639.40243-95-andrei.otcheretianski@intel.com>", "date": "2026-04-28T20:06:35", "name": "[94/97] wpa_supplicant: Support overriding NAN potential availability", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "5cc1d5669101d86ee5f9945bc7550c2244cacbb4", "submitter": { "id": 62065, "url": "http://patchwork.ozlabs.org/api/1.1/people/62065/?format=api", "name": "Andrei Otcheretianski", "email": "andrei.otcheretianski@intel.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/hostap/patch/20260428200639.40243-95-andrei.otcheretianski@intel.com/mbox/", "series": [ { "id": 501927, "url": "http://patchwork.ozlabs.org/api/1.1/series/501927/?format=api", "web_url": "http://patchwork.ozlabs.org/project/hostap/list/?series=501927", "date": "2026-04-28T20:05:05", "name": "NAN: Group keys support, schedule update and more", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/501927/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2229901/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2229901/checks/", "tags": {}, "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=p/8vaeCA;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256\n header.s=casper.20170209 header.b=HeivBH0C;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=d235MS2+;\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 4g4sC61Vftz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 06:16:18 +1000 (AEST)", "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wHoqR-00000002NR2-0HyK;\n\tTue, 28 Apr 2026 20:15:47 +0000", "from casper.infradead.org ([2001:8b0:10b:1236::1])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wHolD-00000002G7t-00s3\n\tfor hostap@bombadil.infradead.org;\n\tTue, 28 Apr 2026 20:10:23 +0000", "from mgamail.intel.com ([198.175.65.16])\n\tby casper.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wHol7-00000004NYt-1Ko7\n\tfor hostap@lists.infradead.org;\n\tTue, 28 Apr 2026 20:10:20 +0000", "from fmviesa001.fm.intel.com ([10.60.135.141])\n by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 28 Apr 2026 13:09:41 -0700", "from iapp347.iil.intel.com (HELO 87c02287900a.iil.intel.com)\n ([10.167.28.6])\n by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 28 Apr 2026 13:09:40 -0700" ], "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=SqVYDs9Pe81+VYAohcntMjS/xP5B00VLzFLVtt7HyCU=; b=p/8vaeCAZirfiJ\n\tcgXsLUnP90tFq0mi3eJA3hOuxtaV3kREP719FV13OljwfSARzti6RlOfKgjPrO+8I5Cpej94Gcwfe\n\tTwgaB4MAk2ahLoD9LKVsz+jJ7OwDWl/ACV6G1Rcy8CxlMVh6hyD68HQPYEtTQ+MZ/tGj50o4cW7eR\n\tlNQQtIe/x/+qkK4jcptIz7VzShqhdPBUcC7LMe9mBRlF0n55Mf8CLxDQmSj78cXKpRQUVZzAjUzH3\n\tHACNsIySla9V0k3D0by5S+Avkbr4c1G/zmD5rZsd9tqPi/oakwE4S0osrQ4cM2qyuqyosYB6pgBVd\n\t/jPmmdqVSHBaWtmNwqig==;", "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version:\n\tReferences:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:\n\tContent-Type:Content-ID:Content-Description;\n\tbh=dXMTOMojKs9pqfTAzZJjQma2huFMt84CXe0yVMpf9GY=; b=HeivBH0CM6+WdojX4lTpxxGvmn\n\tq8VRe6TVLeTjhFP4xnoapcMCSTNHdjH8LLGQLz8667SI7wO67hFm2xQBTnA4ps9bAIDi2CRHxErPf\n\trEwnzSNwHBYKKdL9GvEQKEQP2XPfTx1aRMrV/qcHBkDlnZ0E5yd2Miii8QDj6kd0JdgX9v5xxyR08\n\tCNamz4WIAW87NSELISlE94kBioxSHy4CjbXEklmLcmc8pnYoIaat4N7cOmIPAiy4w+F7SyqcwHLMM\n\tvZ8CywnhG5k7O+cA9oPNPbzzz8PWyfcFOu0bR2KE/JzubrNCnwen9zW3GdeCj+4zBKPDRXlC3CEW6\n\thFv2tmXQ==;", "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1777407017; x=1808943017;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=OJXhQd9ILRhzUvKnLoj2G5zJZ2UwT5NgS4keVuiB+wc=;\n b=d235MS2+Tlfjpinl2weqVp/IirtiXszYD65r7zeKRhE4dE7ANhmRdRG6\n JKbyN97ncTIH6+YPQPz7BdT/hfDSRI8l3N/qc1SjAlxK/PNK2JNsazNkt\n mYAuLwhEv/k2+o6mlRP8+PJANn+pCvZfh4T0G4N6mgujGQK2n7QCC9ldm\n epxlEjbxsoFEcijueHhJuWyw1dhspV5XNTa+T/40sl71jEICAQQoKiyZ2\n Qwp9WWKb1HKeSEvh0guER9ddJTmJXot/zWMFCbSBusz5eNhjdtY6laA/M\n AKtyzeBe4+QOunswxPjXzNXh8uzEscDf6r1IdLqUy2wv5s/O2JRJ5XSr9\n g==;" ], "X-CSE-ConnectionGUID": [ "BnkhC0FTS1+9DxHPaRZdQA==", "bDf7NxMjT4yBwZDjpKkNvg==" ], "X-CSE-MsgGUID": [ "PMxjtcHwQ2mLBI8nDkF85Q==", "hWAQfScjS3GOZFL7LOXISA==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6800,10657,11770\"; a=\"78519766\"", "E=Sophos;i=\"6.23,204,1770624000\";\n d=\"scan'208\";a=\"78519766\"", "E=Sophos;i=\"6.23,204,1770624000\";\n d=\"scan'208\";a=\"257611001\"" ], "X-ExtLoop1": "1", "From": "Andrei Otcheretianski <andrei.otcheretianski@intel.com>", "To": "hostap@lists.infradead.org", "Cc": "vamsin@qti.qualcomm.com,\n\tmaheshkkv@google.com,\n\tAndrei Otcheretianski <andrei.otcheretianski@intel.com>", "Subject": "[PATCH 94/97] wpa_supplicant: Support overriding NAN potential\n availability", "Date": "Tue, 28 Apr 2026 23:06:35 +0300", "Message-ID": "<20260428200639.40243-95-andrei.otcheretianski@intel.com>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260428200639.40243-1-andrei.otcheretianski@intel.com>", "References": "<20260428200639.40243-1-andrei.otcheretianski@intel.com>", "MIME-Version": "1.0", "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ", "X-CRM114-CacheID": "sfid-20260428_211017_711659_A8ACAC2B ", "X-CRM114-Status": "GOOD ( 20.30 )", "X-Spam-Score": "-4.4 (----)", "X-Spam-Report": "SpamAssassin version 4.0.1 on casper.infradead.org summary:\n Content analysis details: (-4.4 points, 5.0 required)\n pts rule name description\n ---- ----------------------\n --------------------------------------------------\n -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/,\n medium trust\n [198.175.65.16 listed in list.dnswl.org]\n 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record\n -0.0 SPF_PASS SPF: sender matches SPF record\n -0.1 DKIM_VALID Message has at least one valid DKIM or DK\n signature\n -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from\n envelope-from domain\n 0.1 DKIM_SIGNED Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n author's\n domain\n -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%\n [score: 0.0000]\n -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender", "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": "Add a control interface API to configure NAN potential availability.\nThis overrides the internally calculated potential availability.\n\nSigned-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>\n---\n wpa_supplicant/nan_supplicant.c | 232 ++++++++++++++++++++++++++----\n wpa_supplicant/wpa_supplicant_i.h | 1 +\n 2 files changed, 208 insertions(+), 25 deletions(-)", "diff": "diff --git a/wpa_supplicant/nan_supplicant.c b/wpa_supplicant/nan_supplicant.c\nindex d53cc206db..a7eabc3ff6 100644\n--- a/wpa_supplicant/nan_supplicant.c\n+++ b/wpa_supplicant/nan_supplicant.c\n@@ -78,45 +78,51 @@ static int get_center(u8 channel, const u8 *center_channels,\n }\n \n \n-static bool wpas_nan_valid_chan(struct wpa_supplicant *wpa_s,\n-\t\t\t\tenum hostapd_hw_mode mode,\n-\t\t\t\tu8 channel, int bw, u8 op_class, u8 *cf1)\n+static u8 get_center_and_width(int bw, u8 channel, int *width)\n {\n \tstatic const u8 nan_160mhz_5ghz_chans[] = { 50, 114, 163 };\n \tstatic const u8 nan_80mhz_5ghz_chans[] =\n \t\t{ 42, 58, 106, 122, 138, 155, 171 };\n-\tstruct hostapd_hw_modes *hw_mode;\n-\tint width, span;\n-\tu8 c, center = 0;\n-\n-\thw_mode = get_mode(wpa_s->hw.modes, wpa_s->hw.num_modes, mode, false);\n-\tif (!hw_mode)\n-\t\treturn false;\n \n \tswitch (bw) {\n \tcase BW20:\n-\t\twidth = 20;\n-\t\tcenter = channel;\n-\t\tbreak;\n+\t\t*width = 20;\n+\t\treturn channel;\n \tcase BW40PLUS:\n \tcase BW40MINUS:\n-\t\twidth = 40;\n-\t\tcenter = bw == BW40PLUS ? channel + 2 : channel - 2;\n-\t\tbreak;\n+\t\t*width = 40;\n+\t\treturn bw == BW40PLUS ? channel + 2 : channel - 2;\n \tcase BW80:\n-\t\twidth = 80;\n-\t\tcenter = get_center(channel, nan_80mhz_5ghz_chans,\n-\t\t\t\t ARRAY_SIZE(nan_80mhz_5ghz_chans), width);\n-\t\tbreak;\n+\t\t*width = 80;\n+\t\treturn get_center(channel, nan_80mhz_5ghz_chans,\n+\t\t\t\t ARRAY_SIZE(nan_80mhz_5ghz_chans),\n+\t\t\t\t *width);\n \tcase BW160:\n-\t\twidth = 160;\n-\t\tcenter = get_center(channel, nan_160mhz_5ghz_chans,\n-\t\t\t\t ARRAY_SIZE(nan_160mhz_5ghz_chans), width);\n-\t\tbreak;\n+\t\t*width = 160;\n+\t\treturn get_center(channel, nan_160mhz_5ghz_chans,\n+\t\t\t\t ARRAY_SIZE(nan_160mhz_5ghz_chans),\n+\t\t\t\t *width);\n \tdefault:\n-\t\treturn false;\n+\t\treturn 0;\n \t}\n \n+\treturn 0;\n+}\n+\n+\n+static bool wpas_nan_valid_chan(struct wpa_supplicant *wpa_s,\n+\t\t\t\tenum hostapd_hw_mode mode,\n+\t\t\t\tu8 channel, int bw, u8 op_class, u8 *cf1)\n+{\n+\tstruct hostapd_hw_modes *hw_mode;\n+\tint width, span;\n+\tu8 c, center;\n+\n+\thw_mode = get_mode(wpa_s->hw.modes, wpa_s->hw.num_modes, mode, false);\n+\tif (!hw_mode)\n+\t\treturn false;\n+\n+\tcenter = get_center_and_width(bw, channel, &width);\n \tif (!center)\n \t\treturn false;\n \n@@ -838,6 +844,26 @@ static int wpas_nan_get_chans_cb(void *ctx, u8 map_id,\n \n \twpa_printf(MSG_DEBUG, \"NAN: Get channels - map_id=%u\", map_id);\n \n+\t/* Check if override is configured */\n+\tif (wpa_s->nan_override_potential_avail.n_chans > 0) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t \"NAN: Using override potential availability (%u channels)\",\n+\t\t\t wpa_s->nan_override_potential_avail.n_chans);\n+\n+\t\tchans->n_chans = wpa_s->nan_override_potential_avail.n_chans;\n+\t\tchans->chans = os_memdup(wpa_s->nan_override_potential_avail.chans,\n+\t\t\t\t wpa_s->nan_override_potential_avail.n_chans *\n+\t\t\t\t sizeof(struct nan_channel_info));\n+\t\tif (!chans->chans) {\n+\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t \"NAN: Failed to allocate memory for override channels\");\n+\t\t\tchans->n_chans = 0;\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\treturn 0;\n+\t}\n+\n \t/* Allocate one extra element so it will be 0 terminated int_array */\n \tshared_freqs = os_calloc(wpa_s->num_multichan_concurrent + 1,\n \t\t\t\t sizeof(int));\n@@ -1470,6 +1496,10 @@ void wpas_nan_deinit(struct wpa_supplicant *wpa_s)\n \twpabuf_free(wpa_s->nan_ulw_attr);\n \twpa_s->nan_ulw_attr = NULL;\n \n+\tos_free(wpa_s->nan_override_potential_avail.chans);\n+\twpa_s->nan_override_potential_avail.chans = NULL;\n+\twpa_s->nan_override_potential_avail.n_chans = 0;\n+\n \twpa_s->nan = NULL;\n }\n \n@@ -1519,6 +1549,155 @@ void wpas_nan_flush(struct wpa_supplicant *wpa_s)\n }\n \n \n+static int wpas_nan_parse_override_potential_avail(struct wpa_supplicant *wpa_s,\n+\t\t\t\t\t\t char *param)\n+{\n+\tstruct nan_channel_info *chans = NULL;\n+\tsize_t n_chans = 0;\n+\tsize_t capacity = 0;\n+\tchar *pos, *end;\n+\n+\t/* Empty string clears the override */\n+\tif (*param == '\\0') {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t \"NAN: Clearing override potential availability\");\n+\t\tgoto out;\n+\t}\n+\n+\t/* Parse format: <op_class:0xbitmap:pref>,... */\n+\tpos = param;\n+\twhile (pos && *pos) {\n+\t\tu8 op_class, pref;\n+\t\tu16 bitmap;\n+\t\tconst struct oper_class_map *o = NULL;\n+\t\tint op, idx;\n+\n+\t\tif (sscanf(pos, \"%hhu:0x%hx:%hhu\", &op_class, &bitmap, &pref) != 3) {\n+\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t \"NAN: Invalid override_potential_availability format at '%s'\",\n+\t\t\t\t pos);\n+\t\t\tos_free(chans);\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\tif (!op_class || op_class > 129 || pref > 3) {\n+\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t \"NAN: Invalid values in override_potential_availability\");\n+\t\t\tos_free(chans);\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\t/* Find the operating class in global_op_class */\n+\t\tfor (op = 0; global_op_class[op].op_class; op++) {\n+\t\t\tif (global_op_class[op].op_class == op_class) {\n+\t\t\t\to = &global_op_class[op];\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\n+\t\tif (!o) {\n+\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t \"NAN: Unknown operating class %d in override_potential_availability\",\n+\t\t\t\t op_class);\n+\t\t\tos_free(chans);\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\t/* Iterate through bitmap bits */\n+\t\tfor (idx = 0; idx < 16 && bitmap; idx++) {\n+\t\t\tu8 chan, center;\n+\n+\t\t\tif (!(bitmap & BIT(idx)))\n+\t\t\t\tcontinue;\n+\n+\t\t\tchan = op_class_idx_to_chan(o, idx);\n+\t\t\tif (!chan) {\n+\t\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t\t \"NAN: Invalid channel index %d for op_class %d\",\n+\t\t\t\t\t idx, op_class);\n+\t\t\t\tos_free(chans);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\n+\t\t\t/*\n+\t\t\t * Validate the channel. For zero preference only\n+\t\t\t * check the very basic validity, but accept\n+\t\t\t * \"NOT ALLOWED\" channels, as the user might want\n+\t\t\t * to explicitly mark them as unavailable.\n+\t\t\t */\n+\t\t\tif (pref && !wpas_nan_valid_chan(wpa_s, o->mode, chan,\n+\t\t\t\t\t\t\t o->bw, o->op_class,\n+\t\t\t\t\t\t\t ¢er)) {\n+\t\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t\t \"NAN: Channel %d (op_class %d) is not a valid NAN channel\",\n+\t\t\t\t\t chan, op_class);\n+\t\t\t\tos_free(chans);\n+\t\t\t\treturn -1;\n+\t\t\t} else if (!pref) {\n+\t\t\t\tint width;\n+\n+\t\t\t\tcenter = get_center_and_width(o->bw, chan,\n+\t\t\t\t\t\t\t &width);\n+\t\t\t\tif (!center) {\n+\t\t\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t\t\t \"NAN: Invalid channel %d for op_class %d\",\n+\t\t\t\t\t\t chan, op_class);\n+\t\t\t\t\tos_free(chans);\n+\t\t\t\t\treturn -1;\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\t/* Expand array if needed */\n+\t\t\tif (n_chans >= capacity) {\n+\t\t\t\tstruct nan_channel_info *new_chans;\n+\n+\t\t\t\tcapacity = capacity ? capacity * 2 : 4;\n+\t\t\t\tnew_chans = os_realloc_array(chans, capacity,\n+\t\t\t\t\t\t\t sizeof(*chans));\n+\t\t\t\tif (!new_chans) {\n+\t\t\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t\t\t \"NAN: Memory allocation failed\");\n+\t\t\t\t\tos_free(chans);\n+\t\t\t\t\treturn -1;\n+\t\t\t\t}\n+\t\t\t\tchans = new_chans;\n+\t\t\t}\n+\n+\t\t\t/* Use center for wide channels */\n+\t\t\tchans[n_chans].op_class = op_class;\n+\t\t\tchans[n_chans].channel = (o->bw == BW80 ||\n+\t\t\t\t\t\t o->bw == BW160) ?\n+\t\t\t\t\t\t center : chan;\n+\t\t\tchans[n_chans].pref = pref;\n+\t\t\tn_chans++;\n+\t\t}\n+\n+\t\t/* Move to next entry */\n+\t\tend = os_strchr(pos, ',');\n+\t\tif (end)\n+\t\t\tpos = end + 1;\n+\t\telse\n+\t\t\tbreak;\n+\t}\n+\n+\t/* Sort channels by preference (higher preference first) */\n+\tif (n_chans > 1)\n+\t\tqsort(chans, n_chans, sizeof(*chans), nan_chan_info_cmp);\n+\n+out:\n+\t/* Free previous configuration */\n+\tos_free(wpa_s->nan_override_potential_avail.chans);\n+\twpa_s->nan_override_potential_avail.chans = chans;\n+\twpa_s->nan_override_potential_avail.n_chans = n_chans;\n+\twpa_s->schedule_sequence_id++;\n+\n+\twpa_printf(MSG_DEBUG,\n+\t\t \"NAN: Configured %zu override potential availability channels\",\n+\t\t n_chans);\n+\treturn 0;\n+}\n+\n+\n int wpas_nan_set(struct wpa_supplicant *wpa_s, char *cmd)\n {\n \tstruct nan_cluster_config *config = &wpa_s->nan_cluster_config;\n@@ -1611,6 +1790,9 @@ int wpas_nan_set(struct wpa_supplicant *wpa_s, char *cmd)\n \t\treturn 0;\n \t}\n \n+\tif (os_strcmp(\"override_potential_availability\", cmd) == 0)\n+\t\treturn wpas_nan_parse_override_potential_avail(wpa_s, param);\n+\n \tif (os_strcmp(\"bootstrap_config\", cmd) == 0) {\n \t\tu16 supported_methods, auto_accept_methods, comeback_timeout;\n \ndiff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h\nindex 95c0f577d4..828795b196 100644\n--- a/wpa_supplicant/wpa_supplicant_i.h\n+++ b/wpa_supplicant/wpa_supplicant_i.h\n@@ -1743,6 +1743,7 @@ struct wpa_supplicant {\n \tstruct wpabuf *nan_ulw_attr;\n \tstruct wpa_freq_range_list nan_disallowed_freqs;\n \tu16 nan_max_bw;\n+\tstruct nan_channels nan_override_potential_avail;\n \tunsigned int nan_ndi_ndp_refcount; /* Active NDP count on this NDI */\n \tstruct nan_gtk ndi_gtk;\n #endif /* CONFIG_NAN */\n", "prefixes": [ "94/97" ] }