Re: static usb device configuration

2010-12-13 Thread Peter Jeremy
On 2010-Dec-13 08:56:51 +0100, Emanuel Haupt  wrote:
>Unfortunately the program in question uses libusb and the configuration
>only allows to define the device by specifying : and
>there are multiple identical devices around with only iSerialNumber
>being different from each other. Somehow I need to make sure the
>devices in the USB hub are always recognized in the same order.

The standard approach seems to be to iterate through all available USB
devices until you find the one that matches your specifications.

-- 
Peter Jeremy


pgp0B07afpudf.pgp
Description: PGP signature


Re: static usb device configuration

2010-12-13 Thread Hans Petter Selasky
On Monday 13 December 2010 08:58:15 Emanuel Haupt wrote:
> Hans Petter Selasky  wrote:
> > On Sunday 12 December 2010 19:49:24 Emanuel Haupt wrote:
> > > Is there any way I can make sure that the following device:
> > > 
> > > ugen1.3:  at usbus1, cfg=0 md=HOST
> > > spd=FULL (12Mbps) pwr=ON
> > > 
> > >   bLength = 0x0012
> > >   bDescriptorType = 0x0001
> > >   bcdUSB = 0x0200
> > >   bDeviceClass = 0x
> > >   bDeviceSubClass = 0x
> > >   bDeviceProtocol = 0x
> > >   bMaxPacketSize0 = 0x0008
> > >   idVendor = 0x0403
> > >   idProduct = 0x6001
> > >   bcdDevice = 0x0400
> > >   iManufacturer = 0x  
> > >   iProduct = 0x  
> > >   iSerialNumber = 0x0003  
> > >   bNumConfigurations = 0x0001
> > > 
> > > Is always registered as:
> > > 
> > > /dev/usb/1.3.0
> > 
> > No, this is currently not possible unless you find the USB port which
> > is enumerated first (I.E. has the lowest second number.)
> 
> When you say 'currently', is there something like that planed?

No.

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: static usb device configuration

2010-12-12 Thread Emanuel Haupt
Hans Petter Selasky  wrote:
> On Sunday 12 December 2010 19:49:24 Emanuel Haupt wrote:
> > Is there any way I can make sure that the following device:
> > 
> > ugen1.3:  at usbus1, cfg=0 md=HOST
> > spd=FULL (12Mbps) pwr=ON
> > 
> >   bLength = 0x0012
> >   bDescriptorType = 0x0001
> >   bcdUSB = 0x0200
> >   bDeviceClass = 0x
> >   bDeviceSubClass = 0x
> >   bDeviceProtocol = 0x
> >   bMaxPacketSize0 = 0x0008
> >   idVendor = 0x0403
> >   idProduct = 0x6001
> >   bcdDevice = 0x0400
> >   iManufacturer = 0x  
> >   iProduct = 0x  
> >   iSerialNumber = 0x0003  
> >   bNumConfigurations = 0x0001
> > 
> > Is always registered as:
> > 
> > /dev/usb/1.3.0
> 
> No, this is currently not possible unless you find the USB port which
> is enumerated first (I.E. has the lowest second number.)

When you say 'currently', is there something like that planed?

Emanuel
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: static usb device configuration

2010-12-12 Thread Emanuel Haupt
Andrew Thompson  wrote:
> On 13 December 2010 07:49, Emanuel Haupt  wrote:
> > Is there any way I can make sure that the following device:
> >
> > ugen1.3:  at usbus1, cfg=0 md=HOST
> > spd=FULL (12Mbps) pwr=ON
> >
> >  bLength = 0x0012
> >  bDescriptorType = 0x0001
> >  bcdUSB = 0x0200
> >  bDeviceClass = 0x
> >  bDeviceSubClass = 0x
> >  bDeviceProtocol = 0x
> >  bMaxPacketSize0 = 0x0008
> >  idVendor = 0x0403
> >  idProduct = 0x6001
> >  bcdDevice = 0x0400
> >  iManufacturer = 0x  
> >  iProduct = 0x  
> >  iSerialNumber = 0x0003  
> >  bNumConfigurations = 0x0001
> >
> > Is always registered as:
> >
> > /dev/usb/1.3.0
> 
> You would be better making a symlink using devd rules, something like
> 
> notify 100 {
> match "system"  "USB";
> match "subsystem"   "DEVICE";
> match "type""ATTACH";
> match "vendor"  "0x0403";
> match "product" "0x6001";
> action "ln -s /dev/$cdev /dev/mydevice";
> };

Unfortunately the program in question uses libusb and the configuration
only allows to define the device by specifying : and
there are multiple identical devices around with only iSerialNumber
being different from each other. Somehow I need to make sure the
devices in the USB hub are always recognized in the same order.

I guess one solution would be to generate the configuration each time
the program starts.

Emanuel
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: static usb device configuration

2010-12-12 Thread Andrew Thompson
On 13 December 2010 07:49, Emanuel Haupt  wrote:
> Is there any way I can make sure that the following device:
>
> ugen1.3:  at usbus1, cfg=0 md=HOST spd=FULL 
> (12Mbps) pwr=ON
>
>  bLength = 0x0012
>  bDescriptorType = 0x0001
>  bcdUSB = 0x0200
>  bDeviceClass = 0x
>  bDeviceSubClass = 0x
>  bDeviceProtocol = 0x
>  bMaxPacketSize0 = 0x0008
>  idVendor = 0x0403
>  idProduct = 0x6001
>  bcdDevice = 0x0400
>  iManufacturer = 0x  
>  iProduct = 0x  
>  iSerialNumber = 0x0003  
>  bNumConfigurations = 0x0001
>
> Is always registered as:
>
> /dev/usb/1.3.0

You would be better making a symlink using devd rules, something like

notify 100 {
match "system"  "USB";
match "subsystem"   "DEVICE";
match "type""ATTACH";
match "vendor"  "0x0403";
match "product" "0x6001";
action "ln -s /dev/$cdev /dev/mydevice";
};


Andrew
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: static usb device configuration

2010-12-12 Thread Hans Petter Selasky
On Sunday 12 December 2010 19:49:24 Emanuel Haupt wrote:
> Is there any way I can make sure that the following device:
> 
> ugen1.3:  at usbus1, cfg=0 md=HOST spd=FULL
> (12Mbps) pwr=ON
> 
>   bLength = 0x0012
>   bDescriptorType = 0x0001
>   bcdUSB = 0x0200
>   bDeviceClass = 0x
>   bDeviceSubClass = 0x
>   bDeviceProtocol = 0x
>   bMaxPacketSize0 = 0x0008
>   idVendor = 0x0403
>   idProduct = 0x6001
>   bcdDevice = 0x0400
>   iManufacturer = 0x  
>   iProduct = 0x  
>   iSerialNumber = 0x0003  
>   bNumConfigurations = 0x0001
> 
> Is always registered as:
> 
> /dev/usb/1.3.0

No, this is currently not possible unless you find the USB port which is 
enumerated first (I.E. has the lowest second number.)

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


static usb device configuration

2010-12-12 Thread Emanuel Haupt
Is there any way I can make sure that the following device:

ugen1.3:  at usbus1, cfg=0 md=HOST spd=FULL 
(12Mbps) pwr=ON

  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0200 
  bDeviceClass = 0x 
  bDeviceSubClass = 0x 
  bDeviceProtocol = 0x 
  bMaxPacketSize0 = 0x0008 
  idVendor = 0x0403 
  idProduct = 0x6001 
  bcdDevice = 0x0400 
  iManufacturer = 0x  
  iProduct = 0x  
  iSerialNumber = 0x0003  
  bNumConfigurations = 0x0001 

Is always registered as:

/dev/usb/1.3.0

Using a pattern match on iSerialNumber could achieve that but how would
I configure something like that?

According to the /etc/devd.conf manpage I could create a symlink but that 
wouldn't solve my problem.

Emanuel
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"