All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Jakub Tyszkowski <jakub.tyszkowski@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 4/4] android/gatt: Set proper MTU for BR/EDR link
Date: Wed, 26 Nov 2014 14:44:12 +0200	[thread overview]
Message-ID: <20141126124412.GA9449@t440s.lan> (raw)
In-Reply-To: <1416991660-21828-4-git-send-email-jakub.tyszkowski@tieto.com>

Hi Jakub,

On Wed, Nov 26, 2014, Jakub Tyszkowski wrote:
> Minimum mtu depends on transport layer and is larger for BREDR link.
> ---
>  android/gatt.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/android/gatt.c b/android/gatt.c
> index b9b3c7b..95ddba0 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -1439,7 +1439,7 @@ static void connect_cb(GIOChannel *io, GError *gerr, gpointer user_data)
>  	uint32_t status;
>  	GAttrib *attrib;
>  	uint16_t mtu;
> -	uint16_t cid;
> +	uint8_t dst_type;
>  
>  	if (dev->state != DEVICE_CONNECT_READY) {
>  		error("gatt: Device not in a connecting state!?");
> @@ -1459,9 +1459,11 @@ static void connect_cb(GIOChannel *io, GError *gerr, gpointer user_data)
>  		goto reply;
>  	}
>  
> -	if (!bt_io_get(io, &gerr, BT_IO_OPT_IMTU, &mtu, BT_IO_OPT_CID, &cid,
> -				BT_IO_OPT_INVALID) || cid == ATT_CID)
> -		mtu = ATT_DEFAULT_LE_MTU;
> +	mtu = ATT_DEFAULT_LE_MTU;
> +
> +	if (bt_io_get(io, &gerr, BT_IO_OPT_DEST_TYPE, &dst_type,
> +			BT_IO_OPT_INVALID) && (dst_type == BDADDR_BREDR))
> +		mtu = ATT_DEFAULT_L2CAP_MTU;
>  
>  	attrib = g_attrib_new(io, mtu);
>  	if (!attrib) {

Isn't this a kernel or BtIO bug if we get the wrong MTU from bt_io_get?

Johan

  reply	other threads:[~2014-11-26 12:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26  8:47 [PATCH 1/4] android/gatt: Unify read by type and read by group type Jakub Tyszkowski
2014-11-26  8:47 ` [PATCH 2/4] android/gatt: Improve prepare write request response Jakub Tyszkowski
2014-11-26  8:47 ` [PATCH 3/4] android/gatt: Fix improper signed write request decoding buffer size Jakub Tyszkowski
2014-11-26  8:47 ` [PATCH 4/4] android/gatt: Set proper MTU for BR/EDR link Jakub Tyszkowski
2014-11-26 12:44   ` Johan Hedberg [this message]
2014-11-27  7:58     ` Tyszkowski Jakub
2014-12-01 11:45 ` [PATCH 1/4] android/gatt: Unify read by type and read by group type Szymon Janc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141126124412.GA9449@t440s.lan \
    --to=johan.hedberg@gmail.com \
    --cc=jakub.tyszkowski@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.