[PATCH] Clie TH55 sync over usb (maybe other OS 5 devices too)
Axel Gonzalez
loox at e-shell.net
Wed Sep 8 00:44:40 PDT 2004
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***
More information about the freebsd-current
mailing list