From owner-freebsd-current@freebsd.org Mon Aug 21 14:25:15 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CDC1DDEFE5 for ; Mon, 21 Aug 2017 14:25:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1174720E5 for ; Mon, 21 Aug 2017 14:25:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22b.google.com with SMTP id p141so10759028iop.3 for ; Mon, 21 Aug 2017 07:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=gIio7x/Batpb89Y9V2kAwQOa4IijuBx4RPLhhNqUHCU=; b=RwN6gERNgqpUXnXBfxibh+cOHkLG1Mf48yVWhZcTV/7zv8BAVoIqQjnKvbfNM4Wvfi ygd7KLIfmATKm9GNwRV7F6vArcipLuJFfm3gWuOPBQPbh+11stHAHqHEy7cX4tHYC3s4 ai9/KUbvvHvwjf/yI63/rkZN7AdzrWogI/z+iT66dGvY8fRpXMj/MiB4JcdwsQyV0NlR QKAnl52mH40lpHoXIRIIpivNhvTXK0zzhL+np72eLKkf/6O0BRGZblqnhUGmcUUbrsYV 4ptwVjQ3iYGbdmt5RktJh2m/3Hlv+Pp91JC+6fRTT6kA9M13Ojlpe/QgSv4lv+RmVIR6 YNFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=gIio7x/Batpb89Y9V2kAwQOa4IijuBx4RPLhhNqUHCU=; b=UNKr16T0tv3CylHOMiHBSYE5RX/SO1gTsuHLdNhde9d5T15LnEDkVEaZbYYGZ3y/U9 MKWYGK6AkKxmHmETP0JfZAxBSfNc+uevqXz6Vohp6O6NcrYKAEeqLIKm/XjkD/M7YlF0 6uxx1ju2CsSp6sti6GTJzfb9u7W4K5oG+K7PHzuaVImByzhFG89M4wxccLGYpWBECCo/ wlu6qzbaECTVy55FSmz33ED4lK4jb06sKzqjTRUTpM6tFhIBlkdPjadc6iUdqVByAD1h jv7SmEzDMU13dJOiY9axz8TRHgpWrYfi68HTIdkPQ7/h+KB1l6m25VVFtuX8A+S4nehS itrw== X-Gm-Message-State: AHYfb5jGttZ01rGw15WDTComHRSvsEuz/q9Jf0pfMHa/Ysogsy1JZ7q0 dthj47J75UtUxzjC1tuxb9AVBUfIt/Si X-Received: by 10.107.131.219 with SMTP id n88mr866128ioi.277.1503325514092; Mon, 21 Aug 2017 07:25:14 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.10.71 with HTTP; Mon, 21 Aug 2017 07:25:13 -0700 (PDT) X-Originating-IP: [69.27.219.53] In-Reply-To: References: From: Warner Losh Date: Mon, 21 Aug 2017 09:25:13 -0500 X-Google-Sender-Auth: Ph0xY3U3QW14e5Zf8IfrUUrELvo Message-ID: Subject: Re: mapping a device from device-id to /dev To: Julian Elischer Cc: freebsd-current Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Aug 2017 14:25:15 -0000 On Mon, Aug 21, 2017 at 6:51 AM, Julian Elischer wrote: > > I have the following (Azure) device (disk) id: > > dev.storvsc..%pnpinfo: classid=32412632-86cb-44a2-9b5c-50d1417354f5 > deviceid=00000000-0001-8899-0000-000000000000 > > the question is: "how can I map that do /dev/da1".. > You can't. Partially because it's also da1p1, da1p2, etc as well. Partially because storvsc is a SIM and can have multiple devices, partially because there's no device_t to SIM mapping, let alone to the dev_t for the disk drive (and even then you have geom to worry about too). > I know that for my device it IS /dev/da1 > but how can I prove it? there are so many mappings from one space to > another I've totally lost track. > there are acpi mappings, pnpmappngs, /dev/ mappings, PCI space mappings, > things in sysctl, things in their own spaces, etc. etc. > In some architectures htere are fdt mappings and in some it's still pretty > random from what I see. > Yes. There's no way to map, generically, a device_t to a dev_t. In fact, the above sounds like a CAM device, which doesn't even have a device_t, just the device_t of the SIM. storvsc is the SIM that you're lucky has only one device attached. mpt can (and does) have a dozen attached to it. There's also the issue that we create separate devices for each way we present the device to the user: /dev/ufs/lable, /dev/ufsid/numbers, /dev/gpt/name, /dev/gptid/numbers, etc. > Is there a document that covers all of these? > /usr/src/sys, sadly I have a similar issue getting the full, physical map to drives for UEFI. Thankfully, I can use logical names for that. I'm slogging through implementing things, though, its tough going... Warner