aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/apps
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-10-22 11:24:37 -0700
committerJosh Blum <josh@joshknows.com>2010-10-22 11:24:37 -0700
commit2ce71ded9dada93ade6f960aac0bd4c25e47456a (patch)
tree9ab11b64556e0183ce3f1911d97e75e7fcce2e86 /firmware/microblaze/apps
parent2628d78e0d0348001cb8428c8064cd1e3179afc8 (diff)
parent8a695c06848dfd254d372e661aa00c2c8d6184a1 (diff)
downloaduhd-2ce71ded9dada93ade6f960aac0bd4c25e47456a.tar.gz
uhd-2ce71ded9dada93ade6f960aac0bd4c25e47456a.tar.bz2
uhd-2ce71ded9dada93ade6f960aac0bd4c25e47456a.zip
Merge branch 'garp' into flow_ctrl
Diffstat (limited to 'firmware/microblaze/apps')
-rw-r--r--firmware/microblaze/apps/txrx_uhd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/firmware/microblaze/apps/txrx_uhd.c b/firmware/microblaze/apps/txrx_uhd.c
index 4765fa006..8cae95b3a 100644
--- a/firmware/microblaze/apps/txrx_uhd.c
+++ b/firmware/microblaze/apps/txrx_uhd.c
@@ -422,6 +422,7 @@ link_changed_callback(int speed)
link_is_up = speed != 0;
hal_set_leds(link_is_up ? LED_RJ45 : 0x0, LED_RJ45);
printf("\neth link changed: speed = %d\n", speed);
+ if (link_is_up) send_gratuitous_arp();
}
static void setup_network(void){
@@ -479,15 +480,18 @@ main(void)
printf("FPGA compatibility number: %d\n", USRP2_FPGA_COMPAT_NUM);
printf("Firmware compatibility number: %d\n", USRP2_FW_COMPAT_NUM);
- ethernet_register_link_changed_callback(link_changed_callback);
- ethernet_init();
-
+ //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);
+ //3) setup ethernet hardware to bring the link up
+ ethernet_register_link_changed_callback(link_changed_callback);
+ ethernet_init();
+
// initialize double buffering state machine for ethernet -> DSP Tx
dbsm_init(&dsp_tx_sm, DSP_TX_BUF_0,