>I am running kernel 2.4.3-12.
>I am attempting to establish USB communications to a device.
>
>Currently I am able to do send and receive control messages
>(usb_control_msg <using usb_sndctrlpipe(dev,0) and usb_rcvctrlpipe(dev,0>)
>and I am able to send bulk messages (usb_bulk_msg <using usb_sndbulkpipe(
>dev, 1)>).

Two problems were found.

The first problem was in the example of 'copy_from_user' I had looked at
there was no error checking (not a good thing).  When error checking was
added, problems were found, corrected, and the correct data was then
transferred in bulk messages.  Yet another example of the fact that if an
error code/condition/status is returned it should be checked and _not_
ignored.

The second problem (discovered with help from the good people at LSS), was
that -EPIPE can be returned on a usb_bulk_msg receiving on a
usb_rcvbulkpipe when fewer bytes are specified (in the usb_bulk_msg
function call) to be retrieved than what were actually received from the
device.  In my case the device was always sending back a complete full
frame even though there was only one byte of data.

Between the resolution of these two problems the driver now works.

Dan

<"Never give people choices you don't want them to take."
 "Never put a glazed doughnut on a mouse pad."
 "Lack of a  sense of urgency will eventually lead to lack of a job."
 "Stop looking for more time and start looking for ways to use the time you
have."
 "Without the right people in the meeting, there will be more than one
meeting."
 "The race at work is not always won by the swift, and there is more to
life than increasing its speed."
    --  Richard A. Moran, Reality Checks for the Workplace, Reader's
Digest, January 1999>
<"Do not attribute malice to something that can easily be written off to
stupidity."  --  Milt Johnson>
<"It's not a good idea to mix enthusiasm with stupidity,..."  --  Wally,
Dilbert comic strip, 1999 February 15>
<"A lot of trouble in this world is caused by combining a narrow mind with
a wide mouth."  --  ??>
<"There is no right way to do a wrong thing."  --  ??>
<"A conclusion is the place where you got tired of thinking."  --  ??>
<"Experience is something you don't get until just after you need it."  --
??>
<"For every action there is an equal and opposite criticism."  --  ??>
<"To steal ideas from one person is plagiarism; to steal from many is
research."  --  ??>
<"The hardness of the butter is proportional to the softness of the bread."
--  ??>
<"I would rather be right than consistent."  --  Winston Churchill>
<"Ignorance never settles a question."  --  chinese fortune cookie>
<"Human beings, who are almost unique in having the ability to learn from
the experience of others,
  are also remarkable for their apparent disinclination to do so."  --
Douglas Adams>
<"There is nothing more horrifying than stupidity in action."  --  Adlai
Stevenson, United Nations ambassador (1900-1965)>
<"Advice to Parents: When you hear the toilet flush and the words "Uh-oh,"
it's already too late. -- Steve Willis>


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

Reply via email to