From 7176f39c2acab3fc30597c3a081dc2c223f7c472 Mon Sep 17 00:00:00 2001 From: Josh Conner Date: Fri, 23 Aug 2024 19:44:04 +0000 Subject: [PATCH] pw_bluetooth_sapphire: Use packet header definitions from Emboss MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace uses of EventHeader and ACLDataHeader with definitions from Emboss. Bug: 42167863 Test: fx test //src/connectivity/bluetooth/core/bt-host Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1097113 GitOrigin-RevId: 6efc50f64607c9432c4bfd2e63503e698104baca Change-Id: Id373bb06d76fc22493dc1ce2a2815cf0001f31ab Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/230556 Reviewed-by: Lulu Wang Commit-Queue: Jason Graffius Lint: Lint 🤖 --- .../internal/host/transport/slab_allocators.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/transport/slab_allocators.h b/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/transport/slab_allocators.h index d35bc8e8d9..6788dea4ec 100644 --- a/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/transport/slab_allocators.h +++ b/pw_bluetooth_sapphire/public/pw_bluetooth_sapphire/internal/host/transport/slab_allocators.h @@ -13,6 +13,9 @@ // the License. #pragma once +#include +#include + #include #include "pw_bluetooth_sapphire/internal/host/common/macros.h" @@ -35,26 +38,30 @@ constexpr size_t kMaxNumSlabs = 100; // The largest possible control packet size. constexpr size_t kMaxEventPayloadSize = hci_spec::kMaxEventPacketPayloadSize; constexpr size_t kMaxEventPacketSize = - sizeof(hci_spec::EventHeader) + kMaxEventPayloadSize; + pw::bluetooth::emboss::EventHeader::IntrinsicSizeInBytes() + + kMaxEventPayloadSize; constexpr size_t kMaxNumEventPackets = kMaxControlSlabSize / kMaxEventPacketSize; // Large, medium, and small buffer sizes for ACL data packets. constexpr size_t kLargeACLDataPayloadSize = hci_spec::kMaxACLPayloadSize; constexpr size_t kLargeACLDataPacketSize = - sizeof(hci_spec::ACLDataHeader) + kLargeACLDataPayloadSize; + pw::bluetooth::emboss::AclDataFrameHeader::IntrinsicSizeInBytes() + + kLargeACLDataPayloadSize; constexpr size_t kNumLargeACLDataPackets = kMaxACLSlabSize / kLargeACLDataPacketSize; constexpr size_t kMediumACLDataPayloadSize = 256; constexpr size_t kMediumACLDataPacketSize = - sizeof(hci_spec::ACLDataHeader) + kMediumACLDataPayloadSize; + pw::bluetooth::emboss::AclDataFrameHeader::IntrinsicSizeInBytes() + + kMediumACLDataPayloadSize; constexpr size_t kNumMediumACLDataPackets = kMaxACLSlabSize / kMediumACLDataPacketSize; constexpr size_t kSmallACLDataPayloadSize = 64; constexpr size_t kSmallACLDataPacketSize = - sizeof(hci_spec::ACLDataHeader) + kSmallACLDataPayloadSize; + pw::bluetooth::emboss::AclDataFrameHeader::IntrinsicSizeInBytes() + + kSmallACLDataPayloadSize; constexpr size_t kNumSmallACLDataPackets = kMaxACLSlabSize / kSmallACLDataPacketSize;