RE: Latest testusb.c, with my additions... While opening usbtest, what device should be opened?!

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

 



Hello Alan,

Thank you very much for your comments. Here are my comments.

Since I read your email, I got some directions. I got the new sets of files for max3420 SPI USB driver. I recompiled them properly and built new kernel for target and new set of modules for gadget directory.

I am able now to recognize g_zero driver. Upon insertion it is there, sitting, but I decided still to proceed with g_printer.

I recognized that my environment on host is not properly set for modprobe command, so I spend some time to do that. At the end I was able to create proper environment which does see usbtest module with modprobe.

Since then, I have g_printer inserted on target. I also see it on my host in /proc/bus/usb/002/009 (it is actually 009), and it does properly shows in /proc/bus/usb/devices as:

T:  Bus=02 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#=  9 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0525 ProdID=a4a8 Rev= 2.27
S:  Manufacturer=Linux 2.6.34.10-WR4.3.0.0_standard with max_udc
S:  Product=Printer Gadget
S:  SerialNumber=1
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  2mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=07(print) Sub=01 Prot=02 Driver=usbtest
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

Then I did your proposed magic (note that the command has 0x in front of parameters, without it'll not work):
modprobe usbtest vendor=0x0525 product=0xa4a8

usbtest _init printed message (inserted by me as KERN_EMER):
kernel:[157420.284462] KERN_EMERG: usb test params: vend=0x0525 prod=0xa4a8

Which shows that it recognized my CLI command.

The very least (but not last): /proc/bus/usb/devices did NOT register usbtest!?

As for your convenience, please, find devices file attached to this email.

Please, advise course of action?

Thank you,
Zoran Stojsavljevic

-----Original Message-----
From: Alan Stern [mailto:stern@xxxxxxxxxxxxxxxxxxx] 
Sent: Saturday, January 21, 2012 9:50 PM
To: Stojsavljevic, Zoran
Cc: Greg KH; linux-usb@xxxxxxxxxxxxxxx
Subject: RE: Latest testusb.c, with my additions... While opening usbtest, what device should be opened?!

On Sat, 21 Jan 2012, Stojsavljevic, Zoran wrote:

> Hello Greg,
> 
> Here are my comments.
> 
> The kernel I am using from its Makefile:
> VERSION = 2
> PATCHLEVEL = 6
> SUBLEVEL = 34
> EXTRAVERSION = .10
> NAME = Sheep on Meth
> 
> Why do you think the version of this kernel is outdated. I don't think so!?
> 
> The device on USB address 7 went away, but it came back upon new registration and numeration, as device 8 (/proc/bus/usb/002/008). So the original conditions are very true/correct. Please, do note that I ran with:
> ./testusb -a  -t 0
> 
> Yes, I am trying to reach on target platform g_printer device, for 
> some reason I am not able to register g_zero on target (enumeration 
> process fails). But g_printer behaves very correctly. It should work 
> also with g_printer, as my understanding is.

testusb should work with g_printer, but that's not the important point here.  g_zero is a much simpler driver than g_printer; if it doesn't work on your target then something is seriously wrong.  You should debug that problem first before worrying about testusb.

Also, you don't have to modify the usbtest driver at all.  All you need to do is load it with the command:

	modprobe usbtest vendor=0525 product=a4a8

Then it should automatically bind to your printer gadget.  You ought to be able to see this in /proc/bus/usb/devices after plugging the target into the host (usbtest should be listed as the driver).

Alan Stern

--------------------------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland 
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
[root@localhost usb]# pwd
/proc/bus/usb
[root@localhost usb]# cat devices

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc= 34/900 us ( 4%), #Int=  3, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0001 Rev= 2.06
S:  Manufacturer=Linux 2.6.35.6-45.fc14.x86_64 uhci_hcd
S:  Product=UHCI Host Controller
S:  SerialNumber=0000:02:00.0
C:* #Ifs= 1 Cfg#= 1 Atr=e0 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=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0e0f ProdID=0003 Rev= 1.02
S:  Manufacturer=VMware
S:  Product=VMware Virtual USB Mouse
C:* #Ifs= 2 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=1ms
I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=1ms

T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  3 Spd=12  MxCh= 7
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0e0f ProdID=0002 Rev= 1.00
S:  Product=VMware Virtual USB Hub
C:* #Ifs= 1 Cfg#= 1 Atr=e0 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=   1 Ivl=255ms

T:  Bus=02 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#=  9 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0525 ProdID=a4a8 Rev= 2.27
S:  Manufacturer=Linux 2.6.34.10-WR4.3.0.0_standard with max_udc
S:  Product=Printer Gadget
S:  SerialNumber=1
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  2mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=07(print) Sub=01 Prot=02 Driver=usbtest
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 6
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 2.06
S:  Manufacturer=Linux 2.6.35.6-45.fc14.x86_64 ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=0000:02:03.0
C:* #Ifs= 1 Cfg#= 1 Atr=e0 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=   4 Ivl=256ms
[root@localhost usb]# 

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux