From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Mon, 03 Jun 2002 18:00:18 +0000 Subject: Re: Which node has the device been bound to? Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Sat, Jun 01, 2002 at 04:12:47AM +0200, Oliver Neukum wrote: > > Have you seen the way driverfs shows the usb and pci topology? > > Fine for humans, which is not the issue here. And for programs. > > And yes, you might be acting on old data. But if you have an ioctl() > > what would it return? A pointer to the topology location which might > > have just changed? I don't see how an ioctl() can solve this problem > > any different from the way driverfs is going about it. But I could be > > missing something. :) > > An ioctl() would either return the actual topology information > or a unique token. > > A name can change meaning. An open file cannot. It'll either > be what the ioctl() will tell you, or it'll be gone. If you operate on a > device that is gone the kernel will return an error and all is well. Yes, you get a response from an ioctl that points you to a /dev node or a driverfs file. Then the device is disconnected and whatever you had pointing to that device (the /dev file pointer) is replaced with a new device connecting. Same problem as before :) > If you parse what driverfs gives you, you operate on changing > data without a lock. I can see no way to change that. I don't see a way around this even with ioctl(). But what is the real problem here? What do you want to solve? Mapping of a /dev node to a physical device? Or mapping of a physical device to a /dev node? Or something else? thanks, greg k-h _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel