From 6eeee3278f631f208e131012a62f904dba55efbb Mon Sep 17 00:00:00 2001 From: Richard Osborne Date: Sun, 29 Jun 2014 18:26:48 +0100 Subject: [PATCH] Simply start of CRC computation. crc32(0, data, poly) = crc32(0, 0, poly) ^ data = 0 ^ data = data --- module_ethernet/src/full/mii_master.xc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/module_ethernet/src/full/mii_master.xc b/module_ethernet/src/full/mii_master.xc index 7e79d01..252e2c8 100644 --- a/module_ethernet/src/full/mii_master.xc +++ b/module_ethernet/src/full/mii_master.xc @@ -232,8 +232,6 @@ void mii_rx_pins( continue; } - crc = 0x9226F562; - #if ETHERNET_RX_HP_QUEUE if (!buf_hp) { dptr_hp = dptr_lp; @@ -242,7 +240,7 @@ void mii_rx_pins( #pragma xta endpoint "mii_rx_first_word" p_mii_rxd :> word; - crc32(crc, word, poly); + crc = ~word; mii_packet_set_data_word_imm(dptr_lp, 0, word); #if ETHERNET_RX_HP_QUEUE mii_packet_set_data_word_imm(dptr_hp, 0, word); @@ -408,7 +406,7 @@ int g_mii_idle_slope[NUM_ETHERNET_PORTS]; unsigned mii_transmit_packet(unsigned buf, out buffered port:32 p_mii_txd, timer tmr, unsigned ifg_time) { register const unsigned poly = 0xEDB88320; - unsigned int crc = 0; + unsigned int crc; unsigned int word; unsigned int dptr; @@ -439,7 +437,7 @@ unsigned mii_transmit_packet(unsigned buf, out buffered port:32 p_mii_txd, timer p_mii_txd <: word; dptr+=4; i++; - crc32(crc, ~word, poly); + crc = ~word; do { #pragma xta label "mii_tx_loop"