Commit 67a039a9 authored by Alessandro Rubini's avatar Alessandro Rubini

dev/ep_pfilter: bugfix: unicast was not working after cleanup

The last commit in branch pfilter-cleanup, where the built-time tables
are built, was bugged in patching the local mac address in the table.
Thus, ptp was working, but IP was not.

Thanks Greg for making the proper checks.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 2c77e853
......@@ -77,13 +77,15 @@ void pfilter_init_default(void)
}
inited++;
}
/* Patch the local MAC address in place, in the first three instructions */
v[0] &= ~(0xffff << 13);
/*
* Patch the local MAC address in place,
* in the first three instructions after NOP */
v[2] &= ~(0xffff << 13);
v[4] &= ~(0xffff << 13);
v[0] |= (EP->MACH >> 0) & 0xffff << 13;
v[2] |= (EP->MACL >> 16) & 0xffff << 13;
v[4] |= (EP->MACL >> 0) & 0xffff << 13;
v[6] &= ~(0xffff << 13);
v[2] |= ((EP->MACH >> 0) & 0xffff) << 13;
v[4] |= ((EP->MACL >> 16) & 0xffff) << 13;
v[6] |= ((EP->MACL >> 0) & 0xffff) << 13;
EP->PFCR0 = 0; // disable pfilter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment