From nobody Tue Mar 18 09:22:18 2025 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 4ZH5vv0s4dz5qKwC; Tue, 18 Mar 2025 09:22:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZH5vt5y6lz45Gr; Tue, 18 Mar 2025 09:22:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1742289738; 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=7SV/4j6aHbQyv9deVQAiqjCrlMxift0nWF4fvMbMgWw=; b=w9GmPjCXCex35N2Te4dxCRvnYvFWQX5NV7AaxwTdoBeBAJ7qP6sfRlE58ppsr6e/s1pH9Y ynIBhuHJiaHY5qooK3FRwtn6O89e9Wc9ShLqg5JY/yJ+i8DK9S37eH/gecO2txsH1+5lTX E3P3F6NCLq5pj2bEwpJbpFaDM/+W3j40dYdKjbHGGM+kxcs9czz/fLqVrlhtqtw1+wwVRE QHuSzPUsktLYhdnOlJpimJPGGwBmtpL9OFpgxc3W8cUyHFEw//R/lW7ZEkBzLCUKloh6wA Dq7swG4oe816rqB07FXKIUDg1cqhL8oBfbZqCoXqPOSENeoDbmJrU0XBG9TKEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1742289738; a=rsa-sha256; cv=none; b=I3gwJVJL/CN/2dOoebwnfomuef48F64dma2gGgLK3SLGm7TR9op0hsK+iOyFRw8AT0SR0A Sc15GroLCoXHWkspN+gxMiimzcH5PMQ/Nz3sC2woO43StfZRJQTE/X1cbCG/FiOzTYTr1V 0aKUmGGlxFbvda6CXEf4jc+0/wfYnM7JgTItCfAQ6NmTHBc0FNQHkT2WC9h/94i3D+5XyJ C8CWETdpxqf0yW/Filvn1PcXWhyozXWV4LFMuivLt4MkUnUndKN6ElqoMrcHqaBhpHyq6w F/QmzV93ZsG8vrzE+RmtFhkd7qUOtadN1vLYV1/p4bG4matKSBbcKsSemAAsHw== 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=1742289738; 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=7SV/4j6aHbQyv9deVQAiqjCrlMxift0nWF4fvMbMgWw=; b=qvFImGIq0VIvWZTWbs5Dw3JPxBlK8PwSoG9a1dwtoDLm9B8YYZmNERTGiMGq71Nj+EPCje 1wSisCxmfAgiY/aqZ60N1DZYTDKuGlSlHbozTtd0DuXo8quQ4hMfBtjWfx/2BHJsa+eQQg X3phz+usL5Mpin+8UM6+2CLNkohP0ZzcJS7NCTSvTQwDiNu03qbr9uR4ON1XyjYdEg/0YR 2SZd+6YZoxO+2L2VlPm5zdrUSCzKWz7BnxxnRuDRi/hx3jSWaWH+YgqJtzM+BjAfs51kTh dZLwCz7GMAgIgfM4EM5GOEnbQ+jQxLi9PiU1ff4DlUbb7NHzjQTuv/nFaQa9dA== 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 4ZH5vt4jGkzBCj; Tue, 18 Mar 2025 09:22:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 52I9MIB9076403; Tue, 18 Mar 2025 09:22:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52I9MIWW076400; Tue, 18 Mar 2025 09:22:18 GMT (envelope-from git) Date: Tue, 18 Mar 2025 09:22:18 GMT Message-Id: <202503180922.52I9MIWW076400@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: b42c339c59fd - main - LinuxKPI: 802.11: CONFIG_PM_SLEEP / WoWLAN header adjustments 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: b42c339c59fd00f2d97f6854b17b54b340019d0c Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b42c339c59fd00f2d97f6854b17b54b340019d0c commit b42c339c59fd00f2d97f6854b17b54b340019d0c Author: Bjoern A. Zeeb AuthorDate: 2025-03-15 00:30:38 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-03-18 09:22:01 +0000 LinuxKPI: 802.11: CONFIG_PM_SLEEP / WoWLAN header adjustments Sort out some (though not yet all) changes needed for CONFIG_PM_SLEEP and respectively WoWLAN support (so we can compile it in). This is just one further step towards proper suspend/resume support. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- .../linuxkpi/common/include/linux/ieee80211.h | 7 ++++++ sys/compat/linuxkpi/common/include/net/cfg80211.h | 26 +++++++++++++++++----- sys/compat/linuxkpi/common/include/net/mac80211.h | 16 +++++++++---- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index 964fd970ecf0..efac2a26e27e 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -147,6 +147,7 @@ enum ieee80211_key_len { WLAN_KEY_LEN_WEP104 = 13, WLAN_KEY_LEN_TKIP = 32, WLAN_KEY_LEN_CCMP = 16, + WLAN_KEY_LEN_CCMP_256 = 32, WLAN_KEY_LEN_GCMP = 16, WLAN_KEY_LEN_AES_CMAC = 16, WLAN_KEY_LEN_GCMP_256 = 32, @@ -507,6 +508,12 @@ struct ieee80211_mgmt { uint16_t capab_info; uint8_t variable[0]; } beacon; + /* 9.3.3.5 Association Request frame format */ + struct { + uint16_t capab_info; + uint16_t listen_interval; + uint8_t variable[0]; + } assoc_req; /* 9.3.3.10 Probe Request frame format */ struct { uint8_t variable[0]; diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 3454b58f1db7..2cdb96ffccdf 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1033,9 +1033,12 @@ struct cfg80211_wowlan_nd_info { enum wiphy_wowlan_support_flags { WIPHY_WOWLAN_DISCONNECT, - WIPHY_WOWLAN_GTK_REKEY_FAILURE, WIPHY_WOWLAN_MAGIC_PKT, WIPHY_WOWLAN_SUPPORTS_GTK_REKEY, + WIPHY_WOWLAN_GTK_REKEY_FAILURE, + WIPHY_WOWLAN_EAP_IDENTITY_REQ, + WIPHY_WOWLAN_4WAY_HANDSHAKE, + WIPHY_WOWLAN_RFKILL_RELEASE, WIPHY_WOWLAN_NET_DETECT, }; @@ -1049,6 +1052,7 @@ struct cfg80211_wowlan_wakeup { /* XXX TODO */ uint16_t pattern_idx; bool disconnect; + bool unprot_deauth_disassoc; bool eap_identity_req; bool four_way_handshake; bool gtk_rekey_failure; @@ -1066,11 +1070,22 @@ struct cfg80211_wowlan_wakeup { struct cfg80211_wowlan { /* XXX TODO */ - int disconnect, gtk_rekey_failure, magic_pkt; - int eap_identity_req, four_way_handshake, rfkill_release, tcp, any; + bool any; + bool disconnect; + bool magic_pkt; + bool gtk_rekey_failure; + bool eap_identity_req; + bool four_way_handshake; + bool rfkill_release; + + /* Magic packet patterns. */ int n_patterns; - struct cfg80211_sched_scan_request *nd_config; struct cfg80211_pkt_pattern *patterns; + + /* netdetect? if not assoc? */ + struct cfg80211_sched_scan_request *nd_config; + + void *tcp; /* XXX ? */ }; struct cfg80211_gtk_rekey_data { @@ -1244,7 +1259,8 @@ struct wiphy { unsigned long ext_features[BITS_TO_LONGS(NUM_NL80211_EXT_FEATURES)]; struct dentry *debugfsdir; - struct cfg80211_wowlan_support *wowlan; + const struct wiphy_wowlan_support *wowlan; + struct cfg80211_wowlan *wowlan_config; /* Lower layer (driver/mac80211) specific data. */ /* Must stay last. */ uint8_t priv[0] __aligned(CACHE_LINE_SIZE); diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 4dc1aaccb886..9830d8f16d05 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -42,6 +42,7 @@ #include #include #include +#include #define ARPHRD_IEEE80211_RADIOTAP __LINE__ /* XXX TODO brcmfmac */ @@ -1089,9 +1090,7 @@ struct ieee80211_ops { int (*set_tim)(struct ieee80211_hw *, struct ieee80211_sta *, bool); int (*set_key)(struct ieee80211_hw *, enum set_key_cmd, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *); - void (*set_default_unicast_key)(struct ieee80211_hw *, struct ieee80211_vif *, int); void (*update_tkip_key)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_key_conf *, struct ieee80211_sta *, u32, u16 *); - void (*set_rekey_data)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_gtk_rekey_data *); int (*start_pmsr)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_pmsr_request *); void (*abort_pmsr)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_pmsr_request *); @@ -1135,9 +1134,18 @@ struct ieee80211_ops { void (*link_sta_add_debugfs)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_link_sta *, struct dentry *); void (*link_add_debugfs)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *, struct dentry *); /* #endif */ +/* #ifdef CONFIG_PM_SLEEP */ /* Do not change depending on compile-time option. */ + int (*suspend)(struct ieee80211_hw *, struct cfg80211_wowlan *); + int (*resume)(struct ieee80211_hw *); + void (*set_wakeup)(struct ieee80211_hw *, bool); + void (*set_rekey_data)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_gtk_rekey_data *); + void (*set_default_unicast_key)(struct ieee80211_hw *, struct ieee80211_vif *, int); +/* #if IS_ENABLED(CONFIG_IPV6) */ + void (*ipv6_addr_change)(struct ieee80211_hw *, struct ieee80211_vif *, struct inet6_dev *); +/* #endif */ +/* #endif CONFIG_PM_SLEEP */ }; - /* -------------------------------------------------------------------------- */ /* linux_80211.c */ @@ -2425,7 +2433,7 @@ ieee80211_get_tkip_p1k_iv(struct ieee80211_key_conf *key, static __inline struct ieee80211_key_conf * ieee80211_gtk_rekey_add(struct ieee80211_vif *vif, - struct ieee80211_key_conf *key) + struct ieee80211_key_conf *key, int link_id) { TODO(); return (NULL);