Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp6567pxj; Fri, 7 May 2021 02:21:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxINh0CQ8RdqC0Nq9NiwTN6hI3QQcTU1KXnPniQefyzs3XqM9E4zKoGgy0At5ZYraBbeOat X-Received: by 2002:a17:906:c010:: with SMTP id e16mr9111800ejz.214.1620379315149; Fri, 07 May 2021 02:21:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620379315; cv=none; d=google.com; s=arc-20160816; b=wZupWoHsbndbTjXy243ptmmVNCc/sEwOft7ip06qr4fyCi2u/YvvbXoilJ1d153+M2 ENOvdGjxW6iVf8JkdMmivHvt1fkouc2jroROdfVgs9fwkCjcoJRjIFkUQgAa33k6CT/3 liaoWOvoNVGL9+3SINec7d+Uk0FfWixVRJ4UXLEFkyA6DIEuEC6MA7HAwcuKPRco/u/c 1fcuc43qNGn9AOw2uljJTXIw4xsKjCv8xNzEukSbibFDrg4zbLRBPviyoil7pmSrro6C orI9RTV1OC7TvdgmBrgTPfu8heGxTBE3VkmPHxzNGTsCo7dXx4NOrbqNEpni9PrNXHxF Ueaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=3yQecBlacTS+JMxSB/AkZrWL6flY2kpnuE01vG6SNOU=; b=Ly6SdMOgKTYQbBItZP7rvotO4l2QcFyDZVnau3Y+FhXh/A2qAx3AFkAUDXmj0nA3e8 TEefZmTMFkJsKEet+iDwC7DZDmYw10m3TFEYCahVc/Bgvq2mLCPYtA/LefB1ljkt9MOv ASgWfpGzAJRZ5MFJZRgMSvShYYgBa64dqEvPlMzSo7iIxJjOIh7Kqh+rDMGrlyVGibxs 7LrG5EFnGmqySrAuuceusFvoUgVN3RhufvBpD2EP4oK8ARgB19vaFqrVRZFFjusTqBNi z2N++tjG2ZVLgCoaeS8gt1BdKZDt9lv3nbOkir83NhI0CZ1qwaO8zSWlKsUIDUV6ydue JJPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si5369513eds.16.2021.05.07.02.21.03; Fri, 07 May 2021 02:21:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236026AbhEGIUA convert rfc822-to-8bit (ORCPT + 99 others); Fri, 7 May 2021 04:20:00 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:40260 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234484AbhEGIUA (ORCPT ); Fri, 7 May 2021 04:20:00 -0400 Received: from smtpclient.apple (p4fefc624.dip0.t-ipconnect.de [79.239.198.36]) by mail.holtmann.org (Postfix) with ESMTPSA id 07C9FCECDB; Fri, 7 May 2021 10:26:50 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\)) Subject: Re: [Bluez PATCH v1] doc/mgmt-api - Add a new error code for HCI status 0x3e From: Marcel Holtmann In-Reply-To: <20210429111523.Bluez.v1.1.Ic00ed950add081b346d6c8ced590bb7b2eb6e9f7@changeid> Date: Fri, 7 May 2021 10:18:58 +0200 Cc: Bluetooth Kernel Mailing List , Luiz Augusto von Dentz , chromeos-bluetooth-upstreaming@chromium.org, Abhishek Pandit-Subedi Content-Transfer-Encoding: 8BIT Message-Id: <44A0B714-12C5-4A43-9829-CAE3D8BF374B@holtmann.org> References: <20210429111523.Bluez.v1.1.Ic00ed950add081b346d6c8ced590bb7b2eb6e9f7@changeid> To: Yu Liu X-Mailer: Apple Mail (2.3654.80.0.2.43) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Yu, > We want to retry the pairing when HCI status 0x3e (Connection failed to > established/Synchronization timeout) is returned from the controller. > This is to add a new MGMT error code so that we can catch this 0x3e > failure and issue a retry in the user space. > > Reviewed-by: Abhishek Pandit-Subedi > --- > > Changes in v1: > - Initial change > > doc/mgmt-api.txt | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt > index 5355fedb0..f7cbf7ab2 100644 > --- a/doc/mgmt-api.txt > +++ b/doc/mgmt-api.txt > @@ -200,6 +200,7 @@ and Command Complete events: > 0x12 RFKilled > 0x13 Already Paired > 0x14 Permission Denied > +0x15 Connection Not Established > > As a general rule all commands generate the events as specified below, > however invalid lengths or unknown commands will always generate a > @@ -1112,6 +1113,7 @@ Pair Device Command > Not Powered > Invalid Index > Already Paired > + Connection Not Established I really dislike the naming. And even more so, I request the motive here. So looking at our code, we have 3 cases where we use the previous status: MGMT_STATUS_CONNECT_FAILED, /* Page Timeout */ MGMT_STATUS_CONNECT_FAILED, /* Connection Establishment Failed */ MGMT_STATUS_CONNECT_FAILED, /* MAC Connection Failed */ And they do map to the 3 available transports, either via BR/EDR or LE or AMP. That means if you call Pair Device you already know well today when it fails to establish the link and can retry it. My question, what are you trying to fix here. Regards Marcel