Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1902943rwd; Sun, 21 May 2023 08:31:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7mK57ur7qU/xd7RPvxV3xWgSKk2EWKr8VWE0cTzk1cdOstOjj5y6YHnWZMf1s7i4BQn72D X-Received: by 2002:a05:6a00:1949:b0:647:7ee8:6251 with SMTP id s9-20020a056a00194900b006477ee86251mr9263367pfk.21.1684683115094; Sun, 21 May 2023 08:31:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684683115; cv=none; d=google.com; s=arc-20160816; b=zsjr8R39V6IIx+d0NO0EJQ0fdZ26dnez5qYv8/YSgj9f5vc1Wa55DdkuDeVbOfG9Me 7m1kddZyXemygaK2KgYqIwhjd/GcFXkS1ZNk621woLT6Hh2NCXUR+zf9mgBEeKDdNjzp 83oNgnjKcJ9qX7mtyh5A2xieFLyIrTZ8X346KRTFPl/j8RWYCkWO5WWYUiY7nIhue+Ll 04kUrXWt0M3yeBZKLfR01ZN/FMEqgMudYFSqzjam6UHw1KO5B48Tr84CbvdlP42pFXFi gaGFFg8DeKemN6URSRzMC0mvkGPKUYXASayNnrXhrNHehedpLxIFAYLAKg1pDZeWyfOE 91PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=pGhPXtcMKINYq1/6dKmAckoShoe36+sjDi7ShCoMcPo=; b=Im7AJn/2H3FiVlmip+fd66v1DS9+QrkW41F5WegSo/cqzOl6ow6900prd7Xt89moeC pzhRlzETWI0GfjkGBciAT5qWrACVw6YZUvjohOXuI70tTBD6/8dWz1IM1W9netOKFg0g 6zFUuYXz5lnvo2ppKl6HqygYIzUviEaCsDczpjTwdOJp8Nnncu3cOPTfsZoiXjVq4Z+Y ChnFG1zJgnCW6DvLbmVSN7jORSQ6h8UpIeQOXA0UnJcGpslIaCow4nVyJA6OtJCMadFW 7pORGyIdDw/kq+xC/QlmDkwxDW0MNWbcWLWOL2NBY58UWsRe45rWOPGDNQ6fCbmHYSq/ mvXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 129-20020a630087000000b005346ce4f2absi3379022pga.605.2023.05.21.08.31.25; Sun, 21 May 2023 08:31:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229664AbjEUP1q (ORCPT + 99 others); Sun, 21 May 2023 11:27:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbjEUP1p (ORCPT ); Sun, 21 May 2023 11:27:45 -0400 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43C22E1 for ; Sun, 21 May 2023 08:27:44 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id EAE0E240027 for ; Sun, 21 May 2023 17:27:41 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QPPbK3RQJz9rxH; Sun, 21 May 2023 17:27:41 +0200 (CEST) From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ 4/5] btdev: report right reason for local Disconnect complete Date: Sun, 21 May 2023 15:27:37 +0000 Message-Id: In-Reply-To: <024df2d86c14fc811701ba27bfa576476bc9c0d6.1684682575.git.pav@iki.fi> References: <024df2d86c14fc811701ba27bfa576476bc9c0d6.1684682575.git.pav@iki.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NEUTRAL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Disconnect initiated by local host should get Connection Terminated by Local Host (0x16) as termination reason. --- emulator/btdev.c | 4 +++- monitor/bt.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/emulator/btdev.c b/emulator/btdev.c index 0eec1d9f2..f9260511a 100644 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -749,7 +749,9 @@ static int cmd_disconnect_complete(struct btdev *dev, const void *data, return 0; } - disconnect_complete(dev, conn->handle, BT_HCI_ERR_SUCCESS, cmd->reason); + /* Local host has different reason (Core v5.3 Vol 4 Part E Sec 7.1.6) */ + disconnect_complete(dev, conn->handle, BT_HCI_ERR_SUCCESS, + BT_HCI_ERR_LOCAL_HOST_TERM); if (conn->link) disconnect_complete(conn->link->dev, conn->link->handle, diff --git a/monitor/bt.h b/monitor/bt.h index 2548f0dcd..b99ada0b2 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -3716,6 +3716,7 @@ struct bt_hci_evt_le_big_info_adv_report { #define BT_HCI_ERR_COMMAND_DISALLOWED 0x0c #define BT_HCI_ERR_UNSUPPORTED_FEATURE 0x11 #define BT_HCI_ERR_INVALID_PARAMETERS 0x12 +#define BT_HCI_ERR_LOCAL_HOST_TERM 0x16 #define BT_HCI_ERR_UNSPECIFIED_ERROR 0x1f #define BT_HCI_ERR_ADV_TIMEOUT 0x3c #define BT_HCI_ERR_CONN_FAILED_TO_ESTABLISH 0x3e -- 2.40.1