158 lines
6.0 KiB
C
Executable File
158 lines
6.0 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_RT_SG_H
|
|
#define CVG_RT_SG_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#if (SUPPORT_SMART_GRID)
|
|
|
|
/*
|
|
* cvg_rt_update_bc() - trigger route module to update beacon template
|
|
* @vdev: pointer to vdev
|
|
* @ent: pointer to beacon update descriptor
|
|
* @rt: pointer to route parameter to be forwarded
|
|
*
|
|
* return:
|
|
* 0 -- for success case
|
|
* othersie -- error code
|
|
*/
|
|
uint32_t cvg_rt_update_bc_sg(cvg_vdev_t *vdev, mac_bc_update_t *ent,
|
|
mac_bc_rt_param_t *rt);
|
|
|
|
/**
|
|
* @brief cvg_rt_dis_node_list_rx() - discover node list mme rx
|
|
* handling funcntion
|
|
* @param vdev: pointer to vdev
|
|
* @param data: pointer to buffer of discover node list mme
|
|
* @param len: length of the mme in byte
|
|
*/
|
|
void cvg_rt_dis_node_list_rx(cvg_vdev_t *vdev, uint8_t *data, uint32_t len);
|
|
|
|
/**
|
|
* @brief cvg_rt_heart_beat_rx() - heart beat check mme rx handling
|
|
* funcntion.
|
|
* @param vdev: pointer to vdev
|
|
* @param data: pointer to buffer of heart beat check mme
|
|
* @param len: length of the mme in byte
|
|
*/
|
|
void cvg_rt_heart_beat_rx(cvg_vdev_t *vdev, uint8_t *data, uint32_t len);
|
|
|
|
/*
|
|
* @brief cvg_rt_start_route_recovery() - start route recovery process
|
|
* @param vdev: pointer to vdev
|
|
* @param dest_tei: tei of the destination sta to be searched
|
|
* @param buf: packet that trigger the recovery process
|
|
* @param mac: pointer to the mac header of packet
|
|
*
|
|
* @retval ERR_OK - for success case
|
|
* @retval otherwise - for failure case. see ERR_XXX
|
|
*/
|
|
uint32_t cvg_rt_start_route_recovery(cvg_vdev_t *vdev,
|
|
tei_t dest_tei, iot_pkt_t *buf, mac_header_t *mac);
|
|
|
|
/*
|
|
* @brief cvg_rt_route_req_rx() - route recovery request rx handling
|
|
* @param vdev: pointer to vdev
|
|
* @param peer_tei: tei of the peer that the packet received from
|
|
* @param snr: rx snr of the route request
|
|
* @param sof_buf: request packet
|
|
* @param mac: pointer to the mac header of packet
|
|
* @param data: pointer to the route request frame
|
|
* @param len: length of the route request frame
|
|
*/
|
|
void cvg_rt_route_req_rx(cvg_vdev_t *vdev, tei_t peer_tei, int8_t snr,
|
|
cvg_rx_sof_buf_t *sof_buf, mac_header_t *mac, uint8_t *data, uint32_t len);
|
|
|
|
/*
|
|
* @brief cvg_rt_route_rsp_rx() - route recovery response rx handling
|
|
* @param vdev: pointer to vdev
|
|
* @param peer_tei: tei of the peer that the packet received from
|
|
* @param snr: rx snr of the route response
|
|
* @param buf: response packet
|
|
* @param mac: pointer to the mac header of packet
|
|
* @param data: pointer to the route response frame
|
|
* @param len: length of the route response frame
|
|
*/
|
|
void cvg_rt_route_rsp_rx(cvg_vdev_t *vdev, tei_t peer_tei, int8_t snr,
|
|
cvg_rx_sof_buf_t *sof_buf, mac_header_t *mac, uint8_t *data, uint32_t len);
|
|
|
|
/*
|
|
* @brief cvg_rt_route_ack_rx() - route recovery ack rx handling
|
|
* @param vdev: pointer to vdev
|
|
* @param peer_tei: tei of the peer that the packet received from
|
|
* @param sof_buf: ack packet
|
|
* @param mac: pointer to the mac header of packet
|
|
* @param data: pointer to the route ack frame
|
|
* @param len: length of the route ack frame
|
|
*/
|
|
void cvg_rt_route_ack_rx(cvg_vdev_t *vdev, tei_t peer_tei,
|
|
cvg_rx_sof_buf_t *sof_buf, mac_header_t *mac, uint8_t *data, uint32_t len);
|
|
|
|
/*
|
|
* @brief cvg_rt_route_err_rx() - route recovery error rx handling
|
|
* @param vdev: pointer to vdev
|
|
* @param mac: pointer to the mac header of packet
|
|
* @param data: pointer to the route error frame
|
|
* @param len: length of the route error frame
|
|
*/
|
|
void cvg_rt_route_err_rx(cvg_vdev_t *vdev, mac_header_t *mac, uint8_t *data,
|
|
uint32_t len);
|
|
|
|
/*
|
|
* @brief cvg_rt_link_conf_req_rx() - link confirm request rx handling
|
|
* @param vdev: pointer to vdev
|
|
* @param peer_tei: tei of the peer that the packet received from
|
|
* @param snr: rx snr of the link conf request
|
|
* @param sof_buf: request packet
|
|
* @param mac: pointer to the mac header of packet
|
|
* @param data: pointer to the link confirm request frame
|
|
* @param len: length of the link confirm request frame
|
|
*/
|
|
void cvg_rt_link_conf_req_rx(cvg_vdev_t *vdev, tei_t peer_tei, int8_t snr,
|
|
cvg_rx_sof_buf_t *sof_buf, mac_header_t *mac, uint8_t *data, uint32_t len);
|
|
|
|
/*
|
|
* @brief cvg_rt_link_conf_rsp_rx() - link confirm response rx handling
|
|
* @param vdev: pointer to vdev
|
|
* @param peer_tei: tei of the peer that the packet received from
|
|
* @param sof_buf: response packet
|
|
* @param mac: pointer to the mac header of packet
|
|
* @param data: pointer to the link confirm response frame
|
|
* @param len: length of the link confirm response frame
|
|
*/
|
|
void cvg_rt_link_conf_rsp_rx(cvg_vdev_t *vdev, tei_t peer_tei,
|
|
cvg_rx_sof_buf_t *sof_buf, mac_header_t *mac, uint8_t *data, uint32_t len);
|
|
|
|
/*
|
|
* @brief cvg_rt_check_route_recovery() - check if any ongoing route recovery
|
|
* process expired.
|
|
* @param vdev: pointer to vdev
|
|
* @param bc_cnt_delta: how many beacon period passed since last check
|
|
*/
|
|
void cvg_rt_check_route_recovery(cvg_vdev_t *vdev, uint32_t bc_cnt_delta);
|
|
|
|
#endif /* SUPPORT_SMART_GRID */
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* CVG_RT_SG_H */
|