Support parsing of multiple mac resources in the same timeslot

Change-Id: Ic2956a5f10cffe296b76a290a0d16f45461eb2e7
This commit is contained in:
wbokslag 2022-09-16 16:12:11 +02:00
parent 40843da7bd
commit cb8383cb76
3 changed files with 25 additions and 15 deletions

View File

@ -307,10 +307,28 @@ void tp_sap_udata_ind(enum tp_sap_data_type type, int blk_num, const uint8_t *bi
/* FIXME: do something */
break;
}
/* send Rx time along with the TMV-UNITDATA.ind primitive */
memcpy(&tup->tdma_time, &tcd->time, sizeof(tup->tdma_time));
upper_mac_prim_recv(&ttp->oph, tms);
int parsed = 0;
int offset = 0;
unsigned char *orig_head = msg->head;
unsigned char *orig_tail = msg->tail;
while (parsed != -1 && offset < tbp->type1_bits - 16) {
/* send Rx time along with the TMV-UNITDATA.ind primitive */
memcpy(&tup->tdma_time, &tcd->time, sizeof(tup->tdma_time));
parsed = upper_mac_prim_recv(&ttp->oph, tms);
/* Increment head and l1h ptrs and reset tail to end of msg (may be altered by removing FCS) */
offset += parsed;
msg->head = orig_head + offset;
msg->tail = orig_tail;
msg->len = msg->tail - msg->head;
msg->l1h = msg->head;
msg->l2h = 0;
msg->l3h = 0;
msg->l4h = 0;
}
talloc_free(msg);
talloc_free(ttp);
}

View File

@ -64,16 +64,11 @@ struct msgb *tetra_gsmtap_makemsg(struct tetra_tdma_time *tm, enum tetra_log_cha
int tetra_gsmtap_sendmsg(struct msgb *msg)
{
int rc;
if (g_gti) {
rc = gsmtap_sendmsg_free(g_gti, msg);
return gsmtap_sendmsg(g_gti, msg);
} else {
msgb_free(msg);
rc = 0;
return 0;
}
return rc;
}
int tetra_gsmtap_init(const char *host, uint16_t port)

View File

@ -554,8 +554,5 @@ int upper_mac_prim_recv(struct osmo_prim_hdr *op, void *priv)
break;
}
talloc_free(op->msg);
talloc_free(op);
return pdu_bits;
}