udev rule and libusb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm working on a userspace driver for the Meade DSI Pro camera. It uses the EZ-USB FX2 chip which requires a firmware upload. I've successfully extracted the firmware into an Intel hex format file and now have a udev rule to load the firmware after which the device renumerates. Here's the udev rule I have:

# 1. Pre-renumeration IDs
# Meade DSI Pro II
BUS=="usb", ACTION=="add", SYSFS{idVendor}=="156c", SYSFS{idProduct}=="0100", ENV{DEVICE}!="", \ RUN+="/sbin/fxload -t fx2 -D $ENV{DEVICE} -I /lib/firmware/meade-dsiproII.hex"

# 2. Post-renumeration IDs
# Meade DSI Pro II
BUS=="usb", ACTION=="add", SYSFS{idVendor}=="156c", SYSFS{idProduct}=="0101", ENV{DEVICE}!="", \
SYMLINK+="dsiproII.%n" MODE="0666"

The symlink is good, it points to /dev/bus/usb/<bus>/<device>, and all it well. I can find and access the device using libusb to iterate over all devices. But the device node in /dev/bus/usb does not have the correct permissions; it has 0644 owner root. This doesn't quite cut it for me.

But...

If I change the second rule to

BUS=="usb", ACTION=="add", SYSFS{idVendor}=="156c", SYSFS{idProduct}=="0101", ENV{DEVICE}!="", \
NAME="dsiproII" SYMLINK+="dsiproII.%n" MODE="0666"

then I get the node /dev/dsiproII with the correct permissions, but the device node in /dev/bus/usb/<bus>/<dev> is gone and libusb can no longer find the device.

I've asked about this over on the linux-usb list and they suggested I ask here. So I am :-)

What I *really* want is to us the pam console rules to change the owner like what happens when I plug in a webcam with the v4l stuff; I can get that to work if I use the NAME= directive (although I have an issue with SELinux I'm still working on there), but I really need the libusb part working.

So...

1. Can I get my "preferred" name and still have libusb find the device?

2. If not, can I get the permission change applied to the underlying device node? 3. If yes, do I have to use the RUN directive with a helper to get this to work?

TIA,

roland

--
		       PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD                             RL Enterprises
roland@xxxxxxxxxxx                            6818 Madeline Court
roland@xxxxxxxxxxxxx                           Brooklyn, NY 11220

--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux