HI Alan:
It helped; thanks much.

I notice there are 2 ioctls for reapurb (with and
without timeout). 


-ashili


--- Alan Stern <[EMAIL PROTECTED]> wrote:

> On Sun, 26 Mar 2006, ashili wrote:
> 
> > I am using devio.c interface to talk to usb
> device. I
> > cannot make the SUBMIT_URB for bulk-in endpoint
> work.
> > Here is what I am doing in my user space app.
> > ---Open devnode, read descriptors, send ioctl for
> "set
> > configuration", I get the return values 0
> (success).
> > ----Set the realtime signal hander for
> "submiturb",
> > and issue ioctl "submiturb" for bulk-out endpoint
> with
> > data. Signal handler gets invoked with status bit
> > field set to 0 (success) and I suppose it also
> means
> > this transaction is complete. And I notice via bus
> > tracer that data is moving to the device. 
> 
> So you know all that works correctly, which is a
> good start.
> 
> > ---Now issue, "sumbiturb" ioctl for bulk-in
> endpoint
> > (I know my device has data to send back).  Signal
> > handler gets invoked with status bit field set to
> > 0(success),
> 
> What do you mean by "status bit field"?  The actual
> status is reported in 
> the struct siginfo's si_errno field.  Is that what
> you are checking?
> 
> > but the user level buffer (which is sent
> > as parameter to usbdevfs_urb) is empty. Also, I
> notice
> > in the bus trace that there is no data(or zero
> data)
> > coming from device to host. This tells me I am not
> > issuing submiturb right. 
> 
> Not really.  If there were a failure in submitting
> the URB then your ioctl 
> call would return directly with that error code and
> the signal handler 
> would not get invoked.
> 
> > I wanted  similar  to asynchronous support and
> hence I
> > cannot use the ioctl "USBDEVFS_BULK". Is there any
> > other setup  I should do to make "sumiturb" ioctl
> > work? or should I issue any other ioctl in between
> or
> > from within signal handler(I cant understand if
> the
> > ioctls "setinterface" and "reapurb" has any
> relevance
> > to this context). 
> 
> setinterface almost certainly doesn't.  It issues a
> Set-Interface request 
> to your device (chooses an altsetting).
> 
> At some point you have to do a reapurb so that the
> system can release the
> resources associated with the URB.  You should do it
> before resubmitting
> this URB, but you can submit another URB before
> reaping this one.
> 
> > It seems this is a basic question(I cant find
> answer
> > in archives). 
> > 
> > how can I get data from device using  "submiturb"
> > ioctl?  Thanks in advance for the response.
> 
> You'll find that it helps to build your kernel with
> CONFIG_USB_DEBUG 
> enabled.  Then there will be lots of useful
> information in the kernel log.  
> Also, even if you don't have CONFIG_USB_DEBUG turned
> on you can still use 
> the usbfs_snoop=y module parameter for usbcore.ko to
> get logs of all your 
> usbfs transactions.
> 
> Alan Stern
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to