All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] Bluetooth: Use lmp_bredr_capable where applicable
@ 2012-07-24 18:03 Andre Guedes
  2012-07-24 18:03 ` [PATCH 2/8] Bluetooth: Use lmp_le_capable " Andre Guedes
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Andre Guedes @ 2012-07-24 18:03 UTC (permalink / raw)
  To: linux-bluetooth

This patch replaces all LMP_NO_BREDR bit checking by the helper
macro lmp_bredr_capable.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
 net/bluetooth/mgmt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 2a0f695..990ec6a 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -383,7 +383,7 @@ static u32 get_supported_settings(struct hci_dev *hdev)
 	if (hdev->features[6] & LMP_SIMPLE_PAIR)
 		settings |= MGMT_SETTING_SSP;
 
-	if (!(hdev->features[4] & LMP_NO_BREDR)) {
+	if (lmp_bredr_capable(hdev)) {
 		settings |= MGMT_SETTING_BREDR;
 		settings |= MGMT_SETTING_LINK_SECURITY;
 	}
@@ -413,7 +413,7 @@ static u32 get_current_settings(struct hci_dev *hdev)
 	if (test_bit(HCI_PAIRABLE, &hdev->dev_flags))
 		settings |= MGMT_SETTING_PAIRABLE;
 
-	if (!(hdev->features[4] & LMP_NO_BREDR))
+	if (lmp_bredr_capable(hdev))
 		settings |= MGMT_SETTING_BREDR;
 
 	if (test_bit(HCI_LE_ENABLED, &hdev->dev_flags))
-- 
1.7.11.2


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

* [PATCH 2/8] Bluetooth: Use lmp_le_capable where applicable
  2012-07-24 18:03 [PATCH 1/8] Bluetooth: Use lmp_bredr_capable where applicable Andre Guedes
@ 2012-07-24 18:03 ` Andre Guedes
  2012-07-24 18:03 ` [PATCH 3/8] Bluetooth: Use lmp_ssp_capable " Andre Guedes
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Andre Guedes @ 2012-07-24 18:03 UTC (permalink / raw)
  To: linux-bluetooth

This patch replaces all LMP_LE bit checking by the helper macro
lmp_le_capable.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
 net/bluetooth/hci_event.c | 4 ++--
 net/bluetooth/mgmt.c      | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 41ff978..498d55e 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -541,7 +541,7 @@ static void hci_setup_event_mask(struct hci_dev *hdev)
 					 * Features Notification */
 	}
 
-	if (hdev->features[4] & LMP_LE)
+	if (lmp_le_capable(hdev))
 		events[7] |= 0x20;	/* LE Meta-Event */
 
 	hci_send_cmd(hdev, HCI_OP_SET_EVENT_MASK, sizeof(events), events);
@@ -746,7 +746,7 @@ static void hci_cc_read_local_ext_features(struct hci_dev *hdev,
 		break;
 	}
 
-	if (test_bit(HCI_INIT, &hdev->flags) && hdev->features[4] & LMP_LE)
+	if (test_bit(HCI_INIT, &hdev->flags) && lmp_le_capable(hdev))
 		hci_set_le_support(hdev);
 
 done:
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 990ec6a..0351bf27 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -391,7 +391,7 @@ static u32 get_supported_settings(struct hci_dev *hdev)
 	if (enable_hs)
 		settings |= MGMT_SETTING_HS;
 
-	if (hdev->features[4] & LMP_LE)
+	if (lmp_le_capable(hdev))
 		settings |= MGMT_SETTING_LE;
 
 	return settings;
@@ -1205,7 +1205,7 @@ static int set_le(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
 
 	hci_dev_lock(hdev);
 
-	if (!(hdev->features[4] & LMP_LE)) {
+	if (!lmp_le_capable(hdev)) {
 		err = cmd_status(sk, hdev->id, MGMT_OP_SET_LE,
 				 MGMT_STATUS_NOT_SUPPORTED);
 		goto unlock;
-- 
1.7.11.2


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

* [PATCH 3/8] Bluetooth: Use lmp_ssp_capable where applicable
  2012-07-24 18:03 [PATCH 1/8] Bluetooth: Use lmp_bredr_capable where applicable Andre Guedes
  2012-07-24 18:03 ` [PATCH 2/8] Bluetooth: Use lmp_le_capable " Andre Guedes
@ 2012-07-24 18:03 ` Andre Guedes
  2012-07-24 18:03 ` [PATCH 4/8] Bluetooth: Use lmp_esco_capable " Andre Guedes
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Andre Guedes @ 2012-07-24 18:03 UTC (permalink / raw)
  To: linux-bluetooth

This patch replaces all LMP_SIMPLE_PAIR bit checking by the helper
macro lmp_ssp_capable.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
 net/bluetooth/hci_event.c | 2 +-
 net/bluetooth/mgmt.c      | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 498d55e..b120388 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -528,7 +528,7 @@ static void hci_setup_event_mask(struct hci_dev *hdev)
 	if (hdev->features[7] & LMP_LSTO)
 		events[6] |= 0x80; /* Link Supervision Timeout Changed */
 
-	if (hdev->features[6] & LMP_SIMPLE_PAIR) {
+	if (lmp_ssp_capable(hdev)) {
 		events[6] |= 0x01;	/* IO Capability Request */
 		events[6] |= 0x02;	/* IO Capability Response */
 		events[6] |= 0x04;	/* User Confirmation Request */
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 0351bf27..a3329cb 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -380,7 +380,7 @@ static u32 get_supported_settings(struct hci_dev *hdev)
 	settings |= MGMT_SETTING_DISCOVERABLE;
 	settings |= MGMT_SETTING_PAIRABLE;
 
-	if (hdev->features[6] & LMP_SIMPLE_PAIR)
+	if (lmp_ssp_capable(hdev))
 		settings |= MGMT_SETTING_SSP;
 
 	if (lmp_bredr_capable(hdev)) {
@@ -1121,7 +1121,7 @@ static int set_ssp(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
 
 	hci_dev_lock(hdev);
 
-	if (!(hdev->features[6] & LMP_SIMPLE_PAIR)) {
+	if (!lmp_ssp_capable(hdev)) {
 		err = cmd_status(sk, hdev->id, MGMT_OP_SET_SSP,
 				 MGMT_STATUS_NOT_SUPPORTED);
 		goto failed;
@@ -2201,7 +2201,7 @@ static int read_local_oob_data(struct sock *sk, struct hci_dev *hdev,
 		goto unlock;
 	}
 
-	if (!(hdev->features[6] & LMP_SIMPLE_PAIR)) {
+	if (!lmp_ssp_capable(hdev)) {
 		err = cmd_status(sk, hdev->id, MGMT_OP_READ_LOCAL_OOB_DATA,
 				 MGMT_STATUS_NOT_SUPPORTED);
 		goto unlock;
-- 
1.7.11.2


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

* [PATCH 4/8] Bluetooth: Use lmp_esco_capable where applicable
  2012-07-24 18:03 [PATCH 1/8] Bluetooth: Use lmp_bredr_capable where applicable Andre Guedes
  2012-07-24 18:03 ` [PATCH 2/8] Bluetooth: Use lmp_le_capable " Andre Guedes
  2012-07-24 18:03 ` [PATCH 3/8] Bluetooth: Use lmp_ssp_capable " Andre Guedes
@ 2012-07-24 18:03 ` Andre Guedes
  2012-07-24 18:03 ` [PATCH 5/8] Bluetooth: Use lmp_rswitch_capable " Andre Guedes
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Andre Guedes @ 2012-07-24 18:03 UTC (permalink / raw)
  To: linux-bluetooth

This patch replaces all LMP_ESCO bit checking by the helper macro
lmp_esco_capable.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
 net/bluetooth/hci_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index b120388..5722a38 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -686,7 +686,7 @@ static void hci_cc_read_local_features(struct hci_dev *hdev,
 		hdev->esco_type |= (ESCO_HV3);
 	}
 
-	if (hdev->features[3] & LMP_ESCO)
+	if (lmp_esco_capable(hdev))
 		hdev->esco_type |= (ESCO_EV3);
 
 	if (hdev->features[4] & LMP_EV4)
-- 
1.7.11.2


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

* [PATCH 5/8] Bluetooth: Use lmp_rswitch_capable where applicable
  2012-07-24 18:03 [PATCH 1/8] Bluetooth: Use lmp_bredr_capable where applicable Andre Guedes
                   ` (2 preceding siblings ...)
  2012-07-24 18:03 ` [PATCH 4/8] Bluetooth: Use lmp_esco_capable " Andre Guedes
@ 2012-07-24 18:03 ` Andre Guedes
  2012-07-24 18:03 ` [PATCH 6/8] Bluetooth: Use lmp_sniff_capable " Andre Guedes
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Andre Guedes @ 2012-07-24 18:03 UTC (permalink / raw)
  To: linux-bluetooth

This patch replaces all LMP_RSWITCH bit checking by the helper macro
lmp_rswitch_capable.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
 net/bluetooth/hci_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 5722a38..5c71c85 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -623,7 +623,7 @@ static void hci_setup_link_policy(struct hci_dev *hdev)
 	struct hci_cp_write_def_link_policy cp;
 	u16 link_policy = 0;
 
-	if (hdev->features[0] & LMP_RSWITCH)
+	if (lmp_rswitch_capable(hdev))
 		link_policy |= HCI_LP_RSWITCH;
 	if (hdev->features[0] & LMP_HOLD)
 		link_policy |= HCI_LP_HOLD;
-- 
1.7.11.2


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

* [PATCH 6/8] Bluetooth: Use lmp_sniff_capable where applicable
  2012-07-24 18:03 [PATCH 1/8] Bluetooth: Use lmp_bredr_capable where applicable Andre Guedes
                   ` (3 preceding siblings ...)
  2012-07-24 18:03 ` [PATCH 5/8] Bluetooth: Use lmp_rswitch_capable " Andre Guedes
@ 2012-07-24 18:03 ` Andre Guedes
  2012-07-24 18:03 ` [PATCH 7/8] Bluetooth: Use lmp_sniffsubr_capable " Andre Guedes
  2012-07-24 18:03 ` [PATCH 8/8] Bluetooth: Use lmp_no_flush_capable " Andre Guedes
  6 siblings, 0 replies; 9+ messages in thread
From: Andre Guedes @ 2012-07-24 18:03 UTC (permalink / raw)
  To: linux-bluetooth

This patch replaces all LMP_SNIFF bit checking by the helper macro
lmp_sniff_capable.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
 net/bluetooth/hci_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 5c71c85..eb9024a 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -627,7 +627,7 @@ static void hci_setup_link_policy(struct hci_dev *hdev)
 		link_policy |= HCI_LP_RSWITCH;
 	if (hdev->features[0] & LMP_HOLD)
 		link_policy |= HCI_LP_HOLD;
-	if (hdev->features[0] & LMP_SNIFF)
+	if (lmp_sniff_capable(hdev))
 		link_policy |= HCI_LP_SNIFF;
 	if (hdev->features[1] & LMP_PARK)
 		link_policy |= HCI_LP_PARK;
-- 
1.7.11.2


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

* [PATCH 7/8] Bluetooth: Use lmp_sniffsubr_capable where applicable
  2012-07-24 18:03 [PATCH 1/8] Bluetooth: Use lmp_bredr_capable where applicable Andre Guedes
                   ` (4 preceding siblings ...)
  2012-07-24 18:03 ` [PATCH 6/8] Bluetooth: Use lmp_sniff_capable " Andre Guedes
@ 2012-07-24 18:03 ` Andre Guedes
  2012-07-24 18:03 ` [PATCH 8/8] Bluetooth: Use lmp_no_flush_capable " Andre Guedes
  6 siblings, 0 replies; 9+ messages in thread
From: Andre Guedes @ 2012-07-24 18:03 UTC (permalink / raw)
  To: linux-bluetooth

This patch replaces all LMP_SNIFF_SUBR bit checking by the helper
macro lmp_sniffsubr_capable.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
 net/bluetooth/hci_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index eb9024a..060780c 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -513,7 +513,7 @@ static void hci_setup_event_mask(struct hci_dev *hdev)
 	if (hdev->features[3] & LMP_RSSI_INQ)
 		events[4] |= 0x02; /* Inquiry Result with RSSI */
 
-	if (hdev->features[5] & LMP_SNIFF_SUBR)
+	if (lmp_sniffsubr_capable(hdev))
 		events[5] |= 0x20; /* Sniff Subrating */
 
 	if (hdev->features[5] & LMP_PAUSE_ENC)
-- 
1.7.11.2


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

* [PATCH 8/8] Bluetooth: Use lmp_no_flush_capable where applicable
  2012-07-24 18:03 [PATCH 1/8] Bluetooth: Use lmp_bredr_capable where applicable Andre Guedes
                   ` (5 preceding siblings ...)
  2012-07-24 18:03 ` [PATCH 7/8] Bluetooth: Use lmp_sniffsubr_capable " Andre Guedes
@ 2012-07-24 18:03 ` Andre Guedes
  2012-07-24 22:17   ` Gustavo Padovan
  6 siblings, 1 reply; 9+ messages in thread
From: Andre Guedes @ 2012-07-24 18:03 UTC (permalink / raw)
  To: linux-bluetooth

This patch replaces all LMP_NO_FLUSH bit checking by the helper
macro lmp_no_flush_capable.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
 net/bluetooth/hci_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 060780c..2d8761b 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -522,7 +522,7 @@ static void hci_setup_event_mask(struct hci_dev *hdev)
 	if (hdev->features[6] & LMP_EXT_INQ)
 		events[5] |= 0x40; /* Extended Inquiry Result */
 
-	if (hdev->features[6] & LMP_NO_FLUSH)
+	if (lmp_no_flush_capable(hdev))
 		events[7] |= 0x01; /* Enhanced Flush Complete */
 
 	if (hdev->features[7] & LMP_LSTO)
-- 
1.7.11.2


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

* Re: [PATCH 8/8] Bluetooth: Use lmp_no_flush_capable where applicable
  2012-07-24 18:03 ` [PATCH 8/8] Bluetooth: Use lmp_no_flush_capable " Andre Guedes
@ 2012-07-24 22:17   ` Gustavo Padovan
  0 siblings, 0 replies; 9+ messages in thread
From: Gustavo Padovan @ 2012-07-24 22:17 UTC (permalink / raw)
  To: Andre Guedes; +Cc: linux-bluetooth

Hi Andre,

* Andre Guedes <andre.guedes@openbossa.org> [2012-07-24 15:03:53 -0300]:

> This patch replaces all LMP_NO_FLUSH bit checking by the helper
> macro lmp_no_flush_capable.
> 
> Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
> ---
>  net/bluetooth/hci_event.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

All 8 patches have been applied to bluetooth-next. Thanks.

	Gustavo

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

end of thread, other threads:[~2012-07-24 22:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-24 18:03 [PATCH 1/8] Bluetooth: Use lmp_bredr_capable where applicable Andre Guedes
2012-07-24 18:03 ` [PATCH 2/8] Bluetooth: Use lmp_le_capable " Andre Guedes
2012-07-24 18:03 ` [PATCH 3/8] Bluetooth: Use lmp_ssp_capable " Andre Guedes
2012-07-24 18:03 ` [PATCH 4/8] Bluetooth: Use lmp_esco_capable " Andre Guedes
2012-07-24 18:03 ` [PATCH 5/8] Bluetooth: Use lmp_rswitch_capable " Andre Guedes
2012-07-24 18:03 ` [PATCH 6/8] Bluetooth: Use lmp_sniff_capable " Andre Guedes
2012-07-24 18:03 ` [PATCH 7/8] Bluetooth: Use lmp_sniffsubr_capable " Andre Guedes
2012-07-24 18:03 ` [PATCH 8/8] Bluetooth: Use lmp_no_flush_capable " Andre Guedes
2012-07-24 22:17   ` Gustavo Padovan

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.