summaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/apps
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-11-17 17:12:01 -0800
committerJosh Blum <josh@joshknows.com>2010-12-11 18:43:09 -0800
commit68af2b9ccf556f42d7697c73406abdcc31093d1b (patch)
tree4045a45d702f678446f1d89db3082b548a8f4c8e /firmware/microblaze/apps
parent58d19c5adf7bde9298ad4363c275f72e4bbecd73 (diff)
downloaduhd-68af2b9ccf556f42d7697c73406abdcc31093d1b.tar.gz
uhd-68af2b9ccf556f42d7697c73406abdcc31093d1b.tar.bz2
uhd-68af2b9ccf556f42d7697c73406abdcc31093d1b.zip
usrp2: implement routing mode calls, and prefix pkt ctrl calls
Diffstat (limited to 'firmware/microblaze/apps')
-rw-r--r--firmware/microblaze/apps/txrx_uhd.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/firmware/microblaze/apps/txrx_uhd.c b/firmware/microblaze/apps/txrx_uhd.c
index 4adccfed9..938491b0e 100644
--- a/firmware/microblaze/apps/txrx_uhd.c
+++ b/firmware/microblaze/apps/txrx_uhd.c
@@ -279,10 +279,16 @@ static void handle_inp_packet(uint32_t *buff, size_t num_lines){
* Called when eth phy state changes (w/ interrupts disabled)
*/
void link_changed_callback(int speed){
- bool 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();
+ printf("\neth link changed: speed = %d\n", speed);
+ if (speed != 0){
+ hal_set_leds(LED_RJ45, LED_RJ45);
+ pkt_ctrl_set_routing_mode(PKT_CTRL_ROUTING_MODE_MASTER);
+ send_gratuitous_arp(); //garp after setting the routing mode
+ }
+ else{
+ hal_set_leds(0x0, LED_RJ45);
+ pkt_ctrl_set_routing_mode(PKT_CTRL_ROUTING_MODE_SLAVE);
+ }
}
static void setup_network(void){
@@ -357,10 +363,10 @@ main(void)
while(true){
size_t num_lines;
- void *buff = claim_incoming_buffer(&num_lines);
+ void *buff = pkt_ctrl_claim_incoming_buffer(&num_lines);
if (buff != NULL){
handle_inp_packet((uint32_t *)buff, num_lines);
- release_incoming_buffer();
+ pkt_ctrl_release_incoming_buffer();
}
int pending = pic_regs->pending; // poll for under or overrun