linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: Correct version check in hci_setup
@ 2011-11-23  9:23 Emeltchenko Andrei
  2011-11-23  9:23 ` [PATCH 2/2] Bluetooth: Remove magic bluetooth version numbers Emeltchenko Andrei
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Emeltchenko Andrei @ 2011-11-23  9:23 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Check for hci_ver instead of lmp_ver

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 net/bluetooth/hci_event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index dfe6fbc..7da7ef6 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -562,7 +562,7 @@ static void hci_setup(struct hci_dev *hdev)
 {
 	hci_setup_event_mask(hdev);
 
-	if (hdev->lmp_ver > 1)
+	if (hdev->hci_ver > 1)
 		hci_send_cmd(hdev, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL);
 
 	if (hdev->features[6] & LMP_SIMPLE_PAIR) {
-- 
1.7.4.1


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

* [PATCH 2/2] Bluetooth: Remove magic bluetooth version numbers
  2011-11-23  9:23 [PATCH 1/2] Bluetooth: Correct version check in hci_setup Emeltchenko Andrei
@ 2011-11-23  9:23 ` Emeltchenko Andrei
  2011-11-23 14:48   ` Marcel Holtmann
  2011-11-23 14:47 ` [PATCH 1/2] Bluetooth: Correct version check in hci_setup Marcel Holtmann
  2011-12-02 11:22 ` Gustavo Padovan
  2 siblings, 1 reply; 7+ messages in thread
From: Emeltchenko Andrei @ 2011-11-23  9:23 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Use bluetooth names instead of BT SIG assigned numbers

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 include/net/bluetooth/bluetooth.h |    5 +++++
 net/bluetooth/hci_conn.c          |    2 +-
 net/bluetooth/hci_event.c         |    6 +++---
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 38cd3da..98ea1b1 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -36,6 +36,11 @@
 #define PF_BLUETOOTH	AF_BLUETOOTH
 #endif
 
+/* Bluetooth versions */
+#define BLUETOOTH_VER_1_1	1
+#define BLUETOOTH_VER_1_2	2
+#define BLUETOOTH_VER_2_0_EDR	3
+
 /* Reserv for core and drivers use */
 #define BT_SKB_RESERVE	8
 
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index de0b93e..b328ac6 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -123,7 +123,7 @@ static void hci_acl_connect_cancel(struct hci_conn *conn)
 
 	BT_DBG("%p", conn);
 
-	if (conn->hdev->hci_ver < 2)
+	if (conn->hdev->hci_ver < BLUETOOTH_VER_1_2)
 		return;
 
 	bacpy(&cp.bdaddr, &conn->dst);
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 7da7ef6..7790108 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -498,7 +498,7 @@ static void hci_setup_event_mask(struct hci_dev *hdev)
 
 	/* CSR 1.1 dongles does not accept any bitfield so don't try to set
 	 * any event mask for pre 1.2 devices */
-	if (hdev->lmp_ver <= 1)
+	if (hdev->lmp_ver <= BLUETOOTH_VER_1_1)
 		return;
 
 	events[4] |= 0x01; /* Flow Specification Complete */
@@ -562,7 +562,7 @@ static void hci_setup(struct hci_dev *hdev)
 {
 	hci_setup_event_mask(hdev);
 
-	if (hdev->hci_ver > 1)
+	if (hdev->hci_ver > BLUETOOTH_VER_1_1)
 		hci_send_cmd(hdev, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL);
 
 	if (hdev->features[6] & LMP_SIMPLE_PAIR) {
@@ -1499,7 +1499,7 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
 		}
 
 		/* Set packet type for incoming connection */
-		if (!conn->out && hdev->hci_ver < 3) {
+		if (!conn->out && hdev->hci_ver < BLUETOOTH_VER_2_0_EDR) {
 			struct hci_cp_change_conn_ptype cp;
 			cp.handle = ev->handle;
 			cp.pkt_type = cpu_to_le16(conn->pkt_type);
-- 
1.7.4.1


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

* Re: [PATCH 1/2] Bluetooth: Correct version check in hci_setup
  2011-11-23  9:23 [PATCH 1/2] Bluetooth: Correct version check in hci_setup Emeltchenko Andrei
  2011-11-23  9:23 ` [PATCH 2/2] Bluetooth: Remove magic bluetooth version numbers Emeltchenko Andrei
@ 2011-11-23 14:47 ` Marcel Holtmann
  2011-12-02 11:22 ` Gustavo Padovan
  2 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2011-11-23 14:47 UTC (permalink / raw)
  To: Emeltchenko Andrei; +Cc: linux-bluetooth

Hi Andrei,

> Check for hci_ver instead of lmp_ver
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  net/bluetooth/hci_event.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



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

* Re: [PATCH 2/2] Bluetooth: Remove magic bluetooth version numbers
  2011-11-23  9:23 ` [PATCH 2/2] Bluetooth: Remove magic bluetooth version numbers Emeltchenko Andrei
@ 2011-11-23 14:48   ` Marcel Holtmann
  2011-11-23 15:19     ` Emeltchenko Andrei
  0 siblings, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2011-11-23 14:48 UTC (permalink / raw)
  To: Emeltchenko Andrei; +Cc: linux-bluetooth

Hi Andrei,

> Use bluetooth names instead of BT SIG assigned numbers
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  include/net/bluetooth/bluetooth.h |    5 +++++
>  net/bluetooth/hci_conn.c          |    2 +-
>  net/bluetooth/hci_event.c         |    6 +++---
>  3 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
> index 38cd3da..98ea1b1 100644
> --- a/include/net/bluetooth/bluetooth.h
> +++ b/include/net/bluetooth/bluetooth.h
> @@ -36,6 +36,11 @@
>  #define PF_BLUETOOTH	AF_BLUETOOTH
>  #endif
>  
> +/* Bluetooth versions */
> +#define BLUETOOTH_VER_1_1	1
> +#define BLUETOOTH_VER_1_2	2
> +#define BLUETOOTH_VER_2_0_EDR	3
> +

I am fine with the patch, but you need to use BLUETOOTH_VER_2_0 here
since you have have 2.0 without EDR. Have a fun night reading with the
Bluetooth SIG branding guidelines.

Once you did that change, ACK.

Regards

Marcel



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

* Re: [PATCH 2/2] Bluetooth: Remove magic bluetooth version numbers
  2011-11-23 14:48   ` Marcel Holtmann
@ 2011-11-23 15:19     ` Emeltchenko Andrei
  2011-11-25 11:39       ` Marcel Holtmann
  0 siblings, 1 reply; 7+ messages in thread
From: Emeltchenko Andrei @ 2011-11-23 15:19 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

On Wed, Nov 23, 2011 at 03:48:58PM +0100, Marcel Holtmann wrote:
> > +/* Bluetooth versions */
> > +#define BLUETOOTH_VER_1_1	1
> > +#define BLUETOOTH_VER_1_2	2
> > +#define BLUETOOTH_VER_2_0_EDR	3
> > +
> 
> I am fine with the patch, but you need to use BLUETOOTH_VER_2_0 here
> since you have have 2.0 without EDR. Have a fun night reading with the
> Bluetooth SIG branding guidelines.

OK, I will remove EDR at the end. BTW: on a bluetooth web site there seems
to be different interpretation of those numbers:

Parameter Name 	Assigned Values
HCI_Version 	
        0 	Bluetooth Core Specification 1.0b
  	1 	Bluetooth Core Specification 1.1
  	2 	Bluetooth Core Specification 1.2
  	3 	Bluetooth Core Specification 2.0 + EDR
  	4 	Bluetooth Core Specification 2.1 + EDR
  	5 	Bluetooth Core Specification 3.0 + HS
  	6 	Bluetooth Core Specification 4.0
  	7 - 255 	Reserved

Source:
https://www.bluetooth.org/technical/assignednumbers/hci.htm

Best regards 
Andrei Emeltchenko 

> 
> Once you did that change, ACK.
> 
> Regards
> 
> Marcel
> 
> 

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

* Re: [PATCH 2/2] Bluetooth: Remove magic bluetooth version numbers
  2011-11-23 15:19     ` Emeltchenko Andrei
@ 2011-11-25 11:39       ` Marcel Holtmann
  0 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2011-11-25 11:39 UTC (permalink / raw)
  To: Emeltchenko Andrei; +Cc: linux-bluetooth

Hi Andrei,

> > > +/* Bluetooth versions */
> > > +#define BLUETOOTH_VER_1_1	1
> > > +#define BLUETOOTH_VER_1_2	2
> > > +#define BLUETOOTH_VER_2_0_EDR	3
> > > +
> > 
> > I am fine with the patch, but you need to use BLUETOOTH_VER_2_0 here
> > since you have have 2.0 without EDR. Have a fun night reading with the
> > Bluetooth SIG branding guidelines.
> 
> OK, I will remove EDR at the end. BTW: on a bluetooth web site there seems
> to be different interpretation of those numbers:
> 
> Parameter Name 	Assigned Values
> HCI_Version 	
>         0 	Bluetooth Core Specification 1.0b
>   	1 	Bluetooth Core Specification 1.1
>   	2 	Bluetooth Core Specification 1.2
>   	3 	Bluetooth Core Specification 2.0 + EDR
>   	4 	Bluetooth Core Specification 2.1 + EDR
>   	5 	Bluetooth Core Specification 3.0 + HS
>   	6 	Bluetooth Core Specification 4.0
>   	7 - 255 	Reserved

they are actually wrong. The + XXX suffix is described in the Bluetooth
branding guidelines.

For example you can only call your product 3.0 + HS if you have a 2.1 or
3.0 controller (yes 2.1 is fine as well) with an AMP controller and
support for High Speed.

So the + XXX is pure product branding and has nothing to do with HCI or
LMP versions.

Regards

Marcel



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

* Re: [PATCH 1/2] Bluetooth: Correct version check in hci_setup
  2011-11-23  9:23 [PATCH 1/2] Bluetooth: Correct version check in hci_setup Emeltchenko Andrei
  2011-11-23  9:23 ` [PATCH 2/2] Bluetooth: Remove magic bluetooth version numbers Emeltchenko Andrei
  2011-11-23 14:47 ` [PATCH 1/2] Bluetooth: Correct version check in hci_setup Marcel Holtmann
@ 2011-12-02 11:22 ` Gustavo Padovan
  2 siblings, 0 replies; 7+ messages in thread
From: Gustavo Padovan @ 2011-12-02 11:22 UTC (permalink / raw)
  To: Emeltchenko Andrei; +Cc: linux-bluetooth

Hi Andrei,

* Emeltchenko Andrei <Andrei.Emeltchenko.news@gmail.com> [2011-11-23 11:23:34 +0200]:

> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> 
> Check for hci_ver instead of lmp_ver
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  net/bluetooth/hci_event.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied to the bluetooth current tree. Thanks.

	Gustavo

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

end of thread, other threads:[~2011-12-02 11:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23  9:23 [PATCH 1/2] Bluetooth: Correct version check in hci_setup Emeltchenko Andrei
2011-11-23  9:23 ` [PATCH 2/2] Bluetooth: Remove magic bluetooth version numbers Emeltchenko Andrei
2011-11-23 14:48   ` Marcel Holtmann
2011-11-23 15:19     ` Emeltchenko Andrei
2011-11-25 11:39       ` Marcel Holtmann
2011-11-23 14:47 ` [PATCH 1/2] Bluetooth: Correct version check in hci_setup Marcel Holtmann
2011-12-02 11:22 ` Gustavo Padovan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).