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,

After I successfully reached stage where I start hiting usbtest.ko's _ioctl, another problem poped up.

It is obvious that test0 worked (./testusb -a -t 0), but none of other tests did not worked at all, and they had early bail out.

I peeked around to understand why. It appear that in case 1, case 2, case 3... dev->out_pipe = 0, so it breaks right here.

The code in _ioctl:
/* Simple non-queued bulk I/O tests */
        case 1:
                if (dev->out_pipe == 0)
                        break;
                dev_info(&intf->dev,
     
Now, I am wondering what this statement really means? Maybe in other words... dev->out_pipe = ep0 which is 0!? Does this mean that ep0 should NOT be used for these tests?

I am testing max SPI USB Linux driver, which supposed to have all 4 endpoints implemented: ep0 to ep3. 

On the another side of the story, I do insert usbtest with modprobe usb_test vendor=0x0525 product=0xa4a8

But in modified testusb code I did insert in testdev_ifnum(FILE *fd) the following:

        /* "printer gadget", Linux-USB test software */
        if (dev.idVendor == 0x0525 && dev.idProduct == 0xa4a8) {
		printf("Found Test Device Vendor id 0x%x and Product Id 0x%x!\n", dev.idVendor, dev.idProduct);
                /* return testdev_ffs_ifnum(fd); */
                return 0;
        }

Should I try to return testdev_ffs_ifnum(fd) instead of 0? And what does this I/F number mean? The index of device (if more devices that 1)?

>From what I see, the SPI USB target driver (which usbtest binds to) has some problems, and I am trying to detect what kind of nature are these problems??

Thank you,
Zoran

-----Original Message-----
From: Alan Stern [mailto:stern@xxxxxxxxxxxxxxxxxxx] 
Sent: Monday, January 23, 2012 4:30 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 Mon, 23 Jan 2012, Stojsavljevic, Zoran wrote:

> 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

You're right; I forget to put in the "0x" parts.

> 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!?

What do you mean?  It shows up in the second-to-last line above:

I:* If#= 0 Alt= 0 #EPs= 1 Cls=07(print) Sub=01 Prot=02 Driver=usbtest

> As for your convenience, please, find devices file attached to this email.
> 
> Please, advise course of action?

Proceed with your testing.  So far everything seems to be working right.

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

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux