I am able submit URBs for bulk out and bulk in
endpoints for sending & recieving data from USB device
(which is Net2280 for now); but I am seeing the
following limitation. I know Net2280 sends me 5 data
packets on bulk-in endpoint for every request I submit
on bulk out endpoint ; but I am able to reap data only
from first reap request (my subsequent reap requests
are just waiting/blocking. I am using devio.c
interface to talk to Net2280.  this is how my code is
structured now
1)read the descriptors from dev node
2)I do set configuration
3)submit command (as part of URB) on bulk-out
endpoint. it returns immediately
4)submit URB on bulk-in endpoint for getting data from
the device (I am not using signals, since I donot want
signals to drive my code).
5)submit ioctl for reapurb (I am using the blocking
version, because that is what I wanted to).  I get the
data on return from reapurb. 
6)I immediately submit second reapurb to the same
endpoint and it just hangs. I gave a different data
buffer  and different URB to reapurb ioctl(not the one
used in step 5), but no luck. 

Why is that step 6 is always hanging. I know my
Net2280 will send multiple (5) packets on single
request/command.  Is there something else I should do
before sending a second reapurb (like send a request
to UNLINK; or send non blocking version of reap urb).
Or is there something else I should be doing in first
place (like sending a "setinterface" request after
step 2).

FYI: I put step4 and step5 in a while loop where I was
able to submit multiple commands and get corresponding
first response from device; but I just dont get any
response for second reapurb (that is if I move step 6
into my while loop, system just hangs and snoop output
tells me reapurb is never returning).

I appreciate any thoughts on this one. 

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