tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ugen vs interfaces



> Setting aside your confusion about interfaces and how they map to
> device nodes in the /dev tree for the moment, I'm curious what you're
> trying to do with this thing that can't be done by using it when it
> attaches as ucom(4) and umodem(4) devices?

Talk to it.

I found the problem.  It _was_ soemthing I was missing, something
people familiar with USB and ugen probably didn't think of because it's
become automatic for them.

I missed this fragment of ugen(4):

     USB_SET_SHORT_XFER (int)
             Allow short read transfer.  Normally a transfer from the device
             which is shorter than the request specified is reported as an
             error.

The way I was trying to use it, I needed to turn this on.  Once I did
that, the EIOs went away.  (I tracked this down by dropping debugging
into ugen.c, printing the usbd_bulk_transfer return code that led to
EIO; it proved to be 16, or USBD_SHORT_XFER.  From there it was a short
step to USB_SET_SHORT_XFER.)

It does not work to let it attach as a ucom and just read and write.
Even if I send the whole request in a single write(), I get nothing
back, whereas doing it myself with /dev/ugen1.0[23] does indeed work.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index