From nobody Mon Jun 26 12:08:43 2023 X-Original-To: dev-commits-src-branches@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 4QqRT755shz4k6bc; Mon, 26 Jun 2023 12:08:43 +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 4QqRT73wCHz3jPy; Mon, 26 Jun 2023 12:08:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687781323; 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=SWiZdi9UkuaQ/u3N/AQ/n9nKdHVTuA4QsfD9Oj6qZpA=; b=OWxcmCY6Ijiwp/tw4SwvpOMJgm4p3V28fVZPMxfmPOwCSRvWH4vhKRdQo+ecO9FWZaa5PB DeUnLFYB4xltmPOQ66fzNb8lZwBs1CxRgUoAAv2kp2rKnXxL85fJu69IgSeSMulCl3jgd9 KuzJ2lWGo5f9GhHESjpusNp5fX9/6NBxQNTG+3eSEd1lsTnzbpZHfAfBDUiLsMRbKnyyxy lkg74Vwmp2IpouDmeLgV2YCpOEL1Gmvna9wnVLHRH+joUNqt+uXs7mKIGz8fEur0fACeJ4 dOVzbfnfAGxmo2+B+qxTXPa8NzC8XqlT8R4ExXJO9Z/BIEi01h6WyiNcQs66qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687781323; 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=SWiZdi9UkuaQ/u3N/AQ/n9nKdHVTuA4QsfD9Oj6qZpA=; b=lv3c+/U2pFFTak7Rc2KQNqqtNSeyRB4lhUtk9xs7Sydmsu9syKfE78gDkSYQd65tkW+mqf CbxOZzjhuII4OylrsKdphGAkFcpxA4iECCDCRUAtTPChKGySYTmS7ditNPXiZ9HdKzRFa8 nK9mj8uyu2qkADU1AOTLduGJyEvEVXIAiEtgJaerbuEygimFy9jP33vrn26UiKAnlsFl/f 32hmu45TBgH2vR8Rz2sjHHPUfWpTtRnplU/z2XHrFvYrgr6c8Wcr2tOqId86iDrbDj+4o2 wsY1EfSPKgQ89IFFZTOkgCCEi0ut+jntTObMfWojCjhfx2eh8w0+dvdpO5D5sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687781323; a=rsa-sha256; cv=none; b=tcvaLb5nyODw/WkfLICw+lmr8fFB0UOZ1uHVLBrviZMY9D6pPCZIWUYGmjpYHvMwX1c8Vs acehw2snnDouBycteC/+7CL5F25l9tK/2qBv+qJ/flf54J/2c4WZDT/PGcn/Xw4RKoV73D BABTRy3Phhq0KpoGAzgg1P1XOk+lgbs/mLJQRjJSDlVe3ANAZvIF/EXbzXUBzKJFeVDSo/ QB0GB8xyl5hKYDpIArPYfl+ZBNhWDWxTwMflzyepgNm/FluF7wWm2ZLBiwex0eWrW68+IL BqxeRX6k7X5TvH9lqb1I2laNnRW4t258Sp/PEhCQFb4LHO5dZqTnMR2RXfXm8Q== 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 4QqRT72mLDz18Ck; Mon, 26 Jun 2023 12:08:43 +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 35QC8hnn083207; Mon, 26 Jun 2023 12:08:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35QC8hb8083206; Mon, 26 Jun 2023 12:08:43 GMT (envelope-from git) Date: Mon, 26 Jun 2023 12:08:43 GMT Message-Id: <202306261208.35QC8hb8083206@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: 46f8d147fbc9 - stable/13 - LinuxKPI: add dummy hash.h and kernel_connect() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 46f8d147fbc94f5ea7a2f916a87d25cd3b42cca2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=46f8d147fbc94f5ea7a2f916a87d25cd3b42cca2 commit 46f8d147fbc94f5ea7a2f916a87d25cd3b42cca2 Author: Bjoern A. Zeeb AuthorDate: 2023-05-11 22:19:57 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-06-26 09:14:28 +0000 LinuxKPI: add dummy hash.h and kernel_connect() Add crypto/hash.h and a dummy kernel_connect() needed to compile the ath11k wireless driver. While I hope we will not actually need the hash.h fallbacks, kernel_connect() we will have to deal with once we sort out more QMI bits. (cherry picked from commit d544b53cb0b6bc25f2ba078bd9c07e611095bf29) --- sys/compat/linuxkpi/common/include/crypto/hash.h | 94 +++++++++++++++++++++++ sys/compat/linuxkpi/common/include/linux/socket.h | 11 +++ 2 files changed, 105 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/crypto/hash.h b/sys/compat/linuxkpi/common/include/crypto/hash.h new file mode 100644 index 000000000000..bf401691722a --- /dev/null +++ b/sys/compat/linuxkpi/common/include/crypto/hash.h @@ -0,0 +1,94 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2022 Bjoern A. Zeeb + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _LINUXKPI_CRYPTO_HASH_H +#define _LINUXKPI_CRYPTO_HASH_H + +#include /* for pr_debug */ + +struct crypto_shash { +}; + +struct shash_desc { + struct crypto_shash *tfm; +}; + +static inline struct crypto_shash * +crypto_alloc_shash(const char *algostr, int x, int y) +{ + + pr_debug("%s: TODO\n", __func__); + return (NULL); +} + +static inline void +crypto_free_shash(struct crypto_shash *csh) +{ + pr_debug("%s: TODO\n", __func__); +} + +static inline int +crypto_shash_init(struct shash_desc *desc) +{ + pr_debug("%s: TODO\n", __func__); + return (-ENXIO); +} + +static inline int +crypto_shash_final(struct shash_desc *desc, uint8_t *mic) +{ + pr_debug("%s: TODO\n", __func__); + return (-ENXIO); +} + +static inline int +crypto_shash_setkey(struct crypto_shash *csh, const uint8_t *key, size_t keylen) +{ + pr_debug("%s: TODO\n", __func__); + return (-ENXIO); +} + +static inline int +crypto_shash_update(struct shash_desc *desc, uint8_t *data, size_t datalen) +{ + pr_debug("%s: TODO\n", __func__); + return (-ENXIO); +} + +static inline void +shash_desc_zero(struct shash_desc *desc) +{ + + explicit_bzero(desc, sizeof(*desc)); +} + +/* XXX review this. */ +#define SHASH_DESC_ON_STACK(desc, tfm) \ + uint8_t ___ ## desc ## _desc[sizeof(struct shash_desc)]; \ + struct shash_desc *desc = (struct shash_desc *)___ ## desc ## _desc + +#endif /* _LINUXKPI_CRYPTO_HASH_H */ diff --git a/sys/compat/linuxkpi/common/include/linux/socket.h b/sys/compat/linuxkpi/common/include/linux/socket.h index 3afb9bdfe3ba..8818971fa4c7 100644 --- a/sys/compat/linuxkpi/common/include/linux/socket.h +++ b/sys/compat/linuxkpi/common/include/linux/socket.h @@ -33,6 +33,17 @@ #include +#define AF_QIPCRTR 42 + +static inline int +kernel_connect(int sd, struct sockaddr *sa, size_t salen, int flags) +{ + + /* kern_connectat()? It is used for sockaddr_qrtr by ath1xk/qmi. */ + pr_debug("%s: TODO\n", __func__); + return (-EINVAL); +} + #ifdef notyet static inline int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len)