Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jun 2005 09:45:12 -0700
From:      Maksim Yevmenkin <maksim.yevmenkin@savvis.net>
To:        vova@fbsd.ru
Cc:        bluetooth <bluetooth@freebsd.org>
Subject:   Re: Problem with Logitech Mx900 again
Message-ID:  <42B84418.2060409@savvis.net>
In-Reply-To: <1119334445.972.17.camel@localhost>
References:  <1119297124.1045.11.camel@localhost>	 <42B72DC4.2090104@savvis.net> <1119334445.972.17.camel@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------040903080605030903040505
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Vladimir,

[...]

> dump with last attempt with pin-code in attachment.

thanks. in the dump you have provided i can see that bthidd(8) have 
successfully established l2cap connection on psm 17 (0x11 - HID control 
channel)

1119333385.368311 < L2CAP(s): Connect req: psm 17 scid 0x0042
1119333385.386224 > L2CAP(s): Connect rsp: dcid 0x0042 scid 0x0042 
result 1 stat
1119333385.443257 > L2CAP(s): Connect rsp: dcid 0x0042 scid 0x0042 
result 0 stat
1119333385.443299 < L2CAP(s): Config req: dcid 0x0042 flags 0x0000 clen 0
1119333385.516189 > L2CAP(s): Config rsp: scid 0x0042 flags 0x0000 
result 0 clen
1119333385.547220 > L2CAP(s): Config req: dcid 0x0042 flags 0x0000 clen 28
   MTU 48 Unknown (type 03, len 22)
1119333385.549241 < L2CAP(s): Config rsp: scid 0x0042 flags 0x0000 
result 0 clen

however, it could not establish HID interrupt channel on psm 19 (0x13 - 
HID interrupt). instead bthidd(8) tried to connect on psm 25 (0x19)! and 
of course mouse rejects the connection.

1119333385.549430 < L2CAP(s): Connect req: psm 25 scid 0x0043
1119333385.580204 > L2CAP(s): Connect rsp: dcid 0x0000 scid 0x0043 
result 2 stat
1119333385.580438 < L2CAP(s): Disconn req: dcid 0x0042 scid 0x0042
1119333385.638242 > L2CAP(s): Disconn rsp: dcid 0x0042 scid 0x0042

i remember you had similar problem before due to incorrect 
"interrupt_psm" value in the bthidd.conf file. in your first email you 
have posted your bthidd.conf file and it had correct values for 
"interrupt_psm" and "control_psm".

so, could you please double check your /etc/bluetooth/bthidd.conf file 
and make sure bthidd(8) uses the correct config.

i suspect there might be another bug in bthidd(8), so if you could 
please try to run bthidd(8) under debugger and try to examine internal 
configuration structures after bthidd(8) parses the config file.

i also attached a patch that renames global variable to avoid name 
collision with the local variables. i do not expect it to fix your 
problem, but please try it anyway.

> It looks like hardware problem for me (over one night both OSes stop
> stop seen mouse) no reset was initiated, cradle was far-far away from
> place where it happens. But, probably there is software solution.

lets not blame the hardware just yet :)

thanks,
max

--------------040903080605030903040505
Content-Type: text/plain;
 name="parser.y.diff.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="parser.y.diff.txt"

--- parser.y.orig	Tue Jun 21 09:37:45 2005
+++ parser.y	Tue Jun 21 09:36:31 2005
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  * $Id: parser.y,v 1.4 2004/11/17 21:59:42 max Exp $
- * $FreeBSD: /repoman/r/ncvs/src/usr.sbin/bluetooth/bthidd/parser.y,v 1.4 2005/05/18 23:03:44 emax Exp $
+ * $FreeBSD: src/usr.sbin/bluetooth/bthidd/parser.y,v 1.4 2005/05/18 23:03:44 emax Exp $
  */
 
 #include <sys/queue.h>
@@ -68,7 +68,7 @@
 
 static	char			 buffer[1024];
 static	int			 hid_descriptor_size;
-static	hid_device_t		*hid_device = NULL;
+static	hid_device_t		*hid_current = NULL;
 static	LIST_HEAD(, hid_device)	 hid_devices;
 
 %}
@@ -92,23 +92,23 @@
 
 line:		T_DEVICE
 			{
-			hid_device = (hid_device_t *) calloc(1, sizeof(*hid_device));
-			if (hid_device == NULL) {
+			hid_current = (hid_device_t *) calloc(1, sizeof(*hid_current));
+			if (hid_current == NULL) {
 				SYSLOG(LOGCRIT, "Could not allocate new " \
 						"config entry" EOL);
 				YYABORT;
 			}
 
-			hid_device->new_device = 1;
+			hid_current->new_device = 1;
 			}
 		'{' options '}'
 			{
-			if (check_hid_device(hid_device))
-				LIST_INSERT_HEAD(&hid_devices,hid_device,next);
+			if (check_hid_device(hid_current))
+				LIST_INSERT_HEAD(&hid_devices, hid_current, next);
 			else
-				free_hid_device(hid_device);
+				free_hid_device(hid_current);
 
-			hid_device = NULL;
+			hid_current = NULL;
 			}
 		;
 
@@ -128,49 +128,49 @@
 
 bdaddr:		T_BDADDR T_BDADDRSTRING
 			{
-			memcpy(&hid_device->bdaddr, &$2, sizeof(hid_device->bdaddr));
+			memcpy(&hid_current->bdaddr, &$2, sizeof(hid_current->bdaddr));
 			}
 		;
 
 control_psm:	T_CONTROL_PSM T_HEXBYTE
 			{
-			hid_device->control_psm = $2;
+			hid_current->control_psm = $2;
 			}
 		;
 
 interrupt_psm:	T_INTERRUPT_PSM T_HEXBYTE
 			{
-			hid_device->interrupt_psm = $2;
+			hid_current->interrupt_psm = $2;
 			}
 		;
 
 reconnect_initiate: T_RECONNECT_INITIATE T_TRUE
 			{
-			hid_device->reconnect_initiate = 1;
+			hid_current->reconnect_initiate = 1;
 			}
 		| T_RECONNECT_INITIATE T_FALSE
 			{
-			hid_device->reconnect_initiate = 0;
+			hid_current->reconnect_initiate = 0;
 			}
 		;
 
 battery_power:	T_BATTERY_POWER T_TRUE
 			{
-			hid_device->battery_power = 1;
+			hid_current->battery_power = 1;
 			}
 		| T_BATTERY_POWER T_FALSE
 			{
-			hid_device->battery_power = 0;
+			hid_current->battery_power = 0;
 			}
 		;
 
 normally_connectable: T_NORMALLY_CONNECTABLE T_TRUE
 			{
-			hid_device->normally_connectable = 1;
+			hid_current->normally_connectable = 1;
 			}
 		| T_NORMALLY_CONNECTABLE T_FALSE
 			{
-			hid_device->normally_connectable = 0;
+			hid_current->normally_connectable = 0;
 			}
 		;
 
@@ -180,11 +180,11 @@
 			}
 		'{' hid_descriptor_bytes '}'
 			{
-			if (hid_device->desc != NULL)
-				hid_dispose_report_desc(hid_device->desc);
+			if (hid_current->desc != NULL)
+				hid_dispose_report_desc(hid_current->desc);
 
-			hid_device->desc = hid_use_report_desc(buffer, hid_descriptor_size);
-			if (hid_device->desc == NULL) {
+			hid_current->desc = hid_use_report_desc(buffer, hid_descriptor_size);
+			if (hid_current->desc == NULL) {
 				SYSLOG(LOGCRIT, "Could not use HID descriptor" EOL);
 				YYABORT;
 			}

--------------040903080605030903040505--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42B84418.2060409>