From patchwork Fri Jul 26 10:43:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "K, Kiran" X-Patchwork-Id: 814645 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1A8A17920C for ; Fri, 26 Jul 2024 10:28:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721989741; cv=none; b=iQ/HCw4LUwTOuU1C+NWjUEm+Qvbo0XyGIlSBdKc1iDQfFUJrUxoaqLyUjGr2CPAUEc39tv5HUfs2cdM/xxzuscSwuW+p/fGvCqMRjW27o/U2YSxwh08lIgOZHm9uCezbGbR9/2zJiqC6866/J57WXQFzOTS8QVlQaAhj6bk41bM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721989741; c=relaxed/simple; bh=aRd3sBsAWCMSsciIU23Y1I4LkWdDP/r3dXjmiFW7xh4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=WrTq+AAYAPW0csiks/R4sR0rDHpkll/6wDZ17HuAT9m8VxgbXGlSTI9EnqF8umw337+ZChR++k5EzW/urqVx8Jwu1ulWQ7sFqxs+XAoEkeTpm+iWuvf+PaFG8wcQq/FUTmHsjTUgCmy7amPFOg42Incc95jobEHNKtRKofjAVIc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=RWvJzSBa; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RWvJzSBa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721989739; x=1753525739; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=aRd3sBsAWCMSsciIU23Y1I4LkWdDP/r3dXjmiFW7xh4=; b=RWvJzSBavrUpEMtpjchUG6csEM1kwbDQByKKbOe1Yv0UCXVKFE+WkSWs HJTp7Myeir+C98bwE8maSzUJeSApAZwlPdDzZgTWL3X2bS6TcSgFR4z3w lrBtHMg+axHsXmzfpQUz6OR/biiWl6Qzd1A6jgTZVz7mnh/xlCg6SilGZ M8yqJHg5OeGLwAK4uP776WC96zWxyAjUItIvajP8hDnjrTKJWaBT5jL+3 rE7wPy9DdvpuVXKQp7xQXxQAmrAqIxH4kNUXU86rNrAYZVFIo2+4eBCBa 8exD9qZ5QOs9lklXffjSTJJJZhu/XkDESVp3M723hN+d5c5Viv9zPxGcE w==; X-CSE-ConnectionGUID: X8NmGpa8RaSODmgDKbb8qw== X-CSE-MsgGUID: jGjSrb5sSz6gaAEGygVR1w== X-IronPort-AV: E=McAfee;i="6700,10204,11144"; a="19575412" X-IronPort-AV: E=Sophos;i="6.09,238,1716274800"; d="scan'208";a="19575412" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2024 03:28:59 -0700 X-CSE-ConnectionGUID: R7iKY0OcRJ6h3ae1SK6ohw== X-CSE-MsgGUID: OX1xZQ/qRtOgLIGVvJE8vw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,238,1716274800"; d="scan'208";a="53146335" Received: from intel-lenovo-legion-y540-15irh-pg0.iind.intel.com ([10.224.186.95]) by orviesa010.jf.intel.com with ESMTP; 26 Jul 2024 03:28:57 -0700 From: Kiran K To: linux-bluetooth@vger.kernel.org Cc: ravishankar.srivatsa@intel.com, chethan.tumkur.narayan@intel.com, chandrashekar.devegowda@intel.com, Kiran K Subject: [PATCH v1 1/3] Bluetooth: Add a helper function to extract iso header Date: Fri, 26 Jul 2024 16:13:24 +0530 Message-Id: <20240726104326.459668-1-kiran.k@intel.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add a helper function hci_iso_hdr() to extract iso header from skb. Signed-off-by: Kiran K --- include/net/bluetooth/hci.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index e372a88e8c3f..ace5d210af38 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h @@ -2898,6 +2898,11 @@ static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) return (struct hci_sco_hdr *) skb->data; } +static inline struct hci_iso_hdr *hci_iso_hdr(const struct sk_buff *skb) +{ + return (struct hci_iso_hdr *)skb->data; +} + /* Command opcode pack/unpack */ #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10))) #define hci_opcode_ogf(op) (op >> 10) From patchwork Fri Jul 26 10:43:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "K, Kiran" X-Patchwork-Id: 814792 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1C7C17920C for ; Fri, 26 Jul 2024 10:29:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721989745; cv=none; b=HP2mmYEUY8bwAo+LNDVHYif4utL7OwMhgE5tHt1LRIk+x9t7d/uGqvQ9SNesvwyy/lG6cfq1SIlagNP/Jl0TSArFXc5aj2AUQbzrvhjOg6ebz0Uua4boxHQRQ4cIsnNRY6YE8LxbxMHJAcCA1/WMCf1lrdmkAyuBDYcrgqCfAs0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721989745; c=relaxed/simple; bh=j1qwJSx6p/LG5LI0UGfU+grmrYpHECObcu3Y9ArejE4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RG8MFli0XFLfDpW9pANAcy7Qhc9fUEjV3ci2UtTHE8Fgc17yJlXE8qUupD/OTj4GvNTyTenlsGzQskmWZ0CWrA5FKGMmWKDQPzPA2y+BxvJpb26472tJ+s7za9zLBDNlbWekLFh2ZPkRDPc48vFZyYBMAxXO1jNoR9FhiIIII80= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=e3G5cNh+; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="e3G5cNh+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721989743; x=1753525743; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=j1qwJSx6p/LG5LI0UGfU+grmrYpHECObcu3Y9ArejE4=; b=e3G5cNh+wPuhwhJfxDj4CsV9vJorLcsYQzRkxrqloWoLyFrkwsdqi/G8 qU4Cj7Y6izw4SEWAkxH9ZVfAmOKNwEzZkym7SN/C7ZaC+3eJA6RMvYWO5 ahpR+sVTBwFXKfimve2XbjGtOuR7Aj6e7ocWm/O1/ro//zAmyEOYKkjqj yaald0riYwDiuzTMMSahZiLH3vinNgv/QGrQzGinvsgruWmIZoGusRf4w MYwqXRlZofeJ5z6RXKtMQnVjlM3JUxA76g/K6eJFghbNCpCRWKZCimzGE V8Y9eKXNIngO8VzXQVI02bwxZNmGDIF3v+C71JOPTefVHu+hH3fFiT17r g==; X-CSE-ConnectionGUID: kxwvK9gCSXSPz4TaDB3TCg== X-CSE-MsgGUID: BwzvSv+xQLibKln701Yvvg== X-IronPort-AV: E=McAfee;i="6700,10204,11144"; a="19575417" X-IronPort-AV: E=Sophos;i="6.09,238,1716274800"; d="scan'208";a="19575417" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2024 03:29:01 -0700 X-CSE-ConnectionGUID: TQF7D35vTKqTINO80TY1bg== X-CSE-MsgGUID: dhwXXznUTYmwaKYgwfIhyQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,238,1716274800"; d="scan'208";a="53146352" Received: from intel-lenovo-legion-y540-15irh-pg0.iind.intel.com ([10.224.186.95]) by orviesa010.jf.intel.com with ESMTP; 26 Jul 2024 03:28:59 -0700 From: Kiran K To: linux-bluetooth@vger.kernel.org Cc: ravishankar.srivatsa@intel.com, chethan.tumkur.narayan@intel.com, chandrashekar.devegowda@intel.com, Kiran K Subject: [PATCH v1 2/3] Bluetooth: Add tx/rx counters to track iso packets Date: Fri, 26 Jul 2024 16:13:25 +0530 Message-Id: <20240726104326.459668-2-kiran.k@intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240726104326.459668-1-kiran.k@intel.com> References: <20240726104326.459668-1-kiran.k@intel.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add counters in hci_dev_stats to track iso tx and rx packets. Signed-off-by: Kiran K --- include/net/bluetooth/hci_sock.h | 2 ++ net/bluetooth/hci_core.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/net/bluetooth/hci_sock.h b/include/net/bluetooth/hci_sock.h index 13e8cd4414a1..98991a11844a 100644 --- a/include/net/bluetooth/hci_sock.h +++ b/include/net/bluetooth/hci_sock.h @@ -101,6 +101,8 @@ struct hci_dev_stats { __u32 acl_rx; __u32 sco_tx; __u32 sco_rx; + __u32 iso_tx; + __u32 iso_rx; __u32 byte_rx; __u32 byte_tx; }; diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 8a4ebd93adfc..b0d40b62238b 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3858,6 +3858,8 @@ static void hci_isodata_packet(struct hci_dev *hdev, struct sk_buff *skb) bt_dev_dbg(hdev, "len %d handle 0x%4.4x flags 0x%4.4x", skb->len, handle, flags); + hdev->stat.iso_rx++; + hci_dev_lock(hdev); conn = hci_conn_hash_lookup_handle(hdev, handle); hci_dev_unlock(hdev); From patchwork Fri Jul 26 10:43:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "K, Kiran" X-Patchwork-Id: 814644 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61D87148FED for ; Fri, 26 Jul 2024 10:29:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721989746; cv=none; b=fRzVUmitYSQMdBpKI3oRB1//GpN8Xb0PlXPRgB/jwJyjklK9i23NGgMxdb6/pl290UQmdCYKBpksyZE/4llmd76yo66B5amaOC2zMN3ycKLf81qD5QoDajjKs2nzpvB6XDW4wj+Gle7WqAL+LgJsypVJPx3+3MfJuw4Q/ng48E4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721989746; c=relaxed/simple; bh=A2hjOcOR8cXTmtGO5rrYPKr3Bik9Fmc0q+1ucHYFj9E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gZUx2+FWuiCk01ax6ashE6iohJTV+9vbvLnvLvC5gilW1MWohe0K6DQVCQGfENcURuLTlqZmlXE+sybu15x28k67OwHHvLJflkaek7b4sFMbEg+U7JKY/YJQ9ELp7XBGvlAeiOTv1EmastcYU1ssvcEPJB5fbUqZxgTi/3eQWQ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=FHtTC3yo; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FHtTC3yo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721989744; x=1753525744; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=A2hjOcOR8cXTmtGO5rrYPKr3Bik9Fmc0q+1ucHYFj9E=; b=FHtTC3yo2ysQ3vV1NPajlyA4MURjfRVFFZvqZBWm7MypodxxgQBgXoWB HWYOL4k0RffU5K563IKS3Yx+sc+CfNO3ljtwRRTkdxNjPwELafLfncF16 vadNgBaBJOAe2QmSlC4fPz7Gcr8Uo2CBDFwcYMg/dRz3a++NP9GW6+ndo ihYVbNDEXEPO2Dghuai5ZVsPND0BGrwjFVaOAohjxnbOZv7HRc8KPyBs9 y1f6Rw57C7La6quR5vWSyHBpX/l1OdvgkDZvZaYn5JcMQL1xdtMZ+167L +rMO0Q/2T/iEr3pmkaYA4LYKbtvhX4sbcOLZC0U7yIR1396OhOR39egkA Q==; X-CSE-ConnectionGUID: LB4pvmDuRPCbCm8fPJt4Hg== X-CSE-MsgGUID: mG5GDIv2R7yGYyXKKJgITA== X-IronPort-AV: E=McAfee;i="6700,10204,11144"; a="19575422" X-IronPort-AV: E=Sophos;i="6.09,238,1716274800"; d="scan'208";a="19575422" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2024 03:29:03 -0700 X-CSE-ConnectionGUID: bvyaian3S2myAiwlW82FUQ== X-CSE-MsgGUID: javLJVjVTf2FxwO1CKHYHg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,238,1716274800"; d="scan'208";a="53146372" Received: from intel-lenovo-legion-y540-15irh-pg0.iind.intel.com ([10.224.186.95]) by orviesa010.jf.intel.com with ESMTP; 26 Jul 2024 03:29:02 -0700 From: Kiran K To: linux-bluetooth@vger.kernel.org Cc: ravishankar.srivatsa@intel.com, chethan.tumkur.narayan@intel.com, chandrashekar.devegowda@intel.com, Kiran Subject: [PATCH v1 3/3] Bluetooth: btintel_pcie: Add support for ISO data Date: Fri, 26 Jul 2024 16:13:26 +0530 Message-Id: <20240726104326.459668-3-kiran.k@intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240726104326.459668-1-kiran.k@intel.com> References: <20240726104326.459668-1-kiran.k@intel.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Kiran Add support for handling ISO RX and TX packets. Signed-off-by: Kiran --- drivers/bluetooth/btintel_pcie.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c index 0d1a0415557b..8a5b5bce0a7d 100644 --- a/drivers/bluetooth/btintel_pcie.c +++ b/drivers/bluetooth/btintel_pcie.c @@ -46,6 +46,7 @@ MODULE_DEVICE_TABLE(pci, btintel_pcie_table); #define BTINTEL_PCIE_HCI_ACL_PKT 0x00000002 #define BTINTEL_PCIE_HCI_SCO_PKT 0x00000003 #define BTINTEL_PCIE_HCI_EVT_PKT 0x00000004 +#define BTINTEL_PCIE_HCI_ISO_PKT 0x00000005 static inline void ipc_print_ia_ring(struct hci_dev *hdev, struct ia *ia, u16 queue_num) @@ -423,6 +424,18 @@ static int btintel_pcie_recv_frame(struct btintel_pcie_data *data, goto exit_error; } break; + + case BTINTEL_PCIE_HCI_ISO_PKT: + if (skb->len >= HCI_ISO_HDR_SIZE) { + plen = HCI_ISO_HDR_SIZE + __le16_to_cpu(hci_iso_hdr(skb)->dlen); + pkt_type = HCI_ISODATA_PKT; + } else { + bt_dev_err(hdev, "ISO packet is too short"); + ret = -EILSEQ; + goto exit_error; + } + break; + default: bt_dev_err(hdev, "Invalid packet type received: 0x%4.4x", pcie_pkt_type); @@ -1082,6 +1095,10 @@ static int btintel_pcie_send_frame(struct hci_dev *hdev, type = BTINTEL_PCIE_HCI_SCO_PKT; hdev->stat.sco_tx++; break; + case HCI_ISODATA_PKT: + type = BTINTEL_PCIE_HCI_ISO_PKT; + hdev->stat.iso_tx++; + break; default: bt_dev_err(hdev, "Unknown HCI packet type"); return -EILSEQ;