Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: AMP: Register AMP only if High Speed enabled
@ 2012-10-04  8:26 Andrei Emeltchenko
  2012-10-04  9:52 ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Andrei Emeltchenko @ 2012-10-04  8:26 UTC (permalink / raw)
  To: linux-bluetooth

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

Make sure that AMP controller is registered only if HS enables.
Return EINVAL if High Speed is not enabled and dev_type is HCI_AMP.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 net/bluetooth/hci_core.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index bd26cb5..746af2d 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1708,7 +1708,10 @@ int hci_register_dev(struct hci_dev *hdev)
 		id = ida_simple_get(&hci_index_ida, 0, 0, GFP_KERNEL);
 		break;
 	case HCI_AMP:
-		id = ida_simple_get(&hci_index_ida, 1, 0, GFP_KERNEL);
+		if (enable_hs)
+			id = ida_simple_get(&hci_index_ida, 1, 0, GFP_KERNEL);
+		else
+			return -EINVAL;
 		break;
 	default:
 		return -EINVAL;
-- 
1.7.9.5


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

end of thread, other threads:[~2012-10-04 10:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-04  8:26 [PATCH] Bluetooth: AMP: Register AMP only if High Speed enabled Andrei Emeltchenko
2012-10-04  9:52 ` Marcel Holtmann
2012-10-04 10:10   ` Andrei Emeltchenko
2012-10-04 10:26     ` Marcel Holtmann

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