The RLC block just arrived on pdch. Figure out to which TBF it belongs and pass it on to the RLCEngine for assembly into a PDU.
| 1568 | // The RLC block just arrived on pdch. Figure out to which TBF it belongs and |
| 1569 | // pass it on to the RLCEngine for assembly into a PDU. |
| 1570 | static void processRLCUplinkDataBlock(PDCHL1FEC *pdch, RLCRawBlock *src,TBF *restbf) |
| 1571 | { |
| 1572 | RLCUplinkDataBlock *rb = new RLCUplinkDataBlock(src); |
| 1573 | |
| 1574 | // If this flag is set, data blocks are supposed to arrive |
| 1575 | // only on odd numbered blocks |
| 1576 | if (gFixIdleFrame && (0==(src->mBSN&1))) { |
| 1577 | GPRSLOG(1) << "@@@OOPS: Even numbered uplink data block:"<<src->mBSN; |
| 1578 | } |
| 1579 | |
| 1580 | // Reassociate the block with the TBF to which it belongs: |
| 1581 | //GPRSLOG(1) << "### Uplink Data Block tfi="<<rb->mTFI<< " bsn="<<src->mBSN; |
| 1582 | TBF *tbf = pdch->getTFITBF(rb->mTFI,RLCDir::Up); |
| 1583 | if (tbf) { |
| 1584 | // The rd data is from the RACH, and is pretty old; |
| 1585 | // Use the new RSSI from RLCRawBlock. |
| 1586 | //if (rd.mValid) { |
| 1587 | // tbf->mtMS->setRadData(rd); |
| 1588 | // tbf->setRadData(rd); |
| 1589 | //} |
| 1590 | // In the calling function processUplinkBlock we looked up the TBF by USF |
| 1591 | // and already counted it. Here we are looking up the TBF by TFI. |
| 1592 | // I am leaving in both calls in case there is a problem, but we wont |
| 1593 | // double count the block for reporting purposes. |
| 1594 | tbf->mtMS->setRadData(src->mRD); |
| 1595 | tbf->mtMS->talkedUp(true); // Mark time, but dont double count. |
| 1596 | |
| 1597 | //GPRSLOG(1) << "### Uplink Data Block tfi="<<rb->mTFI |
| 1598 | // <<" tbf="<<tbf << " bsn="<<src->mBSN; |
| 1599 | if (GPRSDebug&2) { |
| 1600 | std::ostringstream oss; |
| 1601 | rb->RLCUplinkDataBlockHeader::text(oss); |
| 1602 | GPRSLOG(2) << "Uplink Data Block tfi="<<rb->mTFI |
| 1603 | <<" tbf=" <<tbf <<" bsn="<<src->mBSN <<tbf<<oss.str(); |
| 1604 | } |
| 1605 | if (restbf && restbf != tbf) { |
| 1606 | GLOG(ERR) << "Incoming block reservation does not match "<<tbf<< LOGVAR(restbf); |
| 1607 | } |
| 1608 | tbf->engineRecvDataBlock(rb,pdch->TN()); |
| 1609 | } else { |
| 1610 | //GPRSLOG(1) << "### Uplink Data Block with unknown tfi="<<rb->mTFI |
| 1611 | // << " bsn="<<src->mBSN; |
| 1612 | GLOG(WARNING) << "Uplink Data Block with TFI="<<rb->mTFI |
| 1613 | << " bsn="<<src->mBSN <<" unassociated with TBF"; |
| 1614 | } |
| 1615 | } |
| 1616 | |
| 1617 | |
| 1618 | // The MS is requesting an uplink TBF. |
no test coverage detected