Files
kunlun/plc/cvg/nwm/inc/cvg_nwm_sta_sg_internal.h
2024-09-28 14:24:04 +08:00

133 lines
4.6 KiB
C

/****************************************************************************
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
be copied by any method or incorporated into another program without
the express written consent of Aerospace C.Power. This Information or any portion
thereof remains the property of Aerospace C.Power. The Information contained herein
is believed to be accurate and Aerospace C.Power assumes no responsibility or
liability for its use in any way and conveys no license or title under
any patent or copyright and makes no representation or warranty that this
Information is free from patent or copyright infringement.
****************************************************************************/
#ifndef CVG_NWM_STA_SG_INTERNAL_H
#define CVG_NWM_STA_SG_INTERNAL_H
/* cvg module internal includes */
#include "cvg_nwm_internal.h"
#ifdef __cplusplus
extern "C" {
#endif
#if PLC_SUPPORT_STA_ROLE && SUPPORT_SMART_GRID
/**
* @brief cvg_nwm_init_sta_vdev_spg() - init station vdev for sg private part.
* @param nwm: -- nwm vdev pointer.
* @retval: ERR_OK - for success case
* @retval: otherwise - error code
*/
uint32_t cvg_nwm_init_sta_vdev_sg(cvg_nwm_vdev_t *nwm, cvg_vdev_cfg_t *cfg);
/**
* @brief cvg_nwm_init_sta_vdev_spg() - deinit station vdev for sg private
* part.
* @param nwm: -- nwm vdev pointer
*/
void cvg_nwm_deinit_sta_vdev_sg(cvg_nwm_vdev_t *nwm);
/**
* @brief cvg_nwm_init_sta_vdev_spg() - reset station vdev for sg private part.
* @param nwm: -- nwm vdev pointer
* @param cfg: -- vdev cfg pointer
*/
void __cvg_nwm_reset_sta_vdev_sg(cvg_nwm_vdev_t *nwm, cvg_vdev_cfg_t *cfg);
/**
* @brief cvg_nwm_sta_msdu_fwd_broadcast() - forward a broadcast msdu
* @param nwm: nwm vdev pointer
* @param sof_buf: iot packet to be forwarded
* @param mac: pointer to mac header of the packet
*/
void cvg_nwm_sta_msdu_fwd_broadcast(cvg_nwm_vdev_t *nwm,
cvg_rx_sof_buf_t *sof_buf);
/**
* @brief cvg_nwm_sta_msdu_fwd_broadcast_ext() - forward a broadcast msdu
* @param nwm: nwm vdev pointer
* @param sof_buf: iot packet to be forwarded
* @param mac: pointer to mac header of the packet
* @param is_dbg_pkt: whether need send packet in debug packet mode
* 0 - normal mode send, 1 - debug packet mode send
*/
void cvg_nwm_sta_msdu_fwd_broadcast_ext(cvg_nwm_vdev_t *nwm, iot_pkt_t *buf,
mac_header_t *mac, uint8_t is_dbg_pkt);
/**
* @brief cvg_nwm_sta_send_nw_conflict_sg() - sending network conflict message
* @param nwm: - nwm vdev pointer
* @param cco_addr: - network CCO address with current network conflict.
*/
void cvg_nwm_sta_send_nw_conflict_sg(cvg_nwm_vdev_t *nwm, uint8_t *cco_addr);
/**
* @brief cvg_nwm_sta_send_proxy_change() - sta send proxy change.
* @param nwm: nwm vdev pointer
* @param cand: cand proxy list
* @param cnt: number of valid tei in the array
* @param reason: roaming reason. see PROXY_CHANGE_XXX
*/
void cvg_nwm_sta_send_proxy_change(cvg_nwm_vdev_t *nwm, pco_link_info_t cand[],
uint32_t cnt, uint8_t reason);
/**
* @brief cvg_nwm_sta_send_conn_less_config_ack_sg() - send connectionless
* messages - configure ACK.
* @param nwm: nwm vdev pointer
* @param app_id: app id
* @param dst_mac: destination MAC address
* @param band_id: band id which STA working on
*/
void cvg_nwm_sta_send_conn_less_config_ack_sg(cvg_nwm_vdev_t *nwm,
uint8_t app_id, uint8_t *dst_mac, uint8_t band_id);
#else /* PLC_SUPPORT_STA_ROLE && SUPPORT_SMART_GRID */
#define cvg_nwm_init_sta_vdev_sg(nwm, cfg) (ERR_NOSUPP)
#define cvg_nwm_deinit_sta_vdev_sg(nwm)
#define __cvg_nwm_reset_sta_vdev_sg(nwm, cfg)
#define cvg_nwm_sta_msdu_fwd_broadcast(nwm, sof_buf) \
do { \
(void)nwm; \
(cvg_free_rx_sof_buf(sof_buf)); \
} while (0)
#define cvg_nwm_sta_msdu_fwd_broadcast_ext(nwm, buf, mac, is_dbg_pkt) \
do { \
(void)nwm; \
(iot_pkt_free(buf)); \
} while (0)
#define cvg_nwm_sta_send_nw_conflict_sg(nwm, cco_addr)
#define cvg_nwm_sta_send_proxy_change(nwm, cand, cnt, reason)
#define cvg_nwm_sta_send_conn_less_config_ack_sg(nwm, app_id, dst_mac, band_id)
#endif /* PLC_SUPPORT_STA_ROLE && SUPPORT_SMART_GRID */
#ifdef __cplusplus
}
#endif
#endif /* CVG_NWM_STA_SG_INTERNAL_H */