Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4726360iob; Sun, 8 May 2022 23:24:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLCXP26NuqrN4EOZoTCc3/D4HtK+h0J3bC/IIj52EZZp6u/2u1CuPrrXkR3IW+kMTGBHlY X-Received: by 2002:a17:902:e211:b0:15c:f342:2fe6 with SMTP id u17-20020a170902e21100b0015cf3422fe6mr15242416plb.18.1652077490558; Sun, 08 May 2022 23:24:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652077490; cv=none; d=google.com; s=arc-20160816; b=k7XOv43HsBDJv+u03hK2tHKLWQxWxIMMkPGA5io+SAEiWas7+f4QcKzTZySxx70bb2 HWxeFXm2yabHnEAo2GjgZl2pG9yw6OTDSXpxS0iyeeoxe37qh2NKf7PEmT2yAK3DowbS n+amLx+0+gDXZXbwuk4yZoi9joP+eHuu+v85kcOvyz22G7uUd3UCedIhrywxrhjEewRe yHKs9Ucl3xMrmOeNKWgDlp0a/VKO0/9+vNJdaqifKRPpUjOydcnjdpQDgS/amcMrgaHW wd6PbDv2z4z8qmOuSvdgmYaPkBRzaeVKkk2mNAynI97KV2CH9UgxA5jaWgU9YA727kJm uG4g== 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=aaPK0e3xWbCk/gr+fK3J7GSQyesYbC8VHkpcykGAlxI=; b=ZIikMoi+vjS/U19EEzn9vB3JYWmi2hXmC3qOxMYA5Q+9DgKy6Zm/3JP1KscgZNScJR OhfHA4XKRRav92NdXveHzR+6D6JOZuK1X7UUisl6EJK+m1HuFBy09TJp6GV2sMjWYR9X ApMoWruIqOAfnj9ojicA4x6RjZXDS0E9buL9YQMFv24Y/BOLBoi9friGJ6+tlI6LyT6R 121dff+f1uuV4YnA4paeZAFcuxAIHy0nj1vFezN9wtY7nF4oOev/1V4hl2jVSDmUP0Y5 AdpiIF1fvX10iR4UmLRQB+0J0g3B2JZKlYsCGXADX+QMtO8gTS0DylgxkCeVClMhuiks U4TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SQFKmup1; spf=softfail (google.com: domain of transitioning linux-bluetooth-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e7-20020a656bc7000000b003a9f944b0cfsi14913975pgw.558.2022.05.08.23.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 23:24:50 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-bluetooth-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SQFKmup1; spf=softfail (google.com: domain of transitioning linux-bluetooth-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B909F179E5B; Sun, 8 May 2022 23:22:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388588AbiEFWBk (ORCPT + 99 others); Fri, 6 May 2022 18:01:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444634AbiEFWBi (ORCPT ); Fri, 6 May 2022 18:01:38 -0400 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8510124F09 for ; Fri, 6 May 2022 14:57:54 -0700 (PDT) Received: by mail-io1-xd35.google.com with SMTP id z26so9483840iot.8 for ; Fri, 06 May 2022 14:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=aaPK0e3xWbCk/gr+fK3J7GSQyesYbC8VHkpcykGAlxI=; b=SQFKmup1GeA7LLqhPgjXFFT0fwfmV34Du0E2D2hf0G6ik0V3qPCCeithOc/ETUrFVy sWihSc8wT4G19b5evlDUvqhW9epznMXe+o9yzVZlm6IYGQglnXAhDr+7G51XTjl5CS8w OmGKGsGHAnEE8LXQbNClBn5UepMZlT5BANijceC8eyJ5X57o/upisD5RXkUQ5z7Q/tZV uQI6/xNNqIqxsyGJ9qD3jXavrQCP8NK5sUkFGENEhUpa0pP3XdXoNCymF0aHCOjjumjr UdfsoY3NUhoPPiJcP3Q5K4oyKe7k2DR4ZbvSlGWjMq8acwwsl8bRkWk33PInTWmoTrPT Njew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aaPK0e3xWbCk/gr+fK3J7GSQyesYbC8VHkpcykGAlxI=; b=srnJjfLHCsnvQK7Kc5fK9mB8xH5k1b4tpwPQ4/Ep5FVEubrdu31L7PFue11jRlnS+s l7ltqDzEHa9Qoi+sC4ukHoQFqGzp86nl3xBcYh2Vo02G+lISw5KKvkS3HgsrN72v1OHk 7u8Vo3IJZi5ys1av49Mm8QQAxP8EXwU/HHcIZjnB+6s9ZgVLgPLu9lrCLf073biMISg0 AvakTjHuz5eaonsW289JjLsG3GidmaZDya9t2sB1qu1ddbWnWarv1m2pjBXRPnMOWeZq rx8iIDd7Z+XVcWGm1vkJ88Dy1g9iH2KtdV7pysWhZoOpcj/nx8IbiwYnUCYoxTAs+RHj NSRA== X-Gm-Message-State: AOAM532YzYNxIXtZWf5bEK2w3Hv4HBdVtWYc8UpaEXPAPcjxRSV5tXUa JXD9hePJJU/qbD5cFHm3b+4UG8odNUE= X-Received: by 2002:a02:950c:0:b0:323:918d:a98f with SMTP id y12-20020a02950c000000b00323918da98fmr2247686jah.190.1651874273690; Fri, 06 May 2022 14:57:53 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id s14-20020a5e980e000000b0065aab053448sm1572281ioj.21.2022.05.06.14.57.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 14:57:52 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v2 8/8] Bluetooth: btusb: Detect if an ACL packet is in fact an ISO packet Date: Fri, 6 May 2022 14:57:43 -0700 Message-Id: <20220506215743.3870212-8-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220506215743.3870212-1-luiz.dentz@gmail.com> References: <20220506215743.3870212-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Fix up the packet type if ISO packets are sent over the bulk endpoint. Note: This is a stopgap since the Bluetooth specification currently doesn't define any endpoint to transport ISO packets. Signed-off-by: Luiz Augusto von Dentz --- drivers/bluetooth/btusb.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index a1ee0b20bdf6..0120cd7cc197 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -893,11 +893,21 @@ static int btusb_recv_bulk(struct btusb_data *data, void *buffer, int count) hci_skb_expect(skb) -= len; if (skb->len == HCI_ACL_HDR_SIZE) { + __u16 handle = __le16_to_cpu(hci_acl_hdr(skb)->handle); __le16 dlen = hci_acl_hdr(skb)->dlen; + __u8 type; /* Complete ACL header */ hci_skb_expect(skb) = __le16_to_cpu(dlen); + /* Detect if ISO packet has been sent over bulk */ + if (hci_conn_num(data->hdev, ISO_LINK)) { + type = hci_conn_lookup_type(data->hdev, + hci_handle(handle)); + if (type == ISO_LINK) + hci_skb_pkt_type(skb) = HCI_ISODATA_PKT; + } + if (skb_tailroom(skb) < hci_skb_expect(skb)) { kfree_skb(skb); skb = NULL; -- 2.35.1