Commit 6e8570e
authored
[mac] enforce single initialization lifecycle for
This commit refactors `Mac::Links` and `Mac` frame preparation to ensure
`TxFrames` buffers are initialized (`Clear()`) exactly once per TX cycle.
Specifically, this commit:
- Replaces `Links::GetTxFrames()` with `Links::InitTxFrames()`, which
encapsulates calling `Clear()` on `mTxFrames` prior to returning its
reference. This prevents callers from retrieving uninitialized or dirty
transmission buffers from a previous radio cycle.
- Updates `PrepareBeaconRequest()` and `PrepareBeacon()` to accept the
initialized `TxFrames &` reference directly as a parameter, making the
data flow explicit.
- Replaces non-const `GetTxFrames()` calls in `HandleTransmitDone()` with
`GetTxFramesRequiredRadioTypes()`, enforcing const-correctness during
TX completion handling.TxFrames (openthread#13264)1 parent ff121bf commit 6e8570e
3 files changed
Lines changed: 30 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
| 706 | + | |
707 | 707 | | |
708 | | - | |
| 708 | + | |
709 | 709 | | |
710 | 710 | | |
711 | 711 | | |
| |||
723 | 723 | | |
724 | 724 | | |
725 | 725 | | |
726 | | - | |
| 726 | + | |
727 | 727 | | |
728 | 728 | | |
729 | 729 | | |
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
738 | | - | |
| 738 | + | |
739 | 739 | | |
740 | 740 | | |
741 | | - | |
| 741 | + | |
742 | 742 | | |
743 | 743 | | |
744 | 744 | | |
| |||
917 | 917 | | |
918 | 918 | | |
919 | 919 | | |
920 | | - | |
| 920 | + | |
921 | 921 | | |
922 | 922 | | |
923 | | - | |
924 | | - | |
925 | 923 | | |
926 | 924 | | |
927 | 925 | | |
| |||
933 | 931 | | |
934 | 932 | | |
935 | 933 | | |
936 | | - | |
| 934 | + | |
937 | 935 | | |
938 | 936 | | |
939 | 937 | | |
| |||
942 | 940 | | |
943 | 941 | | |
944 | 942 | | |
945 | | - | |
| 943 | + | |
946 | 944 | | |
947 | 945 | | |
948 | 946 | | |
| |||
1319 | 1317 | | |
1320 | 1318 | | |
1321 | 1319 | | |
1322 | | - | |
| 1320 | + | |
1323 | 1321 | | |
1324 | 1322 | | |
1325 | 1323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
832 | 832 | | |
833 | 833 | | |
834 | 834 | | |
835 | | - | |
836 | | - | |
| 835 | + | |
| 836 | + | |
837 | 837 | | |
838 | 838 | | |
839 | 839 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
520 | | - | |
| 520 | + | |
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
524 | | - | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
525 | 529 | | |
526 | 530 | | |
527 | 531 | | |
528 | 532 | | |
529 | 533 | | |
530 | 534 | | |
531 | | - | |
| 535 | + | |
532 | 536 | | |
533 | 537 | | |
534 | 538 | | |
| |||
545 | 549 | | |
546 | 550 | | |
547 | 551 | | |
548 | | - | |
| 552 | + | |
549 | 553 | | |
550 | 554 | | |
551 | 555 | | |
552 | 556 | | |
553 | 557 | | |
554 | 558 | | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
555 | 570 | | |
556 | 571 | | |
557 | 572 | | |
| |||
0 commit comments