public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [Bluez-devel] Prepare patch bluez for the CoD in hci_conn
  2004-12-06 13:34 [Bluez-devel] Prepare patch bluez for the CoD in hci_conn Chen Bin
@ 2004-12-06  6:40 ` Marcel Holtmann
  2004-12-06 15:11   ` Chen Bin
  0 siblings, 1 reply; 15+ messages in thread
From: Marcel Holtmann @ 2004-12-06  6:40 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi Chen,

> Do you remember that I have asked a CoD question in this list and you
> ask me to do a patch to let the CoD value in hci_conn? Now I have time
> to do this work and I have something to clarify for I am not a bluez
> member before and I am not very fimiliar with BlueZ.
> 
> This time I just want to keep the remote CoD value in hci_conn when a
> connection is done. But as you know, sometimes it is impossible for us
> to get the CoD of the remote class without a prestage inquiry. So, not
> every CoD value in hci_conn is valid. I will check the BT spec to find a
> right way to tell the user whether the CoD is valid.
> 
> Is it enough that I add a field to hci_conn and when the connection is
> done I update the field?

you need only to add a "__u8 dev_class[3]" field to the data structure
and if you don't know the current value for CoD. For example for an
outgoing connection, where the value is not in the inquiry cache, then
you simply put 0x000000 in there.

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Prepare patch bluez for the CoD in hci_conn
  2004-12-06 15:11   ` Chen Bin
@ 2004-12-06  7:18     ` Marcel Holtmann
  2004-12-06 15:50       ` Chen Bin
  2004-12-06 15:53       ` Chen Bin
  0 siblings, 2 replies; 15+ messages in thread
From: Marcel Holtmann @ 2004-12-06  7:18 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi Chen,

> I have done this. I searched the BT spec and find two places which will
> let us know the CoD value, and I simply test it, it works find.
> 
> Ok, next step is to make an interface(maybe ioctl) to let the user get
> the CoD value, is it needed(if there has been a interface which can get
> the entire hci_conn structure)? If it is not needed, I will send you the
> patch now.

step by step. Send your patch now and don't forget the Signed-off-by
statement.

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Prepare patch bluez for the CoD in hci_conn
  2004-12-06 15:50       ` Chen Bin
@ 2004-12-06  8:07         ` Marcel Holtmann
  0 siblings, 0 replies; 15+ messages in thread
From: Marcel Holtmann @ 2004-12-06  8:07 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi Chen,

> I haven't patched for the kernel before, so I don't know what is the
> Singed-off-by statement.I only added my change log at the header of the
> file and in the part of the file I modified I have added some comments.

please prepare an email with the patch and describe briefly what it
changes. Then you put a

	Signed-off-by: Chen Bin <binch@mobilesoft.com.cn>

under it to say that the code is from you. Don't spread all the source
code with your name, because this will result in extra work for me to
delete it.

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Prepare patch bluez for the CoD in hci_conn
  2004-12-06 15:53       ` Chen Bin
@ 2004-12-06  8:41         ` Marcel Holtmann
  2004-12-06 16:54           ` Chen Bin
  2004-12-06 17:05           ` Chen Bin
  0 siblings, 2 replies; 15+ messages in thread
From: Marcel Holtmann @ 2004-12-06  8:41 UTC (permalink / raw)
  To: BlueZ Mailing List

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

Hi Chen,

> The attachment is my patch, the comments and the debug info can be
> removed as soon as this patch is tested fully.

and your patch is quite too complex. Mine consists of three additional
lines only.

Regards

Marcel


[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1138 bytes --]

===== include/net/bluetooth/hci_core.h 1.29 vs edited =====
--- 1.29/include/net/bluetooth/hci_core.h	2004-12-06 09:15:52 +01:00
+++ edited/include/net/bluetooth/hci_core.h	2004-12-06 09:26:59 +01:00
@@ -152,6 +152,7 @@
 	__u16		 state;
 	__u8		 type;
 	__u8		 out;
+	__u8		 dev_class[3];
 	__u32		 link_mode;
 	unsigned long	 pend;
 	
===== net/bluetooth/hci_conn.c 1.18 vs edited =====
--- 1.18/net/bluetooth/hci_conn.c	2004-12-06 09:16:18 +01:00
+++ edited/net/bluetooth/hci_conn.c	2004-12-06 09:38:53 +01:00
@@ -74,6 +74,7 @@
 		cp.pscan_rep_mode = ie->data.pscan_rep_mode;
 		cp.pscan_mode     = ie->data.pscan_mode;
 		cp.clock_offset   = ie->data.clock_offset | __cpu_to_le16(0x8000);
+		memcpy(conn->dev_class, ie->data.dev_class, 3);
 	}
 
 	cp.pkt_type = __cpu_to_le16(hdev->pkt_type & ACL_PTYPE_MASK);
===== net/bluetooth/hci_event.c 1.20 vs edited =====
--- 1.20/net/bluetooth/hci_event.c	2004-12-06 09:16:20 +01:00
+++ edited/net/bluetooth/hci_event.c	2004-12-06 09:29:36 +01:00
@@ -555,6 +555,7 @@
 				return;
 			}
 		}
+		memcpy(conn->dev_class, ev->dev_class, 3);
 		conn->state = BT_CONNECT;
 		hci_dev_unlock(hdev);
 

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

* Re: [Bluez-devel] Prepare patch bluez for the CoD in hci_conn
  2004-12-06 16:54           ` Chen Bin
@ 2004-12-06  9:04             ` Marcel Holtmann
  2004-12-06 17:40               ` Chen Bin
  0 siblings, 1 reply; 15+ messages in thread
From: Marcel Holtmann @ 2004-12-06  9:04 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi Chen,

> Ok, use your patch is ok, if I have find some more info in the Bluetooth
> Spec, I will send my patch to you:)

it is only compile tested, but actually from a code review it should do
exactly what was requested. If you wanna test it, you must change the
ie->data into ie->info, because the inquiry_data change is not yet
merged back into mainline. A new -mh patch will follow soon.

> BTW: I will remain our company's BT engineer and if the BlueZ have some
> part not completed, may be I can contribute to do some work:)

Go ahead, because every patch is welcome.

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Prepare patch bluez for the CoD in hci_conn
  2004-12-06 17:05           ` Chen Bin
@ 2004-12-06  9:14             ` Marcel Holtmann
  2004-12-06 17:21               ` Chen Bin
  0 siblings, 1 reply; 15+ messages in thread
From: Marcel Holtmann @ 2004-12-06  9:14 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi Chen,

> I see your patch that you patch the hci_acl_connect()=81Cbut why not
> hci_conn_add()?
>=20
> I feel the latter is more appropriate.

no, it is not. The hci_conn_add is called at various times. It is called
for incoming and outgoing connections. We don't need to do a lookup at
the inquiry cache for an incoming connection, because we get the value
within the connection request event. The hci_acl_connect() is used to
create an outgoing connection and it already have to lookup the other
parameters from the inquiry cache. Do see the point?

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Prepare patch bluez for the CoD in hci_conn
  2004-12-06 17:40               ` Chen Bin
@ 2004-12-06  9:56                 ` Marcel Holtmann
  0 siblings, 0 replies; 15+ messages in thread
From: Marcel Holtmann @ 2004-12-06  9:56 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi Chen,

> > it is only compile tested, but actually from a code review it should do
> > exactly what was requested. If you wanna test it, you must change the
> > ie->data into ie->info, because the inquiry_data change is not yet
> > merged back into mainline. A new -mh patch will follow soon.
> > 
> 
> I have test my patch, and I will test yours too. 
> 
> And I wanna know which kernel version you current work on? Your new -mh
> patch will only apply to the newest kernel or olders too?
> 
> I don't know much about your patch convention.

if it says patch-2.6.9-mh4 then it applies cleanly against 2.6.9.

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* [Bluez-devel] Prepare patch bluez for the CoD in hci_conn
@ 2004-12-06 13:34 Chen Bin
  2004-12-06  6:40 ` Marcel Holtmann
  0 siblings, 1 reply; 15+ messages in thread
From: Chen Bin @ 2004-12-06 13:34 UTC (permalink / raw)
  To: bluez-devel

Hi Marcel,

Do you remember that I have asked a CoD question in this list and you
ask me to do a patch to let the CoD value in hci_conn? Now I have time
to do this work and I have something to clarify for I am not a bluez
member before and I am not very fimiliar with BlueZ.

This time I just want to keep the remote CoD value in hci_conn when a
connection is done. But as you know, sometimes it is impossible for us
to get the CoD of the remote class without a prestage inquiry. So, not
every CoD value in hci_conn is valid. I will check the BT spec to find a
right way to tell the user whether the CoD is valid.

Is it enough that I add a field to hci_conn and when the connection is
done I update the field?

Chen



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Prepare patch bluez for the CoD in hci_conn
  2004-12-06  6:40 ` Marcel Holtmann
@ 2004-12-06 15:11   ` Chen Bin
  2004-12-06  7:18     ` Marcel Holtmann
  0 siblings, 1 reply; 15+ messages in thread
From: Chen Bin @ 2004-12-06 15:11 UTC (permalink / raw)
  To: bluez-devel

Hi Marcel,

I have done this. I searched the BT spec and find two places which will
let us know the CoD value, and I simply test it, it works find.

Ok, next step is to make an interface(maybe ioctl) to let the user get
the CoD value, is it needed(if there has been a interface which can get
the entire hci_conn structure)? If it is not needed, I will send you the
patch now.


Chen
=D4=DA 2004-12-06=D2=BB=B5=C4 07:40 +0100=A3=ACMarcel Holtmann=D0=B4=B5=C0=
=A3=BA
>                               =B7=A2=BC=FE=C8=CB:=20
> Marcel Holtmann
> <marcel@holtmann.org>
>                               =BB=D8=B8=B4=D6=C1:=20
> bluez-devel@lists.sourceforge.net
>                               =CA=D5=BC=FE=C8=CB:=20
> BlueZ Mailing List
> <bluez-devel@lists.sourceforge.net>
>                                =D6=F7=CC=E2:=20
> Re: [Bluez-devel] Prepare patch
> bluez for the CoD in hci_conn
>                                =C8=D5=C6=DA:=20
> Mon, 06 Dec 2004 07:40:36 +0100
> (14:40 CST)
>=20
> Hi Chen,
>=20
> > Do you remember that I have asked a CoD question in this list and
> you
> > ask me to do a patch to let the CoD value in hci_conn? Now I have
> time
> > to do this work and I have something to clarify for I am not a bluez
> > member before and I am not very fimiliar with BlueZ.
> >=20
> > This time I just want to keep the remote CoD value in hci_conn when
> a
> > connection is done. But as you know, sometimes it is impossible for
> us
> > to get the CoD of the remote class without a prestage inquiry. So,
> not
> > every CoD value in hci_conn is valid. I will check the BT spec to
> find a
> > right way to tell the user whether the CoD is valid.
> >=20
> > Is it enough that I add a field to hci_conn and when the connection
> is
> > done I update the field?
>=20
> you need only to add a "__u8 dev_class[3]" field to the data structure
> and if you don't know the current value for CoD. For example for an
> outgoing connection, where the value is not in the inquiry cache, then
> you simply put 0x000000 in there.
>=20
> Regards
>=20
> Marcel



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Prepare patch bluez for the CoD in hci_conn
  2004-12-06  7:18     ` Marcel Holtmann
@ 2004-12-06 15:50       ` Chen Bin
  2004-12-06  8:07         ` Marcel Holtmann
  2004-12-06 15:53       ` Chen Bin
  1 sibling, 1 reply; 15+ messages in thread
From: Chen Bin @ 2004-12-06 15:50 UTC (permalink / raw)
  To: bluez-devel

Hi Marcel,

I haven't patched for the kernel before, so I don't know what is the
Singed-off-by statement.I only added my change log at the header of the
file and in the part of the file I modified I have added some comments.

/*
   BlueZ - Bluetooth protocol stack for Linux
   Copyright (C) 2000-2001 Qualcomm Incorporated

   Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License version 2 as
   published by the Free Software Foundation;

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS
   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
RIGHTS.
   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR
ANY
   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY
DAMAGES
   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF
   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
   SOFTWARE IS DISCLAIMED.

 * Add some code for CoD value, 06/12/04, Chen Bin
 *     binch@mobilesoft.com.cn
*/


Sorry for inconvient.

Chen
=D4=DA 2004-12-06=D2=BB=B5=C4 08:18 +0100=A3=ACMarcel Holtmann=D0=B4=B5=C0=
=A3=BA
> Hi Chen,
>=20
> > I have done this. I searched the BT spec and find two places which wi=
ll
> > let us know the CoD value, and I simply test it, it works find.
> >=20
> > Ok, next step is to make an interface(maybe ioctl) to let the user ge=
t
> > the CoD value, is it needed(if there has been a interface which can g=
et
> > the entire hci_conn structure)? If it is not needed, I will send you =
the
> > patch now.
>=20
> step by step. Send your patch now and don't forget the Signed-off-by
> statement.
>=20
> Regards
>=20
> Marcel
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users=
.
> Discover which products truly live up to the hype. Start reading now.=20
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Prepare patch bluez for the CoD in hci_conn
  2004-12-06  7:18     ` Marcel Holtmann
  2004-12-06 15:50       ` Chen Bin
@ 2004-12-06 15:53       ` Chen Bin
  2004-12-06  8:41         ` Marcel Holtmann
  1 sibling, 1 reply; 15+ messages in thread
From: Chen Bin @ 2004-12-06 15:53 UTC (permalink / raw)
  To: bluez-devel

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

The attachment is my patch, the comments and the debug info can be
removed as soon as this patch is tested fully.

Chen
在 2004-12-06一的 08:18 +0100,Marcel Holtmann写道:
> Hi Chen,
> 
> > I have done this. I searched the BT spec and find two places which will
> > let us know the CoD value, and I simply test it, it works find.
> > 
> > Ok, next step is to make an interface(maybe ioctl) to let the user get
> > the CoD value, is it needed(if there has been a interface which can get
> > the entire hci_conn structure)? If it is not needed, I will send you the
> > patch now.
> 
> step by step. Send your patch now and don't forget the Signed-off-by
> statement.
> 
> Regards
> 
> Marcel
> 
> 
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now. 
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel

[-- Attachment #2: patch-2.6.9-CoD --]
[-- Type: text/x-patch, Size: 3397 bytes --]

diff -ruN linux-2.6.9/include/net/bluetooth/hci_core.h linux-2.6.9-my/include/net/bluetooth/hci_core.h
--- linux-2.6.9/include/net/bluetooth/hci_core.h	Tue Oct 19 05:54:30 2004
+++ linux-2.6.9-my/include/net/bluetooth/hci_core.h	Mon Dec  6 23:39:24 2004
@@ -20,6 +20,9 @@
    ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
    COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
    SOFTWARE IS DISCLAIMED.
+
+ * Add some code for CoD value, 06/12/04, Chen Bin 
+ *     binch@mobilesoft.com.cn
 */
 
 #ifndef __HCI_CORE_H
@@ -143,6 +146,11 @@
 	__u8		 out;
 	__u32		 link_mode;
 	unsigned long	 pend;
+
+	/* 
+	 * added by Chen Bin.
+	 */
+	__u8     dev_class[3];
 	
 	unsigned int	 sent;
 	
diff -ruN linux-2.6.9/net/bluetooth/hci_conn.c linux-2.6.9-my/net/bluetooth/hci_conn.c
--- linux-2.6.9/net/bluetooth/hci_conn.c	Tue Oct 19 05:55:29 2004
+++ linux-2.6.9-my/net/bluetooth/hci_conn.c	Mon Dec  6 23:14:59 2004
@@ -20,6 +20,9 @@
    ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
    COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
    SOFTWARE IS DISCLAIMED.
+
+ * Add some code for CoD value, 06/12/04, Chen Bin 
+ *     binch@mobilesoft.com.cn
 */
 
 /* Bluetooth HCI connection handling. */
@@ -143,6 +146,7 @@
 struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
 {
 	struct hci_conn *conn;
+	struct inquiry_entry *ie;
 
 	BT_DBG("%s dst %s", hdev->name, batostr(dst));
 
@@ -154,6 +158,31 @@
 	conn->type   = type;
 	conn->hdev   = hdev;
 	conn->state  = BT_OPEN;
+
+	/*
+	 * added by Chen Bin for CoD value.
+	 */
+
+	if ((ie = hci_inquiry_cache_lookup(hdev, dst)) &&
+			inquiry_entry_age(ie) <= INQUIRY_ENTRY_AGE_MAX) {
+		/*
+		 * Found a valid entry
+		 * copy the CoD value to the hci_conn
+		 */
+		conn->dev_class[0] = ie->info.dev_class[0];
+		conn->dev_class[1] = ie->info.dev_class[1];
+		conn->dev_class[2] = ie->info.dev_class[2];
+
+	} else {
+		conn->dev_class[0] = 0x00;
+		conn->dev_class[1] = 0x00;
+		conn->dev_class[2] = 0x00; 
+	}
+	
+	printk("hci_conn_add: the dev_class = %x %x %x\n", conn->dev_class[0], conn->dev_class[1], conn->dev_class[2]);
+
+	//---------------------------------------------------------
+
 
 	skb_queue_head_init(&conn->data_q);
 	hci_conn_init_timer(conn);
diff -ruN linux-2.6.9/net/bluetooth/hci_event.c linux-2.6.9-my/net/bluetooth/hci_event.c
--- linux-2.6.9/net/bluetooth/hci_event.c	Tue Oct 19 05:53:06 2004
+++ linux-2.6.9-my/net/bluetooth/hci_event.c	Mon Dec  6 23:15:06 2004
@@ -20,6 +20,9 @@
    ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
    COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
    SOFTWARE IS DISCLAIMED.
+
+ * Add some code for CoD value, 06/12/04, Chen Bin 
+ *     binch@mobilesoft.com.cn
 */
 
 /* Bluetooth HCI event handling. */
@@ -539,6 +542,15 @@
 			}
 		}
 		conn->state = BT_CONNECT;
+		/*
+		 * added by Chen Bin
+		 * if the remote ba address is in the cache, hci_conn_add will add the
+		 * dev_class field in conn.
+		 * So the following two lines is useless.
+		 */
+		memcpy(conn->dev_class, &ev->dev_class, 3);
+		printk("hci_conn_request_evt:the dev_class = %x %x %x\n", conn->dev_class[0], conn->dev_class[1], conn->dev_class[2]);
+		//--------------------------------------------------------
 		hci_dev_unlock(hdev);
 
 		bacpy(&cp.bdaddr, &ev->bdaddr);

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

* Re: [Bluez-devel] Prepare patch bluez for the CoD in hci_conn
  2004-12-06  8:41         ` Marcel Holtmann
@ 2004-12-06 16:54           ` Chen Bin
  2004-12-06  9:04             ` Marcel Holtmann
  2004-12-06 17:05           ` Chen Bin
  1 sibling, 1 reply; 15+ messages in thread
From: Chen Bin @ 2004-12-06 16:54 UTC (permalink / raw)
  To: bluez-devel

Hi Marcel,

Ok, use your patch is ok, if I have find some more info in the Bluetooth
Spec, I will send my patch to you:)

Thank you.

BTW: I will remain our company's BT engineer and if the BlueZ have some
part not completed, may be I can contribute to do some work:)

Chen
=D4=DA 2004-12-06=D2=BB=B5=C4 09:41 +0100=A3=ACMarcel Holtmann=D0=B4=B5=C0=
=A3=BA
> Hi Chen,
>=20
> > The attachment is my patch, the comments and the debug info can be
> > removed as soon as this patch is tested fully.
>=20
> and your patch is quite too complex. Mine consists of three additional
> lines only.
>=20
> Regards
>=20
> Marcel
>=20



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Prepare patch bluez for the CoD in hci_conn
  2004-12-06  8:41         ` Marcel Holtmann
  2004-12-06 16:54           ` Chen Bin
@ 2004-12-06 17:05           ` Chen Bin
  2004-12-06  9:14             ` Marcel Holtmann
  1 sibling, 1 reply; 15+ messages in thread
From: Chen Bin @ 2004-12-06 17:05 UTC (permalink / raw)
  To: bluez-devel

Hi Marcel,

I see your patch that you patch the hci_acl_connect()=A3=ACbut why not
hci_conn_add()?

I feel the latter is more appropriate.

Chen

=D4=DA 2004-12-06=D2=BB=B5=C4 09:41 +0100=A3=ACMarcel Holtmann=D0=B4=B5=C0=
=A3=BA
> Hi Chen,
>=20
> > The attachment is my patch, the comments and the debug info can be
> > removed as soon as this patch is tested fully.
>=20
> and your patch is quite too complex. Mine consists of three additional
> lines only.
>=20
> Regards
>=20
> Marcel
>=20



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Prepare patch bluez for the CoD in hci_conn
  2004-12-06  9:14             ` Marcel Holtmann
@ 2004-12-06 17:21               ` Chen Bin
  0 siblings, 0 replies; 15+ messages in thread
From: Chen Bin @ 2004-12-06 17:21 UTC (permalink / raw)
  To: bluez-devel

=D4=DA 2004-12-06=D2=BB=B5=C4 10:14 +0100=A3=ACMarcel Holtmann=D0=B4=B5=C0=
=A3=BA
> Hi Chen,
>=20
> > I see your patch that you patch the hci_acl_connect()=A3=ACbut why no=
t
> > hci_conn_add()?
> >=20
> > I feel the latter is more appropriate.
>=20
> no, it is not. The hci_conn_add is called at various times. It is calle=
d
> for incoming and outgoing connections. We don't need to do a lookup at
> the inquiry cache for an incoming connection, because we get the value
> within the connection request event. The hci_acl_connect() is used to
> create an outgoing connection and it already have to lookup the other
> parameters from the inquiry cache. Do see the point?
>=20

Ok, got it. Thanks.

> Regards
>=20
> Marcel
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users=
.
> Discover which products truly live up to the hype. Start reading now.=20
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Prepare patch bluez for the CoD in hci_conn
  2004-12-06  9:04             ` Marcel Holtmann
@ 2004-12-06 17:40               ` Chen Bin
  2004-12-06  9:56                 ` Marcel Holtmann
  0 siblings, 1 reply; 15+ messages in thread
From: Chen Bin @ 2004-12-06 17:40 UTC (permalink / raw)
  To: bluez-devel

=D4=DA 2004-12-06=D2=BB=B5=C4 10:04 +0100=A3=ACMarcel Holtmann=D0=B4=B5=C0=
=A3=BA
> Hi Chen,
>=20
> > Ok, use your patch is ok, if I have find some more info in the Blueto=
oth
> > Spec, I will send my patch to you:)
>=20
> it is only compile tested, but actually from a code review it should do
> exactly what was requested. If you wanna test it, you must change the
> ie->data into ie->info, because the inquiry_data change is not yet
> merged back into mainline. A new -mh patch will follow soon.
>=20

I have test my patch, and I will test yours too.=20

And I wanna know which kernel version you current work on? Your new -mh
patch will only apply to the newest kernel or olders too?

I don't know much about your patch convention.

> > BTW: I will remain our company's BT engineer and if the BlueZ have so=
me
> > part not completed, may be I can contribute to do some work:)
>=20
> Go ahead, because every patch is welcome.
>=20
> Regards
>=20
> Marcel
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users=
.
> Discover which products truly live up to the hype. Start reading now.=20
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

end of thread, other threads:[~2004-12-06 17:40 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-06 13:34 [Bluez-devel] Prepare patch bluez for the CoD in hci_conn Chen Bin
2004-12-06  6:40 ` Marcel Holtmann
2004-12-06 15:11   ` Chen Bin
2004-12-06  7:18     ` Marcel Holtmann
2004-12-06 15:50       ` Chen Bin
2004-12-06  8:07         ` Marcel Holtmann
2004-12-06 15:53       ` Chen Bin
2004-12-06  8:41         ` Marcel Holtmann
2004-12-06 16:54           ` Chen Bin
2004-12-06  9:04             ` Marcel Holtmann
2004-12-06 17:40               ` Chen Bin
2004-12-06  9:56                 ` Marcel Holtmann
2004-12-06 17:05           ` Chen Bin
2004-12-06  9:14             ` Marcel Holtmann
2004-12-06 17:21               ` Chen Bin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox