Front Haul Interface Library first seed code contribution
[o-du/phy.git] / fhi_lib / lib / api / xran_transport.h
1 /******************************************************************************
2 *
3 *   Copyright (c) 2019 Intel.
4 *
5 *   Licensed under the Apache License, Version 2.0 (the "License");
6 *   you may not use this file except in compliance with the License.
7 *   You may obtain a copy of the License at
8 *
9 *       http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *   Unless required by applicable law or agreed to in writing, software
12 *   distributed under the License is distributed on an "AS IS" BASIS,
13 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *   See the License for the specific language governing permissions and
15 *   limitations under the License.
16 *
17 *******************************************************************************/
18
19
20 /**
21  * @brief This file provides the definitions for Transport layer (eCPRI) API.
22  *
23  * @file xran_transport.h
24  * @ingroup group_lte_source_xran
25  * @author Intel Corporation
26  *
27  **/
28
29 #ifndef _XRAN_TRANSPORT_H_
30 #define _XRAN_TRANSPORT_H_
31
32 #include <rte_common.h>
33 #include <rte_mbuf.h>
34
35 #include "xran_pkt.h"
36
37 struct xran_eaxc_info {
38     uint8_t cuPortId;
39     uint8_t bandSectorId;
40     uint8_t ccId;
41     uint8_t ruPortId;
42     };
43
44 /**
45  * @brief Compose ecpriRtcid/ecpriPcid
46  *
47  * @param CU_Port_ID CU Port ID
48  * @param BanbSector_ID Band Sector ID
49  * @param CC_ID Component Carrier ID
50  * @param Ant_ID RU Port ID (antenna ID)
51  * @return uint16_t composed ecpriRtcid/ecpriPcid
52  */
53 uint16_t xran_compose_cid(uint8_t CU_Port_ID, uint8_t BandSector_ID, uint8_t CC_ID, uint8_t Ant_ID);
54
55 /**
56  * @brief Decompose ecpriRtcid/ecpriPcid
57  *
58  * @param cid composed ecpriRtcid/ecpriPcid (network byte order)
59  * @param result the pointer of the structure to store decomposed values
60  * @return none
61  */
62 void xran_decompose_cid(uint16_t cid, struct xran_eaxc_info *result);
63
64 /**
65  * @brief modify the payload size of eCPRI header in xRAN packet
66  *
67  * @param mbuf Initialized rte_mbuf packet which has eCPRI header already
68  * @param size payload size to be updated
69  * @return none
70  */
71 void xran_update_ecpri_payload_size(struct rte_mbuf *mbuf, int size);
72
73 #endif
74