From nobody Sat Aug 27 14:56:03 2022 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 4MFKX36xGSz4ZZvC; Sat, 27 Aug 2022 14:56:03 +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 4MFKX36W71z3ZjJ; Sat, 27 Aug 2022 14:56:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661612163; 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=RRQDZExQCveKH7GG3n86iuixR09dXg4XydSp2oOfMx4=; b=omIIDr/mh1hbkPlyZJ9gsdXsp7uq11VlYtLkdnJgqqCfbQSKuAtpJPQNpkCq/MtZeod8dt 1ErvSuBwTjJ+gv0Nr24QjaOlEyABgJWigAuNIteZHc4W0y6mdd7NzekfXv7S/F4Cn95KAa LNqoBGliisPXfDKSOYDEtXvxB3cstReCsVlcJEzWRWkEMhJC2pTUlipWHZuc/Kf0P+f5HA ieUFY12iBRDN08dNnXS7dkveLhSUuIWg0kvexctU70nercu8TPut+qwTWG4zELQ/tFBXGQ tEZbyQBqea5JAGm0mCxp5LAxMDrK2XZJi9ElxC+jt01w6mbjrVvLhSwkOvYDrw== 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 4MFKX35TwMzn0k; Sat, 27 Aug 2022 14:56:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27REu3vg079700; Sat, 27 Aug 2022 14:56:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27REu3nO079699; Sat, 27 Aug 2022 14:56:03 GMT (envelope-from git) Date: Sat, 27 Aug 2022 14:56:03 GMT Message-Id: <202208271456.27REu3nO079699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: caaa79c3f8c6 - main - LinuxKPI 802.11: change type of bssid in struct ieee80211_bss_conf 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: caaa79c3f8c692b9822df74a2dc0a37e4ab33a3b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661612163; 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=RRQDZExQCveKH7GG3n86iuixR09dXg4XydSp2oOfMx4=; b=obO3HL8X54pcpiV5ya1Wi02bMv6Vl93NfEAgAl+xunVEwetqfTj81fZ4QrMzw3XBCu4DmR +2/AdUOMaaT2JWYAODuSxaFAXZXTdlexmyrQgUk9Hz9hWy1hBcoWyGMUED9xVUk1PlupU/ 1IAdeZXMPE1h8lq6tgsvNPcDkl83RX3GZ2EBxRD+CD+RGc5DJPDuNI7PIXbPEDakPKw1XT cpvb+PfyIHxqqLDRlLZbgIh8pshIH43ZPbjeBbvMlo5J/BUTZw0WfyZGuJ4RAcl3AGg1gO gAi9hFQ9fZuFYTWs0T05HRmzfCb5wq4xNFIo38e190fDIdGA4c3ivFLCj0BhAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661612163; a=rsa-sha256; cv=none; b=JpPHeGY36Ze/XsPCi+AGWSAD6LAddeJu6eoG7BAyHXJ160H4ktVGn5UAHrODfrpCQ2YZnO FQg/iV2hGXLHuVMxkTBAsMglj/KXHwjqowrDZHgtW9Q56LK8HVO5A44BZcXQQTAroU+AS0 03/0FQEaZX1PS1cdHupwJnmGzYyqg2hUJE27l+UJZ6FkfoVj1Fyy4lBOnSLo/9MLNKoQrS JSEnPS//Jg9jZ+cygH4l4bixfP+3900GUbixqaKrSJRR5oZG1GvK+6m0m3DBoeUa63Wp+X hK51XQvsDJa7brdxfL7c5NzZZEbTlZ/fQPrCbfN31+WFomnUpRggeDUMsnYbxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=caaa79c3f8c692b9822df74a2dc0a37e4ab33a3b commit caaa79c3f8c692b9822df74a2dc0a37e4ab33a3b Author: Bjoern A. Zeeb AuthorDate: 2022-08-27 14:48:09 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-08-27 14:54:02 +0000 LinuxKPI 802.11: change type of bssid in struct ieee80211_bss_conf Enabling other driver code found that the bssid in struct ieee80211_bss_conf is not an array but expected to be a const pointer (const, != NULL checks). Adjust accordingly in the header and in the LinuxKPI compat code. There initialization now needs to be a static array always present as we need a value before we will have a BSS (node in scan_to_auth) as the mac80211 driver (*handlers) are expecting the pointer to be not NULL (copying without checks). This is a pre-req to enable d3 (CONFIG_PM[_SLEEP]) in the future. Tested by: Tomoaki AOKI (junchoon dec.sakura.ne.jp) Tested by: Berislav Purgar (bpurgar gmail.com) Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/net/mac80211.h | 2 +- sys/compat/linuxkpi/common/src/linux_80211.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 4320edc90eba..13ae7bb99376 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -215,7 +215,7 @@ struct mac80211_fils_discovery { struct ieee80211_bss_conf { /* TODO FIXME */ - uint8_t bssid[ETH_ALEN]; + const uint8_t *bssid; uint8_t transmitter_bssid[ETH_ALEN]; struct ieee80211_ftm_responder_params *ftmr_params; struct ieee80211_p2p_noa_attr p2p_noa_attr; diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index a98ed56fcdad..4ec54400c166 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -115,6 +115,9 @@ SYSCTL_INT(_compat_linuxkpi_80211, OID_AUTO, debug, CTLFLAG_RWTUN, #define PREP_TX_INFO_DURATION 0 /* Let the driver do its thing. */ #endif +/* c.f. ieee80211_ioctl.c */ +static const uint8_t zerobssid[IEEE80211_ADDR_LEN]; + /* This is DSAP | SSAP | CTRL | ProtoID/OrgCode{3}. */ const uint8_t rfc1042_header[6] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; @@ -996,7 +999,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int /* Set bss info (bss_info_changed). */ bss_changed = 0; - IEEE80211_ADDR_COPY(vif->bss_conf.bssid, ni->ni_bssid); + vif->bss_conf.bssid = ni->ni_bssid; bss_changed |= BSS_CHANGED_BSSID; vif->bss_conf.txpower = ni->ni_txpower; bss_changed |= BSS_CHANGED_TXPOWER; @@ -2230,6 +2233,15 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], vif->bss_conf.ht_operation_mode = IEEE80211_HT_OP_MODE_PROTECTION_NONE; vif->bss_conf.assoc = false; vif->bss_conf.aid = 0; + /* + * We need to initialize it to something as the bss_info_changed call + * will try to copy from it in iwlwifi and NULL is a panic. + * We will set the proper one in scan_to_auth() before being assoc. + * NB: the logic there with using an array as bssid_override and checking + * for non-NULL later is flawed but in their workflow does not seem to + * matter. + */ + vif->bss_conf.bssid = zerobssid; #endif #if 0 vif->bss_conf.dtim_period = 0; /* IEEE80211_DTIM_DEFAULT ; must stay 0. */