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

📄 mac.h

📁 wimax BS simulation code,implemented under linux.
💻 H
📖 第 1 页 / 共 4 页
字号:
        MCA_REQ = 21,        MCA_RSP,        DBPC_REQ,        DBPC_RSP,        RES_CMD = 25,        SBC_REQ,        SBC_RSP,        CLK_CMP,        DREG_CMD,        DSX_RVD = 30,        TFTP_CPLT,        TFTP_RSP,        ARQ_FEEDBACK,        ARQ_DISCARD,        ARQ_RESET = 35,        REP_REQ,        REP_RSP,        FPC,        MSH_NCFG,        MSH_NENT = 40,        MSH_DSCH,        MSH_CSCH,        MSH_CSCF,        AAS_FBCK_REQ,        AAS_FBCK_RSP = 45,        AAS_BEAM_SELECT,        AAS_BEAM_REQ,        AAS_BEAM_RSP,        DREG_REQ,        MACMSG_TYPE_BOTTOM,	CDMA_CODE}MAC_MANAGEMENT_MSG_ENUM;typedef struct macmsghdr_s{        uint8_t msgtype;}macmsghdr_t    __attribute__ ((aligned (1))) ;typedef struct cdmacode_s{	macmsghdr_t hdr;	uint8_t frame_number_index;	uint8_t ranging_code;	uint8_t ranging_symbol;	uint8_t ranging_subchannel;	uint8_t is_bwr;}cdmacode_t;#define BURSTPROFILE_TLVMASK_FEC							1#define BURSTPROFILE_TLVMASK_DIUC_Mandatory_exit_threshold				2#define BURSTPROFILE_TLVMASK_DIUC_Minimum_entry_threshold				3#define BURSTPROFILE_TLVMASK_Frequency							4#define BURSTPROFILE_TLVMASK_Ranging_data_ratio						5typedef struct dcdhdr_s{	macmsghdr_t hdr;	uint8_t reserv;	uint8_t config_change_count;}dcdhdr_t;typedef struct dcdinfo_s{	dcdhdr_t dcdhdr;	uint32_t tlvmask[2];}dcdinfo_t;#define DCD_TLVMASK_Downlink_Burst_Profile						34#define DCD_TLVMASK_BS_EIRP								1#define DCD_TLVMASK_PHY_Type								3#define DCD_TLVMASK_Power_adjustment_rule						4#define DCD_TLVMASK_Channel_Nr								5#define DCD_TLVMASK_TTG									6#define DCD_TLVMASK_RTG									7#define DCD_TLVMASK_RSS_IR_max								8#define DCD_TLVMASK_Channel_Switch_Frame_Number						9#define DCD_TLVMASK_Frequency								10#define DCD_TLVMASK_BS_ID								11#define DCD_TLVMASK_Frame_Duration_Code							12#define DCD_TLVMASK_Frame_Number							13#define DCD_TLVMASK_H_ARQ_ACK_delay_for_DL_burst					14#define DCD_TLVMASK_Permutation_type_for_broadcast_region_in_HARQ_zone			15#define DCD_TLVMASK_Maximum_retransmission						16#define DCD_TLVMASK_Default_RSSI_and_CINR_averaging_parameter				17#define DCD_TLVMASK_DL_AMC_allocated_physical_bands_bitmap				18#define DCD_TLVMASK_H_Add_Threshold							19#define DCD_TLVMASK_H_Delete_Threshold							20#define DCD_TLVMASK_ASR_Anchor_Switch_Report_Slot_Length_M_an_SwitchingPeriod_L_	21#define DCD_TLVMASK_DL_region_definition						22#define DCD_TLVMASK_Paging_Group_ID							23#define DCD_TLVMASK_TUSC1_permutation_active_subchannels_bitmap				24#define DCD_TLVMASK_TUSC2_permutation_active_sbuchannels_bitmap				25#define DCD_TLVMASK_HO_type_support							26#define DCD_TLVMASK_Hysteresis_margin							27#define DCD_TLVMASK_Time_to_Trigger_duration						28#define DCD_TLVMASK_Trigger								29#define DCD_TLVMASK_N_I									30#define DCD_TLVMASK_Downlink_burst_profile_for_multiple_FEC_types			31#define DCD_TLVMASK_BS_Restart_Count							32#define DCD_TLVMASK_MAC_version								33typedef struct ucdhdr_s{	macmsghdr_t hdr;	uint8_t config_change_count;	uint8_t ranging_backoff_start;	uint8_t ranging_backoff_end;	uint8_t request_backoff_start;	uint8_t request_backoff_end;}ucdhdr_t;typedef struct ucdinfo_s{	ucdhdr_t ucdhdr;	uint32_t tlvmask[2];}ucdinfo_t;#define UCD_TLVMASK_Uplink_Burst_Profile						53#define UCD_TLVMASK_Contention_based_reservation_timeout				1#define UCD_TLVMASK_Bandwidth_request_opportunity_size					2#define UCD_TLVMASK_Ranging_request_opportunity_size					3#define UCD_TLVMASK_Frequency								4#define UCD_TLVMASK_HO_ranging_start							5#define UCD_TLVMASK_HO_ranging_end							6#define UCD_TLVMASK_UL_AMC_Allocated_physical_bands_bitmap				7#define UCD_TLVMASK_Initial_ranging_codes						8#define UCD_TLVMASK_Periodic_ranging_codes						9#define UCD_TLVMASK_Bandwidth_request_codes						10#define UCD_TLVMASK_Periodic_ranging_backoff_start					11#define UCD_TLVMASK_Periodic_ranging_backoff_end					12#define UCD_TLVMASK_Start_of_ranging_codes_group					13#define UCD_TLVMASK_Permutation_base							14#define UCD_TLVMASK_UL_allocated_subchannels_bitmap					15#define UCD_TLVMASK_Optional_permutation_UL_Allocated_subchannels_bitmap		16#define UCD_TLVMASK_Band_AMC_Allocation_Threshold					17#define UCD_TLVMASK_Band_AMC_Release_Threshold						18#define UCD_TLVMASK_Band_AMC_Allocation_Timer						19#define UCD_TLVMASK_Band_AMC_Release_Timer						20#define UCD_TLVMASK_Band_Status_Reporting_MAX_Period					21#define UCD_TLVMASK_Band_AMC_Retry_Timer						22#define UCD_TLVMASK_Safety_Channel_Allocation_Threshold					23#define UCD_TLVMASK_Safety_Channel_Release_Threshold					24#define UCD_TLVMASK_Safety_Channel_Allocation_Timer					25#define UCD_TLVMASK_Safety_Channel_Release_Timer					26#define UCD_TLVMASK_Bin_Status_Reporting_MAX_Period					27#define UCD_TLVMASK_Safety_Channel_Retry_Timer						28#define UCD_TLVMASK_H_ARQ_ACK_delay_for_DL_burst					29#define UCD_TLVMASK_CQICH_Band_AMC_Transition_Delay					30#define UCD_TLVMASK_Maximum_retransimission						31#define UCD_TLVMASK_Normalized_C_N_override						32#define UCD_TLVMASK_Size_of_CQICH_ID_field						33#define UCD_TLVMASK_Normalized_C_N_override2						34#define UCD_TLVMASK_Band_AMC_Entry_Average_CINR						35#define UCD_TLVMASK_UpperBound_AAS_PREAMBLE						36#define UCD_TLVMASK_LowerBound_AAS_PREAMBLE						37#define UCD_TLVMASK_Allow_AAS_Beam_Select_Messages					38#define UCD_TLVMASK_Use_CQICH_indication_flag						39#define UCD_TLVMASK_MS_specific_up_power_offset_adjustment_step				40#define UCD_TLVMASK_MS_specific_down_power_offset_adjustment				41#define UCD_TLVMASK_Minimum_level_of_power_offset_adjustment				42#define UCD_TLVMASK_Maximum_level_of_power_offset_adjustment				43#define UCD_TLVMASK_Handover_Ranging_Codes						44#define UCD_TLVMASK_Initial_ranging_interval						45#define UCD_TLVMASK_Tx_Power_Report							46#define UCD_TLVMASK_Normalized_C_N_for_Channel_Sounding					47#define UCD_TLVMASK_Initial_ranging_backoff_start					48#define UCD_TLVMASK_Initial_ranging_backoff_end						49#define UCD_TLVMASK_Bandwidth_request_backoff_start					50#define UCD_TLVMASK_Bandwidth_request_backoff_end					51#define UCD_TLVMASK_Uplink_burst_profile_for_multiple_FEC_types				52typedef struct dlmaphdr_s{	macmsghdr_t hdr;	uint8_t frame_duration_code;	uint8_t frame_number[3];	uint8_t dcd_count;	uint8_t bsid[6];}dlmaphdr_t;typedef struct dlmapie_1cid_s{	uint8_t ncid_h4		:4,		diuc		:4;	uint8_t cid_h4		:4,		ncid_l4		:4;		uint8_t cid_m8;		uint8_t offsym_h4	:4,		cid_l4		:4;	uint8_t offschn_h4	:4,		offsym_l4	:4;	uint8_t nrsym_h3	:3,		boosting	:3,		offschn_l2	:2;	uint8_t nrschn_h4	:4,		nrsym_l4	:4;	uint8_t pad		:4,		rep		:2,		nrschn_l2	:2;}dlmapie_1cid_t;#define dlmapie_1cid_set_ncid(p, ncid)	do { \	(p)->ncid_h4 = ((ncid) & 0xf0) >> 4; \	(p)->ncid_l4 = (ncid) & 0xf;	\}while (0)#define dlmapie_1cid_set_cid(p, cid)	do { \	(p)->cid_h4 = ((cid) & 0xf000) >> 12; \	(p)->cid_m8 = ((cid) & 0xff0) >> 4; \	(p)->cid_l4 = (cid) & 0xf; \}while (0)#define dlmapie_1cid_set_offsym(p, offsym)	do { \	(p)->offsym_h4 = ((offsym) & 0xf0) >> 4; \	(p)->offsym_l4 = (offsym) & 0xf; \}while (0)#define dlmapie_1cid_set_offschn(p, offschn)	do { \	(p)->offschn_h4 = ((offschn) & 0x3c) >> 2; \	(p)->offschn_l2 = (offschn) & 0x3; \}while (0)#define dlmapie_1cid_set_nrsym(p, nrsym)	do { \	(p)->nrsym_h3 = ((nrsym) & 0x70) >> 4; \	(p)->nrsym_l4 = (nrsym) & 0xf; \}while (0)#define dlmapie_1cid_set_nrschn(p, nrschn)	do { \	(p)->nrschn_h4 = ((nrschn) & 0x3c) >> 2; \	(p)->nrschn_l2 = (nrschn) & 0x3; \}while (0)#define dlmapie_1cid_set(p, _diuc, cid, offsym, offschn, _boosting, nrsym, nrschn, _rep)	do { \	(p)->diuc = (_diuc); \	dlmapie_1cid_set_ncid(p, 1); \	dlmapie_1cid_set_cid(p, cid); \	dlmapie_1cid_set_offsym(p, offsym); \	dlmapie_1cid_set_offschn(p, offschn); \	(p)->boosting = (_boosting); \	dlmapie_1cid_set_nrsym(p, nrsym); \	dlmapie_1cid_set_nrschn(p, nrschn); \	(p)->rep = (_rep); \}while (0)typedef struct dlmapie_1cid_sh4_s{	uint8_t diuc		:4,		rsv		:4;	uint8_t ncid;	uint8_t cid_h8;	uint8_t cid_l8;	uint8_t offsym;	uint8_t boosting_h2	:2,		offschn		:6;	uint8_t nrsym		:7,		boosting_l1	:1;	uint8_t rep		:2,		nrschn		:6;}dlmapie_1cid_sh4_t;#define dlmapie_1cid_sh4_set_cid(p, cid)	do { \	(p)->cid_h8 = ((cid) & 0xff00) >> 8; \	(p)->cid_l8 = (cid) & 0xff; \}while (0)#define dlmapie_1cid_sh4_set_boosting(p, boosting)	do { \	(p)->boosting_h2 = ((boosting) & 0x6) >> 1; \	(p)->boosting_l1 = boosting & 0x1; \}while (0)#define dlmapie_1cid_sh4_set_rsv(p, buf) do{ \	(p)->rsv = (*((uint8_t *)(buf)) & 0xf0) >> 4; \}while (0)#define dlmapie_1cid_sh4_set(p, buf, _diuc, cid, _offsym, _offschn, boosting, _nrsym, _nrschn, _rep)	do { \	dlmapie_1cid_sh4_set_rsv(p, buf); \	(p)->diuc = _diuc; \	(p)->ncid = 1; \	dlmapie_1cid_sh4_set_cid(p, cid); \	(p)->offsym = _offsym; \	(p)->offschn = _offschn; \	dlmapie_1cid_sh4_set_boosting(p, boosting); \	(p)->nrsym = _nrsym; \	(p)->nrschn =  _nrschn; \	(p)->rep = _rep; \}while (0)typedef struct ulmaphdr_s{	macmsghdr_t hdr;	uint8_t rsv;	uint8_t ucd_count;	uint32_t allocation_start_time __attribute__ ((packed)) ;	uint8_t no_ofdma_symbols;}ulmaphdr_t;typedef struct ulmapie_s{	uint8_t cid_h8;	uint8_t cid_l8;	uint8_t duration_h4	:4,		uiuc		:4;	uint8_t repetition_coding_indication	:2,		duration_l6			:6;}ulmapie_t;#define ulmapie_get_cid(p) (uint16_t)((p)->cid_h8 << 8 | (p)->cid_l8)#define ulmapie_set_cid(p, cid) do{ \	(p)->cid_h8 = ((cid) & 0xff00 ) >> 8; \	(p)->cid_l8 = (cid) & 0xff; \}while (0)#define ulmapie_get_duration(p) (uint16_t)((p)->duration_h4 << 6 | (p)->duration_l6)#define ulmapie_set_duration(p, duration) do{ \	(p)->duration_h4 = ((duration) & 0x3c0) >> 6; \	(p)->duration_l6 = (duration) & 0x3f; \}while (0)#define ulmapie_set(p, cid, _uiuc, duration, _repetition_coding_indication) do{ \	ulmapie_set_cid(p, cid); \	(p)->uiuc = (_uiuc); \	ulmapie_set_duration(p, duration); \	(p)->repetition_coding_indication = (_repetition_coding_indication); \}while (0)typedef struct ulmapie_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 pad				:4,		repetition_coding_indication	:2,		duration_l2			:2;}ulmapie_sh4_t;#define ulmapie_sh4_set_rsv(p, buf) do{ \	(p)->rsv = (*((uint8_t *)(buf)-1) & 0xf0) >> 4; \}while (0)#define ulmapie_sh4_get_cid(p) (uint16_t)((p)->cid_h4 << 12 | (p)->cid_m8 << 4 | (p)->cid_l4)#define ulmapie_sh4_set_cid(p, cid) do{ \	(p)->cid_h4 = ((cid) & 0xf000) >> 12; \	(p)->cid_m8 = ((cid) & 0xff0) >> 4; \	(p)->cid_l4 = (cid) & 0xf; \}while (0)#define ulmapie_sh4_get_duration(p) (uint16_t)((p)->duration_h8 << 2 | (p)->duration_l2)#define ulmapie_sh4_set_duration(p, duration) do{ \	(p)->duration_h8 = ((duration) & 0xffc) >> 2; \	(p)->duration_l2 = (duration) & 0x3; \}while (0)#define ulmapie_sh4_set(p, buf, cid, _uiuc, duration, _repetition_coding_indication) do{ \	ulmapie_sh4_set_rsv(p, buf); \	ulmapie_sh4_set_cid(p, cid); \	(p)->uiuc = (_uiuc); \	ulmapie_sh4_set_duration(p, duration); \	(p)->repetition_coding_indication = (_repetition_coding_indication); \}while (0)typedef struct aasulmapie_s{	uint8_t cid_h8;	uint8_t cid_l8;	uint8_t duration_h4	:4,		uiuc		:4;	uint8_t repetition_coding_indication	:2,			duration_l6			:6;	uint8_t slot_offset_h8;	uint8_t pad		:4,		slot_offset_l4	:4;}aasulmapie_t;#define aasulmapie_get_cid(p) ulmapie_get_cid(p)#define aasulmapie_set_cid(p, cid) ulmapie_set_cid(p, cid)#define aasulmapie_get_duration(p) ulmapie_get_duration(p)#define aasulmapie_set_duration(p, duration) ulmapie_set_duration(p, duration)#define aasulmapie_get_slot_offset(p) (uint16_t)((p)->slot_offset_h8 << 4 | (p)->slot_offset_l4)#define aasulmapie_set_slot_offset(p, slot_offset) do{ \	(p)->slot_offset_h8 = ((slot_offset) & 0xff0) >> 4; \	(p)->slot_offset_h4 = (slot_offset) & 0xf >> 8; \}while (0)#define amculzoneulmapie aasulmapie;

⌨️ 快捷键说明

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