Commit 1bb83adc authored by Cedric Roux's avatar Cedric Roux

nr pdcp: bugfix: D/C bit set only for DRBs

parent 0d313542
...@@ -140,16 +140,24 @@ static void nr_pdcp_entity_recv_sdu(nr_pdcp_entity_t *entity, ...@@ -140,16 +140,24 @@ static void nr_pdcp_entity_recv_sdu(nr_pdcp_entity_t *entity,
int sn; int sn;
int header_size; int header_size;
char buf[size+3+4]; char buf[size+3+4];
int dc_bit;
count = entity->tx_next; count = entity->tx_next;
sn = entity->tx_next & entity->sn_max; sn = entity->tx_next & entity->sn_max;
/* D/C bit is only to be set for DRBs */
if (entity->type == NR_PDCP_DRB_AM || entity->type == NR_PDCP_DRB_UM) {
dc_bit = 0x80;
} else {
dc_bit = 0;
}
if (entity->sn_size == 12) { if (entity->sn_size == 12) {
buf[0] = 0x80 | ((sn >> 8) & 0xf); buf[0] = dc_bit | ((sn >> 8) & 0xf);
buf[1] = sn & 0xff; buf[1] = sn & 0xff;
header_size = 2; header_size = 2;
} else { } else {
buf[0] = 0x80 | ((sn >> 16) & 0x3); buf[0] = dc_bit | ((sn >> 16) & 0x3);
buf[1] = (sn >> 8) & 0xff; buf[1] = (sn >> 8) & 0xff;
buf[2] = sn & 0xff; buf[2] = sn & 0xff;
header_size = 3; header_size = 3;
......
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