From nobody Tue Jan 24 22:11:55 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 4P1h5l45Wqz3bffy; Tue, 24 Jan 2023 22:11:55 +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 4P1h5l3YCQz4PtG; Tue, 24 Jan 2023 22:11:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598315; 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=yU1y5e4Wl1lF5HrzX5YGOjJQt/HetDU9OZsEMuB25hc=; b=UkCzeAqbLGkFnMzpRzk+WP0yHdhLnOEPMEiQ/KU+x+zB44UAGRsj6SDXYbET/piIXXWZmQ 8tqy43WI6B3ohIJe8LvVI36SI7ewgF4LvqE8yCw4mmKzTcJmg4U0z6SLl+BqbA7O7QfOFg 5UbwNT5T3iQrbYqhBGaDbv0pl40htmY9Oq3qYMc/0i8JF9BuqkzmufYteZ5kRw9QwNc+Kx 50ggtuDgiBVHIeOJjc5NoO4A2VEX8y1essp7HJXxnSzMmA2F+KIjGCaOSxkoHGNyTwn1ag 31sp46X0fhPRZhISoC/sA+c2gUG7I7hzw497kboAm5cPOOzkuBIvwwK3d2nOMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598315; 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=yU1y5e4Wl1lF5HrzX5YGOjJQt/HetDU9OZsEMuB25hc=; b=sKfLybVAIhuEt1cWX5wnj1RcVPRTH1uVBoGLmljcoUa+HPbhv7COlyBuBPC7xVtAPLp2In 9IbmmFjiYu8Gc9/eqmH6H+b9j+sav2Uy+kdUYvfwnIeP/bM4+ACaYkt3QUIsBj7vI+BrV1 HRHnGTsxHFjsxb/mBBhuekN4AJ0hRxgCN1dNE0PfcRCpZPjXQUHqJZ5R0E+JJcOx9BpGhM +ijzLamJ8ljDEloqemeaWN/+8Y6J4CiSzx1PJqYBpdHLMkGwDkQwUY/ymXDi4m077EKOUs BmQvWvw83hm8JsjUsMzeMiy0dRWAkEMkP4aOoCkHZHsgn4vgSKHiEX4wBkeP8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598315; a=rsa-sha256; cv=none; b=PzCFawD42jOh7GdOEiPSj5ETspCciaiVVMGgXIRfCsjLZwNPYfWrx9IJAZT2R3FMtghirO 3Rkcb2HvLNM1M3YZjBOr8AAYVsyuxVIgVetHNm3JSehDnzjkyL9hg7ba2F5dnM/rYXhCI7 lM+pjrv/dIfY4Uu4vzs8eJjiwRtKPmED6SymiF8IeSTRh8GWiUv/8/zgoSzKHBrYEKTE+F JSjFDwpYPT7FOubC/kM78mHGLnI2IOSPWa3aCcgkulGtOMeDG0i/u02YDAB1eb7J2zQCJN HDRM1DtL3RhFqG8cssTD4nOunAo6bSNxD6tWPMcdSEFF5C46eG4MDH76M9jJGQ== 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 4P1h5l2L3mzQcF; Tue, 24 Jan 2023 22:11:55 +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 30OMBto1085375; Tue, 24 Jan 2023 22:11:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OMBtEn085374; Tue, 24 Jan 2023 22:11:55 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:11:55 GMT Message-Id: <202301242211.30OMBtEn085374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: e6cafedf0991 - stable/13 - stand: Add dv_devfmt to return a string represenation of the device 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e6cafedf0991fbe6f087a0a75f39ac07d8d4642a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e6cafedf0991fbe6f087a0a75f39ac07d8d4642a commit e6cafedf0991fbe6f087a0a75f39ac07d8d4642a Author: Warner Losh AuthorDate: 2022-08-11 15:05:34 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:30 +0000 stand: Add dv_devfmt to return a string represenation of the device Add a new pointer, dv_devfmt, to allow devices to format themselves. We will use this to simplify many of the fmtdev functions in the tree as they are all almost the same, or all are isomorphic to each other. Sponsored by: Netflix Reviewed by: tsoome (prior version) Differential Revision: https://reviews.freebsd.org/D35915 (cherry picked from commit 4d4b1a298c84f2357c304583dfe78d0e4b8fa2f1) --- stand/libsa/stand.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stand/libsa/stand.h b/stand/libsa/stand.h index 5f87f96ce673..5ffff54c7ca7 100644 --- a/stand/libsa/stand.h +++ b/stand/libsa/stand.h @@ -140,6 +140,8 @@ extern struct fs_ops efihttp_fsops; * Device switch */ #define DEV_NAMLEN 8 /* Length of name of device class */ +#define DEV_DEVLEN 128 /* Length of longest device instance name */ +struct devdesc; struct devsw { const char dv_name[DEV_NAMLEN]; int dv_type; /* opaque type constant */ @@ -157,6 +159,7 @@ struct devsw { int (*dv_ioctl)(struct open_file *f, u_long cmd, void *data); int (*dv_print)(int verbose); /* print device information */ void (*dv_cleanup)(void); + char * (*dv_fmtdev)(struct devdesc *); }; /* @@ -177,6 +180,8 @@ struct devdesc { void *d_opendata; }; +char *devformat(struct devdesc *d); + struct open_file { int f_flags; /* see F_* below */ struct devsw *f_dev; /* pointer to device operations */