@@ -43,6 +43,10 @@ namespace mbed {
4343 // / This is used to support Eth MACs that don't allow enqueuing every single descriptor at a time.
4444 const size_t extraTxDescsToLeave;
4545
46+ // / Whether the hardware supports chaining multiple descriptors together to send one
47+ // / packet that's split across multiple buffers.
48+ const bool supportsDescChaining;
49+
4650 // / Pointer to first memory buffer in the chain associated with descriptor n.
4751 // / The buffer address shall only be set for the *last* descriptor, so that the entire chain is freed
4852 // / when the last descriptor is returned.
@@ -60,8 +64,9 @@ namespace mbed {
6064 size_t txReclaimIndex; // /< Index of the next Tx descriptor that will be reclaimed by the mac thread calling reclaimTxDescs().
6165
6266 // / Construct, passing a value for extraTxDescsToLeave
63- GenericTxDMARing (size_t extraTxDescsToLeave = 0 ):
64- extraTxDescsToLeave (extraTxDescsToLeave)
67+ GenericTxDMARing (size_t extraTxDescsToLeave = 0 , bool supportsDescChaining = true ):
68+ extraTxDescsToLeave (extraTxDescsToLeave),
69+ supportsDescChaining (supportsDescChaining)
6570 {}
6671
6772 // / Configure DMA registers to point to the DMA ring,
@@ -193,6 +198,14 @@ namespace mbed {
193198 size_t packetDescsUsed = memory_manager->count_buffers (buf);
194199 size_t neededFreeDescs = packetDescsUsed + extraTxDescsToLeave;
195200 bool needToCopy = false ;
201+
202+ if (packetDescsUsed > 1 && !supportsDescChaining)
203+ {
204+ // / Packet uses more than 1 descriptor and the hardware doesn't support that so
205+ // / we have to copy it into one single descriptor.
206+ needToCopy = true ;
207+ }
208+
196209 if (neededFreeDescs >= TX_NUM_DESCS)
197210 {
198211 // Packet uses too many buffers, we have to copy it into a continuous buffer.
0 commit comments