175 lines
6.7 KiB
C
175 lines
6.7 KiB
C
/*
|
|
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
* this work for additional information regarding copyright ownership.
|
|
* The OpenAirInterface Software Alliance licenses this file to You under
|
|
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
|
* except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.openairinterface.org/?page_id=698
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*-------------------------------------------------------------------------------
|
|
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
|
* contact@openairinterface.org
|
|
*/
|
|
|
|
/**
|
|
* @file antenna-control-mplane.h
|
|
* @brief O-RAN WG4 M-Plane compliant antenna control via NETCONF
|
|
*
|
|
* This module implements the MPLANE-TRX-CONTROL feature as defined in
|
|
* O-RAN WG4 M-Plane specification and o-ran-uplane-conf.yang model.
|
|
*
|
|
* YANG paths used:
|
|
* /o-ran-uplane-conf:user-plane-configuration/tx-array-antenna-mask-config
|
|
* /o-ran-uplane-conf:user-plane-configuration/rx-array-antenna-mask-config
|
|
*
|
|
* References:
|
|
* - O-RAN.WG4.MP.0-v10.00 Section 20.3.2 (M-Plane based TRX control)
|
|
* - o-ran-uplane-conf.yang (grouping array-config-group)
|
|
* - o-ran-wg4-features.yang (MPLANE-TRX-CONTROL feature)
|
|
*/
|
|
|
|
#ifndef ANTENNA_CONTROL_MPLANE_H
|
|
#define ANTENNA_CONTROL_MPLANE_H
|
|
|
|
#include "ru-mplane-api.h"
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* @brief O-RAN antenna mask configuration result
|
|
*/
|
|
typedef enum {
|
|
ANTENNA_CTRL_SUCCESS = 0,
|
|
ANTENNA_CTRL_ERR_NO_SESSION,
|
|
ANTENNA_CTRL_ERR_FEATURE_NOT_SUPPORTED,
|
|
ANTENNA_CTRL_ERR_INVALID_ARRAY_NAME,
|
|
ANTENNA_CTRL_ERR_INVALID_MASK,
|
|
ANTENNA_CTRL_ERR_NETCONF_FAILED,
|
|
ANTENNA_CTRL_ERR_VALIDATION_FAILED,
|
|
ANTENNA_CTRL_ERR_COMMIT_FAILED
|
|
} antenna_ctrl_result_t;
|
|
|
|
/**
|
|
* @brief Convert result code to string description
|
|
*/
|
|
const char *antenna_ctrl_result_str(antenna_ctrl_result_t result);
|
|
|
|
/**
|
|
* @brief Set TX antenna bitmask via NETCONF O1 interface
|
|
*
|
|
* Implements O-RAN WG4 MPLANE-TRX-CONTROL feature by sending
|
|
* NETCONF edit-config RPC to configure tx-array-antenna-mask-config.
|
|
*
|
|
* The operation sequence is:
|
|
* 1. Create XML configuration for o-ran-uplane-conf:tx-array-antenna-mask-config
|
|
* 2. Send NETCONF <edit-config> to candidate datastore
|
|
* 3. Send NETCONF <validate>
|
|
* 4. Send NETCONF <commit>
|
|
*
|
|
* @param ru_session Active NETCONF session to the RU
|
|
* @param array_name O-RAN TX array name (e.g., from tx-arrays list)
|
|
* @param antenna_bitmask Bitmask where bit N = 1 means antenna N is active
|
|
* @param num_antennas Number of antennas in the array
|
|
* @return Result code indicating success or specific error
|
|
*/
|
|
antenna_ctrl_result_t mplane_set_tx_antenna_mask(ru_session_t *ru_session,
|
|
const char *array_name,
|
|
uint8_t antenna_bitmask,
|
|
uint8_t num_antennas);
|
|
|
|
/**
|
|
* @brief Set RX antenna bitmask via NETCONF O1 interface
|
|
*
|
|
* Same as mplane_set_tx_antenna_mask but for RX arrays.
|
|
* Configures rx-array-antenna-mask-config in o-ran-uplane-conf.
|
|
*
|
|
* @param ru_session Active NETCONF session to the RU
|
|
* @param array_name O-RAN RX array name (e.g., from rx-arrays list)
|
|
* @param antenna_bitmask Bitmask where bit N = 1 means antenna N is active
|
|
* @param num_antennas Number of antennas in the array
|
|
* @return Result code indicating success or specific error
|
|
*/
|
|
antenna_ctrl_result_t mplane_set_rx_antenna_mask(ru_session_t *ru_session,
|
|
const char *array_name,
|
|
uint8_t antenna_bitmask,
|
|
uint8_t num_antennas);
|
|
|
|
/**
|
|
* @brief Get current TX antenna mask from RU via NETCONF
|
|
*
|
|
* Sends NETCONF <get> RPC to retrieve current tx-array-antenna-mask-config.
|
|
*
|
|
* @param ru_session Active NETCONF session to the RU
|
|
* @param array_name O-RAN TX array name
|
|
* @param antenna_bitmask Output: current antenna bitmask
|
|
* @return Result code indicating success or specific error
|
|
*/
|
|
antenna_ctrl_result_t mplane_get_tx_antenna_mask(ru_session_t *ru_session,
|
|
const char *array_name,
|
|
uint8_t *antenna_bitmask);
|
|
|
|
/**
|
|
* @brief Get current RX antenna mask from RU via NETCONF
|
|
*
|
|
* Sends NETCONF <get> RPC to retrieve current rx-array-antenna-mask-config.
|
|
*
|
|
* @param ru_session Active NETCONF session to the RU
|
|
* @param array_name O-RAN RX array name
|
|
* @param antenna_bitmask Output: current antenna bitmask
|
|
* @return Result code indicating success or specific error
|
|
*/
|
|
antenna_ctrl_result_t mplane_get_rx_antenna_mask(ru_session_t *ru_session,
|
|
const char *array_name,
|
|
uint8_t *antenna_bitmask);
|
|
|
|
/**
|
|
* @brief Check if RU supports MPLANE-TRX-CONTROL feature
|
|
*
|
|
* Queries the RU capabilities to verify MPLANE-TRX-CONTROL feature
|
|
* is advertised (defined in o-ran-wg4-features.yang).
|
|
*
|
|
* @param ru_session Active NETCONF session to the RU
|
|
* @return true if feature is supported, false otherwise
|
|
*/
|
|
bool mplane_supports_trx_control(ru_session_t *ru_session);
|
|
|
|
/**
|
|
* @brief Create antenna bitmask XML content for NETCONF edit-config
|
|
*
|
|
* Helper function to generate O-RAN compliant XML for antenna mask configuration.
|
|
* Uses libyang to create proper o-ran-uplane-conf structure.
|
|
*
|
|
* @param ru_session Active NETCONF session (for libyang context)
|
|
* @param is_tx true for TX array, false for RX array
|
|
* @param array_name O-RAN array name
|
|
* @param antenna_bitmask Antenna bitmask value
|
|
* @param num_antennas Number of antennas (for binary encoding)
|
|
* @param xml_content Output: allocated XML string (caller must free)
|
|
* @return true on success, false on error
|
|
*/
|
|
bool mplane_create_antenna_mask_xml(ru_session_t *ru_session,
|
|
bool is_tx,
|
|
const char *array_name,
|
|
uint8_t antenna_bitmask,
|
|
uint8_t num_antennas,
|
|
char **xml_content);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* ANTENNA_CONTROL_MPLANE_H */
|
|
|