📄 global.~h
字号:
/****************************************************************************************************************************************
** Work Group : WBG RNC
** Creator : Yong.Li
** Create Date : 2006/10/03
** Modify By :
** Description : common data type, constant and structure. All are software related, and used in the scope of whole MAC
** Version : sr1.0 phase 1
**----------------------------------------------------------------------------------------------------------------------------------------
** Involving functions:
**----------------------------------------------------------------------------------------------------------------------------------------
** <Complement: Maybe update history>
** 2006-10-3 : Created
*****************************************************************************************************************************************/
#ifndef _GLOBAL_H_
#define _GLOBAL_H_
/*******************************************************Data Type Definition Begin***********************************************************/
#ifndef HAVE_BYTE
#define HAVE_BYTE
typedef unsigned char BYTE; /* 8 bit */
#endif /* HAVE_BYTE */
#ifndef HAVE_WORD
#define HAVE_WORD
typedef unsigned short WORD; /* 16 bit */
#endif /* HAVE_WORD */
#ifndef HAVE_DWORD
#define HAVE_DWORD
typedef unsigned long DWORD; /* 32 bit */
#endif /* HAVE_DWORD */
/*typedef int BOOL;*/
typedef BYTE MAC_BOOL;
/*******************************************************Data Type Definition End***********************************************************/
/*****************************************************Const Value Definition Begin***********************************************************/
#define PRESENT 1
#define UNPRESENT 0 /*not present*/
#ifndef FALSE
#define FALSE 0
#define TRUE 1
#endif
/* Return status values */
#ifndef SUCCESS
#define SUCCESS 0
#endif
#ifndef FAILURE
#define FAILURE (-1)
#endif
#ifndef OK
#define OK 0
#endif
#ifndef ERROR
#define ERROR (-1)
#endif
#ifndef NULL
#define NULL 0
#endif
/*****************************************************Const Value Definition End***********************************************************/
/*****************************************************TCP/UDP/IP Definition Begin***********************************************************/
#define UDP_PORT 6000 /* Default UDP Port */
/*****************************************************TCP/UDP/IP Definition End*************************************************************/
/*****************************************************Message Format Definition Begin*********************************************************/
#define MAX_INTER_MESSAGE_LENGTH 1024 /* maximum message length, should be the input parameters when creating message queue*/
/* common message header, prefix to the inter-module message*/
typedef struct _envelop
{
BYTE protocolSap; /*All of the protocol SAPs were defined in common.h*/
BYTE msgType; /*message type defined for each SAP */
WORD MessageLength; /*total length of the message, including this ENVELOP header*/
}ENVELOP;
/* LMT message header */
typedef struct LMT_ENVELOP
{
WORD wprimary_key; /* indicate function block such as PM, CT, OLPC and so on. */
WORD wsub_key; /* indicate message type */
BYTE bresult; /* return result. 0 for success; others for failed */
BYTE bdirect; /* 0 for LMT->BS; 1 for BS->LMT */
}LMT_ENVELOP;
typedef struct LMT_STANDARD_MSG
{
ENVELOP envelop;
LMT_ENVELOP lmt_envelop;
}LMT_STANDARD_MSG;
#define ENVELOP_SIZE sizeof(ENVELOP)
/*****************************************************Message Format Definition End***********************************************************/
/**************************************************************software constant BEGIN*****************************************************************/
#define MAX_MS_NUM_PER_BS 1024
#define MAX_SF_NUM_PER_MS 20
#define MAX_TRAFFIC_CID_NUM_PER_MS MAX_SF_NUM_PER_MS
#define MAX_MANAGEMENT_CID_NUM_PER_MS 2
#define MAX_MS_MANAGEMENT_CID (MAX_MS_NUM_PER_BS*MAX_MANAGEMENT_CID_NUM_PER_MS)
#define MAX_CID_NUM_PER_MS (MAX_TRAFFIC_CID_NUM_PER_MS+MAX_MANAGEMENT_CID_NUM_PER_MS) /*traffic CID num +management cids*/
#define MAX_CID (MAX_MS_NUM_PER_BS*MAX_CID_NUM_PER_MS)
#define MAX_PAGING_GROUP_PER_BS 5
#define MAX_MAC_ADDR_PAG 10
/**************************************************************software constant END*****************************************************************/
/**************************************************************SAP BEGIN*****************************************************************/
#define HWM_BSUP_SAP 100
#define BSUP_RRM_SAP 110
#define BSUP_CMAC_SAP 120
#define CMAC_RRM_SAP 130
#define R6_SAP 140
#define HWM_RRM_SAP 150
#define APP_TIMER_SAP 240
/**************************************************************SAP END*****************************************************************/
#ifdef ARMEB
/*
a: DWORD a;
b: BYTE * b;
*/
#define DWORD_2_BYTEP(a, b) \
{ \
BYTE * pb_convert; \
pb_convert = (BYTE *)&(a); \
(b)[0] = pb_convert[0]; \
(b)[1] = pb_convert[1]; \
(b)[2] = pb_convert[2]; \
(b)[3] = pb_convert[3]; \
}
/*
a: BYTE * a;
b: DWORD b;
*/
#define BYTEP_2_DWORD(a, b) \
{ \
BYTE * pb_convert; \
pb_convert = (BYTE *)&(b); \
pb_convert[0] = (a)[0]; \
pb_convert[1] = (a)[1]; \
pb_convert[2] = (a)[2]; \
pb_convert[3] = (a)[3]; \
}
/*
a: WORD a;
b: BYTE * b;
*/
#define WORD_2_BYTEP(a, b) \
{ \
BYTE * pb_convert; \
pb_convert = (BYTE *)&(a); \
(b)[0] = pb_convert[0]; \
(b)[1] = pb_convert[1]; \
}
/*
a: BYTE * a;
b: WORD b;
*/
#define BYTEP_2_WORD(a, b) \
{ \
BYTE * pb_convert; \
pb_convert = (BYTE *)&(b); \
pb_convert[0] = (a)[0]; \
pb_convert[1] = (a)[1]; \
}
#else
#define DWORD_2_BYTEP(a, b) *(DWORD *)(b) = (a)
#define BYTEP_2_DWORD(a, b) (b) = *(DWORD *)(a)
#define WORD_2_BYTEP(a, b) *(WORD *)(b) = (a)
#define BYTEP_2_WORD(a, b) (b) = *(WORD *)(a)
#endif
/**************************************************************R6 udp port BEGIN*****************************************************************/
#define R6_BS_RECEIVE_UDP_PORT_FROM_GW 6031
#define R6_GW_RECEIVE_UDP_PORT_FROM_BS 6021
/**************************************************************R6 udp port END*****************************************************************/
#endif /* _3G_GLOBAL_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -