• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <cstdint>
20 
21 /**
22  * Parameters for a direction of packet flow in an LE L2CAP COC socket.
23  */
24 struct L2capCocConfig {
25   //! Channel identifier of the endpoint.
26   uint16_t cid;
27 
28   //! Maximum Transmission Unit.
29   uint16_t mtu;
30 
31   //! Maximum PDU payload Size.
32   uint16_t mps;
33 
34   //! Currently available credits for sending or receiving K-frames in LE
35   //! Credit Based Flow Control mode.
36   uint16_t credits;
37 };
38 
39 /**
40  * Data for the offloaded LE L2CAP COC socket.
41  */
42 struct BleL2capCocSocketData {
43   //! Unique identifier for this socket connection. This ID in the offload
44   //! domain matches the ID used on the host side. It is valid only while the
45   //! socket is connected.
46   uint64_t socketId;
47 
48   //! The ID of the Hub endpoint for hardware offload data path.
49   uint64_t endpointId;
50 
51   //! ACL connection handle for the socket.
52   uint16_t connectionHandle;
53 
54   //! The originating or destination client ID on the host side, used to direct
55   //! responses only to the client that sent the request.
56   uint16_t hostClientId;
57 
58   L2capCocConfig rxConfig;
59 
60   L2capCocConfig txConfig;
61 };
62