@@ -417,6 +417,39 @@ Inputs:
417417 and coalescing consecutive `XFERLIST_VOID ` entries into a single larger one. This can help
418418 reduce fragmentation and improve reuse of space in the Transfer List.
419419
420+ Overwriting a TE
421+ ^^^^^^^^^^^^^^^^
422+
423+ Inputs:
424+
425+ - `te_base_addr `: Base address of the Transfer Entry (TE) to be overwritten
426+ - `new_data_size `: Size in bytes of the new data to be encapsulated in the TE
427+ - [data]: Data to be copied into the TE
428+
429+ #. If `te.data_size ` is smaller than `new_data_size `, the overwrite operation must return an error.
430+ The caller is then responsible for:
431+
432+ #. Reclaiming the existing space by calling `Adding a void TE `_ with `te_base_addr ` and `te.data_size `.
433+
434+ #. Adding a new TE by invoking `Adding a new TE `_ with appropriate arguments.
435+
436+ #. If `has_checksum `, subtract the sum of `te.data_size ` bytes starting at
437+ `te_base_addr + te.hdr_size ` from `tl.checksum `.
438+
439+ #. Set `te.data_size ` (`te_base_addr + 0x4 `) to `align8(new_data_size) `.
440+
441+ #. Copy or generate the new TE data into `te_base_addr + te.hdr_size `.
442+
443+ #. If `has_checksum `, add the sum of `align8(new_data_size) ` bytes starting at
444+ `te_base_addr + te.hdr_size ` to `tl.checksum `.
445+
446+ #. If `te.data_size - align8(new_data_size) ` is greater than or equal to `0x8 `, create a new
447+ void TE to fill the remaining space by calling `Adding a void TE `_ with the following arguments:
448+
449+ #. `te_base_addr ` = `te_base_addr + te.hdr_size + align8(new_data_size) `
450+
451+ #. `data_size ` = `te.data_size - align8(new_data_size) - 0x8 `
452+
420453Adding a new TE with special data alignment requirement
421454^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
422455
0 commit comments