Bluetooth: controller: Unified ISO-AL TX SDU fragment count
Implemented incrementing TX SDU fragment count such that it indicates the number of completed SDU fragments in the PDU being emitted for both unframed and framed transmission. Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
This commit is contained in:
parent
64c9a521d4
commit
fc107a0775
|
@ -1202,6 +1202,7 @@ static isoal_status_t isoal_tx_try_emit_pdu(struct isoal_source *source,
|
|||
pp->payload_number,
|
||||
pp->pdu_written);
|
||||
pp->payload_number++;
|
||||
pp->sdu_fragments = 0;
|
||||
}
|
||||
|
||||
return err;
|
||||
|
@ -1273,11 +1274,12 @@ static isoal_status_t isoal_tx_unframed_produce(struct isoal_source *source,
|
|||
/* Reset PDU fragmentation count for this SDU */
|
||||
pp->pdu_cnt = 0;
|
||||
|
||||
/* The start of an unframed SDU will always be in a new PDU.
|
||||
* There cannot be any other fragments packed.
|
||||
*/
|
||||
pp->sdu_fragments = 0;
|
||||
}
|
||||
|
||||
pp->sdu_fragments++;
|
||||
|
||||
/* PDUs should be created until the SDU fragment has been fragmented or
|
||||
* if this is the last fragment of the SDU, until the required padding
|
||||
* PDU(s) are sent.
|
||||
|
@ -1298,6 +1300,13 @@ static isoal_status_t isoal_tx_unframed_produce(struct isoal_source *source,
|
|||
pp->pdu_available
|
||||
);
|
||||
|
||||
/* End of the SDU fragment has been reached when the last of the
|
||||
* SDU is packed into a PDU.
|
||||
*/
|
||||
bool end_of_sdu_frag = !padding_pdu &&
|
||||
((consume_len > 0 && consume_len == packet_available) ||
|
||||
zero_length_sdu);
|
||||
|
||||
if (consume_len > 0) {
|
||||
err |= session->pdu_write(&pdu->contents,
|
||||
pp->pdu_written,
|
||||
|
@ -1309,6 +1318,13 @@ static isoal_status_t isoal_tx_unframed_produce(struct isoal_source *source,
|
|||
packet_available -= consume_len;
|
||||
}
|
||||
|
||||
if (end_of_sdu_frag) {
|
||||
/* Each PDU will carry the number of completed SDU
|
||||
* fragments contained in that PDU.
|
||||
*/
|
||||
pp->sdu_fragments++;
|
||||
}
|
||||
|
||||
/* End of the SDU is reached at the end of the last SDU fragment
|
||||
* or if this is a single fragment SDU
|
||||
*/
|
||||
|
@ -1568,12 +1584,8 @@ static isoal_status_t isoal_tx_framed_produce(struct isoal_source *source,
|
|||
|
||||
/* Reset PDU fragmentation count for this SDU */
|
||||
pp->pdu_cnt = 0;
|
||||
|
||||
pp->sdu_fragments = 0;
|
||||
}
|
||||
|
||||
pp->sdu_fragments++;
|
||||
|
||||
/* PDUs should be created until the SDU fragment has been fragmented or if
|
||||
* this is the last fragment of the SDU, until the required padding PDU(s)
|
||||
* are sent.
|
||||
|
@ -1612,6 +1624,13 @@ static isoal_status_t isoal_tx_framed_produce(struct isoal_source *source,
|
|||
pp->pdu_available
|
||||
);
|
||||
|
||||
/* End of the SDU fragment has been reached when the last of the
|
||||
* SDU is packed into a PDU.
|
||||
*/
|
||||
bool end_of_sdu_frag = !padding_pdu &&
|
||||
((consume_len > 0 && consume_len == packet_available) ||
|
||||
zero_length_sdu);
|
||||
|
||||
if (consume_len > 0) {
|
||||
err |= session->pdu_write(&pdu->contents,
|
||||
pp->pdu_written,
|
||||
|
@ -1623,6 +1642,13 @@ static isoal_status_t isoal_tx_framed_produce(struct isoal_source *source,
|
|||
packet_available -= consume_len;
|
||||
}
|
||||
|
||||
if (end_of_sdu_frag) {
|
||||
/* Each PDU will carry the number of completed SDU
|
||||
* fragments contained in that PDU.
|
||||
*/
|
||||
pp->sdu_fragments++;
|
||||
}
|
||||
|
||||
/* End of the SDU is reached at the end of the last SDU fragment
|
||||
* or if this is a single fragment SDU
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue