📄 dlul_map_analyze.c
字号:
subchannel_offset = (UINT16)(((*(p_dlul_map_data + i) & 0x0f) << 3) | ((*(p_dlul_map_data + i + 1) & 0xe0) >> 5)); //Subchannel offset
i++;
num_symbol = (UINT16)(((*(p_dlul_map_data + i) & 0x1f) << 2) | ((*(p_dlul_map_data + i + 1) & 0xc0) >> 6)); //Number of OFDMA symbols
i++;
num_subchannel = (UINT16)(((*(p_dlul_map_data + i) & 0x3f) << 1) | ((*(p_dlul_map_data + i + 1) & 0x80) >> 7)); //Number of Subchannels
i += 2;
}
repetition = 0;
/* calculate total number of slots of current burst */
burst_total_slot = (UINT16)(num_subchannel * (num_symbol >> 1));
/* assign burst parameter to uplink subframe stuct */
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_type = 1;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_index = burst_num;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].fec_code_type = 100;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_data_len_byte = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].ofdma_symbol_offset = ofdma_symbol_offset;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].subchannel_offset = subchannel_offset;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].boosting = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_symbol = num_symbol;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_subchannel = num_subchannel;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].repetition_coding = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_slot = burst_total_slot;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_slot_remain = burst_total_slot;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_subburst = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_block = 0;
/* increase burst index */
burst_num++;
}
/******************************** analyze CDMA RANGING IE **************************************/
/* CDMA RANGING burst */
else if(uiuc == 12){
/* increase the number of IE */
ie_cnt++;
/* CDMA RANGING IE is half-byte IE */
nibble_ie_cnt++;
/* if current byte is aligned to byte */
if(byte_align_flag == 0){
ofdma_symbol_offset = (UINT16)(*(p_dlul_map_data + i)); //OFDMA symbol offset
i++;
subchannel_offset = (UINT16)((*(p_dlul_map_data + i) & 0xfe) >> 1); //Subchannel offset
num_symbol = (UINT16)(((*(p_dlul_map_data + i) & 0x01) << 6) | ((*(p_dlul_map_data + i + 1) & 0xfc) >> 2)); //Number of OFDMA symbols
i++;
num_subchannel = (UINT16)(((*(p_dlul_map_data + i) & 0x03) << 5) | ((*(p_dlul_map_data + i + 1) & 0xf8) >> 3)); //Number of Subchannels
i++;
ranging_method = (UINT16)((*(p_dlul_map_data + i) & 0x06) >> 1); //Ranging method
i++;
}
else{
ofdma_symbol_offset = (UINT16)(((*(p_dlul_map_data + i - 1) & 0x0f) << 4) | ((*(p_dlul_map_data + i) & 0xf0) >> 4)); //OFDMA symbol offset
subchannel_offset = (UINT16)(((*(p_dlul_map_data + i) & 0x0f) << 3) | ((*(p_dlul_map_data + i + 1) & 0xe0) >> 5)); //Subchannel offset
i++;
num_symbol = (UINT16)(((*(p_dlul_map_data + i) & 0x1f) << 2) | ((*(p_dlul_map_data + i + 1) & 0xc0) >> 6)); //Number of OFDMA symbols
i++;
num_subchannel = (UINT16)(((*(p_dlul_map_data + i) & 0x3f) << 1) | ((*(p_dlul_map_data + i + 1) & 0x80) >> 7)); //Number of Subchannels
i++;
ranging_method = (UINT16)((*(p_dlul_map_data + i) & 0x60) >> 5); //Ranging method
i++;
}
repetition = 0;
/* calculate total number of slots of current burst */
burst_total_slot = (UINT16)(num_subchannel * (num_symbol / 3));
/* assign burst parameter to uplink subframe stuct */
if(ranging_method == 0 || ranging_method == 1){
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_type = 2;
}
else if(ranging_method == 2 || ranging_method == 3){
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_type = 3;
}
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_index = burst_num;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].fec_code_type = 100;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_data_len_byte = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].ofdma_symbol_offset = ofdma_symbol_offset;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].subchannel_offset = subchannel_offset;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].boosting = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_symbol = num_symbol;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_subchannel = num_subchannel;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].repetition_coding = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_slot = burst_total_slot;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_slot_remain = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_subburst = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_block = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].ranging_method = ranging_method;
/* increase burst index */
burst_num++;
}
/******************************** analyze CDMA Allocation IE **************************************/
else if(uiuc == 14){
/* increase the number of IE */
ie_cnt++;
/* CDMA RANGING IE is half-byte IE */
nibble_ie_cnt++;
/* if current byte is aligned to byte */
if(byte_align_flag == 0){
cdma_alloc_dura = (UINT16)((*(p_dlul_map_data + i) & 0xfc) >> 2);
trans_uiuc = (UINT16)(((*(p_dlul_map_data + i) & 0x03) << 2) | ((*(p_dlul_map_data + i + 1) & 0xc0) >> 6));
i++;
repetition = (UINT16)((*(p_dlul_map_data + i) & 0x30) >> 4);
frm_num_index = (UINT16)(*(p_dlul_map_data + i) & 0x0f);
i++;
ranging_code = (UINT16)(*(p_dlul_map_data + i));
i++;
ranging_sym = (UINT16)(*(p_dlul_map_data + i));
i++;
ranging_subch = (UINT16)((*(p_dlul_map_data + i) & 0xfe) >> 1);
i++;
}
else{
cdma_alloc_dura = (UINT16)(((*(p_dlul_map_data + i - 1) & 0x0f) << 2) | ((*(p_dlul_map_data + i) & 0xc0) >> 6));
trans_uiuc = (UINT16)((*(p_dlul_map_data + i) & 0x3c) >> 2);
repetition = (UINT16)(*(p_dlul_map_data + i) & 0x03);
i++;
frm_num_index = (UINT16)((*(p_dlul_map_data + i) & 0xf0) >> 4);
ranging_code = (UINT16)(((*(p_dlul_map_data + i) & 0x0f) << 4) | ((*(p_dlul_map_data + i + 1) & 0xf0) >> 4));
i++;
ranging_sym = (UINT16)(((*(p_dlul_map_data + i) & 0x0f) << 4) | ((*(p_dlul_map_data + i + 1) & 0xf0) >> 4));
i++;
ranging_subch = (UINT16)(((*(p_dlul_map_data + i) & 0x0f) << 3) | ((*(p_dlul_map_data + i + 1) & 0xe0) >> 5));
i += 2;
}
fec_code_type = uiuc_fec_code[trans_uiuc - 1];
slot_to_blk(fec_code_type,cdma_alloc_dura,repetition,&burst_data_len_byte,&burst_num_slot,&burst_num_slot_remain,&num_block,uncoded_blk_len,coded_blk_len,blk_num_slot);
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_type = 8;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_index = burst_num;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].fec_code_type = fec_code_type;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_data_len_byte = burst_data_len_byte;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].ofdma_symbol_offset = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].subchannel_offset = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].boosting = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_symbol = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_subchannel = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].repetition_coding = repetition;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_slot = burst_num_slot;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_slot_remain = burst_num_slot_remain;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_subburst = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_block = num_block;
/* assign block parameter of current subburst to subframe stuct */
for(k = 0; k < num_block; k++){
p_ul_subframe_tx->zone[zone_num].burst[burst_num].block[k].block_index = k;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].block[k].block_len_uncoded = uncoded_blk_len[k];
p_ul_subframe_tx->zone[zone_num].burst[burst_num].block[k].block_len_coded = coded_blk_len[k];
p_ul_subframe_tx->zone[zone_num].burst[burst_num].block[k].number_of_slot = blk_num_slot[k];
}
/* increase burst index */
burst_num++;
}
/********************************** analyze Extended-2 IE ****************************************/
/* Extended-2 UIUC */
else if(uiuc == 11){
/* if current byte is aligned to byte */
if(byte_align_flag == 0){
e_uiuc = (UINT16)((*(p_dlul_map_data + i) & 0xf0) >> 4);
i++;
byte_align_flag = 1;
}
else{
e_uiuc = (UINT16)(*(p_dlul_map_data + i - 1) & 0x0f);
i++;
byte_align_flag = 0;
}
/********************************** analyze HARQ ACKCH IE ****************************************/
/* HARQ ACK Channel burst */
if(e_uiuc == 0x08){
/* increase the number of IE */
ie_cnt++;
/* if current byte is aligned to byte */
if(byte_align_flag == 0){
i++;
ofdma_symbol_offset = (UINT16)(*(p_dlul_map_data + i)); //OFDMA symbol offset
i++;
subchannel_offset = (UINT16)((*(p_dlul_map_data + i) & 0xfe) >> 1); //Subchannel offset
num_symbol = (UINT16)(((*(p_dlul_map_data + i) & 0x01) << 4) | ((*(p_dlul_map_data + i + 1) & 0xf0) >> 4)); //Number of OFDMA symbols
i++;
num_subchannel = (UINT16)(*(p_dlul_map_data + i) & 0x0f); //Number of Subchannels
i++;
}
else{
ofdma_symbol_offset = (UINT16)(((*(p_dlul_map_data + i) & 0x0f) << 4) | ((*(p_dlul_map_data + i + 1) & 0xf0) >> 4)); //OFDMA symbol offset
i++;
subchannel_offset = (UINT16)(((*(p_dlul_map_data + i) & 0x0f) << 3) | ((*(p_dlul_map_data + i + 1) & 0xe0) >> 5)); //Subchannel offset
i++;
num_symbol = (UINT16)(*(p_dlul_map_data + i) & 0x1f); //Number of OFDMA symbols
i++;
num_subchannel = (UINT16)((*(p_dlul_map_data + i) & 0xf0) >> 4);
i++;
}
repetition = 0;
/* calculate total number of slots of current burst */
burst_total_slot = (UINT16)(num_subchannel * (num_symbol >> 1));
/* assign burst parameter to uplink subframe stuct */
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_type = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_index = burst_num;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].fec_code_type = 100;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_data_len_byte = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].ofdma_symbol_offset = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].subchannel_offset = subchannel_offset;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].boosting = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_symbol = num_symbol;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_subchannel = num_subchannel;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].repetition_coding = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_slot = burst_total_slot;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_slot_remain = burst_total_slot;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_subburst = 0;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].number_of_block = 0;
/* increase burst index */
burst_num++;
}
/* other Extended-2 UL_MAP IE is not supported now */
else{
printf("Error: This extended-2 UL_MAP IE is not supported!\n");
exit_phy(-507);
}
}
/****************** analyze normal UL_MAP IE with different burst profiles **********************/
else if(uiuc >= 1 && uiuc <= 10){
/* increase the number of IE */
ie_cnt++;
/* if current byte is aligned to byte */
if(byte_align_flag == 0){
burst_total_slot = ((UINT16)(*(p_dlul_map_data + i)) << 2) | ((UINT16)(*(p_dlul_map_data + i + 1) & 0xc0) >> 6); //Duration in OFDMA slots
i++;
repetition = (UINT16)((*(p_dlul_map_data + i) & 0x30) >> 4); //Repetition coding indication
i++;
}
else{
burst_total_slot = ((UINT16)(*(p_dlul_map_data + i - 1) & 0x0f) << 6) | ((UINT16)(*(p_dlul_map_data + i) & 0xfc) >> 2); //Duration in OFDMA slots
repetition = (UINT16)(*(p_dlul_map_data + i) & 0x03);
i++;
}
fec_code_type = uiuc_fec_code[uiuc - 1];
slot_to_blk(fec_code_type,burst_total_slot,repetition,&burst_data_len_byte,&burst_num_slot,&burst_num_slot_remain,&num_block,uncoded_blk_len,coded_blk_len,blk_num_slot);
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_type = 7;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_index = burst_num;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].fec_code_type = fec_code_type;
p_ul_subframe_tx->zone[zone_num].burst[burst_num].burst_data_len_byte = burst_data_len_byte;
p_ul_subframe_tx->zone[zone_num].bu
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -