From nobody Sun Feb 20 18:15:29 2022 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 05D2A19CE81B; Sun, 20 Feb 2022 18:15:30 +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 4K1trx5vjYz4XJV; Sun, 20 Feb 2022 18:15:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645380929; 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=VIgjMQVDBsdyc8npUMzVB5JphgB7u7YEfq3vL34hlyY=; b=ZHdPAYS5QRPLBnr+KDO/oOym5SUnxRH405r1dcMC6yBWpZ+v1dk67GI6VBiNGogikRorC4 09AfHeBIqUfKlLg/o5iSLoom+D9XkWieb3Hp20DTHrxwt1pDMbLnRHuG58x3otuKh2WYEu 6hsNdWXl2pG0tS+MO5Ur8rXai99bJVN/daOMEMaBIlSxh2ZDxg0C5gVhmCvPLv1Seh7l8l BIPmRFAKUkzUUFHFUQzu0Tw0ToiGm4JRiO4BE3LpWsVI1FT9hhngpmJtZuIcgPxFrmm2lh K0Yd7g0IXgbjHmOfhgrunZiXWmIs9++TqchfuRYXx4InPhNUEXDjnU5AokCJ3g== 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 98072210FD; Sun, 20 Feb 2022 18:15: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 21KIFTB2022751; Sun, 20 Feb 2022 18:15:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21KIFTbr022750; Sun, 20 Feb 2022 18:15:29 GMT (envelope-from git) Date: Sun, 20 Feb 2022 18:15:29 GMT Message-Id: <202202201815.21KIFTbr022750@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: 0a856847c58c - stable/13 - LinuxKPI: add eth_random_addr() and device_get_mac_address() 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: 0a856847c58cd1f511b327ab0661eb6ca98fa87e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645380929; 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=VIgjMQVDBsdyc8npUMzVB5JphgB7u7YEfq3vL34hlyY=; b=ltdUd+PUW0LXRkI37KTlYFDCLLCWVADax9SAgKMDTCK4X02gAazshYGyQUWdyM+g3+bOxt BBRvca4TDnhk/o+ywMZe2xaGeGCqud6RgwckMGPoICXL42ISWwfK3Ip/D3sm+nVWVLpn/Q RpLQdFnYqRJDsGdIEx0gf6xO9VIcgjiyfGNxX5KAdcn6kCS6e4wW3goUM3y8PBH7M382o5 jO5Yxv7HmkHmCfH2nk32vifjVeknefljXq0m402p0jsxl1jIiSUKGBoXf1+s8jBnr2+5eE Voy+NjucNsp1z16ExBRR0m2+/VlQHcjP9KxOB8bXKf+zUvNI7GAuuzf0Y3Ru+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645380929; a=rsa-sha256; cv=none; b=wz7esOQ1wVQRNAw98IO6lJxgNd1eKIaJPju94pdiDdV+knzUfAkTVqdAZS8SZiDc3AUlIv TdaAjXkh9ozTM0tHe4PJb1QqvvURv2rXOlc+Cp09zOY19ILOHF4mfWLnOkaLE6lA0Z+JNB vNvYY2EVOWwmhEOpMeoEjZEPKlIrxSDGM+qtqUR8h8I9DG22JilNyR5267ViDDYkp1Bgpc iZITQ/t+qDSgTJuPOn7/edhuH1CnpE7deB+T3Tyjg5Oc8d+k6m+zwhEZHK+zEMBWmGrN5Y 3Ju9D7U0Tb++2JOGhqARIPY4YQ8z+qR6AsqdtS9sTbcDTfPIz3xBZPcnYBXb4g== 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=0a856847c58cd1f511b327ab0661eb6ca98fa87e commit 0a856847c58cd1f511b327ab0661eb6ca98fa87e Author: Bjoern A. Zeeb AuthorDate: 2022-02-09 11:50:27 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-02-20 16:23:05 +0000 LinuxKPI: add eth_random_addr() and device_get_mac_address() Add eth_random_addr() and a dummy of device_get_mac_address() pending OF (FDT) support needed by drivers. While here remove a white space in random_ether_addr(). Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D34228 (cherry picked from commit 3cd6d6ff527ad0a57d278e2911f59b22dbd402cf) --- sys/compat/linuxkpi/common/include/linux/etherdevice.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/etherdevice.h b/sys/compat/linuxkpi/common/include/linux/etherdevice.h index 5d8671c00020..219ed55a880d 100644 --- a/sys/compat/linuxkpi/common/include/linux/etherdevice.h +++ b/sys/compat/linuxkpi/common/include/linux/etherdevice.h @@ -28,6 +28,7 @@ #define _LINUXKPI_LINUX_ETHERDEVICE_H_ #include +#include #include #include @@ -107,7 +108,7 @@ eth_zero_addr(u8 *pa) } static inline void -random_ether_addr(u8 * dst) +random_ether_addr(u8 *dst) { arc4random_buf(dst, 6); @@ -115,4 +116,19 @@ random_ether_addr(u8 * dst) dst[0] |= 0x02; } +static inline void +eth_random_addr(u8 *dst) +{ + + random_ether_addr(dst); +} + +static inline int +device_get_mac_address(struct device *dev, char *dst) +{ + + /* XXX get mac address from FDT? */ + return (-ENOENT); +} + #endif /* _LINUXKPI_LINUX_ETHERDEVICE_H_ */