102 lines
		
	
	
		
			3.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			102 lines
		
	
	
		
			3.1 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 PLC_MME_LEAVE_IND_H
							 | 
						||
| 
								 | 
							
								#define PLC_MME_LEAVE_IND_H
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* os shim includes */
							 | 
						||
| 
								 | 
							
								#include "os_types.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* plc includes */
							 | 
						||
| 
								 | 
							
								#include "plc_mme.h"
							 | 
						||
| 
								 | 
							
								#include "plc_utils.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								extern "C" {
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* pack for the structures in the whole file */
							 | 
						||
| 
								 | 
							
								#pragma pack(push)  /* save the pack status */
							 | 
						||
| 
								 | 
							
								#pragma pack(1)     /* 1 byte align */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define RESERVED_SIZE   10
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* reason of the sg leave indication */
							 | 
						||
| 
								 | 
							
								#define CCO_IND_LEAVE           0x00
							 | 
						||
| 
								 | 
							
								#define EXCEED_MAX_TOPO_LEVEL   0x01
							 | 
						||
| 
								 | 
							
								#define STA_NOT_IN_WHITELIST    0x02
							 | 
						||
| 
								 | 
							
								#define STA_IN_BLACKLIST        0xFF
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* reason of the spg leave indication */
							 | 
						||
| 
								 | 
							
								#define SPG_STA_NOT_IN_NETWORK      0x00
							 | 
						||
| 
								 | 
							
								#define SPG_EXCEED_MAX_TOPO_LEVEL   0x02
							 | 
						||
| 
								 | 
							
								#define SPG_CCO_IND_LEAVE           0x04
							 | 
						||
| 
								 | 
							
								#define SPG_STA_NOT_IN_WHITELIST    0x03
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if SUPPORT_SMART_GRID
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								typedef struct _mme_leave_ind {
							 | 
						||
| 
								 | 
							
								    /* reason why STAs should leave */
							 | 
						||
| 
								 | 
							
								    uint16_t        reason;
							 | 
						||
| 
								 | 
							
								    /* number of STAs should leave */
							 | 
						||
| 
								 | 
							
								    uint16_t        sta_cnt;
							 | 
						||
| 
								 | 
							
								    /* delay before leaving */
							 | 
						||
| 
								 | 
							
								    uint16_t        delay;
							 | 
						||
| 
								 | 
							
								    /* reserved according to spec */
							 | 
						||
| 
								 | 
							
								    uint8_t         reserved[RESERVED_SIZE];
							 | 
						||
| 
								 | 
							
								    /* mac of STAs that should leave */
							 | 
						||
| 
								 | 
							
								    uint8_t         mac_addr[0][IOT_MAC_ADDR_LEN];
							 | 
						||
| 
								 | 
							
								} mme_leave_ind_t;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* SUPPORT_SMART_GRID */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if SUPPORT_SOUTHERN_POWER_GRID
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								typedef struct _spg_mme_leave_ind {
							 | 
						||
| 
								 | 
							
								    /* tei of sta that should leave */
							 | 
						||
| 
								 | 
							
								    tei_t           sta_tei;
							 | 
						||
| 
								 | 
							
								    /* reason why sta should leave */
							 | 
						||
| 
								 | 
							
								    uint16_t        reason;
							 | 
						||
| 
								 | 
							
								    /* mac of sta that should leave */
							 | 
						||
| 
								 | 
							
								    uint8_t         mac_addr[IOT_MAC_ADDR_LEN];
							 | 
						||
| 
								 | 
							
								    /* tei of proxy of sta that should leave */
							 | 
						||
| 
								 | 
							
								    tei_t           pco_tei;
							 | 
						||
| 
								 | 
							
								    /* reserved according to spec */
							 | 
						||
| 
								 | 
							
								    uint8_t         reserved[8];
							 | 
						||
| 
								 | 
							
								} spg_mme_leave_ind_t;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								typedef struct _spg_mme_delay_leave_ind {
							 | 
						||
| 
								 | 
							
								    /* reason why sta should leave */
							 | 
						||
| 
								 | 
							
								    uint16_t        reason;
							 | 
						||
| 
								 | 
							
								    /* number of STAs should leave */
							 | 
						||
| 
								 | 
							
								    uint16_t        sta_cnt;
							 | 
						||
| 
								 | 
							
								    /* delay before leaving */
							 | 
						||
| 
								 | 
							
								    uint16_t        delay;
							 | 
						||
| 
								 | 
							
								    /* reserved according to spec */
							 | 
						||
| 
								 | 
							
								    uint8_t         resv0[10];
							 | 
						||
| 
								 | 
							
								    /* mac of STAs that should leave */
							 | 
						||
| 
								 | 
							
								    uint8_t         mac_addr[0][IOT_MAC_ADDR_LEN];
							 | 
						||
| 
								 | 
							
								} spg_mme_delay_leave_ind_t;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* SUPPORT_SOUTHERN_POWER_GRID */
							 | 
						||
| 
								 | 
							
								#pragma pack(pop)   /* restore the pack status */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* PLC_MME_LEAVE_IND_H */
							 |