From nobody Fri May 12 11:21:29 2023 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 4QHmYP2Sm9z4BsZ2; Fri, 12 May 2023 11:21:29 +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 4QHmYP1t1Nz3l0M; Fri, 12 May 2023 11:21:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683890489; 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=pVg1H0tn4aCLijYDLZgPCiWdRoe0+XhbKGOcfcDjCgU=; b=RDTT+bL2Ht3DFW+yaYGP6NDhxLYTl1Bn7taFkSxENT36QbwFUu8o+r+7rn4FE/VKICTnjv CTnfZc4dr4JUDz/NVR5pBJTOVh+eGS5Hlbud0RvxB1ITGQavBroXpczzD5hLs7y19HvEib vl0BTGVykUIE8cSyAwz/BwtsJ+5TkX0q69Q7QFSdtZcZWwTontLMIorEfjH7tr8OiG2FlO rw4Dp/bDjvLUGB05CpjWnCYKKEup5ZJW0MYgBq/1+NumMGUaaVNdutACYTsmB8Mof4rzmi YIYzeVxcywXDTlKfohwwMkSjFE2TqVM1FiS0hH7CxzITNMudtbgf7DaBns5K+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683890489; 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=pVg1H0tn4aCLijYDLZgPCiWdRoe0+XhbKGOcfcDjCgU=; b=snKaN4SbnV6pznvuwWQz3HQRh7S/9ZViJLszUDS6boNu0kIyTKbOhdD8vFF+bCCuyEviqZ ZRvyyN6kk4BMHcpg2TUyX5mC4B3kjNuRLwukZMHb/YEB/Pqs3pxbFHEuLjDIzj5tXTNT4n 7IBs1Kn32ZfVvAp6sEnPFxN9nq70I4YWqXWiZOWpz7sZqOgYnlpsyFUMgTTrfgwfzBUGdA vEKm/uEHQmkOrXTu3SXmqLJ1116l2eSv4vtGUlpcMfL0eRwSzrao9rmclFdQpfAB66TqQ8 fMr/IKvPssDw4/nXbHaXgG8nvut1Wfnfhwb7lxMRsh9sU1iOFRp6Yo58lKVztw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683890489; a=rsa-sha256; cv=none; b=gU+YA9jAbz/MHMJ7lG2H9QJ+RHUKQGoOci5lQ8SJDopBUJtn2hzZ+g+tnozRNPuBY8SL1l BWSeQdFNDSneume1a1YHfS7L+gVKk9H4Vhypa/IueObKM8E8gS+6/wmp8juflA9gyhucOU yTuX9UQGgYUWzHoOzi5NBXAR8JIy+qUzfz9EHQOaLb/26xHbgq2+8089hpU9zg/zrr1Tzu HVRwWss9zkashboEfLnt3YVqYVF4oHIqxoDl00aMV3isK5pnu+/TP2sMxffbldmzBmi7Th 9+usmshI3KuBBfo3UeMRGoMGSyURfu9sIkuTsR1xkvIvcZmQh3Wj3e0ytPtNRA== 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 4QHmYP0xMTzYKY; Fri, 12 May 2023 11:21:29 +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 34CBLTCj033976; Fri, 12 May 2023 11:21:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34CBLTXV033975; Fri, 12 May 2023 11:21:29 GMT (envelope-from git) Date: Fri, 12 May 2023 11:21:29 GMT Message-Id: <202305121121.34CBLTXV033975@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: d544b53cb0b6 - main - LinuxKPI: add dummy hash.h and kernel_connect() 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: d544b53cb0b6bc25f2ba078bd9c07e611095bf29 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d544b53cb0b6bc25f2ba078bd9c07e611095bf29 commit d544b53cb0b6bc25f2ba078bd9c07e611095bf29 Author: Bjoern A. Zeeb AuthorDate: 2023-05-11 22:19:57 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-05-12 11:21:10 +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. MFC after: 10 days --- 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)