summaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/convert.hpp2
-rw-r--r--host/include/uhd/transport/bounded_buffer.hpp14
-rw-r--r--host/include/uhd/transport/usb_zero_copy.hpp21
3 files changed, 28 insertions, 9 deletions
diff --git a/host/include/uhd/convert.hpp b/host/include/uhd/convert.hpp
index 8fc2f38db..99f1860ae 100644
--- a/host/include/uhd/convert.hpp
+++ b/host/include/uhd/convert.hpp
@@ -29,7 +29,7 @@ namespace uhd{ namespace convert{
typedef uhd::ref_vector<void *> output_type;
typedef uhd::ref_vector<const void *> input_type;
- typedef boost::function<void(const input_type&, const output_type&, size_t)> function_type;
+ typedef boost::function<void(const input_type&, const output_type&, size_t, double)> function_type;
/*!
* Describe the priority of a converter function.
diff --git a/host/include/uhd/transport/bounded_buffer.hpp b/host/include/uhd/transport/bounded_buffer.hpp
index 6aa92c2e6..620a708d0 100644
--- a/host/include/uhd/transport/bounded_buffer.hpp
+++ b/host/include/uhd/transport/bounded_buffer.hpp
@@ -48,7 +48,7 @@ namespace uhd{ namespace transport{
* \param elem the element reference pop to
* \return false when the buffer is full
*/
- bool push_with_haste(const elem_type &elem){
+ UHD_INLINE bool push_with_haste(const elem_type &elem){
return _detail.push_with_haste(elem);
}
@@ -59,7 +59,7 @@ namespace uhd{ namespace transport{
* \param elem the new element to push
* \return true if the element fit without popping for space
*/
- bool push_with_pop_on_full(const elem_type &elem){
+ UHD_INLINE bool push_with_pop_on_full(const elem_type &elem){
return _detail.push_with_pop_on_full(elem);
}
@@ -68,7 +68,7 @@ namespace uhd{ namespace transport{
* Wait until the bounded_buffer becomes non-full.
* \param elem the new element to push
*/
- void push_with_wait(const elem_type &elem){
+ UHD_INLINE void push_with_wait(const elem_type &elem){
return _detail.push_with_wait(elem);
}
@@ -79,7 +79,7 @@ namespace uhd{ namespace transport{
* \param timeout the timeout in seconds
* \return false when the operation times out
*/
- bool push_with_timed_wait(const elem_type &elem, double timeout){
+ UHD_INLINE bool push_with_timed_wait(const elem_type &elem, double timeout){
return _detail.push_with_timed_wait(elem, timeout);
}
@@ -89,7 +89,7 @@ namespace uhd{ namespace transport{
* \param elem the element reference pop to
* \return false when the buffer is empty
*/
- bool pop_with_haste(elem_type &elem){
+ UHD_INLINE bool pop_with_haste(elem_type &elem){
return _detail.pop_with_haste(elem);
}
@@ -98,7 +98,7 @@ namespace uhd{ namespace transport{
* Wait until the bounded_buffer becomes non-empty.
* \param elem the element reference pop to
*/
- void pop_with_wait(elem_type &elem){
+ UHD_INLINE void pop_with_wait(elem_type &elem){
return _detail.pop_with_wait(elem);
}
@@ -109,7 +109,7 @@ namespace uhd{ namespace transport{
* \param timeout the timeout in seconds
* \return false when the operation times out
*/
- bool pop_with_timed_wait(elem_type &elem, double timeout){
+ UHD_INLINE bool pop_with_timed_wait(elem_type &elem, double timeout){
return _detail.pop_with_timed_wait(elem, timeout);
}
diff --git a/host/include/uhd/transport/usb_zero_copy.hpp b/host/include/uhd/transport/usb_zero_copy.hpp
index b39171fba..dc344ad8b 100644
--- a/host/include/uhd/transport/usb_zero_copy.hpp
+++ b/host/include/uhd/transport/usb_zero_copy.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010 Ettus Research LLC
+// Copyright 2010-2011 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -49,6 +49,7 @@ public:
* \param recv_endpoint an integer specifiying an IN endpoint number
* \param send_endpoint an integer specifiying an OUT endpoint number
* \param hints optional parameters to pass to the underlying transport
+ * \return a new zero copy usb object
*/
static sptr make(
usb_device_handle::sptr handle,
@@ -56,6 +57,24 @@ public:
size_t send_endpoint,
const device_addr_t &hints = device_addr_t()
);
+
+ /*!
+ * Make a wrapper around a zero copy implementation.
+ * The wrapper performs the following functions:
+ * - Pad commits to the frame boundary
+ * - Extract multiple packets on recv
+ *
+ * When enable multiple receive packets is set to true,
+ * the implementation inspects the vita length on transfers,
+ * and may split a single transfer into multiple managed buffers.
+ *
+ * \param usb_zc a usb zero copy interface object
+ * \param usb_frame_boundary bytes per frame
+ * \return a new zero copy wrapper object
+ */
+ static sptr make_wrapper(
+ sptr usb_zc, size_t usb_frame_boundary = 512
+ );
};
}} //namespace