From nobody Sat Sep 03 22:55:10 2022 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 4MKqqf6x2dz4bnw5; Sat, 3 Sep 2022 22:55:10 +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 4MKqqf6HBQz4K4D; Sat, 3 Sep 2022 22:55:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662245710; 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=Cyj2Hh8H/s0znR0kHSawfsoFCoDDr/hTi6DnwBDRz7M=; b=QOp4zze/D4vm+TJAaZc3SDT3fPFdrwUNSTjshw56XobxPVA8NQO6sE30+3uZ8gLniK2XsX 5nDkoLKCIT4oBPYs70m3E4xTk5LCPXWgwfInpNTFpxcxRG7tl++H2ULqDwSOmz1TgE9hsu /hzhK/8yV8p1CuyhJIZquRyMOlQesAdQEz5Gq3EK9ajTwZuQt4hOlC2dMYZKS6cA3ZLaCr FYzVdsKwbFo6LaGOvH/xvjyLyUwPQS4Ag4VlPNM0oEIr8kAWYoZNqW+Ia9BnzZ+yyikrIG V43SNaIRO1MLEnfEfz43kF7M1sVYgv5m+YHYeIX2fA+XPb0jF7jb0ddBJt9q4w== 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 4MKqqf5KP4zHq6; Sat, 3 Sep 2022 22:55:10 +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 283MtAuo007151; Sat, 3 Sep 2022 22:55:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 283MtAv9007150; Sat, 3 Sep 2022 22:55:10 GMT (envelope-from git) Date: Sat, 3 Sep 2022 22:55:10 GMT Message-Id: <202209032255.283MtAv9007150@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: b35f6cd06612 - main - LinuxKPI: 80211: make HW_CRYPTO compileable again 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b35f6cd066128f8cf0b7f3125529f59dd8ba3059 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662245710; 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=Cyj2Hh8H/s0znR0kHSawfsoFCoDDr/hTi6DnwBDRz7M=; b=j97fbz091ddQNFsI2SXbhPc3AYTxn2lKeGBp5dcLEg3WvDcUzc/Zw9vt9l3UgsMG+Nn9yJ PqkZ1COpYuN04nzBPl3Cvalx0xomJBZZAfMErfX2aXBlCKzOBrnW0dvb+OeNfAybwU0pFS m5oMInzXdbMq8zBNv7WAkKh26EjKl+E4VExBsEy1XQnPEctL/6Evl14qIRzi/G5W6Pzt4c RtaNmKz305uor2osASCp6AhDYzs8M8Z60o+h2an5+0ImRN9obajbmTKF6Vt3CII2wAN3d/ x+8QHgE7giXEq+zYN47CqwVpWzCyRpQmIglIz0mLBnO44Hm6Gb3rf00chWqBmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662245710; a=rsa-sha256; cv=none; b=b+xmBDWTQ3E3gb6CNkbb/7CekQhpJ7xPh0yVAqpTKgFLTtDZPwcpvUo/CR7A+8YgZN4yk3 uXoyBtTmtbkxqLFPQn+MUjH/Aekd9GAnk+IxHsdDm/SK5yyLD8F95NrNQP5V7EM9r9nUlx kArzf9PhpZLz/Ql8KMTTDVqHdPHB3ILv5KtdgemzIV4dYYymhbKBG5oZu9Vd/pa5PhrxeT Ap8BUDq73hWhsvda8RYNGKKmzuppR/u4QlXFS3Ap+9T3XLFrIxwQ/1yAEp3LXymrF8OsNU L+DKiL3+sqz8k7CTIZm51dn/NPGmnm86FOm3Fw6HmrQwEAzrleNAPbsKA8eb/w== 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=b35f6cd066128f8cf0b7f3125529f59dd8ba3059 commit b35f6cd066128f8cf0b7f3125529f59dd8ba3059 Author: Bjoern A. Zeeb AuthorDate: 2022-09-03 22:51:16 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-09-03 22:51:16 +0000 LinuxKPI: 80211: make HW_CRYPTO compileable again Rename TRY_HW_CRYPTO to LKPI_80211_HW_CRYPTO for consitency and make it compileable again in case someone wants to sit down and make it work. It's probably not too much to do. Otherwise I might eventually get around to it. Obtained from: bz/wireless-dev Sponsored by: The FreeBSD Foundation MFC after: 4 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 4ec54400c166..6408f57c20c3 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -70,6 +70,8 @@ __FBSDID("$FreeBSD$"); #include #include "linux_80211.h" +/* #define LKPI_80211_HW_CRYPTO */ + static MALLOC_DEFINE(M_LKPI80211, "lkpi80211", "LinuxKPI 80211 compat"); /* -------------------------------------------------------------------------- */ @@ -364,7 +366,7 @@ lkpi_opmode_to_vif_type(enum ieee80211_opmode opmode) return (NL80211_IFTYPE_UNSPECIFIED); } -#ifdef __notyet__ +#ifdef LKPI_80211_HW_CRYPTO static uint32_t lkpi_l80211_to_net80211_cyphers(uint32_t wlan_cipher_suite) { @@ -395,9 +397,7 @@ lkpi_l80211_to_net80211_cyphers(uint32_t wlan_cipher_suite) return (0); } -#endif -#ifdef TRY_HW_CRYPTO static uint32_t lkpi_net80211_to_l80211_cipher_suite(uint32_t cipher, uint8_t keylen) { @@ -558,7 +558,7 @@ linuxkpi_cfg80211_bss_flush(struct wiphy *wiphy) IEEE80211_UNLOCK(ic); } -#ifdef TRY_HW_CRYPTO +#ifdef LKPI_80211_HW_CRYPTO static int _lkpi_iv_key_set_delete(struct ieee80211vap *vap, const struct ieee80211_key *k, enum set_key_cmd cmd) @@ -2295,7 +2295,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], /* Key management. */ if (lhw->ops->set_key != NULL) { -#ifdef TRY_HW_CRYPTO +#ifdef LKPI_80211_HW_CRYPTO vap->iv_key_set = lkpi_iv_key_set; vap->iv_key_delete = lkpi_iv_key_delete; #endif @@ -2925,7 +2925,9 @@ static void lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) { struct ieee80211_node *ni; +#ifndef LKPI_80211_HW_CRYPTO struct ieee80211_frame *wh; +#endif struct ieee80211_key *k; struct sk_buff *skb; struct ieee80211com *ic; @@ -2947,7 +2949,8 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) #endif ni = lsta->ni; -#ifndef TRY_HW_CRYPTO + k = NULL; +#ifndef LKPI_80211_HW_CRYPTO /* Encrypt the frame if need be; XXX-BZ info->control.hw_key. */ wh = mtod(m, struct ieee80211_frame *); if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { @@ -3037,7 +3040,7 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) lsta = lkpi_find_lsta_by_ni(lvif, ni); if (lsta != NULL) { sta = LSTA_TO_STA(lsta); -#ifdef TRY_HW_CRYPTO +#ifdef LKPI_80211_HW_CRYPTO info->control.hw_key = lsta->kc; #endif } else { @@ -3493,7 +3496,7 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) #endif ic->ic_cryptocaps = 0; -#ifdef TRY_HW_CRYPTO +#ifdef LKPI_80211_HW_CRYPTO if (hw->wiphy->n_cipher_suites > 0) { for (i = 0; i < hw->wiphy->n_cipher_suites; i++) ic->ic_cryptocaps |= lkpi_l80211_to_net80211_cyphers(