All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/1] Add KeyboardDisplay IO Capability
@ 2012-01-16  8:06 Hemant Gupta
  2012-01-16  8:06 ` [PATCH v1 1/1] " Hemant Gupta
  0 siblings, 1 reply; 3+ messages in thread
From: Hemant Gupta @ 2012-01-16  8:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Hemant Gupta, Hemant Gupta

This is a rebased version of previous patch, incorporating
Johan's comments. This patch is dependent on Kernel
patch [PATCH v1 1/1] Bluetooth: Send correct response to IO
Capability Request. 

Hemant Gupta (1):
  Add KeyboardDisplay IO Capability

 plugins/hciops.c |    8 +++++++-
 src/adapter.c    |    3 +++
 2 files changed, 10 insertions(+), 1 deletions(-)


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

* [PATCH v1 1/1] Add KeyboardDisplay IO Capability
  2012-01-16  8:06 [PATCH v1 0/1] Add KeyboardDisplay IO Capability Hemant Gupta
@ 2012-01-16  8:06 ` Hemant Gupta
  2012-01-18 12:22   ` Johan Hedberg
  0 siblings, 1 reply; 3+ messages in thread
From: Hemant Gupta @ 2012-01-16  8:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Hemant Gupta, Hemant Gupta

This patch adds suppport for KeyboardDisplay IO capability in BlueZ.
It is ensured that the new capability is set only if management
interface is being used. For hciops Keyboarddisplay capability is
mapped to DisplayYesNo.
---
 plugins/hciops.c |    8 +++++++-
 src/adapter.c    |    3 +++
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/plugins/hciops.c b/plugins/hciops.c
index 77d2421..4102537 100644
--- a/plugins/hciops.c
+++ b/plugins/hciops.c
@@ -3573,7 +3573,13 @@ static int hciops_set_io_capability(int index, uint8_t io_capability)
 {
 	struct dev_info *dev = &devs[index];
 
-	dev->io_capability = io_capability;
+	/*
+	 * Hciops is not to be used for SMP
+	 * pairing for LE devices. So change the IO
+	 * capability from KeyboardDisplay to
+	 * DisplayYesNo in case it is set.
+	 */
+	dev->io_capability = (io_capability == 0x04) ? 0x01 : io_capability;
 
 	return 0;
 }
diff --git a/src/adapter.c b/src/adapter.c
index 7e4bbb6..ba86cd4 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -74,6 +74,7 @@
 #define IO_CAPABILITY_DISPLAYYESNO	0x01
 #define IO_CAPABILITY_KEYBOARDONLY	0x02
 #define IO_CAPABILITY_NOINPUTNOOUTPUT	0x03
+#define IO_CAPABILITY_KEYBOARDDISPLAY	0x04
 #define IO_CAPABILITY_INVALID		0xFF
 
 #define check_address(address) bachk(address)
@@ -1533,6 +1534,8 @@ static uint8_t parse_io_capability(const char *capability)
 		return IO_CAPABILITY_KEYBOARDONLY;
 	if (g_str_equal(capability, "NoInputNoOutput"))
 		return IO_CAPABILITY_NOINPUTNOOUTPUT;
+	if (g_str_equal(capability, "KeyboardDisplay"))
+		return IO_CAPABILITY_KEYBOARDDISPLAY;
 	return IO_CAPABILITY_INVALID;
 }
 
-- 
1.6.6.1


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

* Re: [PATCH v1 1/1] Add KeyboardDisplay IO Capability
  2012-01-16  8:06 ` [PATCH v1 1/1] " Hemant Gupta
@ 2012-01-18 12:22   ` Johan Hedberg
  0 siblings, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2012-01-18 12:22 UTC (permalink / raw)
  To: Hemant Gupta; +Cc: linux-bluetooth, Hemant Gupta

Hi Hemant,

On Mon, Jan 16, 2012, Hemant Gupta wrote:
> This patch adds suppport for KeyboardDisplay IO capability in BlueZ.
> It is ensured that the new capability is set only if management
> interface is being used. For hciops Keyboarddisplay capability is
> mapped to DisplayYesNo.
> ---
>  plugins/hciops.c |    8 +++++++-
>  src/adapter.c    |    3 +++
>  2 files changed, 10 insertions(+), 1 deletions(-)

Applied. Thanks.

Johan

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

end of thread, other threads:[~2012-01-18 12:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-16  8:06 [PATCH v1 0/1] Add KeyboardDisplay IO Capability Hemant Gupta
2012-01-16  8:06 ` [PATCH v1 1/1] " Hemant Gupta
2012-01-18 12:22   ` Johan Hedberg

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.