Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1845174rwb; Fri, 28 Jul 2023 16:25:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlFoBcvNNde4N1u2n4Phxm506CwdAgG3v+iaWM9wnXHHXi6DlP5OQYrlfM+/agQb7MnEY4t0 X-Received: by 2002:a05:6a00:130f:b0:668:8705:57dd with SMTP id j15-20020a056a00130f00b00668870557ddmr2905898pfu.28.1690586706482; Fri, 28 Jul 2023 16:25:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690586706; cv=none; d=google.com; s=arc-20160816; b=TrlL9xBoxP49VMkVaLmGm/OzEBJkazr3eTBvS9JHIC+2IgOfhfk5RJvxWRAhtQ7wi7 v3BlfOzFsrGELXzXwrfWAVuoa/vjnrhtmRHvpUHwNGpBt34d3jNgUrFVOW5awO1d6/xx e2ca8LHlMhtv9Z/J34vrp6wlK/eNhQIZEiPE9PhK120CD5RbAnD5ce7+vSXx9hGN01uH jaBIPXXo6IER+nbax8ALV9nDxYG4ya9DUyVCpzcLxP2+eaiTsda0Tzipy/QBJRVB15h3 1jrRgBSORrB3WQXJQ+gLr9iYSNGOWutKqTnYei0KQe1TWKof4lpLcvOuQco0RB/qP05j rTxg== 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:to:from :dkim-signature; bh=AqtPrNOzG2zgD66FN9kCCGXtJuxydbI9dQmkP+yzwmg=; fh=V2LL5OuZUBGeSu6TXDWykcThOoazTGUpkln19rrO2KM=; b=OqpX8wgvw2OFaN7yz/8XfUzZDshkC+JV7VJmU4uElroOpW1YSi1/dfZlCzlg8magXF VP8BsDo133boQukddZkCarIPzP7m0ovIECwoYL8LlXiCTYLTbxWgPqM9t/nPNUFkHAuz mxflm34+ACyoFhFedUwoo7OKQ5fDJa9dqvlBCz8nTQTAAfIhayN/hkyTuVegDPJnisgB gIIJ4b9Wt8v2Kn2YiS7GkaivRMZEee7KKVOcah6u1LY/splfC7+hJO+rcbin8yUVQ3I/ mb/XMAcyj0Ml+2kix54os3NGnHUvAKG1oVoYeX3idEFMrLpoVGqbRd/UnkJYv/MCRhg9 4BMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="D/c/EuE0"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q10-20020a056a00084a00b00682b0b7ed43si2349617pfk.368.2023.07.28.16.24.53; Fri, 28 Jul 2023 16:25:06 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b="D/c/EuE0"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233478AbjG1Wm7 (ORCPT + 99 others); Fri, 28 Jul 2023 18:42:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231880AbjG1Wm6 (ORCPT ); Fri, 28 Jul 2023 18:42:58 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF746421C for ; Fri, 28 Jul 2023 15:42:57 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-686e29b058cso2012029b3a.1 for ; Fri, 28 Jul 2023 15:42:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690584176; x=1691188976; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=AqtPrNOzG2zgD66FN9kCCGXtJuxydbI9dQmkP+yzwmg=; b=D/c/EuE0Q0PYZO2uGGIAEMmqGMEVtza8aDkdb2Yxp1hyS+xAl8grmUaNy9SrQYphlv RNPkaWOOLedy3ntJBm/ETHnRWs7Kt8wMTJqbTDm90UqmSWhcD12tM6XVXHAoi4/abMX+ fL7uR5zWS8KTglW8if9D7c7qRwPBKXxnnKPNXHVVg/wYaQpdtrR5iiSidzThtDrzk9Cb NOik+TPa8pmLett2rVHKBih8r058VwvwQdvXzhcz80xTQFM4/rRzJ9K2j5ZGj9fxfJVA DxxWZYdRUHyLLpCO0y/jG2V9D2tN571Fs/fud7n9SlMJZmDkgRtCjYzl2EAK1kFu1ivt gA4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690584176; x=1691188976; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AqtPrNOzG2zgD66FN9kCCGXtJuxydbI9dQmkP+yzwmg=; b=JR74wiiGy4sq5i1PMslOJwlVEFL925tSYUK7BJAZcR6PUxg/KGZRoWdVq25NvQO224 3ec0ly7fWVdeTmuEK6JL6u7/LYfjv94GVo0g2PMtqdi1Bn+OwdBlx7q0J4sRUEktj7Ff yTGabG9y+IlqnWW6/+bc4gim16L8vl12wU7N+hu1dar0CMDtSh0yEK7SFSkGMlcwlk/Z nqVq3SXmWEM3X8o4qHA0ljZthDVC3Rs/AJijsvy2HOJDWeRG6Mz6QCwF7xt+yiANOLJ4 OL8Dj3onxVsNIvt2u92agVBnp1zJJxLssrno/aM6L+KWQQ/pzuHiynd0TI555IFzxuu7 KX/g== X-Gm-Message-State: ABy/qLaVMOnX/6D8uZLsvm2ENhiWaLicnu9sMetL+I5dfpdCkRsrkj8r yqi8/MFzUFdPuGaJbUoaytdPEN3lswo= X-Received: by 2002:a05:6a00:1955:b0:686:bc23:e20a with SMTP id s21-20020a056a00195500b00686bc23e20amr3459914pfk.21.1690584176535; Fri, 28 Jul 2023 15:42:56 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-236-201-58.hsd1.or.comcast.net. [71.236.201.58]) by smtp.gmail.com with ESMTPSA id x41-20020a056a000be900b0068703879d3esm2731041pfu.113.2023.07.28.15.42.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 15:42:55 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [BlueZ PATCH v5 5/7] monitor: Fix not calculating latency for ISO/SCO packets Date: Fri, 28 Jul 2023 15:42:45 -0700 Message-ID: <20230728224247.102057-5-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230728224247.102057-1-luiz.dentz@gmail.com> References: <20230728224247.102057-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 From: Luiz Augusto von Dentz ISO/SCO packets latency was not being calculated because no connection was assigned to them. --- monitor/packet.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/monitor/packet.c b/monitor/packet.c index badc9b9c7785..b5a4fb1671b1 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -10607,6 +10607,10 @@ static void sync_conn_complete_evt(struct timeval *tv, uint16_t index, print_field("RX packet length: %d", le16_to_cpu(evt->rx_pkt_len)); print_field("TX packet length: %d", le16_to_cpu(evt->tx_pkt_len)); print_air_mode(evt->air_mode); + + if (evt->status == 0x00) + assign_handle(index, le16_to_cpu(evt->handle), evt->link_type, + (void *)evt->bdaddr, BDADDR_BREDR); } static void sync_conn_changed_evt(struct timeval *tv, uint16_t index, @@ -11566,6 +11570,10 @@ static void le_cis_established_evt(struct timeval *tv, uint16_t index, print_field("Central to Peripheral MTU: %u", le16_to_cpu(evt->c_mtu)); print_field("Peripheral to Central MTU: %u", le16_to_cpu(evt->p_mtu)); print_slot_125("ISO Interval", evt->interval); + + if (!evt->status) + assign_handle(index, le16_to_cpu(evt->conn_handle), 0x05, + NULL, BDADDR_LE_PUBLIC); } static void le_req_cis_evt(struct timeval *tv, uint16_t index, @@ -11604,6 +11612,14 @@ static void le_big_complete_evt(struct timeval *tv, uint16_t index, print_slot_125("ISO Interval", evt->interval); print_list(evt->bis_handle, size, evt->num_bis, sizeof(*evt->bis_handle), print_bis_handle); + + if (!evt->status) { + int i; + + for (i = 0; i < evt->num_bis; i++) + assign_handle(index, le16_to_cpu(evt->bis_handle[i]), + 0x05, NULL, BDADDR_LE_PUBLIC); + } } static void le_big_terminate_evt(struct timeval *tv, uint16_t index, @@ -11631,6 +11647,14 @@ static void le_big_sync_estabilished_evt(struct timeval *tv, uint16_t index, print_slot_125("ISO Interval", evt->interval); print_list(evt->bis, size, evt->num_bis, sizeof(*evt->bis), print_bis_handle); + + if (!evt->status) { + int i; + + for (i = 0; i < evt->num_bis; i++) + assign_handle(index, le16_to_cpu(evt->bis[i]), + 0x05, NULL, BDADDR_LE_PUBLIC); + } } static void le_big_sync_lost_evt(struct timeval *tv, uint16_t index, -- 2.41.0