[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: No puede ser tan difícil: Palm T|X



On Fri, Mar 10, 2006 at 01:39:55PM +0100, VictorSanchez2 wrote:
> > Ojalá logres que te funcione. Ya que salga voy a juntar todo esto y 
> > hacer un README para que lo incluyan en pilot-link.
>
> Volveré a intentarlo a ver si hacemos que funcione. Gracias por todo.

¿Todavía andas con este problema? En la lista de pilot-link-dev acaba
de llegar un parche relacionado a no-sé-que problema que afecta a la
T|X y la LifeDrive. Te anexo el parche, a ver si te sirve.

----- Forwarded message from Daniel Gollub <dgollub@suse.de> -----

Subject: LiveDrive-issue fix for libusb connection
From: Daniel Gollub <dgollub@suse.de>
Date: Mon, 3 Jul 2006 17:39:09 +0200
To: pilot-link Development List <pilot-link-devel@pilot-link.org>
Organization: SUSE Linux Products GmbH
X-gnu-designs.com-MailScanner: Found to be clean, Found to be clean
Reply-To: pilot-link Development List <pilot-link-devel@pilot-link.org>
X-MailScanner-From: pilot-link-devel-bounces@pilot-link.org

Hi,

i have written a small fix for the "LiveDrive"-issue, which was discussed few 
days ago in #pilot-link channel. Now i am able to sync the Palm T|X without 
re-plugging the device. The problem is that the device is listed in the 
known_devices table but doesn't fail in USB_configure_device and is listing 
until the device disappears, when the hotsync starts => sync fails.

The fix lets USB_poll() skip the known devices which are unconfigured and 
avoid that USB_poll() is only called once by u_wait_for_device(). So 
USB_poll() is called until the device appears again and gets successfully 
configured.

Debug output is also attachted, if somebody is interested.

Tested with Palm T|X.

best regards,
Daniel

--- pilot-link-0.12.0/libpisock/libusb.c
+++ pilot-link-0.12.0/libpisock/libusb.c
@@ -138,6 +138,11 @@
 			USB_in_endpoint = USB_out_endpoint = 0xFF;
 
 			ret = USB_configure_device (data, &input_endpoint, &output_endpoint);
+			if (ret < 0) {
+				LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "%s: USB configure failed for familar device: 0x%04x 0x%04x. (LifeDrive issue?!)\n", __FILE__, dev->descriptor.idVendor, dev->descriptor.idProduct));
+				usb_close(USB_handle);
+				continue;
+			}
 
 			for (i = 0; i < dev->config[0].interface[0].altsetting[0].bNumEndpoints; i++) {
 				struct usb_endpoint_descriptor *endpoint;
--- pilot-link-0.12.0/libpisock/usb.c
+++ pilot-link-0.12.0/libpisock/usb.c
@@ -951,6 +951,9 @@
 	} else {
 		/* other devices will either accept or deny this generic call */
 		ret = USB_configure_generic (dev, input_pipe, output_pipe);
+		if (ret < 0) {
+			return -1;
+		}
 	}
 
 	/* query bytes available. Not that we really care,
@@ -962,6 +965,8 @@
 		ret = dev->impl.control_request (dev, 0xc2, GENERIC_REQUEST_BYTES_AVAILABLE, 0, 0, &ba[0], 2, 0);
 		if (ret < 0) {
 			LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "usb: GENERIC_REQUEST_BYTES_AVAILABLE failed (err=%08x)\n", ret));
+			/* configuration have to fail to skip this device - or LiveDrive(?) devices will hang */
+			return -1;
 		}
 		LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "GENERIC_REQUEST_BYTES_AVAILABLE returns 0x%02x%02x\n", ba[0], ba[1]));
 	}
@@ -1017,6 +1022,7 @@
 USB_configure_generic (pi_usb_data_t *dev, u_int8_t *input_pipe, u_int8_t *output_pipe)
 {
 	int i, ret;
+	int hotsync = 0;
 	palm_ext_connection_info_t ci;
 	u_int32_t flags = dev->dev.flags;
 
@@ -1031,6 +1037,9 @@
 			LOG((PI_DBG_DEV, PI_DBG_LVL_DEBUG, "\t[%d] endpoint_info=%d\n", i, ci.connections[i].endpoint_info));
 			if (!memcmp(ci.connections[i].port_function_id, "cnys", 4)) {
 
+				/* found hotsync port */
+				hotsync = 1;
+
 				/* 'sync': we found the pipes to use for synchronization force
 				   find_interfaces to select this one rather than another one */
 				if (ci.endpoint_numbers_different) {
@@ -1046,6 +1055,11 @@
 				}
 			}
 		}
+
+		if (!hotsync) {
+			LOG((PI_DBG_DEV, PI_DBG_LVL_ERR, "usb: PALM_GET_EXT_CONNECTION_INFORMATION - no hotsync port found.\n", ret));
+			return -1;
+		}
 	}
 
 	if (flags & USB_INIT_TAPWAVE) {


----- End forwarded message -----

-- 
Rodrigo Gallardo
GPG-Fingerprint: 7C81 E60C 442E 8FBC D975  2F49 0199 8318 ADC9 BC28


-- 
Rodrigo Gallardo
GPG-Fingerprint: 7C81 E60C 442E 8FBC D975  2F49 0199 8318 ADC9 BC28

Attachment: signature.asc
Description: Digital signature


Reply to: