aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/usrp2_regs.cpp
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2010-11-10 16:23:11 -0800
committerNick Foster <nick@nerdnetworks.org>2010-11-10 16:23:11 -0800
commite0b3b4e3dd9f22d27e9465bba0c978a488733aae (patch)
tree4fd68a4f7ed5551de7bcd739eb388a8731058dcf /host/lib/usrp/usrp2/usrp2_regs.cpp
parentfb0cdbc553d288402ee7939dc72f4368eb9e8e1b (diff)
downloaduhd-e0b3b4e3dd9f22d27e9465bba0c978a488733aae.tar.gz
uhd-e0b3b4e3dd9f22d27e9465bba0c978a488733aae.tar.bz2
uhd-e0b3b4e3dd9f22d27e9465bba0c978a488733aae.zip
U2P: Ripped out the mboard_rev_t structure in favor of an enum in usrp2_regs.hpp and some logic.
Also change ethernet.c to move generic code to eth_lib.
Diffstat (limited to 'host/lib/usrp/usrp2/usrp2_regs.cpp')
-rw-r--r--host/lib/usrp/usrp2/usrp2_regs.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_regs.cpp b/host/lib/usrp/usrp2/usrp2_regs.cpp
index 0f0360c95..5853e91e5 100644
--- a/host/lib/usrp/usrp2/usrp2_regs.cpp
+++ b/host/lib/usrp/usrp2/usrp2_regs.cpp
@@ -15,25 +15,23 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#include "mboard_rev.hpp"
#include "usrp2_regs.hpp"
int sr_addr(int misc_output_base, int sr) {
return misc_output_base + 4 * sr;
}
-usrp2_regs_t usrp2_get_regs(mboard_rev_t hw_rev) {
-
+usrp2_regs_t usrp2_get_regs(boost::uint16_t hw_rev) {
//how about you just make this dependent on hw_rev instead of doing the init before main, and give up the const globals, since the application won't ever need both.
- const int misc_output_base = (hw_rev.is_usrp2p()) ? USRP2P_MISC_OUTPUT_BASE : USRP2_MISC_OUTPUT_BASE,
- gpio_base = (hw_rev.is_usrp2p()) ? USRP2P_GPIO_BASE : USRP2_GPIO_BASE,
- atr_base = (hw_rev.is_usrp2p()) ? USRP2P_ATR_BASE : USRP2_ATR_BASE,
- bp_base = (hw_rev.is_usrp2p()) ? USRP2P_BP_STATUS_BASE : USRP2_BP_STATUS_BASE;
+ const int misc_output_base = (hw_rev >= usrp2_rev_nums(N2XX)) ? USRP2P_MISC_OUTPUT_BASE : USRP2_MISC_OUTPUT_BASE,
+ gpio_base = (hw_rev >= usrp2_rev_nums(N2XX)) ? USRP2P_GPIO_BASE : USRP2_GPIO_BASE,
+ atr_base = (hw_rev >= usrp2_rev_nums(N2XX)) ? USRP2P_ATR_BASE : USRP2_ATR_BASE,
+ bp_base = (hw_rev >= usrp2_rev_nums(N2XX)) ? USRP2P_BP_STATUS_BASE : USRP2_BP_STATUS_BASE;
usrp2_regs_t x;
x.sr_misc = 0;
x.sr_tx_prot_eng = 32;
- x.sr_rx_prot_eng = 48;
+ x.sr_rx_prot_eng = 48;
x.sr_buffer_pool_ctrl = 64;
x.sr_udp_sm = 96;
x.sr_tx_dsp = 208;