Hi,
--- Quote Start ---
I was trying to get DHCP working because I thought maybe I was just misconfiguring something, but I am still not seeing any communication in or out of the device, so I am back to trying to debug the driver. This hardware design was working before the MMU was added. Now I get no errors or hangs, it's just not sending or receiving anything.
--- Quote End ---
So I tested 'dhclient' and don't know whether it's fortunate or unfortunate, but it sends DHCP DISCOVER packets from my NEEK. The DHCP server returns an IP address.
Of course, I encountered several bugs.
1) The compiler translates the function
memcpy (&from -> sin_addr, &ip -> ip_src, 4);
in the file '/common/packet.c' to the next machine code
0x0000aeb0 <decode_udp_ip_header+152>: ldw r2,0(r21)
0x0000aeb4 <decode_udp_ip_header+156>: add r17,r16,r19
0x0000aeb8 <decode_udp_ip_header+160>: stw r2,4(fp)
. Unfortunately, the address of 'from -> sin_addr' is word-aligned, so the code 'ldw r2,0(r21)' will evoke SIGBUS error. The detour is to rewrite the function as follows.
{ int i;
unsigned char *pd = &ip -> ip_src, *ps = &from -> sin_addr;
for (i = 0; i < 4; i++)
*pd++ = *ps++;
}
2) Also the checksum is wrong, I only comment the code out.
// if (usum && usum != sum) {
// udp_packets_bad_checksum++;
// if (udp_packets_seen > 4 &&
// (udp_packets_seen / udp_packets_bad_checksum) < 2) {
// note ("%d bad udp checksums in %d packets",
// udp_packets_bad_checksum, udp_packets_seen);
// udp_packets_seen = udp_packets_bad_checksum = 0;
// }
// return -1;
// }
Maybe , the function 'checksum' has some bugs. And 'dhclient-script' is not interpreted well. Maybe we need 'bash'.
--- Quote Start ---
in your altera_tse.c, you changed from using the .ndo functions to setting them somewhere else, was there a reason for that?
--- Quote End ---
I can't understand what you mean, but I think that these malfunctions are not caused by the driver.
Kazu