aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/apps/txrx_uhd.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/microblaze/apps/txrx_uhd.c')
-rw-r--r--firmware/microblaze/apps/txrx_uhd.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/firmware/microblaze/apps/txrx_uhd.c b/firmware/microblaze/apps/txrx_uhd.c
index d00f2bc1f..9c1873e1c 100644
--- a/firmware/microblaze/apps/txrx_uhd.c
+++ b/firmware/microblaze/apps/txrx_uhd.c
@@ -396,7 +396,7 @@ eth_pkt_inspector(dbsm_t *sm, int bufno)
// In the future, a hardware state machine will do this...
if ( //warning! magic numbers approaching....
(((buff + ((2 + 14 + 20)/sizeof(uint32_t)))[0] & 0xffff) == USRP2_UDP_DATA_PORT) &&
- ((buff + ((2 + 14 + 20 + 8)/sizeof(uint32_t)))[0] != USRP2_INVALID_VRT_HEADER)
+ ((buff + ((2 + 14 + 20 + 8)/sizeof(uint32_t)))[1] != USRP2_INVALID_VRT_HEADER)
) return false;
//test if its an ip recovery packet
@@ -497,6 +497,16 @@ main(void)
{
u2_init();
+//we do this to see if we should set a default ip addr or not
+#ifdef USRP2P
+ bool safe_fw = find_safe_booted_flag();
+ set_safe_booted_flag(0);
+ if(safe_fw) {
+ set_default_ip_addr();
+ set_default_mac_addr();
+ }
+#endif
+
putstr("\nTxRx-NEWETH\n");
print_mac_addr(ethernet_mac_addr()->addr);
newline();
@@ -507,7 +517,7 @@ main(void)
//1) register the addresses into the network stack
register_mac_addr(ethernet_mac_addr());
register_ip_addr(get_ip_addr());
-
+
//2) register callbacks for udp ports we service
register_udp_listener(USRP2_UDP_CTRL_PORT, handle_udp_ctrl_packet);
register_udp_listener(USRP2_UDP_DATA_PORT, handle_udp_data_packet);