Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp608058pxh; Tue, 9 Nov 2021 16:06:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJPEfySAO3pzUPeN9s3TduMgsmCe0DzodQnJ9diPrHucTjDwjJmIS6ADR6gKDGFDf9mdfv X-Received: by 2002:a05:6e02:190f:: with SMTP id w15mr8395355ilu.56.1636502797346; Tue, 09 Nov 2021 16:06:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636502797; cv=none; d=google.com; s=arc-20160816; b=wmw6UJhJP/gjvoZkfz7jpO5PbsO4dvIcd57uhUhyx9DKZ482uxKgVIERR0Q00GdfYB vUmWnA0MRP54ZytACMZaTmStKjQrfkoCNnWQUXFMzBvV5W2nwYm/GKqSty/JRsgj+2vT 1/+U7nUWKH25a6LPUV9TMp1yOVLOZEmm94+Lnmy/KuJ7JTbfA2YBniAOuwY2kXmEzXWd JPg14X1u/GZmjA/v8xHb4UVQkvNw9Cz5tkUsN/4JKmpbySlmi5xfCnPjw6GvAu7bx+t5 X1n67G14pJeK/Rm4fOTUhKZ40v7E+6VAAPLAi+SAViVUQ7FeXPyKUcSZA6vpTkWCnCj6 XelQ== 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 :dkim-signature; bh=K20FTmKeMcaSMklUhK0ny/B+G4bWOYmXCUJt5X0Pkww=; b=t6iSr0g17KBBZ+C2TsyHXc2zApVaKI1TaUsPDMXxyQ0w0cteOrFRT1aa90zySzBfoc eRwINvkNwfAN8MeWAW1itUC4WDNnhzX63YkactuA29a6iuJ9+AkeO5A2ZCGLi8IvKreF pVLi8zEWD9kHBQ/xCvBU25Qo7rJxrE5PffuSd9wL2JclfbMtg6m010MzquA9fDNPgP1f jnH5wHbMB+xer7ctohRp94JyNcaXOSI/OwihKyjUsaYXJKI9vcpvGJkGIZYYyelIHFZJ MFVYphS6w5HORg+6GX9s7BQsdFVsEyH1+/rDvdyundBjOeQEYNHcfVzo9i6st8z81Dnb V+4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="P7/xjy07"; 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; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n17si35143580ilt.86.2021.11.09.16.06.25; Tue, 09 Nov 2021 16:06:37 -0800 (PST) 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; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="P7/xjy07"; 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; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239448AbhKIQoY (ORCPT + 99 others); Tue, 9 Nov 2021 11:44:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238174AbhKIQoX (ORCPT ); Tue, 9 Nov 2021 11:44:23 -0500 Received: from sipsolutions.net (unknown [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3E16C061764 for ; Tue, 9 Nov 2021 08:41:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=K20FTmKeMcaSMklUhK0ny/B+G4bWOYmXCUJt5X0Pkww=; t=1636476097; x=1637685697; b=P7/xjy07XICHD8P6t9oM4dHMpnkEiUjnQI+52o5g5VAC+Rq dw5U4PktbhKVnAeEnyfP2rUblFo+mzQyN28C5qjCpu8oDpvCRDpLiP7GiFtcdowzNpYX4BGwj/7Nt baWLy7i7X1vN8WiLIEAxbgMJyDiXGh/i0aa7fsvs8YfoMCd3cXrVIkeEB59CmpV1TaFYBOK3K0Ano th2XpiN8xSKh5Wk2mVpG9R+TuCU22pHHg1tL6v3SiTnKCEIx6ZDVc04oZlV+TOWSToHLVIfHBB9jK EOqu0p8UtIAbeiwWP5dVxXCE4p/F+nsGFEV9gEhkanAYFvYTOXtdx2OJdobvUQLQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1mkUBh-00D1dY-IK; Tue, 09 Nov 2021 17:41:33 +0100 From: Benjamin Berg To: linux-bluetooth@vger.kernel.org Cc: Benjamin Berg Subject: [PATCH 2/4] Bluetooth: Add new hci_tx_error function Date: Tue, 9 Nov 2021 17:41:11 +0100 Message-Id: <20211109164113.65981-3-benjamin@sipsolutions.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211109164113.65981-1-benjamin@sipsolutions.net> References: <20211109164113.65981-1-benjamin@sipsolutions.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Benjamin Berg Currently this function only cancels any synchronous operation that might be ongoing. Adding this function allows aborting synchronous commands in case of low level TX/RX issues. A common example for this is that the device has been removed. Signed-off-by: Benjamin Berg --- include/net/bluetooth/hci_core.h | 1 + net/bluetooth/hci_core.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index dd8840e70e25..542f5a37b9d0 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -1267,6 +1267,7 @@ void hci_release_dev(struct hci_dev *hdev); int hci_suspend_dev(struct hci_dev *hdev); int hci_resume_dev(struct hci_dev *hdev); int hci_reset_dev(struct hci_dev *hdev); +void hci_tx_error(struct hci_dev *hdev, int err); int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb); int hci_recv_diag(struct hci_dev *hdev, struct sk_buff *skb); __printf(2, 3) void hci_set_hw_info(struct hci_dev *hdev, const char *fmt, ...); diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 8d33aa64846b..bbb35188e41f 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -4069,6 +4069,13 @@ int hci_reset_dev(struct hci_dev *hdev) } EXPORT_SYMBOL(hci_reset_dev); +/* Reset HCI device */ +void hci_tx_error(struct hci_dev *hdev, int err) +{ + hci_req_sync_cancel(hdev, err); +} +EXPORT_SYMBOL(hci_tx_error); + /* Receive frame from HCI drivers */ int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb) { -- 2.31.1