summaryrefslogtreecommitdiff
path: root/usrp2/host
diff options
context:
space:
mode:
authorjcorgan2009-02-22 20:52:29 +0000
committerjcorgan2009-02-22 20:52:29 +0000
commit8056ff424a153dd5bab95bdda1758efe5ed9b246 (patch)
treed635d8f080821287c566b700c84dc631037f7aca /usrp2/host
parentf92986d6ff10330ee4608510f7baaa895e6772e0 (diff)
downloadgnuradio-8056ff424a153dd5bab95bdda1758efe5ed9b246.tar.gz
gnuradio-8056ff424a153dd5bab95bdda1758efe5ed9b246.tar.bz2
gnuradio-8056ff424a153dd5bab95bdda1758efe5ed9b246.zip
Adds ifc_name() to libusrp2 and gr-usrp2
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10475 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'usrp2/host')
-rw-r--r--usrp2/host/include/usrp2/usrp2.h5
-rw-r--r--usrp2/host/lib/usrp2.cc6
-rw-r--r--usrp2/host/lib/usrp2_impl.cc4
-rw-r--r--usrp2/host/lib/usrp2_impl.h2
4 files changed, 15 insertions, 2 deletions
diff --git a/usrp2/host/include/usrp2/usrp2.h b/usrp2/host/include/usrp2/usrp2.h
index 14f04fafd..3b806af87 100644
--- a/usrp2/host/include/usrp2/usrp2.h
+++ b/usrp2/host/include/usrp2/usrp2.h
@@ -94,6 +94,11 @@ namespace usrp2 {
*/
std::string mac_addr();
+ /*!
+ * Returns the GbE interface name associated with this USRP
+ */
+ std::string ifc_name();
+
/*
* ----------------------------------------------------------------
* Rx configuration and control
diff --git a/usrp2/host/lib/usrp2.cc b/usrp2/host/lib/usrp2.cc
index 77c1e3374..ab64cb6cd 100644
--- a/usrp2/host/lib/usrp2.cc
+++ b/usrp2/host/lib/usrp2.cc
@@ -160,6 +160,12 @@ namespace usrp2 {
return d_impl->mac_addr();
}
+ std::string
+ usrp2::ifc_name()
+ {
+ return d_impl->ifc_name();
+ }
+
// Receive
bool
diff --git a/usrp2/host/lib/usrp2_impl.cc b/usrp2/host/lib/usrp2_impl.cc
index 332e479a5..3a0cd918e 100644
--- a/usrp2/host/lib/usrp2_impl.cc
+++ b/usrp2/host/lib/usrp2_impl.cc
@@ -129,8 +129,8 @@ namespace usrp2 {
usrp2::impl::impl(const std::string &ifc, props *p)
- : d_eth_buf(new eth_buffer()), d_pf(0), d_bg_thread(0), d_bg_running(false),
- d_rx_seqno(-1), d_tx_seqno(0), d_next_rid(0),
+ : d_eth_buf(new eth_buffer()), d_ifc_name(ifc), d_pf(0), d_bg_thread(0),
+ d_bg_running(false), d_rx_seqno(-1), d_tx_seqno(0), d_next_rid(0),
d_num_rx_frames(0), d_num_rx_missing(0), d_num_rx_overruns(0), d_num_rx_bytes(0),
d_num_enqueued(0), d_enqueued_mutex(), d_bg_pending_cond(&d_enqueued_mutex),
d_channel_rings(NCHANS), d_tx_interp(0), d_rx_decim(0)
diff --git a/usrp2/host/lib/usrp2_impl.h b/usrp2/host/lib/usrp2_impl.h
index 6822f8f97..8928751b3 100644
--- a/usrp2/host/lib/usrp2_impl.h
+++ b/usrp2/host/lib/usrp2_impl.h
@@ -57,6 +57,7 @@ namespace usrp2 {
static const size_t NCHANS = 32;
eth_buffer *d_eth_buf;
+ std::string d_ifc_name;
pktfilter *d_pf;
std::string d_addr; // FIXME: use u2_mac_addr_t instead
usrp2_thread *d_bg_thread;
@@ -117,6 +118,7 @@ namespace usrp2 {
void bg_loop();
std::string mac_addr() const { return d_addr; } // FIXME: convert from u2_mac_addr_t
+ std::string ifc_name() const { return d_ifc_name; }
// Rx