aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/chdr.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-11-14 14:30:34 -0800
committerMartin Braun <martin.braun@ettus.com>2018-07-25 15:34:03 -0700
commit988515ab19a715773086a7a8c023ddb8249c7e37 (patch)
tree71c861c3a1d0a5e295dad5939358dd30e0a33f3b /host/lib/transport/chdr.cpp
parent8b16ab706fb4768f802ddb65a81fc26e1562cb0d (diff)
downloaduhd-988515ab19a715773086a7a8c023ddb8249c7e37.tar.gz
uhd-988515ab19a715773086a7a8c023ddb8249c7e37.tar.bz2
uhd-988515ab19a715773086a7a8c023ddb8249c7e37.zip
Device3: Change packet-based flow control to byte-based flow control
Diffstat (limited to 'host/lib/transport/chdr.cpp')
-rw-r--r--host/lib/transport/chdr.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/host/lib/transport/chdr.cpp b/host/lib/transport/chdr.cpp
index 48263f57e..36f380d62 100644
--- a/host/lib/transport/chdr.cpp
+++ b/host/lib/transport/chdr.cpp
@@ -23,6 +23,7 @@ using namespace uhd::transport::vrt;
static const uint32_t HDR_FLAG_TSF = (1 << 29);
static const uint32_t HDR_FLAG_EOB = (1 << 28);
static const uint32_t HDR_FLAG_ERROR = (1 << 28);
+static const uint32_t HDR_FLAG_FCACK = (1 << 28);
/***************************************************************************/
/* Packing */
@@ -45,8 +46,8 @@ UHD_INLINE uint32_t _hdr_pack_chdr(
| (if_packet_info.packet_type << 30)
// 1 Bit: Has time
| (if_packet_info.has_tsf ? HDR_FLAG_TSF : 0)
- // 1 Bit: EOB or Error
- | ((if_packet_info.eob or if_packet_info.error) ? HDR_FLAG_EOB : 0)
+ // 1 Bit: EOB or Error or FC ACK
+ | ((if_packet_info.eob or if_packet_info.error or if_packet_info.fc_ack) ? HDR_FLAG_EOB : 0)
// 12 Bits: Sequence number
| ((if_packet_info.packet_count & 0xFFF) << 16)
// 16 Bits: Total packet length
@@ -111,6 +112,8 @@ UHD_INLINE void _hdr_unpack_chdr(
&& ((chdr & HDR_FLAG_EOB) > 0);
if_packet_info.error = (if_packet_info.packet_type == if_packet_info_t::PACKET_TYPE_RESP)
&& ((chdr & HDR_FLAG_ERROR) > 0);
+ if_packet_info.fc_ack = (if_packet_info.packet_type == if_packet_info_t::PACKET_TYPE_FC)
+ && ((chdr & HDR_FLAG_FCACK) > 0);
if_packet_info.packet_count = (chdr >> 16) & 0xFFF;
// Set packet length variables