summaryrefslogtreecommitdiff
path: root/usrp2/firmware/lib/ethernet.c
diff options
context:
space:
mode:
authorJosh Blum2009-10-12 12:16:12 -0700
committerJosh Blum2009-10-12 12:16:12 -0700
commit5b74bb4d34f381fa8a8af1e1d96ea2d673a8be71 (patch)
treead6a9f64e3b610d008b0fb612772efd4162a82aa /usrp2/firmware/lib/ethernet.c
parent57e810d3f07909947a9fb2daeb507b439d5f4f50 (diff)
parent38d5389f3054164a2f04d6e4e8fe381aa5ee03fc (diff)
downloadgnuradio-5b74bb4d34f381fa8a8af1e1d96ea2d673a8be71.tar.gz
gnuradio-5b74bb4d34f381fa8a8af1e1d96ea2d673a8be71.tar.bz2
gnuradio-5b74bb4d34f381fa8a8af1e1d96ea2d673a8be71.zip
Merge commit '38d5389f3054164a2f04d6e4e8fe381aa5ee03fc' into vrt
Diffstat (limited to 'usrp2/firmware/lib/ethernet.c')
-rw-r--r--usrp2/firmware/lib/ethernet.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/usrp2/firmware/lib/ethernet.c b/usrp2/firmware/lib/ethernet.c
index d19287044..f554e0179 100644
--- a/usrp2/firmware/lib/ethernet.c
+++ b/usrp2/firmware/lib/ethernet.c
@@ -43,6 +43,8 @@ ethernet_register_link_changed_callback(ethernet_link_changed_callback_t new_cal
static void
ed_set_mac_speed(int speed)
{
+ printf("Speed set to %d\n",speed);
+ /*
switch(speed){
case 10:
eth_mac->speed = 1;
@@ -56,6 +58,7 @@ ed_set_mac_speed(int speed)
default:
break;
}
+ */
}
static void
@@ -196,17 +199,17 @@ ethernet_init(void)
ed_state.link_speed = S_UNKNOWN;
// initialize MAC registers
- eth_mac->tx_hwmark = 0x1e;
- eth_mac->tx_lwmark = 0x19;
+ // eth_mac->tx_hwmark = 0x1e;
+ //eth_mac->tx_lwmark = 0x19;
- eth_mac->crc_chk_en = 1;
- eth_mac->rx_max_length = 2048;
+ //eth_mac->crc_chk_en = 1;
+ //eth_mac->rx_max_length = 2048;
// configure PAUSE frame stuff
- eth_mac->tx_pause_en = 1; // pay attn to pause frames sent to us
+ //eth_mac->tx_pause_en = 1; // pay attn to pause frames sent to us
- eth_mac->pause_quanta_set = 38; // a bit more than 1 max frame 16kb/512 + fudge
- eth_mac->pause_frame_send_en = 1; // enable sending pause frames
+ //eth_mac->pause_quanta_set = 38; // a bit more than 1 max frame 16kb/512 + fudge
+ //eth_mac->pause_frame_send_en = 1; // enable sending pause frames
// setup PHY to interrupt on changes
@@ -256,6 +259,10 @@ ethernet_init(void)
t &= ~(NWAY_AR_10T_HD_CAPS | NWAY_AR_10T_FD_CAPS | NWAY_AR_100TX_HD_CAPS | NWAY_AR_100TX_FD_CAPS);
eth_mac_miim_write(PHY_AUTONEG_ADV, t);
+ int r = eth_mac_miim_read(PHY_AUTONEG_ADV); // DEBUG, read back
+ if (t != r){
+ printf("PHY_AUTONEG_ADV: wrote 0x%x, got 0x%x\n", t, r);
+ }
// Restart autonegotation.
// We want to ensure that we're advertising our PAUSE capabilities.
@@ -322,6 +329,7 @@ ethernet_check_errors(void)
// these registers are reset when read
int r = 0;
+ /*
if (eth_mac_read_rmon(0x05) != 0)
r |= RME_RX_CRC;
if (eth_mac_read_rmon(0x06) != 0)
@@ -335,6 +343,6 @@ ethernet_check_errors(void)
r |= RME_TX_FIFO_UNDER;
if (eth_mac_read_rmon(0x27) != 0)
r |= RME_TX_FIFO_OVER;
-
+ */
return r;
}