A possible bug or lack of feature in ucom driver

Karolis Tamutis karolis.t at gmail.com
Sat Aug 20 00:45:29 GMT 2005


Hi all. I'm just digging into usb programming, I want to write drivers
for my motorola phone. Normally, my phone connects in AT mode, with
product ID being: 0x4902, but in I need to change this mode to P2K (in
order to operate the phone). On linux it's done by sending AT command
"AT+MODE=8" to the acm device, here - by sending the same command to
ucom device. If the command executed successfully, phone's product ID
should change to 0x4901 (I believe the phone has to reboot it self to
achieve this?). But here's what I get when executing the following:
root@# cu -l /dev/ucom0 
AT+MODE=8
OK

Lost carrier.
[EOT]
root@# cu -l /dev/ucom0 
/dev/ucom0: No such file or directory
link down

Output of dmesg:
ucom0: ucomreadcb: IOERROR
ucom0: abnormal status: IOERROR
ucom0: abnormal status: IOERROR
ucom0: at uhub0 port 1 (addr 2) disconnected
ucom0: still open, forcing close

I believe the phone can't return from rebooting?
Here's that piece of code from /usr/src/sys/dev/usb/ucom.c:

Line 1045
	if (status != USBD_NORMAL_COMPLETION) {
		if (!(sc->sc_state & UCS_RXSTOP))
			printf("%s: ucomreadcb: %s\n",
			       USBDEVNAME(sc->sc_dev), usbd_errstr(status));
		sc->sc_state |= UCS_RXSTOP;
		if (status == USBD_STALLED)
			usbd_clear_endpoint_stall_async(sc->sc_bulkin_pipe);
		/* XXX we should restart after some delay. */
		return;
	}
Line 1056

/* XXX we should restart after some delay. */
Doe's this comment means it lacks some functionality? Could someone
wit the knowledge make a patch or tell me what to do? I would be very
thankful, because this really stops my progress. Thank you.


More information about the freebsd-usb mailing list