Hi,

I have a nice little USB Bar Code Scanner. It is set up as a USB device, but I can not connect to the default control pipe. I'm thinking that attaching the usbhid driver will help.

I have an usb mouse and keyboard which work just fine. Kernel is 2.6.15-1-486.

Here are my questions
1) What is used to setup the mouse/KB which aren't used for the bar code scanner? I can't find the udev rules, and it seems like I'm missing a big chunk of what happens during a usb hotplug. 2) Is there a way to see what udev rules are matched when a device is plugged in? 3) Can I specify vendor=0xXXXX and product=0xYYYY get driver "usbhid" on the command line?

Here is what I tried
Based on udevinfo I made a new rule.
SUBSYSTEM=="usb", ATTR{bInterfaceProtocol}=="01", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceClass}=="03", ATTR{bNumEndpoints}=="01" DRIVER=="usbhid"

I placed the rule in /etc/udev/usb.rule and softlinked /etc/udev/rules.d/z80_usb.rules -> ../usb.rules


$ udevinfo -a -p /devices/pci0000:00/0000:00:02.1/usb3/3-3/3-3:1.0

looking at device '/devices/pci0000:00/0000:00:02.1/usb3/3-3/3-3:1.0':
  KERNEL=="3-3:1.0"
  SUBSYSTEM=="usb"
  DRIVER==""                      <==== no driver :(
  ATTR{interface}=="EP1"
  ATTR{modalias}=="usb:v04B4pCFA1d0254dc00dsc00dp00ic03isc01ip01"
  ATTR{bInterfaceProtocol}=="01"
  ATTR{bInterfaceSubClass}=="01"
  ATTR{bInterfaceClass}=="03"
  ATTR{bNumEndpoints}=="01"
  ATTR{bAlternateSetting}==" 0"
  ATTR{bInterfaceNumber}=="00"

Thanks
ERIC
Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:02.1/usb3/3-3/3-3:1.0':
    KERNEL=="3-3:1.0"
    SUBSYSTEM=="usb"
    DRIVER==""
    ATTR{interface}=="EP1"
    ATTR{modalias}=="usb:v04B4pCFA1d0254dc00dsc00dp00ic03isc01ip01"
    ATTR{bInterfaceProtocol}=="01"
    ATTR{bInterfaceSubClass}=="01"
    ATTR{bInterfaceClass}=="03"
    ATTR{bNumEndpoints}=="01"
    ATTR{bAlternateSetting}==" 0"
    ATTR{bInterfaceNumber}=="00"

  looking at parent device '/devices/pci0000:00/0000:00:02.1/usb3/3-3':
    KERNELS=="3-3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}=="HID KB"
    ATTRS{product}=="Generic KB-HID"
    ATTRS{manufacturer}=="Guest"
    ATTRS{maxchild}=="0"
    ATTRS{version}==" 1.10"
    ATTRS{devnum}=="15"
    ATTRS{speed}=="1.5"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bcdDevice}=="0254"
    ATTRS{idProduct}=="cfa1"
    ATTRS{idVendor}=="04b4"
    ATTRS{bMaxPower}=="100mA"
    ATTRS{bmAttributes}=="a0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bNumInterfaces}==" 1"

  looking at parent device '/devices/pci0000:00/0000:00:02.1/usb3':
    KERNELS=="usb3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{serial}=="0000:00:02.1"
    ATTRS{product}=="OHCI Host Controller"
    ATTRS{manufacturer}=="Linux 2.6.15-1-486 ohci_hcd"
    ATTRS{maxchild}=="3"
    ATTRS{version}==" 1.10"
    ATTRS{devnum}=="1"
    ATTRS{speed}=="12"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bcdDevice}=="0206"
    ATTRS{idProduct}=="0000"
    ATTRS{idVendor}=="0000"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bNumInterfaces}==" 1"

  looking at parent device '/devices/pci0000:00/0000:00:02.1':
    KERNELS=="0000:00:02.1"
    SUBSYSTEMS=="pci"
    DRIVERS=="ohci_hcd"
    ATTRS{modalias}=="pci:v000010DEd00000067sv0000103Csd000012B9bc0Csc03i10"
    ATTRS{local_cpus}=="1"
    ATTRS{irq}=="177"
    ATTRS{class}=="0x0c0310"
    ATTRS{subsystem_device}=="0x12b9"
    ATTRS{subsystem_vendor}=="0x103c"
    ATTRS{device}=="0x0067"
    ATTRS{vendor}=="0x10de"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""




umonitor -env

UEVENT[1159287566.399867] add@/devices/pci0000:00/0000:00:02.1/usb3/3-3
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/usb3/3-3
SUBSYSTEM=usb
SEQNUM=2462
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb

UDEV  [1159287566.400759] add@/devices/pci0000:00/0000:00:02.1/usb3/3-3
UDEV_LOG=6
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/usb3/3-3
SUBSYSTEM=usb
SEQNUM=2462
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
UDEVD_EVENT=1
DRIVER=usb

UEVENT[1159287566.408099] add@/devices/pci0000:00/0000:00:02.1/usb3/3-3/3-3:1.0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/usb3/3-3/3-3:1.0
SUBSYSTEM=usb
SEQNUM=2463
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/003/015
PRODUCT=4b4/cfa1/254
TYPE=0/0/0
INTERFACE=3/1/1
MODALIAS=usb:v04B4pCFA1d0254dc00dsc00dp00ic03isc01ip01

UDEV  [1159287566.413632] add@/devices/pci0000:00/0000:00:02.1/usb3/3-3/3-3:1.0
UDEV_LOG=6
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/usb3/3-3/3-3:1.0
SUBSYSTEM=usb
SEQNUM=2463
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/003/015
PRODUCT=4b4/cfa1/254
TYPE=0/0/0
INTERFACE=3/1/1
MODALIAS=usb:v04B4pCFA1d0254dc00dsc00dp00ic03isc01ip01
UDEVD_EVENT=1

UEVENT[1159287566.415443] add@/class/usb_device/usbdev3.15
ACTION=add
DEVPATH=/class/usb_device/usbdev3.15
SUBSYSTEM=usb_device
SEQNUM=2464
PHYSDEVPATH=/devices/pci0000:00/0000:00:02.1/usb3/3-3
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
MAJOR=189
MINOR=270

UDEV  [1159287566.528485] add@/class/usb_device/usbdev3.15
UDEV_LOG=6
ACTION=add
DEVPATH=/class/usb_device/usbdev3.15
SUBSYSTEM=usb_device
SEQNUM=2464
PHYSDEVPATH=/devices/pci0000:00/0000:00:02.1/usb3/3-3
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
MAJOR=189
MINOR=270
UDEVD_EVENT=1
DEVNAME=/dev/bus/usb/003/015
Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0':
    KERNEL=="2-3:1.0"
    SUBSYSTEM=="usb"
    DRIVER=="usbhid"
    ATTR{modalias}=="usb:v046DpC016d0340dc00dsc00dp00ic03isc01ip02"
    ATTR{bInterfaceProtocol}=="02"
    ATTR{bInterfaceSubClass}=="01"
    ATTR{bInterfaceClass}=="03"
    ATTR{bNumEndpoints}=="01"
    ATTR{bAlternateSetting}==" 0"
    ATTR{bInterfaceNumber}=="00"

  looking at parent device '/devices/pci0000:00/0000:00:02.0/usb2/2-3':
    KERNELS=="2-3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{product}=="Optical USB Mouse"
    ATTRS{manufacturer}=="Logitech"
    ATTRS{maxchild}=="0"
    ATTRS{version}==" 2.00"
    ATTRS{devnum}=="6"
    ATTRS{speed}=="1.5"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bcdDevice}=="0340"
    ATTRS{idProduct}=="c016"
    ATTRS{idVendor}=="046d"
    ATTRS{bMaxPower}=="100mA"
    ATTRS{bmAttributes}=="a0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bNumInterfaces}==" 1"

  looking at parent device '/devices/pci0000:00/0000:00:02.0/usb2':
    KERNELS=="usb2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{serial}=="0000:00:02.0"
    ATTRS{product}=="OHCI Host Controller"
    ATTRS{manufacturer}=="Linux 2.6.15-1-486 ohci_hcd"
    ATTRS{maxchild}=="3"
    ATTRS{version}==" 1.10"
    ATTRS{devnum}=="1"
    ATTRS{speed}=="12"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bcdDevice}=="0206"
    ATTRS{idProduct}=="0000"
    ATTRS{idVendor}=="0000"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bNumInterfaces}==" 1"

  looking at parent device '/devices/pci0000:00/0000:00:02.0':
    KERNELS=="0000:00:02.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="ohci_hcd"
    ATTRS{modalias}=="pci:v000010DEd00000067sv0000103Csd000012B9bc0Csc03i10"
    ATTRS{local_cpus}=="1"
    ATTRS{irq}=="193"
    ATTRS{class}=="0x0c0310"
    ATTRS{subsystem_device}=="0x12b9"
    ATTRS{subsystem_vendor}=="0x103c"
    ATTRS{device}=="0x0067"
    ATTRS{vendor}=="0x10de"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""



udevmonitor --env

UEVENT[1159288608.989359] add@/devices/pci0000:00/0000:00:02.0/usb2/2-3
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-3
SUBSYSTEM=usb
SEQNUM=2471
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb

UDEV  [1159288608.990069] add@/devices/pci0000:00/0000:00:02.0/usb2/2-3
UDEV_LOG=6
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-3
SUBSYSTEM=usb
SEQNUM=2471
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
UDEVD_EVENT=1
DRIVER=usb

UEVENT[1159288608.996095] add@/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0
SUBSYSTEM=usb
SEQNUM=2472
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/002/007
PRODUCT=46d/c016/340
TYPE=0/0/0
INTERFACE=3/1/2
MODALIAS=usb:v046DpC016d0340dc00dsc00dp00ic03isc01ip02

UEVENT[1159288609.005569] add@/class/input/input8
ACTION=add
DEVPATH=/class/input/input8
SUBSYSTEM=input
SEQNUM=2473
PHYSDEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0
PHYSDEVBUS=usb
PHYSDEVDRIVER=usbhid
PRODUCT=3/46d/c016/340
NAME="Logitech Optical USB Mouse"
PHYS="usb-0000:00:02.0-3/input0"
UNIQ=""
EV=7
KEY=70000 0 0 0 0 0 0 0 0
REL=103

UEVENT[1159288609.006455] add@/class/input/input8/mouse1
ACTION=add
DEVPATH=/class/input/input8/mouse1
SUBSYSTEM=input
SEQNUM=2474
PHYSDEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0
PHYSDEVBUS=usb
PHYSDEVDRIVER=usbhid
MAJOR=13
MINOR=33

UEVENT[1159288609.006715] add@/class/input/input8/event3
ACTION=add
DEVPATH=/class/input/input8/event3
SUBSYSTEM=input
SEQNUM=2475
PHYSDEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0
PHYSDEVBUS=usb
PHYSDEVDRIVER=usbhid
MAJOR=13
MINOR=67

UEVENT[1159288609.006752] add@/class/usb_device/usbdev2.7
ACTION=add
DEVPATH=/class/usb_device/usbdev2.7
SUBSYSTEM=usb_device
SEQNUM=2476
PHYSDEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-3
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
MAJOR=189
MINOR=134

UDEV  [1159288609.097563] add@/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0
UDEV_LOG=6
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0
SUBSYSTEM=usb
SEQNUM=2472
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/002/007
PRODUCT=46d/c016/340
TYPE=0/0/0
INTERFACE=3/1/2
MODALIAS=usb:v046DpC016d0340dc00dsc00dp00ic03isc01ip02
UDEVD_EVENT=1

UDEV  [1159288609.107005] add@/class/input/input8
UDEV_LOG=6
ACTION=add
DEVPATH=/class/input/input8
SUBSYSTEM=input
SEQNUM=2473
PHYSDEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0
PHYSDEVBUS=usb
PHYSDEVDRIVER=usbhid
PRODUCT=3/46d/c016/340
NAME="Logitech Optical USB Mouse"
PHYS="usb-0000:00:02.0-3/input0"
UNIQ=""
EV=7
KEY=70000 0 0 0 0 0 0 0 0
REL=103
UDEVD_EVENT=1

UDEV  [1159288609.117035] add@/class/usb_device/usbdev2.7
UDEV_LOG=6
ACTION=add
DEVPATH=/class/usb_device/usbdev2.7
SUBSYSTEM=usb_device
SEQNUM=2476
PHYSDEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-3
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
MAJOR=189
MINOR=134
UDEVD_EVENT=1
DEVNAME=/dev/bus/usb/002/007

UDEV  [1159288609.192475] add@/class/input/input8/mouse1
UDEV_LOG=6
ACTION=add
DEVPATH=/class/input/input8/mouse1
SUBSYSTEM=input
SEQNUM=2474
PHYSDEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0
PHYSDEVBUS=usb
PHYSDEVDRIVER=usbhid
MAJOR=13
MINOR=33
UDEVD_EVENT=1
ID_VENDOR=Logitech
ID_MODEL=Optical_USB_Mouse
ID_REVISION=0340
ID_SERIAL=Logitech_Optical_USB_Mouse
ID_TYPE=hid
ID_BUS=usb
ID_CLASS=mouse
ID_PATH=pci-0000:00:02.0-usb-0:3:1.0
DEVNAME=/dev/input/mouse1
DEVLINKS=/dev/input/by-id/usb-Logitech_Optical_USB_Mouse-mouse 
/dev/input/by-path/pci-0000:00:02.0-usb-0:3:1.0-mouse

UDEV  [1159288609.242977] add@/class/input/input8/event3
UDEV_LOG=6
ACTION=add
DEVPATH=/class/input/input8/event3
SUBSYSTEM=input
SEQNUM=2475
PHYSDEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0
PHYSDEVBUS=usb
PHYSDEVDRIVER=usbhid
MAJOR=13
MINOR=67
UDEVD_EVENT=1
ID_VENDOR=Logitech
ID_MODEL=Optical_USB_Mouse
ID_REVISION=0340
ID_SERIAL=Logitech_Optical_USB_Mouse
ID_TYPE=hid
ID_BUS=usb
ID_CLASS=mouse
ID_PATH=pci-0000:00:02.0-usb-0:3:1.0
DEVNAME=/dev/input/event3
DEVLINKS=/dev/input/by-id/usb-Logitech_Optical_USB_Mouse-event-mouse 
/dev/input/by-path/pci-0000:00:02.0-usb-0:3:1.0-event-mouse
nt3
DEVLINKS=/dev/input/by-id/usb-Logitech_Optical_USB_Mouse-event-mouse 
/dev/input/by-path/pci-0000:00:02.0-usb-0:3:1.0-event-mouse
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to