PUCCH CHANGES AT SCH AND LOWER MAC
[o-du/l2.git] / src / phy_stub / l1_bdy1.c
index 9bb8362..cedcc3c 100644 (file)
@@ -333,7 +333,7 @@ uint16_t l1BuildAndSendCrcInd(uint16_t slot, uint16_t sfn)
    return ROK;
 } /* l1BuildAndSendCrcInd */
 
-
+#ifdef FAPI
 /*******************************************************************
  *
  * @brief Build and send Rx data indication
@@ -351,9 +351,8 @@ uint16_t l1BuildAndSendCrcInd(uint16_t slot, uint16_t sfn)
  *         RFAILED - failure
  *
  * ****************************************************************/
-uint16_t l1BuildAndSendRxDataInd(uint16_t slot, uint16_t sfn)
+uint16_t l1BuildAndSendRxDataInd(uint16_t slot, uint16_t sfn, fapi_ul_pusch_pdu_t puschPdu)
 {
-#ifdef FAPI
    uint8_t idx = 0;
    fapi_rx_data_indication_t *rxDataInd;
    fapi_pdu_ind_info_t       *pduInfo;
@@ -373,10 +372,10 @@ uint16_t l1BuildAndSendRxDataInd(uint16_t slot, uint16_t sfn)
    rxDataInd->numPdus = 1;
 
    pduInfo = &rxDataInd->pdus[idx];
-   pduInfo->handle = 0;
-   pduInfo->rnti = 0;
-   pduInfo->harqId = 0;
-   pduInfo->pduLength = 24;
+   pduInfo->handle = puschPdu.handle;
+   pduInfo->rnti = puschPdu.rnti;
+   pduInfo->harqId = puschPdu.puschData.harqProcessId;
+   pduInfo->pduLength = puschPdu.puschData.tbSize;
    pduInfo->ul_cqi = 0;
    pduInfo->timingAdvance = 0;
    pduInfo->rssi = 0;
@@ -416,10 +415,9 @@ uint16_t l1BuildAndSendRxDataInd(uint16_t slot, uint16_t sfn)
    if(pduInfo->pduLength)
       MAC_FREE(pduInfo->pduData, pduInfo->pduLength);
    MAC_FREE(rxDataInd, sizeof(fapi_rx_data_indication_t));
-#endif
    return ROK;
 }
-
+#endif
 
 /*******************************************************************
  *
@@ -597,7 +595,7 @@ PUBLIC S16 l1HdlDlTtiReq(uint16_t msgLen, void *msg)
    fapi_dl_tti_req_t *dlTtiReq;
    dlTtiReq = (fapi_dl_tti_req_t *)msg;
 
-   printf("\nPHY STUB: Received DL TTI Request");
+   printf("\nPHY STUB: DL TTI Request at sfn=%d slot=%d",dlTtiReq->sfn,dlTtiReq->slot);
 #if 0
    printf("\nPHY_STUB:  SFN     %d", dlTtiReq->sfn);
    printf("\nPHY_STUB:  SLOT    %d", dlTtiReq->slot);
@@ -658,7 +656,7 @@ PUBLIC S16 l1HdlTxDataReq(uint16_t msgLen, void *msg)
    fapi_tx_data_req_t *txDataReq;
    txDataReq = (fapi_tx_data_req_t *)msg;
 
-   DU_LOG("\nPHY STUB: Received TX DATA Request");
+   DU_LOG("\nPHY STUB: TX DATA Request at sfn=%d slot=%d",txDataReq->sfn,txDataReq->slot);
 
        MAC_FREE(txDataReq, msgLen);
 #endif
@@ -699,7 +697,19 @@ PUBLIC S16 l1HdlUlTtiReq(uint16_t msgLen, void *msg)
        while(numPdus)
        {
                if(ulTtiReq->pdus[numPdus-1].pduType == 0)
+               {
                        DU_LOG("\nPHY STUB: PRACH PDU");
+               }
+      if(ulTtiReq->pdus[numPdus-1].pduType == 1)
+      {
+         DU_LOG("\nPHY STUB: PUSCH PDU");                      
+         l1BuildAndSendRxDataInd(ulTtiReq->slot, ulTtiReq->sfn, \
+                          ulTtiReq->pdus[numPdus-1].u.pusch_pdu); 
+      }
+               if(ulTtiReq->pdus[numPdus-1].pduType == 2)
+          {
+                  DU_LOG("\nPHY STUB: PUCCH PDU");
+               }
                numPdus--;
        }