Commit 288c29da authored by Robert Schmidt's avatar Robert Schmidt

Apply review suggestions

parent a7e7d05d
...@@ -287,8 +287,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, ...@@ -287,8 +287,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) { for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) {
c16_t *r=(c16_t*)&rxdataF[aa][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[l]]; c16_t *r=(c16_t*)&rxdataF[aa][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[l]];
for (n=0;n<12;n++) { for (n=0;n<12;n++) {
xr[aa][l][n].r +=(int32_t)x_re[l][n]*r[n].r+(int32_t)x_im[l][n]*r[n].i; xr[aa][l][n].r += (int32_t)x_re[l][n] * r[n].r + (int32_t)x_im[l][n] * r[n].i;
xr[aa][l][n].i +=(int32_t)x_re[l][n]*r[n].i-(int32_t)x_im[l][n]*r[n].r; xr[aa][l][n].i += (int32_t)x_re[l][n] * r[n].i - (int32_t)x_im[l][n] * r[n].r;
#ifdef DEBUG_NR_PUCCH_RX #ifdef DEBUG_NR_PUCCH_RX
printf("x (%d,%d), r%d.%d (%d,%d), xr (%lld,%lld)\n", printf("x (%d,%d), r%d.%d (%d,%d), xr (%lld,%lld)\n",
x_re[l][n],x_im[l][n],l2,re_offset[l],r[n].r,r[n].i,xr[aa][l][n].r,xr[aa][l][n].i); x_re[l][n],x_im[l][n],l2,re_offset[l],r[n].r,r[n].i,xr[aa][l][n].r,xr[aa][l][n].i);
...@@ -317,12 +317,12 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, ...@@ -317,12 +317,12 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) { for (int aa=0;aa<frame_parms->nb_antennas_rx;aa++) {
corr_re[aa][l]=0; corr_re[aa][l]=0;
corr_im[aa][l]=0; corr_im[aa][l]=0;
for (n=0;n<12;n++) { for (n = 0; n < 12; n++) {
corr_re[aa][l]+=xr[aa][l][n].r*idft12_re[seq_index][n]+xr[aa][l][n].i*idft12_im[seq_index][n]; corr_re[aa][l] += xr[aa][l][n].r * idft12_re[seq_index][n] + xr[aa][l][n].i * idft12_im[seq_index][n];
corr_im[aa][l]+=xr[aa][l][n].r*idft12_im[seq_index][n]-xr[aa][l][n].i*idft12_re[seq_index][n]; corr_im[aa][l] += xr[aa][l][n].r * idft12_im[seq_index][n] - xr[aa][l][n].i * idft12_re[seq_index][n];
} }
corr_re[aa][l]>>=15; corr_re[aa][l] >>= 15;
corr_im[aa][l]>>=15; corr_im[aa][l] >>= 15;
} }
} }
LOG_D(PHY,"PUCCH IDFT[%d/%d] = (%ld,%ld)=>%f\n", LOG_D(PHY,"PUCCH IDFT[%d/%d] = (%ld,%ld)=>%f\n",
......
...@@ -118,14 +118,14 @@ typedef struct { ...@@ -118,14 +118,14 @@ typedef struct {
} __attribute__ ((__packed__)) NR_MAC_SUBHEADER_FIXED; } __attribute__ ((__packed__)) NR_MAC_SUBHEADER_FIXED;
static inline void getMacLen(uint8_t* pdu, uint16_t *mac_ce_len, uint16_t *mac_subheader_len) { static inline void getMacLen(uint8_t* pdu, uint16_t *mac_ce_len, uint16_t *mac_subheader_len) {
NR_MAC_SUBHEADER_SHORT *s=(NR_MAC_SUBHEADER_SHORT*) pdu; NR_MAC_SUBHEADER_SHORT *s = (NR_MAC_SUBHEADER_SHORT*) pdu;
NR_MAC_SUBHEADER_LONG *l=(NR_MAC_SUBHEADER_LONG*) pdu; NR_MAC_SUBHEADER_LONG *l = (NR_MAC_SUBHEADER_LONG*) pdu;
if (s->F) { if (s->F) {
*mac_subheader_len=sizeof(*l); *mac_subheader_len = sizeof(*l);
*mac_ce_len=ntohs(l->L); *mac_ce_len = ntohs(l->L);
} else { } else {
*mac_subheader_len=sizeof(*s); *mac_subheader_len = sizeof(*s);
*mac_ce_len=s->L; *mac_ce_len = s->L;
} }
} }
......
...@@ -2092,7 +2092,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, ...@@ -2092,7 +2092,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
pucch->is_common = current_harq->is_common; pucch->is_common = current_harq->is_common;
current_harq->active = false; current_harq->active = false;
current_harq->ack_received = false; current_harq->ack_received = false;
LOG_D(PHY,"%d.%d Sent %d ack on harq pid %d\n", frame, slot, current_harq->ack, dl_harq_pid); LOG_D(PHY,"%4d.%2d Sent %d ack on harq pid %d\n", frame, slot, current_harq->ack, dl_harq_pid);
} }
} }
} }
...@@ -3497,7 +3497,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, ...@@ -3497,7 +3497,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT))
return; return;
getMacLen(pduP, &mac_len, &mac_subheader_len); getMacLen(pduP, &mac_len, &mac_subheader_len);
LOG_D(NR_MAC, "[UE %d] Frame %d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, gNB_index, mac_len); LOG_D(NR_MAC, "[UE %d] %4d.%2d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, slot, rx_lcid, gNB_index, mac_len);
#if defined(ENABLE_MAC_PAYLOAD_DEBUG) #if defined(ENABLE_MAC_PAYLOAD_DEBUG)
LOG_T(MAC, "[UE %d] First 32 bytes of DLSCH : \n", module_idP); LOG_T(MAC, "[UE %d] First 32 bytes of DLSCH : \n", module_idP);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment