From owner-freebsd-current@FreeBSD.ORG Wed Sep 8 07:44:40 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5966516A4CE for ; Wed, 8 Sep 2004 07:44:40 +0000 (GMT) Received: from sophia3.e-shell.net (sophia3.e-shell.net [64.246.46.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 061D143D39 for ; Wed, 8 Sep 2004 07:44:40 +0000 (GMT) (envelope-from loox@e-shell.net) Received: from dsl-201-135-241-226.prod-infinitum.com.mx (unknown [201.135.241.226]) by sophia3.e-shell.net (Postfix) with ESMTP id 00DA6656804 for ; Wed, 8 Sep 2004 02:44:57 -0500 (CDT) From: Axel Gonzalez Organization: e-shell.net Inc To: freebsd-current@freebsd.org Date: Wed, 8 Sep 2004 02:44:37 -0500 User-Agent: KMail/1.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200409080244.37726.loox@e-shell.net> Subject: [PATCH] Clie TH55 sync over usb (maybe other OS 5 devices too) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2004 07:44:40 -0000 Finally got my TH55 to hotsync with pilot-link. There was a couple issues: * It doesn't like the 'getting connection info' part, it just timed out. After removing it, attach/detach work fine (don't know if its needed for other devices, so in the patch I don't remove it.. my m505 works ok with this code). It was the same problem as described on this thread: http://lists.freebsd.org/pipermail/freebsd-current/2004-August/033438.html so maybe this will work for other devices too. * This device uses 2 pairs of bulk ports, uses first pair for 'in', second for 'out'. You need to map the correct addresses in order to work (got a hint for a little bird on this one). After this couple fixes (and adding id's for the device), it works just fine. ***begin usbdevs patch*** --- usbdevs.orig Sat Sep 4 02:07:35 2004 +++ usbdevs Sun Sep 5 22:34:12 2004 @@ -1312,6 +1312,7 @@ product SONY CLIE_41_MS 0x0099 Sony Clie v4.1 Memory Stick slot product SONY CLIE_41 0x009a Sony Clie v4.1 product SONY CLIE_NX60 0x00da Sony Clie nx60 +product SONY CLIE_TH55 0x0144 Sony Clie th55 /* Sony Ericsson products */ product SONYERICSSON DCU10 0x0528 USB Cable ***end usbdevs patch*** ***begin uvisor.c patch*** --- uvisor.c.orig Sun Jun 27 07:41:44 2004 +++ uvisor.c Wed Sep 8 02:14:44 2004 @@ -207,6 +207,7 @@ struct usb_devno uv_dev; u_int16_t uv_flags; #define PALM4 0x0001 +#define PALM5 0x0002 }; static const struct uvisor_type uvisor_devs[] = { {{ USB_VENDOR_HANDSPRING, USB_PRODUCT_HANDSPRING_VISOR }, 0 }, @@ -227,6 +228,7 @@ {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_S360 }, PALM4 }, {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_NX60 }, PALM4 }, {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_35 }, 0 }, + {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_TH55 }, PALM5 }, /* {{ USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_25 }, PALM4 },*/ }; #define uvisor_lookup(v, p) ((const struct uvisor_type *)usb_lookup(uvisor_devs, v, p)) @@ -313,8 +315,11 @@ addr = ed->bEndpointAddress; dir = UE_GET_DIR(ed->bEndpointAddress); attr = ed->bmAttributes & UE_XFERTYPE; - if (dir == UE_DIR_IN && attr == UE_BULK) + if (dir == UE_DIR_IN && attr == UE_BULK) { + if (ucom->sc_bulkin_no != -1) + continue; ucom->sc_bulkin_no = addr; + } else if (dir == UE_DIR_OUT && attr == UE_BULK) ucom->sc_bulkout_no = addr; else { @@ -417,17 +422,19 @@ uWord avail; char buffer[256]; - DPRINTF(("uvisor_init: getting connection info\n")); - req.bmRequestType = UT_READ_VENDOR_ENDPOINT; - req.bRequest = UVISOR_GET_CONNECTION_INFORMATION; - USETW(req.wValue, 0); - USETW(req.wIndex, 0); - USETW(req.wLength, UVISOR_CONNECTION_INFO_SIZE); - err = usbd_do_request_flags(sc->sc_ucom.sc_udev, &req, &coninfo, - USBD_SHORT_XFER_OK, &actlen, - USBD_DEFAULT_TIMEOUT); - if (err) - return (err); + if (!(sc->sc_flags & PALM5)) { + DPRINTF(("uvisor_init: getting connection info\n")); + req.bmRequestType = UT_READ_VENDOR_ENDPOINT; + req.bRequest = UVISOR_GET_CONNECTION_INFORMATION; + USETW(req.wValue, 0); + USETW(req.wIndex, 0); + USETW(req.wLength, UVISOR_CONNECTION_INFO_SIZE); + err = usbd_do_request_flags(sc->sc_ucom.sc_udev, &req, &coninfo, + USBD_SHORT_XFER_OK, &actlen, + USBD_DEFAULT_TIMEOUT); + if (err) + return (err); + } #ifdef USB_DEBUG { ***end uvisor.c patch***