Hi,

I'am trying to initialize a usb<->serial adapter called pl2303,
type HX, with a program derived from Christoph Lohmann's usbuart (with
setupreq added from cmd/usb/lib/setup.c). At the beginning, a sequence
of commands is sent over ep0, some proprietary ones and things like
the baudrate value.

Though, the device does not behave as expected, but seems to persist in
some kind of "read-only" state, i.e. it probably does not accept the
line settings (which contains the baudrate).

In contrast, with a user-space program on Linux (based on libusb),
containing the same initialization instructions, i'm able to set up
that adapter.

[The initialization in detail (ep0 messages,
written to /dev/usb1/1/setup:

Set configuration and interface (perhaps superfluous, as usbd
already does it?):
out[8] 00 09 01 00 00 00 00 00
out[8] 01 0b 00 00 00 00 00 00

Proprietary sequence:
out[8] c0 01 84 84 00 00 01 00 in[1] 02
out[8] 40 01 04 04 00 00 00 00
out[8] c0 01 84 84 00 00 01 00 in[1] 02
out[8] c0 01 83 83 00 00 01 00 in[1] 00
out[8] c0 01 84 84 00 00 01 00 in[1] 02
out[8] 40 01 04 04 00 00 00 00
out[8] c0 01 84 84 00 00 01 00 in[1] 02
out[8] c0 01 83 83 00 00 01 00 in[1] 00
out[8] 40 01 00 00 01 00 00 00
out[8] 40 01 01 00 00 00 00 00

Adapter type "HX"
out[8] 40 01 02 00 44 00 00 00

Setup "upstream pipes"
out[8] 40 01 08 00 00 00 00 00
out[8] 40 01 09 00 00 00 00 00

Get line settings
out[8] a1 21 00 00 00 00 07 00 in[7] 80 25 00 00 00 00 00 (*)
'-9600baud-'

Set line settings
out[15] 21 20 00 00 00 00 07 00 00 c2 01 00 00 00 08
`-115200-'

Get line settings again,
on Linux I get:
out[8] a1 21 00 00 00 00 07 00 in[7] 00 c2 01 00 00 00 08
but on Plan9 (same as *):
out[8] a1 21 00 00 00 00 07 00 in[7] 80 25 00 00 00 00 00 ]


So on Plan9 the adapter still reports the initial setting of 9600
baud (as on any future request), while on Linux it has correctly
processed the set-line command.

Perhaps it is already a good sign, that on Plan9 the adapter's answer
messages seem meaningful too, and they are in all cases (except as for
the get-line request) the same as on Linux.

I already used the debug feature in usbuhci.c, which told me that the
commands are really written (interesting: on each RD2H-request a 0
byte long message is written that seems to originate in the
kernel). What could I have missed?

Michael