Re: libusb and usbdevfs

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

 



On 10/14/06, Greg KH <greg@xxxxxxxxx> wrote:
On Sat, Oct 14, 2006 at 12:05:37PM +0530, pradeep singh wrote:
> [snip]
> >> >> Without a driver i may not be able to communicate to the device like
> >> >> normal read write etc. But shouldnt it be visible to me through sysfs
> >> >> interface?
> >> >
> >> >Yes it should.
> >> Yes it is now visible. But problem is now it recognizes it as webcam
> >> :(. Though it is not. How big is this problem?
> >
> >What is it really?  Why would the kernel be confused this way?
> Greg the device is a USB I/O card. I dont know why is kernel confused
> this way? But it loads the USB serial webcam driver for it , dont know
> why.

What does the kernel say when you plug in your USB device?  You can see
this by running 'dmesg'.
I did that already and dmesg says
#[4296433.598000] usb 5-6: new high speed USB device using ehci_hcd
and address 2

> >
> >> or is it a problem at all? On the other hand can question specially to
> >> Greg :). You rewrote ezusb.c in the source tree for 2.6.x kernel. I
> >> want to use it but i somehow cant. Can i somehow use cypress_m8 module
> >> instead of ezusb module?
> >
> >Please provide specifics as to why you can not use the ezusb.c calls in
> >your driver.  It works for me.
> I havent written the driver yet, so didnt try the ezusb calls:).

They why did you say you can not use it?
apologies, i meant it didnt load the ezusb module but now i am clear.

> >> I tried but cypress_m8 module doesnot identifies the card at all :(.
> >
> >I don't understand, why would different random drivers work with this
> >device.  What type of device is it?  What is the output of
> >/proc/bus/usb/devices with the device plugged in?
> there is no such thing devices in my /proc/bus/usb/ :(.

Did you select the CONFIG_USB_DEVICEFS option in your kernel
configuration?  If so, just mount it:
        mount -t usbfs none /proc/bus/usb

and then send the output of the file with the device plugged in.
root@blufox:usb# cat devices

T:  Bus=05 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 8
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.15.7-ubuntu1 ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=0000:00:1d.7
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=256ms
-----This as it seems is the device specific information------
T:  Bus=05 Lev=01 Prnt=01 Port=05 Cnt=01 Dev#=  2 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0547 ProdID=1003 Rev= 0.00
S:  Manufacturer=EZ-USB FX2
C:* #Ifs= 1 Cfg#= 1 Atr=60 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 4 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
--------till here----------

T:  Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.15.7-ubuntu1 uhci_hcd
S:  Product=UHCI Host Controller
S:  SerialNumber=0000:00:1d.3
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.15.7-ubuntu1 uhci_hcd
S:  Product=UHCI Host Controller
S:  SerialNumber=0000:00:1d.2
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.15.7-ubuntu1 uhci_hcd
S:  Product=UHCI Host Controller
S:  SerialNumber=0000:00:1d.1
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 2.06
S:  Manufacturer=Linux 2.6.15.7-ubuntu1 uhci_hcd
S:  Product=UHCI Host Controller
S:  SerialNumber=0000:00:1d.0
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms


but cat /proc/bus/usb/devices says Driver=(None) for EZ USB FX2.
I think now its more clear to me that i need to write a driver for the device.

I also suggest that you take a look at the Linux Device Drivers book for
the USB chapter (free online), and the built-in USB documentation in the
kernel ('make psdocs' creates it all.)
Doing that already and have started on writing a driver for the device.

Also, there is a skeleton USB driver in drivers/usb/usb-skeleton.c that
will help you out.
yes its an excellent sample driver, will surely take help from it.

If you still have questions after all of that, please ask them on the
linux-usb-devel mailing list.  That's the proper place for this.
great

Thank a lot Greg.

good luck,

greg k-h



--
play the game

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux