1 /******************************************************************************
3 * Copyright (c) 2021 Intel.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 *******************************************************************************/
21 * This file consist of implementation of FAPI CONFIG.response message.
25 #include "nr5g_fapi_framework.h"
26 #include "nr5g_fapi_fapi2mac_api.h"
27 #include "nr5g_fapi_fapi2mac_p5_proc.h"
28 #include "nr5g_fapi_internal.h"
30 /** @ingroup group_source_api_p5_fapi2mac_proc
32 * @param[in] p_phy_instance Pointer to PHY instance.
33 * @param[in] p_fapi_resp Pointer to IAPI CONFIG.response message structure.
34 * @return Returns ::SUCCESS and ::FAILURE.
37 * This Message is the FAPI Message Header.
40 uint8_t nr5g_fapi_message_header(
41 p_nr5g_fapi_phy_ctx_t p_phy_ctx,
46 for (phy_id = 0; phy_id < FAPI_MAX_PHY_INSTANCES; phy_id++) {
47 if ((FAPI_STATE_CONFIGURED == p_phy_ctx->phy_instance[phy_id].state) ||
48 (FAPI_STATE_RUNNING == p_phy_ctx->phy_instance[phy_id].state)) {
49 nr5g_fapi_message_header_per_phy(phy_id, is_urllc);
56 /** @ingroup group_source_api_p5_fapi2mac_proc
58 * @param[in] p_phy_instance Pointer to PHY instance.
59 * @param[in] p_fapi_resp Pointer to IAPI CONFIG.response message structure.
60 * @return Returns ::SUCCESS and ::FAILURE.
63 * This Message is the FAPI Message Header.
66 uint8_t nr5g_fapi_message_header_per_phy(
70 p_fapi_api_queue_elem_t p_list_elem = NULL;
71 p_fapi_msg_header_t p_fapi_msg_hdr = NULL;
74 nr5g_fapi_fapi2mac_create_api_list_elem(FAPI_VENDOR_MSG_HEADER_IND, 1,
75 sizeof(fapi_msg_header_t));
77 NR5G_FAPI_LOG(ERROR_LOG, ("[FAPI MSG HDR] Unable to create "
78 "list element. Out of memory!!!"));
82 p_fapi_msg_hdr = (fapi_msg_header_t *) (p_list_elem + 1);
83 p_fapi_msg_hdr->num_msg = 0;
84 p_fapi_msg_hdr->handle = phy_id;
86 // Add element to send list
87 nr5g_fapi_fapi2mac_add_api_to_list(phy_id, p_list_elem, is_urllc);
88 NR5G_FAPI_LOG(DEBUG_LOG,
89 ("[FAPI MSG HDR] FAPI Message Header Added for PHY: %d", phy_id));