diff options
Diffstat (limited to 'usrp2/firmware')
-rw-r--r-- | usrp2/firmware/apps/app_common_v2.c | 54 | ||||
-rw-r--r-- | usrp2/firmware/apps/app_common_v2.h | 2 | ||||
-rw-r--r-- | usrp2/firmware/apps/factory_test.c | 20 | ||||
-rw-r--r-- | usrp2/firmware/apps/mimo_tx_slave.c | 6 | ||||
-rw-r--r-- | usrp2/firmware/apps/serdes_txrx.c | 6 | ||||
-rw-r--r-- | usrp2/firmware/apps/txrx.c | 8 |
6 files changed, 48 insertions, 48 deletions
diff --git a/usrp2/firmware/apps/app_common_v2.c b/usrp2/firmware/apps/app_common_v2.c index 3681046e3..2d131bda7 100644 --- a/usrp2/firmware/apps/app_common_v2.c +++ b/usrp2/firmware/apps/app_common_v2.c @@ -152,7 +152,7 @@ config_tx_v2_cmd(const op_config_tx_v2_t *p, memset(&tune_result, 0, sizeof(tune_result)); bool ok = true; - + if (p->valid & CFGV_GAIN){ ok &= db_set_gain(tx_dboard, p->gain); } @@ -161,7 +161,7 @@ config_tx_v2_cmd(const op_config_tx_v2_t *p, bool was_streaming = is_streaming(); if (was_streaming) stop_rx_cmd(); - + u2_fxpt_freq_t f = u2_fxpt_freq_from_hilo(p->freq_hi, p->freq_lo); bool tune_ok = db_tune(tx_dboard, f, &tune_result); ok &= tune_ok; @@ -185,7 +185,7 @@ config_tx_v2_cmd(const op_config_tx_v2_t *p, hb1 = 1; interp = interp >> 1; } - + if (interp < MIN_CIC_INTERP || interp > MAX_CIC_INTERP) ok = false; else { @@ -215,7 +215,7 @@ config_tx_v2_cmd(const op_config_tx_v2_t *p, } static size_t -config_rx_v2_cmd(const op_config_rx_v2_t *p, +config_rx_v2_cmd(const op_config_rx_v2_t *p, void *reply_payload, size_t reply_payload_space) { op_config_rx_reply_v2_t *r = (op_config_rx_reply_v2_t *) reply_payload; @@ -226,7 +226,7 @@ config_rx_v2_cmd(const op_config_rx_v2_t *p, memset(&tune_result, 0, sizeof(tune_result)); bool ok = true; - + if (p->valid & CFGV_GAIN){ ok &= db_set_gain(rx_dboard, p->gain); } @@ -235,7 +235,7 @@ config_rx_v2_cmd(const op_config_rx_v2_t *p, bool was_streaming = is_streaming(); if (was_streaming) stop_rx_cmd(); - + u2_fxpt_freq_t f = u2_fxpt_freq_from_hilo(p->freq_hi, p->freq_lo); bool tune_ok = db_tune(rx_dboard, f, &tune_result); ok &= tune_ok; @@ -249,17 +249,17 @@ config_rx_v2_cmd(const op_config_rx_v2_t *p, int decim = p->decim; int hb1 = 0; int hb2 = 0; - + if(!(decim & 1)) { hb2 = 1; decim = decim >> 1; } - + if(!(decim & 1)) { hb1 = 1; decim = decim >> 1; } - + if (decim < MIN_CIC_DECIM || decim > MAX_CIC_DECIM) ok = false; else { @@ -294,7 +294,7 @@ read_time_cmd(const op_generic_t *p, void *reply_payload, size_t reply_payload_space) { op_read_time_reply_t *r = (op_read_time_reply_t *) reply_payload; - if (reply_payload_space < sizeof(*r)) + if (reply_payload_space < sizeof(*r)) return 0; // no room r->opcode = OP_READ_TIME_REPLY; @@ -323,7 +323,7 @@ dboard_info_cmd(const op_generic_t *p, void *reply_payload, size_t reply_payload_space) { op_dboard_info_reply_t *r = (op_dboard_info_reply_t *) reply_payload; - if (reply_payload_space < sizeof(*r)) + if (reply_payload_space < sizeof(*r)) return 0; // no room r->opcode = OP_DBOARD_INFO_REPLY; @@ -411,14 +411,14 @@ generic_reply(const op_generic_t *p, bool ok) { op_generic_t *r = (op_generic_t *) reply_payload; - if (reply_payload_space < sizeof(*r)) + if (reply_payload_space < sizeof(*r)) return 0; // no room - + r->opcode = p->opcode | OP_REPLY_BIT; r->len = sizeof(*r); r->rid = p->rid; r->ok = ok; - + return r->len; } @@ -426,14 +426,14 @@ static size_t add_eop(void *reply_payload, size_t reply_payload_space) { op_generic_t *r = (op_generic_t *) reply_payload; - if (reply_payload_space < sizeof(*r)) + if (reply_payload_space < sizeof(*r)) return 0; // no room - + r->opcode = OP_EOP; r->len = sizeof(*r); r->rid = 0; r->ok = 0; - + return r->len; } @@ -443,15 +443,15 @@ handle_control_chan_frame(u2_eth_packet_t *pkt, size_t len) unsigned char reply[sizeof(u2_eth_packet_t) + 4 * sizeof(u2_subpkt_t)] _AL4; unsigned char *reply_payload = &reply[sizeof(u2_eth_packet_t)]; int reply_payload_space = sizeof(reply) - sizeof(u2_eth_packet_t); - + // initialize reply memset(reply, 0, sizeof(reply)); set_reply_hdr((u2_eth_packet_t *) reply, pkt); - + // point to beginning of payload (subpackets) unsigned char *payload = ((unsigned char *) pkt) + sizeof(u2_eth_packet_t); int payload_len = len - sizeof(u2_eth_packet_t); - + size_t subpktlen = 0; bool ok = false; @@ -468,7 +468,7 @@ handle_control_chan_frame(u2_eth_packet_t *pkt, size_t len) case OP_ID: subpktlen = op_id_cmd(gp, reply_payload, reply_payload_space); break; - + case OP_CONFIG_TX_V2: subpktlen = config_tx_v2_cmd((op_config_tx_v2_t *) payload, reply_payload, reply_payload_space); break; @@ -484,12 +484,12 @@ handle_control_chan_frame(u2_eth_packet_t *pkt, size_t len) start_rx_streaming_at_cmd(&pkt->ehdr.src, (op_start_rx_streaming_t *)payload, pkt->fixed.timestamp); ok = true; goto generic_reply; - + case OP_STOP_RX: stop_rx_cmd(); ok = true; goto generic_reply; - + case OP_BURN_MAC_ADDR: ok = ethernet_set_mac_addr(&((op_burn_mac_addr_t *)payload)->addr); goto generic_reply; @@ -535,8 +535,8 @@ handle_control_chan_frame(u2_eth_packet_t *pkt, size_t len) case OP_GPIO_SET_DDR: ok = true; - hal_gpio_set_ddr(((op_gpio_t *)payload)->bank, - ((op_gpio_t *)payload)->value, + hal_gpio_set_ddr(((op_gpio_t *)payload)->bank, + ((op_gpio_t *)payload)->value, ((op_gpio_t *)payload)->mask); goto generic_reply; @@ -552,8 +552,8 @@ handle_control_chan_frame(u2_eth_packet_t *pkt, size_t len) case OP_GPIO_WRITE: ok = true; - hal_gpio_write(((op_gpio_t *)payload)->bank, - ((op_gpio_t *)payload)->value, + hal_gpio_write(((op_gpio_t *)payload)->bank, + ((op_gpio_t *)payload)->value, ((op_gpio_t *)payload)->mask); goto generic_reply; diff --git a/usrp2/firmware/apps/app_common_v2.h b/usrp2/firmware/apps/app_common_v2.h index d076ae364..ff1baec06 100644 --- a/usrp2/firmware/apps/app_common_v2.h +++ b/usrp2/firmware/apps/app_common_v2.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007,2008 Free Software Foundation, Inc. + * Copyright 2007,2008,2009 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/usrp2/firmware/apps/factory_test.c b/usrp2/firmware/apps/factory_test.c index 1332f6219..e7dde524a 100644 --- a/usrp2/firmware/apps/factory_test.c +++ b/usrp2/firmware/apps/factory_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2007,2008 Free Software Foundation, Inc. + * Copyright 2007,2008,2009 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -154,7 +154,7 @@ restart_streaming(void) dsp_rx_regs->rx_command = MK_RX_CMD(FRAMES_PER_CMD * streaming_items_per_frame, streaming_items_per_frame, - 1, 1); + 1, 1); dsp_rx_regs->rx_time = 0; // enqueue second command } @@ -229,7 +229,7 @@ setup_tx() * that we didn't handle the packet. A bit of a kludge * but it should work. */ -bool +bool fw_sets_seqno_inspector(dbsm_t *sm, int buf_this) // returns false { uint32_t *p = buffer_ram(buf_this); @@ -264,22 +264,22 @@ int test_ram() { int i,j,k; output_regs->ram_page = 1<<10; - + extram[0] = 0xDEADBEEF; extram[1] = 0xF00D1234; extram[7] = 0x76543210; - + output_regs->ram_page = 2<<10; extram[7] = 0x55555555; extram[1] = 0xaaaaaaaa; extram[0] = 0xeeeeeeee; - + output_regs->ram_page = 1<<10; - + i = extram[0]; k = extram[1]; j = extram[7]; - + if((i != 0xDEADBEEF)||(j!=0x76543210)||(k!=0xF00D1234)) { puts("RAM FAIL1!\n"); puthex32_nl(i); @@ -287,7 +287,7 @@ int test_ram() puthex32_nl(k); return 0; } - + output_regs->ram_page = 2<<10; j = extram[7]; @@ -311,7 +311,7 @@ int test_sd() puts("FAILED INIT of Card\n"); return 0; } - + unsigned char buf[512]; i = sd_read_block(2048,buf); if(i == 0) { diff --git a/usrp2/firmware/apps/mimo_tx_slave.c b/usrp2/firmware/apps/mimo_tx_slave.c index 69010c248..4c284b7c9 100644 --- a/usrp2/firmware/apps/mimo_tx_slave.c +++ b/usrp2/firmware/apps/mimo_tx_slave.c @@ -160,7 +160,7 @@ restart_streaming(void) dsp_rx_regs->rx_command = MK_RX_CMD(FRAMES_PER_CMD * streaming_items_per_frame, streaming_items_per_frame, - 1, 1); + 1, 1); dsp_rx_regs->rx_time = 0; // enqueue second command } @@ -234,7 +234,7 @@ setup_tx() * that we didn't handle the packet. A bit of a kludge * but it should work. */ -bool +bool fw_sets_seqno_inspector(dbsm_t *sm, int buf_this) // returns false { uint32_t *p = buffer_ram(buf_this); @@ -314,7 +314,7 @@ main(void) //output_regs->flush_icache = 1; - + // initialize double buffering state machine for DSP RX -> Ethernet if (FW_SETS_SEQNO){ diff --git a/usrp2/firmware/apps/serdes_txrx.c b/usrp2/firmware/apps/serdes_txrx.c index 6eff8778e..aa4a3f33c 100644 --- a/usrp2/firmware/apps/serdes_txrx.c +++ b/usrp2/firmware/apps/serdes_txrx.c @@ -152,7 +152,7 @@ restart_streaming(void) dsp_rx_regs->rx_command = MK_RX_CMD(FRAMES_PER_CMD * streaming_items_per_frame, streaming_items_per_frame, - 1, 1); + 1, 1); dsp_rx_regs->rx_time = 0; // enqueue second command } @@ -226,7 +226,7 @@ setup_tx() * that we didn't handle the packet. A bit of a kludge * but it should work. */ -bool +bool fw_sets_seqno_inspector(dbsm_t *sm, int buf_this) // returns false { uint32_t *p = buffer_ram(buf_this); @@ -306,7 +306,7 @@ main(void) //output_regs->flush_icache = 1; - + // initialize double buffering state machine for DSP RX -> Ethernet if (FW_SETS_SEQNO){ diff --git a/usrp2/firmware/apps/txrx.c b/usrp2/firmware/apps/txrx.c index 839141ff2..975f314bd 100644 --- a/usrp2/firmware/apps/txrx.c +++ b/usrp2/firmware/apps/txrx.c @@ -1,5 +1,5 @@ /* - * Copyright 2007,2008 Free Software Foundation, Inc. + * Copyright 2007,2008,2009 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -152,7 +152,7 @@ restart_streaming(void) dsp_rx_regs->rx_command = MK_RX_CMD(FRAMES_PER_CMD * streaming_items_per_frame, streaming_items_per_frame, - 1, 1); + 1, 1); dsp_rx_regs->rx_time = 0; // enqueue second command } @@ -180,7 +180,7 @@ restart_streaming_at(uint32_t time) dsp_rx_regs->rx_command = MK_RX_CMD(FRAMES_PER_CMD * streaming_items_per_frame, streaming_items_per_frame, - 1, 1); + 1, 1); dsp_rx_regs->rx_time = 0; // enqueue second command } @@ -277,7 +277,7 @@ setup_tx() * that we didn't handle the packet. A bit of a kludge * but it should work. */ -bool +bool fw_sets_seqno_inspector(dbsm_t *sm, int buf_this) // returns false { uint32_t *p = buffer_ram(buf_this); |