From nobody Wed Nov 30 22:31:23 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 4NMv7c0hppz4jCKK; Wed, 30 Nov 2022 22:31:24 +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 4NMv7b73lYz44HX; Wed, 30 Nov 2022 22:31:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669847484; 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=ovopVfagWvtu3zVBgWln4R9B7CjMX4l8UWFlmqI0Q/Q=; b=p6VZYBVuAXxwGC6+D4GFW1UG8ZOh1kN3+ir6Gj9yXpF5L9s2qVycMddwfOXSHHWU8kb679 OvhP+/KQt0RTTSMKP4SeuaLI+FXkIGEtCFYS5U6ynIAJqrRA5TCYQ/e74l8/WbwSdF/buC jUE17v4J/kyFQj200hrVId+crhPGRxpwSiKZp6+li1cy7AqPQupKzIXRk2uEpOl1rlJ8Ew 05uuc5XHs+bV0Vf/kU2Cimuk60JY2jjfQbfPrb8BpSmebxRPDqKEu+/xxKSMqh0Y8YVWit /8yojsvr2HJ8EXh/24X5IuKLz+QfnLOTHfikaJ56edke+PzsNmsbCrB4csVj8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669847484; 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=ovopVfagWvtu3zVBgWln4R9B7CjMX4l8UWFlmqI0Q/Q=; b=PEPiITiyjv1lg3Ryz6woodgwFsXqSHfVOLLau3uRBj3EDOdj+m6bhVxMYDL1Qu1t+o3OK6 h04EJk5gyq1CC5QCICXX49JVxPZ4Da+1L8okDJ8NudvJPccV23w3CRpRcTd3BUTGW/Jn5m +qcBuJgYLUD540EuyMjkXA2HFRsmEMFez/ZrgHrmPQ65dlXFcLL0T3Dwbi9tj39yvWRd3y /g5RLPHJ0ERHzaInDCnQM08/9NDFsQiG7V/UY2EzKfX6mdUYfH0p0QaosfHs247WYF1Kgf 7x+MkMpohyvwlzs2aD0cegmAnxh2dCnK+6ZVWI+OLFD6Ggz4rJMCWqtMscMIZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669847484; a=rsa-sha256; cv=none; b=G5yNs/LVqdat2BQEy14gD6PaW8LR2vm0Jqz4e+a2xdBcgntDafZoq6rEpD8OgskSreU3+4 JJ3pfZkCIctR7huljromJOYdc/2uG+h8NdlyCnVWUXv+JgRMYzonZGVjtoECG8Hmu+nujR sW9kyEi5JSQOJkO53r74KODY4Ugn4n3SnP/fQa+LF7Li7QFeNK1XkP+7w9uAZjR+VADKCI z1F4pO8vljKWB1RI9dPhPB46shRjPESR+Aa0CfwExi7kHOPt1OS5e06k+wK7F0yk5rpj/w 6Qo6shBI3ToYSsC7Yl7NN3Jdk8e1gS2LJkaORQTyVeDV2qGmmbxOX7Gfb3qrHA== 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 4NMv7b611tz1CtZ; Wed, 30 Nov 2022 22:31:23 +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 2AUMVNaW023559; Wed, 30 Nov 2022 22:31:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AUMVNHe023558; Wed, 30 Nov 2022 22:31:23 GMT (envelope-from git) Date: Wed, 30 Nov 2022 22:31:23 GMT Message-Id: <202211302231.2AUMVNHe023558@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: daaf594e8469 - main - stand/ofw: ofw_disk isn't really a disk 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: daaf594e8469b1fb4fb7861c2f7129f4d61c6d4d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=daaf594e8469b1fb4fb7861c2f7129f4d61c6d4d commit daaf594e8469b1fb4fb7861c2f7129f4d61c6d4d Author: Warner Losh AuthorDate: 2022-11-30 22:09:23 +0000 Commit: Warner Losh CommitDate: 2022-11-30 22:30:33 +0000 stand/ofw: ofw_disk isn't really a disk The rest of the code in the tree assumes that a DEVT_DISK uses a disk_devdesc to represent the device. However ofw_disk diesn't, so we can't use disk_fmtdev, nor disk_parsedev. ofw needs to have a dv_match-like routine to use devpasrse, though, since we have two drivers (net and block) that claim the same sort of devices (eg /path/to/ofw-dev) based on the device-type property. In the interim, we can't use devmatch and ofw_disk's and the default net driver's parsing is offloaded ofw_parsedev. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D37347 --- stand/libofw/libofw.h | 2 ++ stand/libofw/ofw_disk.c | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/stand/libofw/libofw.h b/stand/libofw/libofw.h index 0483c9dbf754..59c7ec1fa6b7 100644 --- a/stand/libofw/libofw.h +++ b/stand/libofw/libofw.h @@ -28,6 +28,8 @@ #include "openfirm.h" #include +#define DEVT_OFDISK 1001 + struct ofw_devdesc { struct devdesc dd; union { diff --git a/stand/libofw/ofw_disk.c b/stand/libofw/ofw_disk.c index 524bc7b77d5c..8f4c0162d32b 100644 --- a/stand/libofw/ofw_disk.c +++ b/stand/libofw/ofw_disk.c @@ -49,10 +49,12 @@ static int ofwd_open(struct open_file *f, ...); static int ofwd_close(struct open_file *f); static int ofwd_ioctl(struct open_file *f, u_long cmd, void *data); static int ofwd_print(int verbose); +static char * ofwd_fmtdev(struct devdesc *); + struct devsw ofwdisk = { .dv_name = "block", - .dv_type = DEVT_DISK, + .dv_type = DEVT_OFDISK, .dv_init = ofwd_init, .dv_strategy = ofwd_strategy, .dv_open = ofwd_open, @@ -60,8 +62,7 @@ struct devsw ofwdisk = { .dv_ioctl = ofwd_ioctl, .dv_print = ofwd_print, .dv_cleanup = nullsys, - .dv_fmtdev = disk_fmtdev, - .dv_parsedev = disk_parsedev, + .dv_fmtdev = ofwd_fmtdev, }; /* @@ -185,3 +186,10 @@ ofwd_print(int verbose __unused) { return (0); } +static char * +ofwd_fmtdev(struct devdesc *idev) +{ + struct ofw_devdesc *dev = (struct ofw_devdesc *)idev; + + return (dev->d_path); +}