I'm running into an error, perhaps someone can point out where the idiot
bit got set.  This seems like a Thomas question, but I imagine there are
others that may also know:

        I've got an Cypress 2131 part, and have a working framework in place.  I
have 2 endpoints, a bulk in and a bulk out on EP1.  With my braindead
console app (BCA), I send a character, the EP1OUT interrupt occurs, I grab
the byte from OUT2BUF, copy into to the IN1BUF, set the IN1BC to 1, and
write to OUT1BC to re-arm the endpoint.  Life is good, I can write bytes and
get them back all day long.

        The BCA allows me to explicitly read a byte, write a byte, or reset an
endpoint.  If I write a byte, and read, all is well.  When I read WITHOUT
writing, I get a "USBDEVFS_BULKIN (ep=0x1 len=64) error Connection timed
out" (I'm using the usblinux.c from ezconsole, it uses the USBDEVFS
userspace calls).  This error I expect.  However, if I write then read
again, I get the same error.

        According to the USB spec, if an endpoint stalls, or errors 3 times, all
IRPs are retired.  So, in theory, I should just need to use USBDEVFS_RESETEP
to reset endpoint 1, correct?  If I do this (the BCA allows making only that
call), I still get the read error on the subsequent write then read.

        I'm not doing anything in the Cy2131 code to handle an endpoint reset.
Based on my reading, I can't even determine what mechanism might be used to
do this.  Perhaps CLEAR_FEATURE(FEATURE_HALT)?  But this doesn't seem
correct.  I've seen other devices that get BULKIN timeout errors, and never
seem to recover without replugging the devices.  Also, section 8.6 of the
USB 1.1 spec, the data toggles are pretty much self managing.

        Am I seeing: A) A bug in my Cy2131 code, where I fail to handle some kind
of endpoint reset condition; B) a bug in my braindead console app, failing
to reset the endpoint properly (or misunderstanding what the endpoint reset
is supposed to do); or, C) a bug in the driver, where resetting an endpoint
doesn't work, or timeouts cause an irrecoverable error?

        None of the Cy2131 code that I've found on the 'net seems to address this
issue.  Most seem to use polling for the bulk endpoints, something I don't
want to do for reasons down the line (not the least of which is power
management).  Thomas' usbstress suite seems to handle the timeout problem by
dieing, rather than attemping to recover, and I've been using that as a
model for my basic framework.

        Any advice would be greatly appreciated.

        --John

        (look for more stupid questions in the near future...)


_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to