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

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

Changes:
	v3: Added the last patch per Marcel suggestion

Andrei Emeltchenko (3):
  Bluetooth: Correct version check in hci_setup
  Bluetooth: Remove magic bluetooth version numbers
  Bluetooth: trivial: correct check for LMP version

 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(-)

-- 
1.7.4.1


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

* [PATCHv3 1/3] Bluetooth: Correct version check in hci_setup
  2011-11-30  8:44 [PATCHv3 0/3] Bluetooth trivial version fixes Emeltchenko Andrei
@ 2011-11-30  8:44 ` Emeltchenko Andrei
  2011-11-30  8:44 ` [PATCHv3 2/3] Bluetooth: Remove magic bluetooth version numbers Emeltchenko Andrei
  2011-11-30  8:44 ` [PATCHv3 3/3] Bluetooth: trivial: correct check for LMP version Emeltchenko Andrei
  2 siblings, 0 replies; 7+ messages in thread
From: Emeltchenko Andrei @ 2011-11-30  8:44 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>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
---
 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

* [PATCHv3 2/3] Bluetooth: Remove magic bluetooth version numbers
  2011-11-30  8:44 [PATCHv3 0/3] Bluetooth trivial version fixes Emeltchenko Andrei
  2011-11-30  8:44 ` [PATCHv3 1/3] Bluetooth: Correct version check in hci_setup Emeltchenko Andrei
@ 2011-11-30  8:44 ` Emeltchenko Andrei
  2011-11-30  8:44 ` [PATCHv3 3/3] Bluetooth: trivial: correct check for LMP version Emeltchenko Andrei
  2 siblings, 0 replies; 7+ messages in thread
From: Emeltchenko Andrei @ 2011-11-30  8:44 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>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
---
 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..97264fc 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	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..60651fa 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) {
 			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

* [PATCHv3 3/3] Bluetooth: trivial: correct check for LMP version
  2011-11-30  8:44 [PATCHv3 0/3] Bluetooth trivial version fixes Emeltchenko Andrei
  2011-11-30  8:44 ` [PATCHv3 1/3] Bluetooth: Correct version check in hci_setup Emeltchenko Andrei
  2011-11-30  8:44 ` [PATCHv3 2/3] Bluetooth: Remove magic bluetooth version numbers Emeltchenko Andrei
@ 2011-11-30  8:44 ` Emeltchenko Andrei
  2011-11-30 14:13   ` Marcel Holtmann
  2 siblings, 1 reply; 7+ messages in thread
From: Emeltchenko Andrei @ 2011-11-30  8:44 UTC (permalink / raw)
  To: linux-bluetooth

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

Make sure that code match exactly what comment says about pre 1.2
LMP version.

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 60651fa..27b1ede 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 <= BLUETOOTH_VER_1_1)
+	if (hdev->lmp_ver < BLUETOOTH_VER_1_2)
 		return;
 
 	events[4] |= 0x01; /* Flow Specification Complete */
-- 
1.7.4.1


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

* Re: [PATCHv3 3/3] Bluetooth: trivial: correct check for LMP version
  2011-11-30  8:44 ` [PATCHv3 3/3] Bluetooth: trivial: correct check for LMP version Emeltchenko Andrei
@ 2011-11-30 14:13   ` Marcel Holtmann
  2011-11-30 14:27     ` Emeltchenko Andrei
  0 siblings, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2011-11-30 14:13 UTC (permalink / raw)
  To: Emeltchenko Andrei; +Cc: linux-bluetooth

Hi Andrei,

> Make sure that code match exactly what comment says about pre 1.2
> LMP version.
> 
> 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>

> 
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index 60651fa..27b1ede 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 <= BLUETOOTH_VER_1_1)
> +	if (hdev->lmp_ver < BLUETOOTH_VER_1_2)
>  		return;

However, even here you need to use hci_ver since it is a HCI detail and
has nothing to do with the LMP version.

Regards

Marcel



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

* Re: [PATCHv3 3/3] Bluetooth: trivial: correct check for LMP version
  2011-11-30 14:13   ` Marcel Holtmann
@ 2011-11-30 14:27     ` Emeltchenko Andrei
  2011-11-30 14:33       ` Marcel Holtmann
  0 siblings, 1 reply; 7+ messages in thread
From: Emeltchenko Andrei @ 2011-11-30 14:27 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

On Wed, Nov 30, 2011 at 03:13:17PM +0100, Marcel Holtmann wrote:
> Hi Andrei,
> 
> > Make sure that code match exactly what comment says about pre 1.2
> > LMP version.
> > 
> > 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>
> 
> > 
> > diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> > index 60651fa..27b1ede 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 <= BLUETOOTH_VER_1_1)
> > +	if (hdev->lmp_ver < BLUETOOTH_VER_1_2)
> >  		return;
> 
> However, even here you need to use hci_ver since it is a HCI detail and
> has nothing to do with the LMP version.

Do you think can I amend this patch and change lmp/hci ?

Best regards 
Andrei Emeltchenko 

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

* Re: [PATCHv3 3/3] Bluetooth: trivial: correct check for LMP version
  2011-11-30 14:27     ` Emeltchenko Andrei
@ 2011-11-30 14:33       ` Marcel Holtmann
  0 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2011-11-30 14:33 UTC (permalink / raw)
  To: Emeltchenko Andrei; +Cc: linux-bluetooth

Hi Andrei,

> > > Make sure that code match exactly what comment says about pre 1.2
> > > LMP version.
> > > 
> > > 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>
> > 
> > > 
> > > diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> > > index 60651fa..27b1ede 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 <= BLUETOOTH_VER_1_1)
> > > +	if (hdev->lmp_ver < BLUETOOTH_VER_1_2)
> > >  		return;
> > 
> > However, even here you need to use hci_ver since it is a HCI detail and
> > has nothing to do with the LMP version.
> 
> Do you think can I amend this patch and change lmp/hci ?

your choice actually. I do not care. Treat both possibilities as acked
by me.

Regards

Marcel



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

end of thread, other threads:[~2011-11-30 14:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-30  8:44 [PATCHv3 0/3] Bluetooth trivial version fixes Emeltchenko Andrei
2011-11-30  8:44 ` [PATCHv3 1/3] Bluetooth: Correct version check in hci_setup Emeltchenko Andrei
2011-11-30  8:44 ` [PATCHv3 2/3] Bluetooth: Remove magic bluetooth version numbers Emeltchenko Andrei
2011-11-30  8:44 ` [PATCHv3 3/3] Bluetooth: trivial: correct check for LMP version Emeltchenko Andrei
2011-11-30 14:13   ` Marcel Holtmann
2011-11-30 14:27     ` Emeltchenko Andrei
2011-11-30 14:33       ` Marcel Holtmann

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).