Forum Discussion
Altera_Forum
Honored Contributor
15 years agoHi Cris72,
I am debugging my simple socket server project and I have found that my Target MAC address: 00:00:00_00:00:00 (00:00:00:00:00:00) I have modified the get_mac_addr() in network_utilities.c int get_mac_addr(NET net, unsigned char mac_addr[6]) { mac_addr[0]=0x00; mac_addr[1]=0x07; mac_addr[2]=0xED; mac_addr[3]=0x0E; mac_addr[4]=0xD3; mac_addr[5]=0xA2; return 0; } In my design I am using TSE and as you said get_mac_address() should be called by prep_tse_mac() in ins_tse_mac.c file. I can't find ins_tse_mac.c Where can I find that? Thank you very much in advance --- Quote Start --- With "define" I didn't mean# define, but I meant you must provide in your code the two functions. These will be called by iniche upon initialization. Here are two simple templates:int get_ip_addr(alt_iniche_dev *p_dev,
ip_addr* ipaddr,
ip_addr* netmask,
ip_addr* gw,
int* use_dhcp)
{
IP4_ADDR(*ipaddr, 192, 168, 101, 100);
IP4_ADDR(*gw, 192, 168, 101, 1);
IP4_ADDR(*netmask, 255, 255, 255, 0);
# ifdef DHCP_CLIENT
*use_dhcp = 1;# else /* not DHCP_CLIENT */
*use_dhcp = 0;
printf("TCP/IP port\n");
printf("Static IP Address is %d.%d.%d.%d\n",
ip4_addr1(*ipaddr),
ip4_addr2(*ipaddr),
ip4_addr3(*ipaddr),
ip4_addr4(*ipaddr) );# endif /* not DHCP_CLIENT */
/* Non-standard API: return 1 for success */
return 1;
}
int get_mac_addr(NET net, unsigned char mac_addr)
{
mac_addr = MAC_BYTE1;
mac_addr = MAC_BYTE2;
mac_addr = MAC_BYTE3;
mac_addr = MAC_BYTE4;
mac_addr = MAC_BYTE5;
mac_addr = MAC_BYTE6;
printf("Default Ethernet MAC address is %02x:%02x:%02x:%02x:%02x:%02x\n",
mac_addr,
mac_addr,
mac_addr,
mac_addr,
mac_addr,
mac_addr);
}
get_ip_address() is called by iniche_devices_init(), which is in file alt_iniche_dev.c get_mac_address() is called by your MAC initialization function; if you use TSE is prep_tse_mac() in ins_tse_mac.c file Regards Cris --- Quote End ---