Hi, 

Thank you for the responses. 

Below are some results of further investigations on Fedora Core 8. 

Fedora Core 8 (kernel-2.6.23.1-42) appears to use the following rule in 
50-udev-default.rules to name the USB device nodes: 

SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", 
NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"

where DEVTYPE, BUSNUM and DEVNUM are the event environment variables associated 
with the uevent that is generated when the USB device is inserted. 

The /sys file system includes information about the device node name for each 
USB device but I cannot find any symlinks to the nodes. For example, 

/sys/bus/usb/devices/usb1 contains devnum and busnum files which hold the 
device number and bus number of the usb1 device (an EHCI Host Controller, in 
this case). The numbers stored in these files do not have leading zeroes. There 
is also a uevent file, which contains the name of the device node and the 
values of the BUSNUM and DEVNUM variables. See an example uevent file below: 

MAJOR=189
MINOR=0
DEVTYPE=usb_device
DRIVER=usb
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
DEVICE=/proc/bus/usb/001/001
PRODUCT=0/0/206
TYPE=9/0/1
BUSNUM=001
DEVNUM=001

Regards,

Richard


----- Original Message ----
From: Dan Streetman <[EMAIL PROTECTED]>
To: Roger Lindsjö <[EMAIL PROTECTED]>
Cc: Richard Clegg <[EMAIL PROTECTED]>; [EMAIL PROTECTED]
Sent: Tuesday, 18 March, 2008 9:18:56 PM
Subject: Re: [javax-usb-devel] Latest source code from CVS and Fedora Core 6 & 8

I think newer systems may also have nodes (symlinks, really) somewhere
in the /sys filesystem, but I haven't actually dug into it so I'm not
sure.

On Tue, Mar 18, 2008 at 2:52 PM, Roger Lindsjö <[EMAIL PROTECTED]> wrote:
> Richard Clegg wrote:
>  > Hi,
>  >
>  > I have been testing the latest source code from CVS on Fedora Core 6
>  > and 8 and it looks like the code is not using the correct identifiers
>  > for the device nodes at /dev/bus/usb/*/*.
>  >
>  > Fedora Core 6 and 8 use device nodes of the form:
>  >
>  > /dev/bus/usb/001/001
>  > /dev/bus/usb/002/001
>  > /dev/bus/usb/003/001
>  > etc
>  >
>  > but the latest javax-usb source code is trying to access the device
>  > nodes:
>  >
>  > /dev/bus/usb/1/1
>  > /dev/bus/usb/2/1
>  > /dev/bus/usb/3/1
>  > etc
>  >
>  > and is failing.
>  >
>  > Changing the following lines in
>  > javax-usb-ri-linux/jni/JavaxUsbKernel.c and then recompiling seemed to
>  > solve the problem:
>  >
>  > #define USBDEVFS_SPRINTF_NODE_NEW "/dev/bus/usb/%d/%d"
>  > changed to
>  > #define USBDEVFS_SPRINTF_NODE_NEW "/dev/bus/usb/%3.03d/%3.03d"
>  >
>  > #define USBDEVFS_SSCANF_NODE_NEW "/dev/bus/usb/%d/%d"
>  > changed to
>  > #define USBDEVFS_SSCANF_NODE_NEW "/dev/bus/usb/%3d/%3d"
>  > Does anyone know if the use of leading zeroes in the naming of the
>  > device nodes under /dev/bus/usb/ is specific to Fedora Core or is it
>  > used on all Linux distributions?
>  >
>  It seems to vary, and I guess that Dan's system has no leading zeroes
>  while my (fedora 7) does. I made the same changes as you to get it
>  running. I think we have to improve the code which handles those files a
>  bit.
>
>  //Roger Lindsjö
>
>  -------------------------------------------------------------------------
>  This SF.net email is sponsored by: Microsoft
>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  _______________________________________________
>  javax-usb-devel mailing list
>  [email protected]
>  https://lists.sourceforge.net/lists/listinfo/javax-usb-devel
>


      ___________________________________________________________ 
Rise to the challenge for Sport Relief with Yahoo! For Good  

http://uk.promotions.yahoo.com/forgood/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
javax-usb-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel

Reply via email to