138 lines
4.6 KiB
C
Executable File
138 lines
4.6 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_CCO_SPG_INTERNAL_H
|
|
#define CVG_NWM_CCO_SPG_INTERNAL_H
|
|
|
|
#include "cvg_nwm_internal.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#if (SUPPORT_SOUTHERN_POWER_GRID) && (PLC_SUPPORT_CCO_ROLE)
|
|
|
|
/*
|
|
* @brief cvg_nwm_init_cco_vdev_spg() - nwm cco vdev init function
|
|
* @param: nwm -- nwm vdev pointer
|
|
* @param: cfg -- pointer of vdev configuration
|
|
*
|
|
* @return 0 - for success case
|
|
* @return otherwise - error code
|
|
*/
|
|
uint32_t cvg_nwm_init_cco_vdev_spg(cvg_nwm_vdev_t *nwm, cvg_vdev_cfg_t *cfg);
|
|
|
|
/*
|
|
* @brief cvg_nwm_deinit_cco_vdev_spg() - deinit cco vdev
|
|
* @param: nwm -- nwm vdev pointer
|
|
*/
|
|
void cvg_nwm_deinit_cco_vdev_spg(cvg_nwm_vdev_t *nwm);
|
|
|
|
/*
|
|
* @brief cvg_nwm_reset_cco_vdev_spg() - nwm cco vdev reset function
|
|
* @param: nwm -- nwm vdev pointer
|
|
* @param: cfg -- pointer of vdev configuration
|
|
*/
|
|
void cvg_nwm_reset_cco_vdev_spg(cvg_nwm_vdev_t *nwm, cvg_vdev_cfg_t *cfg);
|
|
|
|
/*
|
|
* @brief cvg_nwm_cco_update_bc_sg() - update the bc template to mac layer
|
|
as the private part of spg.
|
|
* @param: nwm -- nwm vdev pointer
|
|
* @param: ent -- pointer to update command entry
|
|
* @return ERR_OK - for success case
|
|
* @return otherwise - error code
|
|
*/
|
|
uint32_t cvg_nwm_cco_update_bc_spg(cvg_nwm_vdev_t *nwm, mac_bc_update_t *ent);
|
|
|
|
/*
|
|
* @brief cvg_nwm_cco_send_assoc_gather_ind_spg() - send assoc gather ind MME.
|
|
* @param: nwm -- nwm vdev pointer
|
|
* @param: is_rf -- flag to mark if send to rf link
|
|
*/
|
|
void cvg_nwm_cco_send_assoc_gather_ind_spg(cvg_nwm_vdev_t *nwm, uint8_t is_rf);
|
|
|
|
/*
|
|
* @brief cvg_nwm_cco_kickout_peer_spg() - kick out peer.
|
|
* @param nwm: pointer to nwm
|
|
* @param cnt count of kickout peer list
|
|
* @param peer kickout peer list
|
|
* @param reason kickout reason
|
|
*/
|
|
void cvg_nwm_cco_kickout_peer_spg(cvg_nwm_vdev_t *nwm, uint16_t cnt,
|
|
cvg_peer_info_t *peer[], uint16_t reason);
|
|
|
|
/*
|
|
* @brief cvg_nwm_cco_kickout_unknown_peer_spg() - kick out unknown peer.
|
|
* @param nwm: pointer to nwm
|
|
* @param addr kickout peer addr list
|
|
* @param reason kickout reason
|
|
*/
|
|
void cvg_nwm_cco_kickout_unknown_peer_spg(cvg_nwm_vdev_t *nwm, uint16_t cnt,
|
|
uint8_t addr[][IOT_MAC_ADDR_LEN], uint16_t reason);
|
|
|
|
/**
|
|
* @brief calculate max allowed none cco beacon slot count in one beacon
|
|
* period
|
|
* @param vdev: pointer to vdev
|
|
* @param bc_pld_min: flag to mark if CCO device using minimum beacon payload
|
|
* size
|
|
*
|
|
* @return:
|
|
* number of none cco beacon slot allowed
|
|
*/
|
|
uint32_t cvg_nwm_cco_get_non_cco_bc_slot_max_spg(cvg_vdev_t *vdev,
|
|
uint8_t bc_pld_min);
|
|
|
|
/*
|
|
* @brief cvg_nwm_cco_send_zc_ntb_req_spg() - send zc collect request to a peer
|
|
* @param nwm: pointer to nwm
|
|
* @param bcast: flag to mark if broacast send
|
|
* @param peer: pointer to peer
|
|
* @param cnt: zc collect count
|
|
* @param period: collecting period. see MME_ZC_CP_XXX
|
|
*/
|
|
void cvg_nwm_cco_send_zc_ntb_req_spg(cvg_nwm_vdev_t *nwm, uint8_t bcast,
|
|
cvg_peer_info_t *peer, uint8_t cnt, uint8_t period);
|
|
|
|
#else /* SUPPORT_SOUTHERN_POWER_GRID && PLC_SUPPORT_CCO_ROLE */
|
|
|
|
#define cvg_nwm_init_cco_vdev_spg(nwm, cfg) (ERR_NOSUPP)
|
|
|
|
#define cvg_nwm_deinit_cco_vdev_spg(nwm)
|
|
|
|
#define cvg_nwm_reset_cco_vdev_spg(nwm, cfg)
|
|
|
|
#define cvg_nwm_cco_update_bc_spg(nwm, ent) (ERR_NOSUPP)
|
|
|
|
#define cvg_nwm_cco_kickout_peer_spg(nwm, cnt, peer, reason)
|
|
|
|
#define cvg_nwm_cco_send_assoc_gather_ind_spg(nwm, is_rf)
|
|
|
|
#define cvg_nwm_cco_kickout_unknown_peer_spg(nwm, cnt, addr, reason)
|
|
|
|
#define cvg_nwm_cco_get_non_cco_bc_slot_max_spg(vdev, bc_pld_min) (0)
|
|
|
|
#define cvg_nwm_cco_send_zc_ntb_req_spg(nwm, bcast, peer, cnt, period)
|
|
|
|
#endif /* SUPPORT_SOUTHERN_POWER_GRID && PLC_SUPPORT_CCO_ROLE */
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* CVG_NWM_CCO_SPG_INTERNAL_H */
|