All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] Corrections in hciattach code
@ 2005-12-06 21:30 Jatin Nahar
  2005-12-06 21:34 ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Jatin Nahar @ 2005-12-06 21:30 UTC (permalink / raw)
  To: bluez-devel

[-- Attachment #1: Type: text/plain, Size: 1086 bytes --]

The hciattach code when used with swave option (RFMD) would not work
since there are 2 bugs in that code, infact it will return with
"Initialization timeout" every single time. Here are fixes for those
(let me know if you would like me to send that to you in some other
form). The base file used for the diff is hciattach.c in
bluez-utils-2.22.

691c691
< 	if (write(fd, cmd, 9) != 9) {
---
> 	if (write(fd, cmd, 10) != 10) {
723c723,724
< 	// we probably got the reply. Now we must send the "soft reset":
---
> 	// we probably got the reply. Now we must send the "soft reset":
which
> 	// is standard HCI RESET.
725,728c726,728
< 	cmd[1] = 0x0B;			// OCF 0x0B	= param access
set	
< 	cmd[2] = 0xfc;			// OGF bx111111 = vendor
specific
< 	cmd[3] = 0x01;			// 1 byte of data following 
< 	cmd[4] = 0x03;			// HCI Reset Subcommand
---
> 	cmd[1] = 0x03;				
> 	cmd[2] = 0x0c;		
> 	cmd[3] = 0x00;		
730,731c730,731
< 	// Send initialization command
< 	if (write(fd, cmd, 5) != 5) {
---
> 	// Send command
> 	if (write(fd, cmd, 4) != 4) {

Regards,
Jatin

[-- Attachment #2: Type: text/html, Size: 3818 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] Corrections in hciattach code
  2005-12-06 21:30 [Bluez-devel] Corrections in hciattach code Jatin Nahar
@ 2005-12-06 21:34 ` Marcel Holtmann
  0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2005-12-06 21:34 UTC (permalink / raw)
  To: bluez-devel

Hi Jatin,

> The hciattach code when used with swave option (RFMD) would not work
> since there are 2 bugs in that code, infact it will return with
> "Initialization timeout" every single time. Here are fixes for those
> (let me know if you would like me to send that to you in some other
> form). The base file used for the diff is hciattach.c in
> bluez-utils-2.22.

send them in unified diff format.

Regards

Marcel




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Bluez-devel] Corrections in hciattach code
  2005-12-08  0:56 Jatin Nahar
@ 2005-12-08  5:41 ` Marcel Holtmann
  0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2005-12-08  5:41 UTC (permalink / raw)
  To: bluez-devel

Hi Jatin,

> You are correct about the specification but HCI reset is needed to have
> the UART change working, even though there won't be any data loss.

if you say so. The change is in the CVS now.

Regards

Marcel




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Bluez-devel] Corrections in hciattach code
@ 2005-12-08  0:56 Jatin Nahar
  2005-12-08  5:41 ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Jatin Nahar @ 2005-12-08  0:56 UTC (permalink / raw)
  To: bluez-devel

Hi Marcel,

> @@ -720,15 +720,15 @@
>  		return -1;
>  	}
> =20
> -	// we probably got the reply. Now we must send the "soft reset":
> +	// we probably got the reply. Now we must send the "soft reset":
> which
> +	// is standard HCI RESET.
>  	cmd[0] =3D HCI_COMMAND_PKT;	// it's a command packet
> -	cmd[1] =3D 0x0B;			// OCF 0x0B	=3D param access
> set=09
> -	cmd[2] =3D 0xfc;			// OGF bx111111 =3D vendor
> specific
> -	cmd[3] =3D 0x01;			// 1 byte of data following=20
> -	cmd[4] =3D 0x03;			// HCI Reset Subcommand
> +	cmd[1] =3D 0x03;			=09
> +	cmd[2] =3D 0x0c;	=09
> +	cmd[3] =3D 0x00;	=09
>  		=09
> -	// Send initialization command
> -	if (write(fd, cmd, 5) !=3D 5) {
> +	// Send HCI RESET command
> +	if (write(fd, cmd, 4) !=3D 4) {
>  		perror("Can't write Silicon Wave reset cmd.");
>  		return -1;
>  	}

But with this one I am not sure. Do this chip really uses HCI Reset to
reset the device and bring it up with the new baud rate. Actually my
understanding is that HCI Reset should not reset the transport layer and
this has been clarified in the Bluetooth 1.1 specification.

You are correct about the specification but HCI reset is needed to have
the UART change working, even though there won't be any data loss.

Thanks,
Jatin=20


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Bluez-devel] Corrections in hciattach code
  2005-12-07  2:21 Jatin Nahar
@ 2005-12-07  9:04 ` Marcel Holtmann
  0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2005-12-07  9:04 UTC (permalink / raw)
  To: bluez-devel

Hi Jatin,

> Here it is...
> 
> --- hciattach_old.c	2005-12-06 13:15:22.000000000 -0800
> +++ hciattach.c	2005-12-06 13:16:15.000000000 -0800
> @@ -688,7 +688,7 @@
>  	}
>  
>  	/* Send initialization command */
> -	if (write(fd, cmd, 9) != 9) {
> +	if (write(fd, cmd, 10) != 10) {
>  		perror("Failed to write init command");
>  		return -1;
>  	}

this part is clear.

> @@ -720,15 +720,15 @@
>  		return -1;
>  	}
>  
> -	// we probably got the reply. Now we must send the "soft reset":
> +	// we probably got the reply. Now we must send the "soft reset":
> which
> +	// is standard HCI RESET.
>  	cmd[0] = HCI_COMMAND_PKT;	// it's a command packet
> -	cmd[1] = 0x0B;			// OCF 0x0B	= param access
> set	
> -	cmd[2] = 0xfc;			// OGF bx111111 = vendor
> specific
> -	cmd[3] = 0x01;			// 1 byte of data following 
> -	cmd[4] = 0x03;			// HCI Reset Subcommand
> +	cmd[1] = 0x03;				
> +	cmd[2] = 0x0c;		
> +	cmd[3] = 0x00;		
>  			
> -	// Send initialization command
> -	if (write(fd, cmd, 5) != 5) {
> +	// Send HCI RESET command
> +	if (write(fd, cmd, 4) != 4) {
>  		perror("Can't write Silicon Wave reset cmd.");
>  		return -1;
>  	}

But with this one I am not sure. Do this chip really uses HCI Reset to
reset the device and bring it up with the new baud rate. Actually my
understanding is that HCI Reset should not reset the transport layer and
this has been clarified in the Bluetooth 1.1 specification.

Regards

Marcel
 



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [Bluez-devel] Corrections in hciattach code
@ 2005-12-07  2:21 Jatin Nahar
  2005-12-07  9:04 ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Jatin Nahar @ 2005-12-07  2:21 UTC (permalink / raw)
  To: bluez-devel

Marcel,

Here it is...

--- hciattach_old.c	2005-12-06 13:15:22.000000000 -0800
+++ hciattach.c	2005-12-06 13:16:15.000000000 -0800
@@ -688,7 +688,7 @@
 	}
=20
 	/* Send initialization command */
-	if (write(fd, cmd, 9) !=3D 9) {
+	if (write(fd, cmd, 10) !=3D 10) {
 		perror("Failed to write init command");
 		return -1;
 	}
@@ -720,15 +720,15 @@
 		return -1;
 	}
=20
-	// we probably got the reply. Now we must send the "soft reset":
+	// we probably got the reply. Now we must send the "soft reset":
which
+	// is standard HCI RESET.
 	cmd[0] =3D HCI_COMMAND_PKT;	// it's a command packet
-	cmd[1] =3D 0x0B;			// OCF 0x0B	=3D param access
set=09
-	cmd[2] =3D 0xfc;			// OGF bx111111 =3D vendor
specific
-	cmd[3] =3D 0x01;			// 1 byte of data following=20
-	cmd[4] =3D 0x03;			// HCI Reset Subcommand
+	cmd[1] =3D 0x03;			=09
+	cmd[2] =3D 0x0c;	=09
+	cmd[3] =3D 0x00;	=09
 		=09
-	// Send initialization command
-	if (write(fd, cmd, 5) !=3D 5) {
+	// Send HCI RESET command
+	if (write(fd, cmd, 4) !=3D 4) {
 		perror("Can't write Silicon Wave reset cmd.");
 		return -1;
 	}

Thanks,
Jatin=20

> The hciattach code when used with swave option (RFMD) would not work=20
> since there are 2 bugs in that code, infact it will return with=20
> "Initialization timeout" every single time. Here are fixes for those=20
> (let me know if you would like me to send that to you in some other=20
> form). The base file used for the diff is hciattach.c in=20
> bluez-utils-2.22.

send them in unified diff format.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-12-08  5:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-06 21:30 [Bluez-devel] Corrections in hciattach code Jatin Nahar
2005-12-06 21:34 ` Marcel Holtmann
2005-12-07  2:21 Jatin Nahar
2005-12-07  9:04 ` Marcel Holtmann
2005-12-08  0:56 Jatin Nahar
2005-12-08  5:41 ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.