120 lines
4.3 KiB
C
Executable File
120 lines
4.3 KiB
C
Executable File
/****************************************************************************
|
|
|
|
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_SPG_INTERNAL_H
|
|
#define CVG_NWM_STA_SPG_INTERNAL_H
|
|
|
|
#include "iot_config.h"
|
|
#include "cvg_nwm_internal.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
|
|
#if SUPPORT_SOUTHERN_POWER_GRID && PLC_SUPPORT_STA_ROLE
|
|
|
|
/**
|
|
* @brief cvg_nwm_init_sta_vdev_spg() - init station vdev for spg private part.
|
|
* @param nwm: -- nwm vdev pointer.
|
|
* @retval: ERR_OK - for success case
|
|
* @retval: otherwise - error code
|
|
*/
|
|
uint32_t cvg_nwm_init_sta_vdev_spg(cvg_nwm_vdev_t *nwm, cvg_vdev_cfg_t *cfg);
|
|
|
|
/**
|
|
* @brief cvg_nwm_init_sta_vdev_spg() - deinit station vdev for spg private
|
|
* part.
|
|
* @param nwm: -- nwm vdev pointer
|
|
*/
|
|
void cvg_nwm_deinit_sta_vdev_spg(cvg_nwm_vdev_t *nwm);
|
|
|
|
/**
|
|
* @brief cvg_nwm_init_sta_vdev_spg() - reset station vdev for spg private part.
|
|
* @param nwm: -- nwm vdev pointer
|
|
* @param cfg: -- vdev cfg pointer
|
|
*/
|
|
void __cvg_nwm_reset_sta_vdev_spg(cvg_nwm_vdev_t *nwm, cvg_vdev_cfg_t *cfg);
|
|
|
|
/**
|
|
* @brief cvg_nwm_sta_send_proxy_change_spg() - sta send proxy change.
|
|
* @param nwm: nwm vdev pointer
|
|
* @param cand: cand array
|
|
* @param cnt: number of valid tei in the array
|
|
* @param reason: roaming reason. see PROXY_CHANGE_XXX
|
|
*/
|
|
void cvg_nwm_sta_send_proxy_change_spg(cvg_nwm_vdev_t *nwm,
|
|
pco_link_info_t cand[], uint32_t cnt, uint8_t reason);
|
|
|
|
/**
|
|
* @brief cvg_nwm_sta_send_nw_conflict_spg() - 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_spg(cvg_nwm_vdev_t *nwm, uint8_t *cco_addr);
|
|
|
|
/**
|
|
* @brief cvg_nwm_sta_msdu_fwd_broadcast_spg() - forward a broadcast msdu
|
|
* @param nwm: nwm vdev pointer
|
|
* @param buf: iot packet to be forwarded
|
|
* @param mac: pointer to mac header of the packet
|
|
*/
|
|
void cvg_nwm_sta_msdu_fwd_broadcast_spg(cvg_nwm_vdev_t *nwm, iot_pkt_t *buf,
|
|
spg_mac_header_t *mac);
|
|
|
|
/**
|
|
* @brief cvg_nwm_sta_msdu_fwd_broadcast_ext_spg() - forward a broadcast msdu
|
|
* @param nwm: nwm vdev pointer
|
|
* @param 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_spg(cvg_nwm_vdev_t *nwm, iot_pkt_t *buf,
|
|
spg_mac_header_t *mac, uint8_t is_dbg_pkt);
|
|
|
|
#else /* SUPPORT_SOUTHERN_POWER_GRID && PLC_SUPPORT_STA_ROLE */
|
|
|
|
#define cvg_nwm_sta_send_proxy_change_spg(nwm, cand, cnt, reason)
|
|
|
|
#define cvg_nwm_sta_send_nw_conflict_spg(nwm, cco_addr)
|
|
|
|
#define cvg_nwm_init_sta_vdev_spg(nwm, cfg) (ERR_NOSUPP)
|
|
|
|
#define cvg_nwm_deinit_sta_vdev_spg(nwm)
|
|
|
|
#define __cvg_nwm_reset_sta_vdev_spg(nwm, cfg)
|
|
|
|
#define cvg_nwm_sta_msdu_fwd_broadcast_spg(nwm, buf, mac) \
|
|
do { \
|
|
(void)nwm; \
|
|
(iot_pkt_free(buf)); \
|
|
} while (0)
|
|
|
|
#define cvg_nwm_sta_msdu_fwd_broadcast_ext_spg(nwm, buf, mac, is_dbg_pkt) \
|
|
do { \
|
|
(void)nwm; \
|
|
(iot_pkt_free(buf)); \
|
|
} while (0)
|
|
|
|
#endif /* SUPPORT_SOUTHERN_POWER_GRID && PLC_SUPPORT_STA_ROLE */
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* CVG_NWM_STA_SPG_INTERNAL_H */
|