summaryrefslogtreecommitdiff
path: root/usrp2/host/lib/usrp2_impl.cc
diff options
context:
space:
mode:
authorEric Blossom2009-09-04 03:48:15 -0700
committerEric Blossom2009-09-04 09:48:34 -0700
commitf945bc6d3188d15c767706a2edbbda950a101c61 (patch)
tree8b2f401872765aeabffd535571af1c28d26222c5 /usrp2/host/lib/usrp2_impl.cc
parent96b6c7b97e3fb9188bc6906153254dc36cedc2cb (diff)
downloadgnuradio-f945bc6d3188d15c767706a2edbbda950a101c61.tar.gz
gnuradio-f945bc6d3188d15c767706a2edbbda950a101c61.tar.bz2
gnuradio-f945bc6d3188d15c767706a2edbbda950a101c61.zip
stop sending short ethernet command packets.
Diffstat (limited to 'usrp2/host/lib/usrp2_impl.cc')
-rw-r--r--usrp2/host/lib/usrp2_impl.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/usrp2/host/lib/usrp2_impl.cc b/usrp2/host/lib/usrp2_impl.cc
index d1e85805c..3d0304324 100644
--- a/usrp2/host/lib/usrp2_impl.cc
+++ b/usrp2/host/lib/usrp2_impl.cc
@@ -300,8 +300,19 @@ namespace usrp2 {
bool
- usrp2::impl::transmit_cmd(void *cmd, size_t len)
+ usrp2::impl::transmit_cmd(void *cmd_, size_t len_)
{
+ const void *cmd = cmd_;
+ int len = len_;
+ unsigned char tmp[64];
+
+ if (len_ < 64){ // pad to minimum ethernet frame size
+ memset(tmp, 0, sizeof(tmp));
+ memcpy(tmp, cmd_, len_);
+ cmd = tmp;
+ len = sizeof(tmp);
+ }
+
return d_eth_buf->tx_frame(cmd, len) == eth_buffer::EB_OK;
}