From nobody Thu Aug 11 16:27:39 2022 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 4M3XK834GLz4YrnG; Thu, 11 Aug 2022 16:27:40 +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 4M3XK80ZxGz3pxm; Thu, 11 Aug 2022 16:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660235260; 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=iUNa5sQytEtBUNIfXW71uf/OWf7P3WoY10iBda0Zwm0=; b=qX7QZJPluGoLpa0dabEmfcf5LWPanezeLgDcYcVu4qDsKgrHrrZdmieut/4u9bMEd+S1jQ HNdzFl9m3R4SZ3Gh3q/qyPxaKPd/yvXn/nrfmvr8OL74osi42biu2/S/rF0sIoBpFr+NA1 5V1fY4Btz4kcsErd6ulrhAFvKgfoZ9YTIm2Q/ZUeL2I3UKEggo5kG2sv2bvLx+MkK3N687 z/5gy1sn5SRrXIn8ukBmCQlM0ymtwVimbVXw+o6SJoBwLWv6ez8EOCH+Xrq+gkvKlW7Mwz P7uAfw0lqTPqCxKsUiUFP8sbpU/GwiDmO9+v7vrNztszJJ3M8oVVXVhquZUuVw== 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 4M3XK764Q6zy4g; Thu, 11 Aug 2022 16:27:39 +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 27BGRd6N055330; Thu, 11 Aug 2022 16:27:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27BGRdnq055329; Thu, 11 Aug 2022 16:27:39 GMT (envelope-from git) Date: Thu, 11 Aug 2022 16:27:39 GMT Message-Id: <202208111627.27BGRdnq055329@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 4d4b1a298c84 - main - stand: Add dv_devfmt to return a string represenation of the device 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d4b1a298c84f2357c304583dfe78d0e4b8fa2f1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660235260; 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=iUNa5sQytEtBUNIfXW71uf/OWf7P3WoY10iBda0Zwm0=; b=GitAjlLpOTZNbTI9TR4/F3V7jBVA0rqz4e2WAK29sg3tCiWW/jVNZEB9IET2NdXEAMNqI2 bAr/outbPpMKj7wBuqsF64STXPfuoDThsb/Dulok8/tJURUHOXB5ic9qeIelYwBtT2lbuN C+IgQws8Hqcw0enuXN7i6cI/E+0+X0/6WQeTf3X/6SEElujHDy8O6y7XgAkrnYjsI7xKH+ fJcwbOi5HROC2V9i0pUXOmEUNmQ7oqZ3VIrhc1Xc6S/B8nMlTWOM22kIa6+2zauoG6uDuN kZ67uZJl3HDCVvl+ebYByiVHmUbIXti2eUOHJuKT/s90ffyBlglxtzW93YebLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660235260; a=rsa-sha256; cv=none; b=wQ5/zdrH8/c1vy08N7Ui+e9UZsG1LOz6dLbH8GBfr0jqAOoz7D4GAbkYYJl7iAZJNFQGm6 Cy/z4N1W4Ev0OEZ6dlUM24tXVJJdCVCZPeNs95mFQlzbvHucxJJD8T4679f03xmGJGuWbj oFXQljRqzlxHXi+3EdZnysNRpwNB5aJpyAqvOHmNYLp2wlDylg1EpUsE4EpXMe9IlZWdMx PmJpyqefcQRlDGSpgu4e0ANe22X5iKhiJlYed4RhJ3eQI0YHGBGhuJSZoCsSsXcaOqVW39 IWH6GwzlmkL+fXL0Yh8yEnys3Gd1RmULautNhlP6HF0MpdmN/jyEvXOZL/lZFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4d4b1a298c84f2357c304583dfe78d0e4b8fa2f1 commit 4d4b1a298c84f2357c304583dfe78d0e4b8fa2f1 Author: Warner Losh AuthorDate: 2022-08-11 15:05:34 +0000 Commit: Warner Losh CommitDate: 2022-08-11 16:27:16 +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 --- 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 */