From nobody Mon Mar 04 16:41:36 2024 X-Original-To: dev-commits-src-main@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 4TpPbh3Jf8z5CvSQ; Mon, 4 Mar 2024 16:41:36 +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 4TpPbh2pJVz4KS4; Mon, 4 Mar 2024 16:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709570496; 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=4I7xfRiv9RLYD8giaOj7/ZYOhTBcMu5jQ8lHSKRGPp0=; b=mGzl9hAnCFrSs3SBjRk1YtRa2onalyIo4De8EL5BkHMRsSRUNfCJX9ZhRa4XwgjKmc1g0l vi+dDROfu1A9y0Wxpvy88MmwD+LTBHTD4ZrYaQxIGw0VhRLMbr3rK8scsoY+BbR48i4X6Z adafATQ/EayymkB1yTByzOfNEr12JZGxKdhvQEtLJDxY3rTncsGqT8Jgi7Q9QI4NzlyorN +a3YavOBvnfWNfeSUy1RvTOOvh+KxR+ts+OGX905UXOJ+YAV6wVq+Yv+xZvTYV2E4eA1Kg cqSM6pn5PZxz7+uLaHxtjs+X/cjNnSv05bxxaWYP3X25LVwF6kdBfb6Z6lAtpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709570496; a=rsa-sha256; cv=none; b=Vl4frCk5vJnYszld46IYs415yAvBo85GceqNqzc7B8fKRtSqXfSBhfRx4sD5OoqdKh0I/W J1bZjaAXSaGG47XQcXvHqHilZ5xsFvJuKPc3XhBxkRb3XBkITFZayxSiByvQNmmWWiieLq kWK4tq4n69YjRknGFraNqHoyTOYrn1B9xB2wA4lN3H/lqcAHMBdMNZ4lMoX47EHG/c3yLP 5YjJUjUyN4+IpeZw/SYZJZQ2Q6edN3ByXc+NlnT5FKTiTSjYzYXYBpSa3dHGYXBAcx0fPK SwoXjoLLhsxnPBcZetWODkbf0504dDl5qmupcCM6sbm7X0GcWHUdvCYNRk/WeA== 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=1709570496; 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=4I7xfRiv9RLYD8giaOj7/ZYOhTBcMu5jQ8lHSKRGPp0=; b=ckWhDC0LEXEiIZsRBoxx8rVKCBRRKxi/gkN67uslhHmBG/o0oA1VCTQK8ePFqV5Yu8Wghc ZxR1j6RerOg2Z5d7XatAli7oHlelaMOZOnWTLXKDLJqcrAxR3aRSAhwI2vnE1HDS67MdCv BFQ2GpzFfbi9aDImSWjwMitcZ+0JNleDZhgEn0cjEscnTQYYMLr2WjM2K/ujEPAPr/3GCV fq9MjSaP4ahS3vp3Ql0xJIIQ87qE38S4eeWMokUVZrwNOqukGIgPDDgsW2xEEVOINLBuTu JL8IZyAPsBsiS1Cqq2TdPJhJEXhK7rly6LHbBedTc3jmFic51SjN2aRrPhvuZw== 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 4TpPbh2N0tzTrm; Mon, 4 Mar 2024 16:41:36 +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 424GfagS093138; Mon, 4 Mar 2024 16:41:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 424GfavG093135; Mon, 4 Mar 2024 16:41:36 GMT (envelope-from git) Date: Mon, 4 Mar 2024 16:41:36 GMT Message-Id: <202403041641.424GfavG093135@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 84ed86380aeb - main - hostapd: Work around lack of MLME support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 84ed86380aeb566ffd8b957ba99c36ad345413ef Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=84ed86380aeb566ffd8b957ba99c36ad345413ef commit 84ed86380aeb566ffd8b957ba99c36ad345413ef Author: Cy Schubert AuthorDate: 2024-02-27 03:34:09 +0000 Commit: Cy Schubert CommitDate: 2024-03-04 16:40:58 +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 MFC after: 1 month --- 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: