From owner-freebsd-usb@FreeBSD.ORG Sat Aug 20 00:45:29 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A493916A41F for ; Sat, 20 Aug 2005 00:45:29 +0000 (GMT) (envelope-from karolis.t@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 435FB43D45 for ; Sat, 20 Aug 2005 00:45:29 +0000 (GMT) (envelope-from karolis.t@gmail.com) Received: by zproxy.gmail.com with SMTP id z6so485119nzd for ; Fri, 19 Aug 2005 17:45:28 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=k9rywspT97fULAnYsGLkDzIAe11HLKbQD1E3f50c0ErCa7Ct3ioBSLbs6NjvAbn8vgM+yZEqwileSQKCgVSKhzwuQecyVRuDYuD0Uy8gDJXeAuZB1lW0c8CavAN0y5bNBTwx7coymQKI+HwtUm1Ybq7pjCuJwpWxzkHCOqntVgE= Received: by 10.36.221.19 with SMTP id t19mr3037589nzg; Fri, 19 Aug 2005 17:45:28 -0700 (PDT) Received: by 10.36.42.9 with HTTP; Fri, 19 Aug 2005 17:45:28 -0700 (PDT) Message-ID: <6f896f9a050819174578785f9a@mail.gmail.com> Date: Sat, 20 Aug 2005 04:45:28 +0400 From: Karolis Tamutis To: freebsd-usb@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: A possible bug or lack of feature in ucom driver X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Aug 2005 00:45:29 -0000 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=3D8" 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=20 AT+MODE=3D8 OK Lost carrier. [EOT] root@# cu -l /dev/ucom0=20 /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 =09if (status !=3D USBD_NORMAL_COMPLETION) { =09=09if (!(sc->sc_state & UCS_RXSTOP)) =09=09=09printf("%s: ucomreadcb: %s\n", =09=09=09 USBDEVNAME(sc->sc_dev), usbd_errstr(status)); =09=09sc->sc_state |=3D UCS_RXSTOP; =09=09if (status =3D=3D USBD_STALLED) =09=09=09usbd_clear_endpoint_stall_async(sc->sc_bulkin_pipe); =09=09/* XXX we should restart after some delay. */ =09=09return; =09} 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.