linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] Fix Minimum gatttool MTU
@ 2011-02-16 21:16 Brian Gix
  2011-02-16 21:16 ` [PATCH 1/1] Fix Min MTU to reflect values for both L2CAP & LE Brian Gix
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Gix @ 2011-02-16 21:16 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: johan.hedberg, padovan, anderson.lizardo

I am satisfied with the rest of the functionality added
to the now "interactive" gatttool, so this patch fixes
the one remaining deficiency from my earlier patch.


-- 
Brian Gix
bgix@codeaurora.org
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

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

* [PATCH 1/1] Fix Min MTU to reflect values for both L2CAP & LE
  2011-02-16 21:16 [PATCH 0/1] Fix Minimum gatttool MTU Brian Gix
@ 2011-02-16 21:16 ` Brian Gix
  2011-02-16 21:23   ` Johan Hedberg
  2011-02-16 21:36   ` Anderson Lizardo
  0 siblings, 2 replies; 4+ messages in thread
From: Brian Gix @ 2011-02-16 21:16 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: johan.hedberg, padovan, anderson.lizardo, Brian Gix

---
 attrib/gatttool.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/attrib/gatttool.c b/attrib/gatttool.c
index 1e2a8db..38636f9 100644
--- a/attrib/gatttool.c
+++ b/attrib/gatttool.c
@@ -44,8 +44,9 @@
 #include "gatt.h"
 #include "gatttool.h"
 
-/* Minimum MTU for L2CAP connections over BR/EDR */
-#define ATT_MIN_MTU_L2CAP 48
+/* Minimum MTU for ATT connections */
+#define ATT_MIN_MTU_LE		23
+#define ATT_MIN_MTU_L2CAP	48
 
 static gchar *opt_src = NULL;
 static gchar *opt_dst = NULL;
@@ -93,9 +94,9 @@ GIOChannel *do_connect(gchar *dst, gboolean le, BtIOConnect connect_cb)
 
 	/* This check is required because currently setsockopt() returns no
 	 * errors for MTU values smaller than the allowed minimum. */
-	if (opt_mtu != 0 && opt_mtu < ATT_MIN_MTU_L2CAP) {
+	if (opt_mtu != 0 && opt_mtu < (le ? ATT_MIN_MTU_LE : ATT_MIN_MTU_L2CAP)) {
 		g_printerr("MTU cannot be smaller than %d\n",
-							ATT_MIN_MTU_L2CAP);
+				(le ? ATT_MIN_MTU_LE : ATT_MIN_MTU_L2CAP));
 		return NULL;
 	}
 
-- 
1.7.1

-- 
Brian Gix
bgix@codeaurora.org
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

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

* Re: [PATCH 1/1] Fix Min MTU to reflect values for both L2CAP & LE
  2011-02-16 21:16 ` [PATCH 1/1] Fix Min MTU to reflect values for both L2CAP & LE Brian Gix
@ 2011-02-16 21:23   ` Johan Hedberg
  2011-02-16 21:36   ` Anderson Lizardo
  1 sibling, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2011-02-16 21:23 UTC (permalink / raw)
  To: Brian Gix; +Cc: linux-bluetooth, padovan, anderson.lizardo

Hi Brian,

On Wed, Feb 16, 2011, Brian Gix wrote:
> ---
>  attrib/gatttool.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)

Pushed upstream. Thanks.

Johan

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

* Re: [PATCH 1/1] Fix Min MTU to reflect values for both L2CAP & LE
  2011-02-16 21:16 ` [PATCH 1/1] Fix Min MTU to reflect values for both L2CAP & LE Brian Gix
  2011-02-16 21:23   ` Johan Hedberg
@ 2011-02-16 21:36   ` Anderson Lizardo
  1 sibling, 0 replies; 4+ messages in thread
From: Anderson Lizardo @ 2011-02-16 21:36 UTC (permalink / raw)
  To: Brian Gix; +Cc: linux-bluetooth, johan.hedberg, padovan

Hi Brian,

On Wed, Feb 16, 2011 at 6:16 PM, Brian Gix <bgix@codeaurora.org> wrote:
> -/* Minimum MTU for L2CAP connections over BR/EDR */
> -#define ATT_MIN_MTU_L2CAP 48
> +/* Minimum MTU for ATT connections */
> +#define ATT_MIN_MTU_LE         23
> +#define ATT_MIN_MTU_L2CAP      48

on attrib/att.h we have:

#define ATT_DEFAULT_L2CAP_MTU 48
#define ATT_DEFAULT_LE_MTU 23

I think It's better to reuse them. Johan has applied your patch
already, so you will need to create a fixup for it.

Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil

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

end of thread, other threads:[~2011-02-16 21:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-16 21:16 [PATCH 0/1] Fix Minimum gatttool MTU Brian Gix
2011-02-16 21:16 ` [PATCH 1/1] Fix Min MTU to reflect values for both L2CAP & LE Brian Gix
2011-02-16 21:23   ` Johan Hedberg
2011-02-16 21:36   ` Anderson Lizardo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).