From nobody Wed Sep 21 14:01:22 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 4MXg7R2j1Hz4cY2s; Wed, 21 Sep 2022 14:01:23 +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 4MXg7R1FSfz49gV; Wed, 21 Sep 2022 14:01:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663768883; 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=fREFdGYpMBdXKEK1Y114B5lp0pR7Jo64NLK4gE5ofq4=; b=JIqFF8SWKRePL3Jm4GsAfxL5df4B/ID0f1xlj1j6WjrXYK7zVocQwrCNe7Y90PK5yWelX9 ikJb9tH5TpmbBKkGVeUiTlPrEl7NKvstqfL7kQll1yUc+MZTcHzuZ/SNJu+zP4nJLNvQ5k JtGWX+5ZkHJWezaKC90N3/uD9itkyjjMpVP9VlYoxhCx4ZHUBj1DJY8v5Fxde8AlTmv98S Hpa9eRHkPMi0sUFJb7x/4BsqSdMOmG4nrG0pi8DIy3VgSAF24iBk6x6myxImGJ1gq9THyy flX3OLz38KP97Q9LuOdt+P/7vCCVx1pGy0+XttC3+/6kn2QaWDCozzKBAIcQOg== 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 4MXg7R0M3tz14t2; Wed, 21 Sep 2022 14:01:23 +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 28LE1MlA099971; Wed, 21 Sep 2022 14:01:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28LE1M8C099970; Wed, 21 Sep 2022 14:01:22 GMT (envelope-from git) Date: Wed, 21 Sep 2022 14:01:22 GMT Message-Id: <202209211401.28LE1M8C099970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a6e2a4c3a48b - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a6e2a4c3a48b42fbcf1fb653003cb9a76e35f11e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663768883; 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=fREFdGYpMBdXKEK1Y114B5lp0pR7Jo64NLK4gE5ofq4=; b=sQigEq10fFHO5kvmQmSB0C7OTYk7nDgPdzkbS8OLlKuTUrzZ800EseLUXVHzMNvkm6h+cn WE76zDT7/lMeZYV1wNh8RTUMjz4p4a7w1fPR0MRyr1HCr7lN5hQKzN2OuO44nzwBGiclDd KzsIUFREPBFUUu2h8ngmUH3/2ROrW7NT79z9Gz1ghYCzMOI7J49bHgnvah0PMowno8kwy0 9dJv75W6r9kdgocS/dWu2uDBKWAAPvOMGq0PEY5ILrlasx39DuuSEOFBJ24x27n9DKbPEF CTY0CAbMlX3CZdJXcJ1T6axpDgfDU/48j/f8VydWOaBcSADra8Z7FdS0SeWG1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663768883; a=rsa-sha256; cv=none; b=TNY4fXccsK6VB9iOzcollExRnaq1/bq5GrdlrCB7idbeHkoEA6lGB250apv2wD4QNgHkO4 dCDQiHh12nYeapJ8t++mve6xjvl+U+pQ3I2nCaGF96qATZB5dhWcacKmv1NruyCjc9+Eq7 LBcE3v+rsxHmggYitYXuZ3rYUuWAh/Pn2bjSeq87RQ1vZjAmR3HQA1BJduKUgghAp+iqmj q/DagsEhkCOzh0DQEqC8AJxqPUYPSiBtE0cX3gX2ru1pO5fXLZtHpG3FS0q9syEPc9KQGl UoTWKC8Uan4tfM0tRp7Uld/J9i1Sq/F3+2HwlaJgOhGtyovbblkrY8pvEe4yvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a6e2a4c3a48b42fbcf1fb653003cb9a76e35f11e commit a6e2a4c3a48b42fbcf1fb653003cb9a76e35f11e Author: Bjoern A. Zeeb AuthorDate: 2022-08-27 14:48:09 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-09-21 11:46:45 +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 (cherry picked from commit caaa79c3f8c692b9822df74a2dc0a37e4ab33a3b) --- 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 6cebeef93cad..a123e7ccaa4a 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. */