From nobody Wed Apr 03 00:28:53 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 4V8QbV1Gy4z5G4t9; Wed, 3 Apr 2024 00:28:54 +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 4V8QbV0Sc9z4DqC; Wed, 3 Apr 2024 00:28:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712104134; 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=ALiQ75RXu0fy9NYzYi17Yz/gSqdAOVzsxV9gjh9bQ1o=; b=fvJmT8orn8zihe4VKEPx6G+KpYgI00unP8Ghg8VtPePrGXBXuiM+zCkVbJXae4Tht8+Rwy sqLycqXznUMVWeju40GBKBp696lFuhi0AGnaLxOPFkEYLmJcYreNiJlzy4ztBRh9tyFdtO vum220GsDYS2rqoB7DYyVodG4REumDZvnHs1TeupLsJe9AZvJQnHdqQNvyw6b1y5o8+tkv AJTeRIS5xmZNcqSim/kiwNg+a870geLVsUCkoEQZqwKiAA0FkWX61z9c+Hz/DuVwD7LzW1 mKASHqTzg3XUod7eA6oIfF6jkRXsu55D3wh/0tMamaPD57GRzxW7ImFHHSfCBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712104134; a=rsa-sha256; cv=none; b=qvlSqxIEhyubryxq8Jb5nN65uREYLhiMAZLUAuE+PCmQF5rtBb/zCIU87bJwY49KidTDaq cY2GHCFBoZv8ztZOsQvS4qVMpI3/Y8domIAWrjX04gzWPnnq4Bt+YAqI2q42GnYzjh+MKF S7XdcyZDqbqn3CBPFzicMcEvbhBljv7mR0Cs/BPiSvl5IBd1HPPXryO+TDE6atvJRm4BWZ 0w2rkYAJFRxP5GAQR9YaePfSXsGsPS6AB3ItXIabKfOizQs2AnxslHVspoAo+fpKBT2tEW jHDbT/7fupclmKVrBsmSlSNNk59plBxh7bqTsf8+SPoZccIRhVRD6N1cfgV+7A== 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=1712104134; 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=ALiQ75RXu0fy9NYzYi17Yz/gSqdAOVzsxV9gjh9bQ1o=; b=FvLxVRm5cAdvpWLoQASwzQYGqUsx13jONybSEx6h7QHN5+JWfcB2GeYAs7vlxZ+ZP6BjL3 P/A8yCDzZKh8cTEel8eHbcgX7VMz056jgASqDBOzQbee5qNp45Eq0gyrX6F3gzegpFIKBv heTZudm5LwKzbzYYDhBPCYI6uPQe2ZuFbF/iCJC2bCeuwvUcO2Rn/tLQjMILrDNj2EufLW vr0nsPITb4w8m8sfFdI0dlxX766xHEgzuPSKeiYZX7zsnq0PrQHsZY1TBF940FdPrcxYdn brj0koeNvO+iUYYPz61S2vv3MZj3JC9fb9yU1Cew97UGZym0MipcPqzSWesa5Q== 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 4V8QbV03yQz19Jr; Wed, 3 Apr 2024 00:28:54 +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 4330SrdS088377; Wed, 3 Apr 2024 00:28:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4330SrlR088374; Wed, 3 Apr 2024 00:28:53 GMT (envelope-from git) Date: Wed, 3 Apr 2024 00:28:53 GMT Message-Id: <202404030028.4330SrlR088374@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: beb5140a9d8f - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: beb5140a9d8f349866ef4ba8ada9d98faed2c770 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=beb5140a9d8f349866ef4ba8ada9d98faed2c770 commit beb5140a9d8f349866ef4ba8ada9d98faed2c770 Author: Cy Schubert AuthorDate: 2024-02-27 03:34:09 +0000 Commit: Cy Schubert CommitDate: 2024-04-03 00:28:45 +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: