Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCHv2 0/3] Trivial fixes for emulating AMP HCI
@ 2011-11-14  9:45 Emeltchenko Andrei
  2011-11-14  9:45 ` [PATCHv2 1/3] Bluetooth: Allow to set AMP type for virtual HCI Emeltchenko Andrei
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Emeltchenko Andrei @ 2011-11-14  9:45 UTC (permalink / raw)
  To: linux-bluetooth

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

Changes:
	v2 Taken Marcel's comments about parameter name & permissions.

Those trivial patches help to emulate AMP HCI controller
currently used for A2MP protocol verification.

Andrei Emeltchenko (3):
  Bluetooth: Allow to set AMP type for virtual HCI
  Bluetooth: Move scope of kernel parameter enable_hs
  Bluetooth: Do not set HCI_RAW when HS enabled

 drivers/bluetooth/hci_vhci.c  |    8 ++++++++
 include/net/bluetooth/hci.h   |    2 ++
 include/net/bluetooth/l2cap.h |    1 -
 net/bluetooth/hci_core.c      |    5 +++--
 4 files changed, 13 insertions(+), 3 deletions(-)

-- 
1.7.4.1


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

* [PATCHv2 1/3] Bluetooth: Allow to set AMP type for virtual HCI
  2011-11-14  9:45 [PATCHv2 0/3] Trivial fixes for emulating AMP HCI Emeltchenko Andrei
@ 2011-11-14  9:45 ` Emeltchenko Andrei
  2011-11-14  9:47   ` Marcel Holtmann
  2011-11-14  9:45 ` [PATCHv2 2/3] Bluetooth: Move scope of kernel parameter enable_hs Emeltchenko Andrei
  2011-11-14  9:45 ` [PATCHv2 3/3] Bluetooth: Do not set HCI_RAW when HS enabled Emeltchenko Andrei
  2 siblings, 1 reply; 5+ messages in thread
From: Emeltchenko Andrei @ 2011-11-14  9:45 UTC (permalink / raw)
  To: linux-bluetooth

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

Type can be changed during re-opening device /dev/vhci.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
---
 drivers/bluetooth/hci_vhci.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 2e302a1..13e734f 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -41,6 +41,8 @@
 
 #define VERSION "1.3"
 
+static bool amp;
+
 struct vhci_data {
 	struct hci_dev *hdev;
 
@@ -239,6 +241,9 @@ static int vhci_open(struct inode *inode, struct file *file)
 	hdev->bus = HCI_VIRTUAL;
 	hdev->driver_data = data;
 
+	if (amp)
+		hdev->dev_type = HCI_AMP;
+
 	hdev->open     = vhci_open_dev;
 	hdev->close    = vhci_close_dev;
 	hdev->flush    = vhci_flush;
@@ -303,6 +308,9 @@ static void __exit vhci_exit(void)
 module_init(vhci_init);
 module_exit(vhci_exit);
 
+module_param(amp, bool, 0644);
+MODULE_PARM_DESC(amp, "AMP HCI device type");
+
 MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
 MODULE_DESCRIPTION("Bluetooth virtual HCI driver ver " VERSION);
 MODULE_VERSION(VERSION);
-- 
1.7.4.1


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

* [PATCHv2 2/3] Bluetooth: Move scope of kernel parameter enable_hs
  2011-11-14  9:45 [PATCHv2 0/3] Trivial fixes for emulating AMP HCI Emeltchenko Andrei
  2011-11-14  9:45 ` [PATCHv2 1/3] Bluetooth: Allow to set AMP type for virtual HCI Emeltchenko Andrei
@ 2011-11-14  9:45 ` Emeltchenko Andrei
  2011-11-14  9:45 ` [PATCHv2 3/3] Bluetooth: Do not set HCI_RAW when HS enabled Emeltchenko Andrei
  2 siblings, 0 replies; 5+ messages in thread
From: Emeltchenko Andrei @ 2011-11-14  9:45 UTC (permalink / raw)
  To: linux-bluetooth

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

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
---
 include/net/bluetooth/hci.h   |    2 ++
 include/net/bluetooth/l2cap.h |    1 -
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 275099f..cdcaac3 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -1357,4 +1357,6 @@ struct hci_inquiry_req {
 };
 #define IREQ_CACHE_FLUSH 0x0001
 
+extern int enable_hs;
+
 #endif /* __HCI_H */
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index aeb8676..71df8cb 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -793,7 +793,6 @@ static inline __u8 __ctrl_size(struct l2cap_chan *chan)
 }
 
 extern int disable_ertm;
-extern int enable_hs;
 
 int l2cap_init_sockets(void);
 void l2cap_cleanup_sockets(void);
-- 
1.7.4.1


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

* [PATCHv2 3/3] Bluetooth: Do not set HCI_RAW when HS enabled
  2011-11-14  9:45 [PATCHv2 0/3] Trivial fixes for emulating AMP HCI Emeltchenko Andrei
  2011-11-14  9:45 ` [PATCHv2 1/3] Bluetooth: Allow to set AMP type for virtual HCI Emeltchenko Andrei
  2011-11-14  9:45 ` [PATCHv2 2/3] Bluetooth: Move scope of kernel parameter enable_hs Emeltchenko Andrei
@ 2011-11-14  9:45 ` Emeltchenko Andrei
  2 siblings, 0 replies; 5+ messages in thread
From: Emeltchenko Andrei @ 2011-11-14  9:45 UTC (permalink / raw)
  To: linux-bluetooth

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

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
---
 net/bluetooth/hci_core.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 189bada..02a6f15 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -570,8 +570,9 @@ int hci_dev_open(__u16 dev)
 	if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks))
 		set_bit(HCI_RAW, &hdev->flags);
 
-	/* Treat all non BR/EDR controllers as raw devices for now */
-	if (hdev->dev_type != HCI_BREDR)
+	/* Treat all non BR/EDR controllers as raw devices if
+	   enable_hs is not set */
+	if (hdev->dev_type != HCI_BREDR && !enable_hs)
 		set_bit(HCI_RAW, &hdev->flags);
 
 	if (hdev->open(hdev)) {
-- 
1.7.4.1


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

* Re: [PATCHv2 1/3] Bluetooth: Allow to set AMP type for virtual HCI
  2011-11-14  9:45 ` [PATCHv2 1/3] Bluetooth: Allow to set AMP type for virtual HCI Emeltchenko Andrei
@ 2011-11-14  9:47   ` Marcel Holtmann
  0 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2011-11-14  9:47 UTC (permalink / raw)
  To: Emeltchenko Andrei; +Cc: linux-bluetooth

Hi Andrei,

> Type can be changed during re-opening device /dev/vhci.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> Acked-by: Marcel Holtmann <marcel@holtmann.org>
> ---
>  drivers/bluetooth/hci_vhci.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
> index 2e302a1..13e734f 100644
> --- a/drivers/bluetooth/hci_vhci.c
> +++ b/drivers/bluetooth/hci_vhci.c
> @@ -41,6 +41,8 @@
>  
>  #define VERSION "1.3"
>  
> +static bool amp;
> +
>  struct vhci_data {
>  	struct hci_dev *hdev;
>  
> @@ -239,6 +241,9 @@ static int vhci_open(struct inode *inode, struct file *file)
>  	hdev->bus = HCI_VIRTUAL;
>  	hdev->driver_data = data;
>  
> +	if (amp)
> +		hdev->dev_type = HCI_AMP;
> +
>  	hdev->open     = vhci_open_dev;
>  	hdev->close    = vhci_close_dev;
>  	hdev->flush    = vhci_flush;
> @@ -303,6 +308,9 @@ static void __exit vhci_exit(void)
>  module_init(vhci_init);
>  module_exit(vhci_exit);
>  
> +module_param(amp, bool, 0644);
> +MODULE_PARM_DESC(amp, "AMP HCI device type");
> +

actually "Create AMP controller device" would be a better description.

Regards

Marcel



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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-14  9:45 [PATCHv2 0/3] Trivial fixes for emulating AMP HCI Emeltchenko Andrei
2011-11-14  9:45 ` [PATCHv2 1/3] Bluetooth: Allow to set AMP type for virtual HCI Emeltchenko Andrei
2011-11-14  9:47   ` Marcel Holtmann
2011-11-14  9:45 ` [PATCHv2 2/3] Bluetooth: Move scope of kernel parameter enable_hs Emeltchenko Andrei
2011-11-14  9:45 ` [PATCHv2 3/3] Bluetooth: Do not set HCI_RAW when HS enabled Emeltchenko Andrei

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