{
uint16_t bytePos = 0;
uint8_t bitPos = 7;
- uint8_t idx = 0;
+ uint8_t pduIdx = 0;
uint8_t macPdu[tbSize];
memset(macPdu, 0, (tbSize * sizeof(uint8_t)));
/* PACK ALL MAC CE */
if(macCeData != NULLP)
{
- for(idx = 0; idx < macCeData->numCes; idx++)
+ for(pduIdx = 0; pduIdx < macCeData->numCes; pduIdx++)
{
- lcid = macCeData->macCe[idx].macCeLcid;
- switch(lcid)
- {
- case MAC_LCID_CRI:
- {
- /* Packing fields into MAC PDU R/R/LCID */
- packBytes(macPdu, &bytePos, &bitPos, RBit, (RBitSize * 2));
- packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
- memcpy(&macPdu[bytePos], macCeData->macCe[idx].macCeValue,\
- MAX_CRI_SIZE);
- bytePos += MAX_CRI_SIZE;
- break;
- }
- default:
- DU_LOG("\nERROR --> MAC: Invalid LCID %d in mac pdu",lcid);
- break;
- }
+ lcid = macCeData->macCe[pduIdx].macCeLcid;
+ switch(lcid)
+ {
+ case MAC_LCID_CRI:
+ {
+ /* Packing fields into MAC PDU R/R/LCID */
+ packBytes(macPdu, &bytePos, &bitPos, RBit, (RBitSize * 2));
+ packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
+ memcpy(&macPdu[bytePos], macCeData->macCe[pduIdx].macCeValue,\
+ MAX_CRI_SIZE);
+ bytePos += MAX_CRI_SIZE;
+ break;
+ }
+ default:
+ DU_LOG("\nERROR --> MAC: Invalid LCID %d in mac pdu",lcid);
+ break;
+ }
}
}
/* PACK ALL MAC SDUs */
- for(idx = 0; idx < dlData->numPdu; idx++)
+ for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++)
{
- lcid = dlData->pduInfo[idx].lcId;
+ lcid = dlData->pduInfo[pduIdx].lcId;
switch(lcid)
{
- case MAC_LCID_CCCH:
- case MAC_LCID_MIN ... MAC_LCID_MAX :
- {
- lenField = dlData->pduInfo[idx].pduLen;
- if(dlData->pduInfo[idx].pduLen > 255)
- {
- FBit = 1;
- lenFieldSize = 16;
-
- }
- else
- {
- FBit = 0;
- lenFieldSize = 8;
- }
- /* Packing fields into MAC PDU R/F/LCID/L */
- packBytes(macPdu, &bytePos, &bitPos, RBit, RBitSize);
- packBytes(macPdu, &bytePos, &bitPos, FBit, FBitSize);
- packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
- packBytes(macPdu, &bytePos, &bitPos, lenField, lenFieldSize);
- memcpy(&macPdu[bytePos], dlData->pduInfo[idx].dlPdu, lenField);
- bytePos += lenField;
- break;
- }
-
- default:
- DU_LOG("\nERROR --> MAC: Invalid LCID %d in mac pdu",lcid);
- break;
+ case MAC_LCID_CCCH:
+ case MAC_LCID_MIN ... MAC_LCID_MAX :
+ {
+ lenField = dlData->pduInfo[pduIdx].pduLen;
+ if(dlData->pduInfo[pduIdx].pduLen > 255)
+ {
+ FBit = 1;
+ lenFieldSize = 16;
+
+ }
+ else
+ {
+ FBit = 0;
+ lenFieldSize = 8;
+ }
+ /* Packing fields into MAC PDU R/F/LCID/L */
+ packBytes(macPdu, &bytePos, &bitPos, RBit, RBitSize);
+ packBytes(macPdu, &bytePos, &bitPos, FBit, FBitSize);
+ packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
+ packBytes(macPdu, &bytePos, &bitPos, lenField, lenFieldSize);
+ memcpy(&macPdu[bytePos], dlData->pduInfo[pduIdx].dlPdu, lenField);
+ bytePos += lenField;
+ break;
+ }
+
+ default:
+ DU_LOG("\nERROR --> MAC: Invalid LCID %d in mac pdu",lcid);
+ break;
}
}
if(bytePos < tbSize && (tbSize-bytePos >= 1))
/* pdcch and pdsch data is filled */
schDlRsrcAllocDlMsg(dlMsgAlloc, cell, crnti, &accumalatedSize, slot);
- /* Calculated TB size could be less than the total size requested.
- * Hence, updated the scheduled bytes report. Following is valid only for
- * one LC.
- * TODO : Update the scheduling byte report for multiple LC based on QCI
+
+ /* TODO : Update the scheduling byte report for multiple LC based on QCI
* and Priority */
- dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc -1].schBytes = accumalatedSize;
+ /* As of now, the total number of bytes scheduled for a slot is divided
+ * equally amongst all LC with pending data. This is avoid starving of any
+ * LC
+ * */
+ accumalatedSize = accumalatedSize/dlMsgAlloc->numLc;
+ for(lcIdx = 0; lcIdx < dlMsgAlloc->numLc; lcIdx ++)
+ dlMsgAlloc->lcSchInfo[lcIdx].schBytes = accumalatedSize;
/* PUCCH resource */
schAllocPucchResource(cell, dlMsgAlloc->crnti, slot);
char ch;
uint8_t teId = 0;
uint8_t ret = ROK;
+ uint8_t cnt = 0;
while(true)
{
if((ch = getchar()) == 'd')
{
- uint8_t cnt =0;
+ /* Change #if 0 to #if 1 to take input from user */
+#if 0
DU_LOG("\n EGTP --> : Enter TEID id(1..10) where DL Data to be sent\n");
scanf("%d",&teId);
}
/* Start Pumping data from CU to DU */
DU_LOG("\nDEBUG --> EGTP: Sending DL User Data(teId:%d)\n",teId);
-
+
+ cnt =0;
while(cnt < NUM_DL_PACKETS)
{
- ret = cuEgtpDatReq(teId);
- if(ret != ROK)
- {
- DU_LOG("\nERROR --> EGTP: Issue with teid=%d\n",teId);
- break;
- }
- cnt++;
+ ret = cuEgtpDatReq(teId);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> EGTP: Issue with teid=%d\n",teId);
+ break;
+ }
+ cnt++;
+ }
+#else
+ for(teId = 1; teId <= NUM_TUNNEL_TO_PUMP_DATA; teId++)
+ {
+ DU_LOG("\nDEBUG --> EGTP: Sending DL User Data(teId:%d)\n",teId);
+ cnt =0;
+ while(cnt < NUM_DL_PACKETS)
+ {
+ ret = cuEgtpDatReq(teId);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> EGTP: Issue with teid=%d\n",teId);
+ break;
+ }
+ cnt++;
+ }
}
+#endif
continue;
}
}