From nobody Wed Apr 03 00:29:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V8Qc40n68z5G526; Wed, 3 Apr 2024 00:29:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V8Qc404k7z4F32; Wed, 3 Apr 2024 00:29:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712104164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kv8+k+UWZnXPnFuxqCNjSfbBQp/5jc+KYsAdHMRZVVs=; b=bwnzQolmRve8ikLtz4uW28J1bOa43KFqqelPUJcydotCvcpSVsd0zecR891l6VYewODgsk cSNVtsD/sKJ8++pUJZXPs8TZKZP2yScyaRiMYikHfbxTI6NzB5Xcnl5XKjLQ59nEHBfkWG EE2ixANkj2AK0vZdEpqwvPNrbkmGFpogkB0YSc/vVH3J36vxIZW6vE8HIaaajO4ojyD9wa yN/OfUxCvRNFamdEbVXge2u8Tasz5+YsSaBuGa2Jx5Y9PaRptW29v06yyh+xuoEuaFnWE0 r8Vy34rBcld59Taw8RPwHGB0gtCX2QgiJWaM6O8Z58YQLOhGpSGTaEsqOxZR/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712104164; a=rsa-sha256; cv=none; b=dCoYHcasE7LAjSmkNXnOuwh0qAIIbpcgWzvl7ZUtuxoNpyUpMBsEPfoIjtSciM4eKnwlM7 qs9eaNWko7qaqaMVNihkghZRDOl3HHf/HcIWErskpgg1YJCFeePIxjH5CoDFAIMzyrbWBh W9QQXFGPGRvxcV5uZT6dkvoFdPLdvF8QEHeIfxzRYZ7fBqWpjvX3OYwi/dahiJAcwS+WoL jTzcxz6rkaeGnmHK6fJTn+CuziGV2LYiSXso9XOMZlvRJQhTOSCJGaF6uXFDJFmGuPas2Q hvjJX8J4EBMlnJY9OBL0yEYh6OfoLHixmqc6Kvhn0IboMIvdU7JiLxw/TKB10Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712104164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kv8+k+UWZnXPnFuxqCNjSfbBQp/5jc+KYsAdHMRZVVs=; b=X33ARYKq+pNGv4COFBu2Z6dFuSNkfWupTODKlbMFYzxF4Hj6qP3bKxciE5/E1h/EJphjaJ tEGthuROq1IVCvI0i4jTY4OcyJNu5N4XJQT5ro49dfFvOQCLiQMNfMM5BjtkqQoD0Xt+fH 81yCoJtU3rm/rFu21O8FCb+MDN1CodVoktE4RJiOdQlcgPon89COE8/aOTWI0MugMew6et zZhT0aTJazHjUGz6LEJgAtZ/F/sjGZFaG9JaW6EKZgKyYzx/CqvBIBC3esDSYP1JdbCbUY VkqVyK/P8LpIQAPx2eQY0WzbRXFUhv05FZhAJfjAaldb+iODRpIviZtGuzPkBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V8Qc36ntKz19qK; Wed, 3 Apr 2024 00:29:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4330TNQD088588; Wed, 3 Apr 2024 00:29:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4330TNM6088585; Wed, 3 Apr 2024 00:29:23 GMT (envelope-from git) Date: Wed, 3 Apr 2024 00:29:23 GMT Message-Id: <202404030029.4330TNM6088585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 0fb7c4a38c85 - stable/13 - hostapd: Work around lack of MLME support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0fb7c4a38c8527156b1d1eedd072787602a13c69 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0fb7c4a38c8527156b1d1eedd072787602a13c69 commit 0fb7c4a38c8527156b1d1eedd072787602a13c69 Author: Cy Schubert AuthorDate: 2024-02-27 03:34:09 +0000 Commit: Cy Schubert CommitDate: 2024-04-03 00:29:13 +0000 hostapd: Work around lack of MLME support hostap MLME uses Linux data structures and definitions not available in FreeBSD. The ability for hostapd to select the frequency (channel) depends Linux MLME, though strictly it's not required. Work around the Linux MLME requirement to configure device frequency. The detailed description is: hostapd will only set the channel (frequency) when Linux MLME is configured. Enabling NEED_AP_MLME will result in numerous build errors due do Linux data structures and definitions not available under FreeBSD. The code to set the frequency from the selected channel is only within the NEED_AP_MLME code path because without MLME, hostapd_get_hw_features() is an inline that always returns -1 whereas with MLME hostapd_get_hw_features() will obtain hardware features from the kernel. Until such time we simply set the frequency as configured. PR: 276375 (cherry picked from commit 84ed86380aeb566ffd8b957ba99c36ad345413ef) --- contrib/wpa/src/ap/hostapd.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/contrib/wpa/src/ap/hostapd.c b/contrib/wpa/src/ap/hostapd.c index 4b88641a2dde..a5cabc01f163 100644 --- a/contrib/wpa/src/ap/hostapd.c +++ b/contrib/wpa/src/ap/hostapd.c @@ -1698,6 +1698,20 @@ static int setup_interface2(struct hostapd_iface *iface) { iface->wait_channel_update = 0; +#ifdef __FreeBSD + /* XXX hostapd_get_hw_features() is an inline that always returns -1 + * because MLME will not build under FreeBSD due to its use of + * Linux definitions. Normally FreeBSD would uncondionally execute the + * "Not all drivers support..." block. Instead we #ifdef out the entire + * block of code instead of maintaining the fallacy that + * hostapd_get_hw_features() returns anything meaninful. + * + * Ideally WANT_AP_MLME should be taught about FreeBSD data structures + * and defintions. Instead we do this to enable channel selection in + * hostapd.conf. + */ + iface->freq = iface->conf->channel; +#else if (hostapd_get_hw_features(iface)) { /* Not all drivers support this yet, so continue without hw * feature data. */ @@ -1744,6 +1758,7 @@ static int setup_interface2(struct hostapd_iface *iface) if (iface->conf->ieee80211h) wpa_printf(MSG_DEBUG, "DFS support is enabled"); } +#endif return hostapd_setup_interface_complete(iface, 0); fail: