⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mac.h

📁 wimax BS simulation code,implemented under linux.
💻 H
📖 第 1 页 / 共 4 页
字号:
typedef struct aasulmapie_sh4_s{	uint8_t cid_h4	:4,		rsv	:4;	uint8_t cid_m8;	uint8_t uiuc	:4,		cid_l4	:4;	uint8_t duration_h8;	uint8_t slot_offset_h4			:4,		repetition_coding_indication	:2,		duration_l2			:2;		uint8_t slot_offset_l8;}aasulmapie_sh4_t;#define aasulmapie_sh4_set_rsv(p, buf) ulmapie_sh4_set_rsv(p, buf)#define aasulmapie_sh4_get_cid(p) ulmapie_sh4_get_cid(p)#define aasulmapie_sh4_set_cid(p, cid) ulmapie_sh4_set_cid(p, cid)#define aasulmapie_sh4_get_duration(p) ulmapie_sh4_get_duration(p)#define aasulmapie_sh4_set_duration(p, duration) ulmapie_sh4_set_duration(p, duration)#define aasulmapie_sh4_get_slot_offset(p) (uint16_t)((p)->slot_offset_h4 << 8 | (p)->slot_offset_l8)#define aasulmapie_sh4_set_slot_offset(p, slot_offset) do{ \	(p)->slot_offset_h4 = ((slot_offset) & 0xf00) >> 8; \	(p)->slot_offset_l8 = (slot_offset) & 0xff; \}while (0)#define amculzoneulmapie_sh4 aasulmapie_sh4;typedef struct cdmarngie_s{	uint8_t cid_h8;	uint8_t cid_l8;	uint8_t ofdma_symbol_offset_h4	:4,		uiuc			:4;	uint8_t subchannel_offset_h4	:4,		ofdma_symbol_offset_l4	:4;	uint8_t no_ofdma_symbols_h5	:5,		subchannel_offset_l3	:3;	uint8_t no_subchannels_h6	:6,		no_ofdma_symbols_l2	:2;		uint8_t pad				:4,		dedicated_ranging_indicator	:1,		ranging_method			:2,		no_subchannels_l1		:1;}cdmarngie_t;#define cdmarngie_get_cid(p) ulmapie_get_cid(p)#define cdmarngie_set_cid(p, cid) ulmapie_set_cid(p, cid)#define cdmarngie_get_ofdma_symbol_offset(p) (uint8_t)((p)->ofdma_symbol_offset_h4 << 4 | (p)->ofdma_symbol_offset_l4)#define cdmarngie_set_ofdma_symbol_offset(p, ofdma_symbol_offset) do{ \	(p)->ofdma_symbol_offset_h4 = ((ofdma_symbol_offset) & 0xf0) >> 4; \	(p)->ofdma_symbol_offset_l4 = (ofdma_symbol_offset) & 0xf; \}while (0)#define cdmarngie_get_subchannel_offset(p) (uint8_t)((p)->subchannel_offset_h4 << 3 | (p)->subchannel_offset_l3)#define cdmarngie_set_subchannel_offset(p, subchannel_offset) do{ \	(p)->subchannel_offset_h4 = ((subchannel_offset) & 0x78) >> 3; \	(p)->subchannel_offset_l3 = (subchannel_offset) & 0x7; \}while (0)#define cdmarngie_get_no_ofdma_symbols(p) (uint8_t)((p)->no_ofdma_symbols_h5 << 2 | (p)->no_ofdma_symbols_l2)#define cdmarngie_set_no_ofdma_symbols(p, no_ofdma_symbols) do{ \	(p)->no_ofdma_symbols_h5 = ((no_ofdma_symbols) & 0x7c) >> 2; \	(p)->no_ofdma_symbols_l2 = (no_ofdma_symbols) & 0x3; \}while (0)#define cdmarngie_get_no_subchannels(p) (uint8_t)((p)->no_subchannels_h6 << 1 | (p)->no_subchannels_l1)#define cdmarngie_set_no_subchannels(p, no_subchannels) do{ \	(p)->no_subchannels_h6 = ((no_subchannels) & 0x7e) >> 1; \	(p)->no_subchannels_l1 = (no_subchannels) & 0x1; \}while (0)#define cdmarngie_set(p, cid, _uiuc, ofdma_symbol_offset, subchannel_offset, no_ofdma_symbols, no_subchannels, _ranging_method, _dedicated_ranging_indicator) do{ \	cdmarngie_set_cid(p, cid); \	(p)->uiuc = (_uiuc); \	cdmarngie_set_ofdma_symbol_offset(p, ofdma_symbol_offset); \	cdmarngie_set_subchannel_offset(p, subchannel_offset); \	cdmarngie_set_no_ofdma_symbols(p, no_ofdma_symbols); \	cdmarngie_set_no_subchannels(p, no_subchannels); \	(p)->ranging_method = (_ranging_method); \	(p)->dedicated_ranging_indicator = (_dedicated_ranging_indicator); \}while (0)#define cdmabwrie_t cdmarngie_t;#define cdmabwrie_get_cid(p) cdmarngie_get_cid(p)#define cdmabwrie_set_cid(p, cid) cdmarngie_set_cid(p, cid)#define cdmabwrie_get_ofdma_symbol_offset(p) cdmarngie_get_ofdma_symbol_offset(p)#define cdmabwrie_set_ofdma_symbol_offset(p, ofdma_symbol_offset) cdmarngie_set_ofdma_symbol_offset(p, ofdma_symbol_offset)#define cdmabwrie_get_subchannel_offset(p) cdmarngie_get_subchannel_offset(p)#define cdmabwrie_set_subchannel_offset(p, subchannel_offset) cdmarngie_set_subchannel_offset(p, subchannel_offset)#define cdmabwrie_get_no_ofdma_symbols(p) cdmarngie_get_no_ofdma_symbols(p)#define cdmabwrie_set_no_ofdma_symbols(p, no_ofdma_symbols) cdmarngie_set_no_ofdma_symbols(p, no_ofdma_symbols)#define cdmabwrie_get_no_subchannels(p) cdmarngie_get_no_subchannels(p)#define cdmabwrie_set_no_subchannels(p, no_subchannels) cdmarngie_set_no_subchannels(p, no_subchannels)#define cdmabwrie_set(p, cid, _uiuc, ofdma_symbol_offset, subchannel_offset, no_ofdma_symbols, no_subchannels, _ranging_method, _dedicated_ranging_indicator) \		cdmarngie_set(p, cid, _uiuc, ofdma_symbol_offset, subchannel_offset, no_ofdma_symbols, no_subchannels, _ranging_method, _dedicated_ranging_indicator)typedef struct cdmarngie_sh4_s{	uint8_t cid_h4	:4,		rsv	:4;	uint8_t cid_m8;	uint8_t uiuc	:4,		cid_l4	:4;	uint8_t ofdma_symbol_offset;	uint8_t no_ofdma_symbols_h1	:1,		subchannel_offset	:7;	uint8_t no_subchannels_h2	:2,		no_ofdma_symbols_l6	:6;		uint8_t dedicated_ranging_indicator	:1,		ranging_method			:2,		no_subchannels_l5		:5;}cdmarngie_sh4_t;#define cdmarngie_sh4_set_rsv(p, buf) ulmapie_sh4_set_rsv(p, buf)#define cdmarngie_sh4_get_cid(p) ulmapie_sh4_get_cid(p)#define cdmarngie_sh4_set_cid(p, cid) ulmapie_sh4_set_cid(p, cid)#define cdmarngie_sh4_get_no_ofdma_symbols(p) (uint8_t)((p)->no_ofdma_symbols_h1 << 6 | (p)->no_ofdma_symbols_l6)#define cdmarngie_sh4_set_no_ofdma_symbols(p, no_ofdma_symbols) do{ \	(p)->no_ofdma_symbols_h1 = ((no_ofdma_symbols) & 0x40) >> 6; \	(p)->no_ofdma_symbols_l6 = (no_ofdma_symbols) & 0x3f; \}while (0)#define cdmarngie_sh4_get_no_subchannels(p) (uint8_t)((p)->no_subchannels_h2 << 2 | (p)->no_subchannels_l5)#define cdmarngie_sh4_set_no_subchannels(p, no_subchannels) do{ \	(p)->no_subchannels_h2 = ((no_subchannels) & 0x60) >> 5; \	(p)->no_subchannels_l5 = (no_subchannels) & 0x1f; \}while (0)#define cdmarngie_sh4_set(p, buf, cid, _uiuc, _ofdma_symbol_offset, _subchannel_offset, no_ofdma_symbols, no_subchannels, _ranging_method, _dedicated_ranging_indicator) do{ \	cdmarngie_sh4_set_rsv(p, buf); \	cdmarngie_sh4_set_cid(p, cid); \	(p)->uiuc = (_uiuc); \	(p)->ofdma_symbol_offset = (_ofdma_symbol_offset); \	(p)->subchannel_offset = (_subchannel_offset); \	cdmarngie_sh4_set_no_ofdma_symbols(p, no_ofdma_symbols); \	cdmarngie_sh4_set_no_subchannels(p, no_subchannels); \	(p)->ranging_method = (_ranging_method); \	(p)->dedicated_ranging_indicator = (_dedicated_ranging_indicator); \}while (0)#define cdmabwrie_sh4_t cdmarngie_sh4_t#define cdmabwrie_sh4_set_rsv(p, buf) cdmarngie_sh4_set_rsv(p, buf)#define cdmabwrie_sh4_get_cid(p) cdmarngie_sh4_get_cid(p)#define cdmabwrie_sh4_set_cid(p, cid) cdmarngie_sh4_set_cid(p, cid)#define cdmabwrie_sh4_get_no_ofdma_symbols(p) cdmarngie_sh4_get_no_ofdma_symbols(p)#define cdmabwrie_sh4_set_no_ofdma_symbols(p, no_ofdma_symbols) cdmarngie_sh4_set_no_ofdma_symbols(p, no_ofdma_symbols)#define cdmabwrie_sh4_get_no_subchannels(p) cdmarngie_sh4_get_no_subchannels(p)#define cdmabwrie_sh4_set_no_subchannels(p, no_subchannels) cdmarngie_sh4_set_no_subchannels(p, no_subchannels)#define cdmabwrie_sh4_set(p, buf, cid, _uiuc, _ofdma_symbol_offset, _subchannel_offset, no_ofdma_symbols, no_subchannels, _ranging_method, _dedicated_ranging_indicator) \		cdmarngie_sh4_set(p, buf, cid, _uiuc, _ofdma_symbol_offset, _subchannel_offset, no_ofdma_symbols, no_subchannels, _ranging_method, _dedicated_ranging_indicator)typedef struct cdmaallocie_s{	uint8_t cid_h8;	uint8_t cid_l8;	uint8_t duration_h4	:4,		uiuc		:4;	uint8_t repetition_coding_indication	:2,		uiuc_for_transmission		:4,		duration_l2			:2;	uint8_t ranging_code_h4		:4,		frame_number_index	:4;	uint8_t ranging_symbol_h4	:4,		ranging_code_l4		:4;	uint8_t ranging_subchannel_h4	:4,		ranging_symbol_l4	:4;	uint8_t pad			:4,		bw_request_mandatory	:1,		ranging_subchannel_l3	:3;}cdmaallocie_t;#define cdmaallocie_get_cid(p) ulmapie_get_cid(p)#define cdmaallocie_set_cid(p, cid) ulmapie_set_cid(p, cid)#define cdmaallocie_get_duration(p) (uint8_t)((p)->duration_h4 << 2 | (p)->duration_l2)#define cdmaallocie_set_duration(p, duration) do{ \	(p)->duration_h4 = ((duration) & 0x3c) >> 2; \	(p)->duration_l2 = (duration) & 0x3; \}while (0)#define cdmaallocie_get_ranging_code(p) (uint8_t)((p)->ranging_code_h4 << 4 | (p)->ranging_code_l4)#define cdmaallocie_set_ranging_code(p, ranging_code) do{ \	(p)->ranging_code_h4 = ((ranging_code) & 0xf0) >> 4; \	(p)->ranging_code_l4 = (ranging_code) & 0xf; \}while (0)#define cdmaallocie_get_ranging_symbol(p) (uint8_t)((p)->ranging_symbol_h4 << 4 | (p)->ranging_symbol_l4)#define cdmaallocie_set_ranging_symbol(p, ranging_symbol) do{ \	(p)->ranging_symbol_h4 = ((ranging_symbol) & 0xf0) >> 4; \	(p)->ranging_symbol_l4 = (ranging_symbol) & 0xf; \}while (0)#define cdmaallocie_get_ranging_subchannel(p) (uint8_t)((p)->ranging_subchannel_h4 << 3 | (p)->ranging_subchannel_l3)#define cdmaallocie_set_ranging_subchannel(p, ranging_subchannel) do{ \	(p)->ranging_subchannel_h4 = ((ranging_subchannel) & 0x78) >> 3; \	(p)->ranging_subchannel_l3 = (ranging_subchannel) & 0x7; \}while (0)#define cdmaallocie_set(p, cid, _uiuc, duration, _uiuc_for_transmission, _repetition_coding_indication, _frame_number_index, ranging_code, ranging_symbol, ranging_subchannel, _bw_request_mandatory) do {\	cdmaallocie_set_cid(p, cid); \	(p)->uiuc = (_uiuc); \	cdmaallocie_set_duration(p, duration); \	(p)->uiuc_for_transmission = (_uiuc_for_transmission); \	(p)->repetition_coding_indication = (_repetition_coding_indication); \	(p)->frame_number_index = (_frame_number_index); \	cdmaallocie_set_ranging_code(p, ranging_code); \	cdmaallocie_set_ranging_symbol(p, ranging_symbol); \	cdmaallocie_set_ranging_subchannel(p, ranging_subchannel); \	(p)->bw_request_mandatory = (_bw_request_mandatory); \}while (0)typedef struct cdmaallocie_sh4_s{	uint8_t cid_h4	:4,		rsv	:4;	uint8_t cid_m8;	uint8_t uiuc	:4,		cid_l4	:4;	uint8_t uiuc_for_transmission_h2	:2,		duration			:6;	uint8_t frame_number_index		:4,		repetition_coding_indication	:2,		uiuc_for_transmission_l2	:2;	uint8_t ranging_code;	uint8_t ranging_symbol;	uint8_t bw_request_mandatory	:1,		ranging_subchannel	:7;}cdmaallocie_sh4_t;#define cdmaallocie_sh4_set_rsv(p, buf) ulmapie_sh4_set_rsv(p, buf)#define cdmaallocie_sh4_get_cid(p) ulmapie_sh4_get_cid(p)#define cdmaallocie_sh4_set_cid(p, cid) ulmapie_sh4_set_cid(p, cid)#define cdmaallocie_sh4_get_uiuc_for_transmission(p) (uint8_t)((p)->uiuc_for_transmission_h2 << 2 | (p)->uiuc_for_transmission_l2)#define cdmaallocie_sh4_set_uiuc_for_transmission(p, uiuc_for_transmission) do{ \	(p)->uiuc_for_transmission_h2 = ((uiuc_for_transmission) & 0xc) >> 2; \	(p)->uiuc_for_transmission_l2 = (uiuc_for_transmission) & 0x3; \}while (0)#define cdmaallocie_sh4_set(p, buf, cid, _uiuc, _duration, uiuc_for_transmission, _repetition_coding_indication, _frame_number_index, _ranging_code, _ranging_symbol, _ranging_subchannel, _bw_request_mandatory) do {\	cdmaallocie_sh4_set_rsv(p, buf); \	cdmaallocie_sh4_set_cid(p, cid); \	(p)->uiuc = (_uiuc); \	(p)->duration = (_duration); \	cdmaallocie_sh4_set_uiuc_for_transmission(p, uiuc_for_transmission); \	(p)->repetition_coding_indication = (_repetition_coding_indication); \	(p)->frame_number_index = (_frame_number_index); \	(p)->ranging_code = (_ranging_code); \	(p)->ranging_symbol = (_ranging_symbol); \	(p)->ranging_subchannel = (_ranging_subchannel); \	(p)->bw_request_mandatory = (_bw_request_mandatory); \}while (0)typedef struct rngrsphdr_s{	macmsghdr_t hdr;	uint8_t reserv;	}rngrsphdr_t;typedef struct rngrspinfo_s{	rngrsphdr_t rngrsphdr;	uint32_t tlvmask[2];	uint8_t ranging_status;}rngrspinfo_t;#define RNGRSP_TLVMASK_Timing_Adjust					1#define RNGRSP_TLVMASK_Power_Level_Adjust				2#define RNGRSP_TLVMASK_Offset_Frequency_Adjust				3#define RNGRSP_TLVMASK_Ranging_Status					4#define RNGRSP_TLVMASK_Downlink_frequency_override			5#define RNGRSP_TLVMASK_Uplink_channel_ID_override			6#define RNGRSP_TLVMASK_Downlink_Operational_Burst_Profile		7#define RNGRSP_TLVMASK_SS_MAC_Address					8#define RNGRSP_TLVMASK_Basic_CID					9#define RNGRSP_TLVMASK_Primary_Management_CID				10#define RNGRSP_TLVMASK_AAS_broadcast_permission				11#define RNGRSP_TLVMASK_Frame_number					12#define RNGRSP_TLVMASK_Initial_ranging_oportunity_number		13#define RNGRSP_TLVMASK_Ranging_code_attributes				14typedef enum _RNGSTATUS_ENUM{	CONTINUE = 1,	ABORT,	SUCCESS,	RERANGE}RNGSTATUS_ENUM;/* ********************************************************* *		BS Control Info Data Structures * ********************************************************* *//* `sfattr' records the service flow attributes, as well as classifier * and phs info associated with it. */enum {	SF_MASK_DIR                 = 0x00000001,	SF_MASK_CID                 = 0x00000002,	SF_MASK_SERV_NAME           = 0x00000004,	SF_MASK_MBS_SERVICE         = 0x00000008,	SF_MASK_QOS_INDEX           = 0x00000010,	SF_MASK_SCHED_TYPE          = 0x00000020,	SF_MASK_RT_POLICY           = 0x00000040,	SF_MASK_FIXED_SDU_IND       = 0x00000080,	SF_MASK_SDU_SIZE            = 0x00000100,	SF_MASK_TGT_SAID            = 0x00000200,	SF_MASK_ARQ_ENABLE          = 0x00000400,	SF_MASK_ARQ_WIN_SIZE        = 0x00000800,	SF_MASK_ARQ_RETRY_TX_DELAY  = 0x00001000,	SF_MASK_ARQ_RETRY_RX_DELAY  = 0x00002000,	SF_MASK_ARQ_BLK_LIFETIME    = 0x00004000,	SF_MASK_ARQ_SYNC_LOSS       = 0x00008000,	SF_MASK_ARQ_IN_ORDER        = 0x00010000,	SF_MASK_ARQ_PURGE_TIMEOUT   = 0x00020000,	SF_MASK_ARQ_BLK_SIZE        = 0x00040000,	SF_MASK_CS                  = 0x00080000,	SF_MASK_DELIVERY_SERV       = 0x00100000,	SF_MASK_SDU_ARRI_INTERVAL   = 0x00200000,	SF_MASK_TIMEBASE            = 0x00400000,	SF_MASK_PAGING_PREF         = 0x00800000,	SF_MASK_MBS_ZONE            = 0x01000000,	SF_MASK_TRAFFIC_IND_PREF    = 0x02000000,	SF_MASK_GLOBAL_SERV_NAME    = 0x04000000,	SF_MASK_SN_FEEDBACK_EN      = 0x08000000,	SF_MASK_FSN_SIZE            = 0x10000000,	SF_MASK_PDU_SN_EXT_SUBHDR   = 0x20000000,	SF_MASK_HARQ_SERVICE_FLOW   = 0x40000000};enum {	QOS_MASK_SUSTAIN_RATE       = 0x00000001,	QOS_MASK_BURST_SIZE         = 0x00000002,	QOS_MASK_RESERVE_RATE       = 0x00000004,	QOS_MASK_TOLERATE_JITTER    = 0x00000008,	QOS_MASK_LATENCY            = 0x00000010,	QOS_MASK_UNSOLI_GRANT_INTERVAL   = 0x00000020,	QOS_MASK_UNSOLI_POLLING_INTERVAL = 0x00000040,	QOS_MASK_PRIORITY           = 0x00000080};typedef struct sfattr_s{	pthread_mutex_t mutex;	struct list_head link;	uint8_t		stat;#define SF_INVALID	0#define SF_ACTIVE	1#define SF_PAUSE	2	uint8_t		ss;					/* which ss that this serviceflow belongs to *//* sf control info */	struct list_head dlink;					/* due to the dual-directional character of management serviceflow */	struct list_head ulink;	uint32_t	priority;	uint32_t	policy;					/* set when initilized */#define SCHED_POLICY_SIG	16#define SCHED_POLICY_UGS	48#define SCHED_POLICY_ERTPS	80#define SCHED_POLICY_RTPS	112#define SCHED_POLICY_NRTPS	144#define SCHED_POLICY_BE		176	uint16_t	fc;	uint16_t	fsn;		uint8_t		fli;	uint8_t		fl;	uint32_t	bwr;					/* bandwidth request sent by ss, unit in byte */	uint32_t	_bwr;					/* add-up bwr since service flow activated */	uint32_t	_data;					/* acual coming-in data sent by ss, unit in byte t*/	uint32_t	last;					/* frame number when last scheded occurs */	uint32_t  mask1;        /* for non qos */	uint32_t  mask2;        /* for qos */	uint8_t		dir;#define DIR_UPLINK		0x01#define DIR_DOWNLINK		0x02#define DIR_DUPLEX		0x03	uint8_t		is_secon_mng;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -