Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/3] Bluetooth: Allow to set AMP type for virtual HCI
@ 2011-11-11 15:02 Emeltchenko Andrei
  2011-11-11 15:02 ` [PATCH 2/3] Bluetooth: Move scope of kernel parameter enable_hs Emeltchenko Andrei
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Emeltchenko Andrei @ 2011-11-11 15:02 UTC (permalink / raw)
  To: linux-bluetooth

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

Type can be changed during module loading.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 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..48f9087 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, 0444);
+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] 7+ messages in thread

* [PATCH 2/3] Bluetooth: Move scope of kernel parameter enable_hs
  2011-11-11 15:02 [PATCH 1/3] Bluetooth: Allow to set AMP type for virtual HCI Emeltchenko Andrei
@ 2011-11-11 15:02 ` Emeltchenko Andrei
  2011-11-11 22:29   ` Marcel Holtmann
  2011-11-11 15:02 ` [PATCH 3/3] Bluetooth: Do not set HCI_RAW when HS enabled Emeltchenko Andrei
  2011-11-11 22:28 ` [PATCH 1/3] Bluetooth: Allow to set AMP type for virtual HCI Marcel Holtmann
  2 siblings, 1 reply; 7+ messages in thread
From: Emeltchenko Andrei @ 2011-11-11 15:02 UTC (permalink / raw)
  To: linux-bluetooth

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


Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 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] 7+ messages in thread

* [PATCH 3/3] Bluetooth: Do not set HCI_RAW when HS enabled
  2011-11-11 15:02 [PATCH 1/3] Bluetooth: Allow to set AMP type for virtual HCI Emeltchenko Andrei
  2011-11-11 15:02 ` [PATCH 2/3] Bluetooth: Move scope of kernel parameter enable_hs Emeltchenko Andrei
@ 2011-11-11 15:02 ` Emeltchenko Andrei
  2011-11-11 22:29   ` Marcel Holtmann
  2011-11-11 22:28 ` [PATCH 1/3] Bluetooth: Allow to set AMP type for virtual HCI Marcel Holtmann
  2 siblings, 1 reply; 7+ messages in thread
From: Emeltchenko Andrei @ 2011-11-11 15:02 UTC (permalink / raw)
  To: linux-bluetooth

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


Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 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] 7+ messages in thread

* Re: [PATCH 1/3] Bluetooth: Allow to set AMP type for virtual HCI
  2011-11-11 15:02 [PATCH 1/3] Bluetooth: Allow to set AMP type for virtual HCI Emeltchenko Andrei
  2011-11-11 15:02 ` [PATCH 2/3] Bluetooth: Move scope of kernel parameter enable_hs Emeltchenko Andrei
  2011-11-11 15:02 ` [PATCH 3/3] Bluetooth: Do not set HCI_RAW when HS enabled Emeltchenko Andrei
@ 2011-11-11 22:28 ` Marcel Holtmann
  2011-11-14  9:47   ` Emeltchenko Andrei
  2 siblings, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2011-11-11 22:28 UTC (permalink / raw)
  To: Emeltchenko Andrei; +Cc: linux-bluetooth

Hi Andre,

> Type can be changed during module loading.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  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..48f9087 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, 0444);
> +MODULE_PARM_DESC(amp, "AMP HCI device type");
> +

actually you could make this 0644 so it can be changed at runtime. Then
you just need to re-open /dev/vhci. Otherwise I am fine with this.

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

Regards

Marcel



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

* Re: [PATCH 2/3] Bluetooth: Move scope of kernel parameter enable_hs
  2011-11-11 15:02 ` [PATCH 2/3] Bluetooth: Move scope of kernel parameter enable_hs Emeltchenko Andrei
@ 2011-11-11 22:29   ` Marcel Holtmann
  0 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2011-11-11 22:29 UTC (permalink / raw)
  To: Emeltchenko Andrei; +Cc: linux-bluetooth

Hi Andrei,

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

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

Regards

Marcel



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

* Re: [PATCH 3/3] Bluetooth: Do not set HCI_RAW when HS enabled
  2011-11-11 15:02 ` [PATCH 3/3] Bluetooth: Do not set HCI_RAW when HS enabled Emeltchenko Andrei
@ 2011-11-11 22:29   ` Marcel Holtmann
  0 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2011-11-11 22:29 UTC (permalink / raw)
  To: Emeltchenko Andrei; +Cc: linux-bluetooth

Hi Andrei,

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

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

Regards

Marcel



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

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

Hi Marcel,

On Sat, Nov 12, 2011 at 07:28:27AM +0900, Marcel Holtmann wrote:
> Hi Andre,
> 
> > Type can be changed during module loading.
> > 
> > Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> > ---
> >  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..48f9087 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, 0444);
> > +MODULE_PARM_DESC(amp, "AMP HCI device type");
> > +
> 
> actually you could make this 0644 so it can be changed at runtime. Then
> you just need to re-open /dev/vhci. Otherwise I am fine with this.\
> 
> Acked-by: Marcel Holtmann <marcel@holtmann.org>

Resent patches with the proposed permissions and your ack.

Best regards 
Andrei Emeltchenko 

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

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

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

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