From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kees Cook Date: Tue, 07 Aug 2007 00:39:22 +0000 Subject: Re: work-around for video4linux sysfs Message-Id: <20070807003922.GQ9617@outflux.net> List-Id: References: <20070731195136.GW9881@outflux.net> In-Reply-To: <20070731195136.GW9881@outflux.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Fri, Aug 03, 2007 at 12:30:12AM +0200, Kay Sievers wrote: > > I have no problem changing it to be more in line with what you'd like > > to see; I just want to solve the problem. :) Can you make some > > suggestions on what a clean solution would look like? > > Can there be more than one device of the same type at the same pci > instance? If not why not just have: > pci-0000:01:06.0-video -> ../../video0 > pci-0000:01:07.0-video -> ../../video1 > > For USB devices it could just look like: > pci-0000:00:1d.2-usb-0:1:1.0-video -> ../../video0 > pci-0000:00:1d.2-usb-0:1:1.0-radio -> ../../radio0 Unfortunately, you can have multiple of the same type for the same PCI instance, which I worked around in the original patch. This is related to how some v4l drivers deal with multiple output modes from the same card[1] (e.g. MPEG2 encoder output, YUV output, audio only output, etc, are associated with an offset minor number). It's really ugly. :( What I did was limit the by-path links to only the first 10 video devices: +# This is limited to the first 10 video devices to avoid per-driver +# device duplication (like ivtv), since we have no way to distinguish +# interfaces via sysfs in a driver-agnostic way yet. If OPTIONS allowed +# replacement, we could set link_priority to -%m to give preference to the +# first v4l interface per physical device. +ENV{ID_PATH}="?*", KERNEL="video[0-9]", SYMLINK+="v4l/by-path/$env{ID_PATH}" If %m was expanded in OPTIONS, then preference in links could be given to the first interface a driver assigned for a given card. Beyond that, I could only think to avoid ivtv's minor id assignment ugliness by just not support having >10 video cards in the same system, which didn't seem like too bad of a compromise. -Kees [1] http://ivtvdriver.org/index.php/FAQ -- Kees Cook @outflux.net ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ 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