X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_utils.c;h=8a5f298db5ca64f1b63fb59cd358679549d43d95;hb=1931d49496d91723b7c54c63db50ff4ee8ff03b6;hp=1397c65d85eeba7dc9bf4a535a93500c11e52e33;hpb=49dec2270f1b3c03b36a801e153bf0786edffc24;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_utils.c b/src/5gnrsch/sch_utils.c index 1397c65d8..8a5f298db 100644 --- a/src/5gnrsch/sch_utils.c +++ b/src/5gnrsch/sch_utils.c @@ -429,6 +429,27 @@ uint16_t mcsTable[32][3] = { { 30, 4, 0}, /* mcs index 30 */ { 31, 6, 0}}; /* mcs index 31 */ +/* PUCCH resource sets before dedicated PUCCH resource configuration */ +/* Table 9.2.1-1 spec 38.213 */ +uint8_t pucchResourceSet[MAX_PUCCH_RES_SET_IDX][4] = { +{ 0, 12, 2, 0 }, /* index 0 */ +{ 0, 12, 2, 0 }, /* index 1 */ +{ 0, 12, 2, 3 }, /* index 2 */ +{ 1, 10, 4, 0 }, /* index 3 */ +{ 1, 10, 4, 0 }, /* index 4 */ +{ 1, 10, 4, 2 }, /* index 5 */ +{ 1, 10, 4, 4 }, /* index 6 */ +{ 1, 4, 10, 0 }, /* index 7 */ +{ 1, 4, 10, 0 }, /* index 8 */ +{ 1, 4, 10, 2 }, /* index 9 */ +{ 1, 4, 10, 4 }, /* index 10 */ +{ 1, 0, 14, 0 }, /* index 11 */ +{ 1, 0, 14, 0 }, /* index 12 */ +{ 1, 0, 14, 2 }, /* index 13 */ +{ 1, 0, 14, 4 }, /* index 14 */ +{ 1, 0, 14, 0 }, /* index 15 */ +}; + /** * @brief frequency domain allocation function. * @@ -448,7 +469,7 @@ void schAllocFreqDomRscType0(uint16_t startPrb, uint16_t prbSize, uint8_t *freqD { uint8_t remBits = prbSize; /* each bit represents 6 PRBs */ uint8_t firstByte = 1; - uint8_t numBits,startBit,byteCount = 0; + uint8_t numBits,startBit,byteCount = 5; while(remBits) { @@ -456,7 +477,7 @@ void schAllocFreqDomRscType0(uint16_t startPrb, uint16_t prbSize, uint8_t *freqD if(startPrb/8) { startPrb -= 8; - byteCount++; + byteCount--; continue; } @@ -477,12 +498,12 @@ void schAllocFreqDomRscType0(uint16_t startPrb, uint16_t prbSize, uint8_t *freqD numBits = 8 - startBit; /* bit operation to set the bits */ - SET_BITS((startBit % 8),numBits,freqDomain[byteCount]) + SET_BITS_MSB((startBit % 8),numBits,freqDomain[byteCount]) firstByte = 0; /* the ramaining bits should be subtracted with the numBits set in this byte */ remBits -= numBits; - byteCount++; + byteCount--; } }