Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify start of CRC computation. #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions module_ethernet/src/full/mii_master.xc
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ void mii_rx_pins(
continue;
}

crc = 0x9226F562;

#if ETHERNET_RX_HP_QUEUE
if (!buf_hp) {
dptr_hp = dptr_lp;
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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"
Expand Down