The old mac used to do this automatically.
set_reply_hdr(u2_eth_packet_t *reply_pkt, u2_eth_packet_t const *cmd_pkt)
{
reply_pkt->ehdr.dst = cmd_pkt->ehdr.src;
+ reply_pkt->ehdr.src = *ethernet_mac_addr();
reply_pkt->ehdr.ethertype = U2_ETHERTYPE;
reply_pkt->thdr.flags = 0;
reply_pkt->thdr.fifo_status = 0; // written by protocol engine
set_reply_hdr(u2_eth_packet_t *reply_pkt, u2_eth_packet_t const *cmd_pkt)
{
reply_pkt->ehdr.dst = cmd_pkt->ehdr.src;
+ reply_pkt->ehdr.src = *ethernet_mac_addr();
reply_pkt->ehdr.ethertype = U2_ETHERTYPE;
reply_pkt->thdr.flags = 0;
reply_pkt->thdr.fifo_status = 0; // written by protocol engine
u2_eth_packet_t pkt;
memset(&pkt, 0, sizeof(pkt));
pkt.ehdr.dst = *host;
+ pkt.ehdr.src = *ethernet_mac_addr();
pkt.ehdr.ethertype = U2_ETHERTYPE;
u2p_set_word0(&pkt.fixed, 0, 0);
// DSP RX will fill in timestamp
memset(&pkt, 0, sizeof(pkt));
pkt.ehdr.dst = dst_mac_addr;
- // src address filled in by mac
-
+ pkt.ehdr.src = *ethernet_mac_addr();
pkt.ehdr.ethertype = U2_ETHERTYPE;
pkt.fixed.word0 = 0x01234567;
pkt.fixed.timestamp = 0xffffffff;
u2_eth_packet_t pkt __attribute__((aligned (4)));
for (i = 0; i < 6; i++){
- pkt.ehdr.dst_addr[i] = dst_mac_addr[i];
- pkt.ehdr.src_addr[i] = 0; // filled in by mac
+ pkt.ehdr.dst.addr[i] = dst_mac_addr[i];
}
+ pkt.ehdr.src = *ethernet_mac_addr();
pkt.ehdr.ethertype = U2_ETHERTYPE;
// fill ALL buffers for debugging
set_reply_hdr(u2_eth_packet_t *reply_pkt, u2_eth_packet_t const *cmd_pkt)
{
reply_pkt->ehdr.dst = cmd_pkt->ehdr.src;
+ reply_pkt->ehdr.src = *ethernet_mac_addr();
reply_pkt->ehdr.ethertype = U2_ETHERTYPE;
reply_pkt->thdr.flags = 0;
reply_pkt->thdr.fifo_status = 0; // written by protocol engine
u2_eth_packet_t pkt;
memset(&pkt, 0, sizeof(pkt));
pkt.ehdr.dst = *host;
+ pkt.ehdr.src = *ethernet_mac_addr();
pkt.ehdr.ethertype = U2_ETHERTYPE;
u2p_set_word0(&pkt.fixed, 0, 0);
// DSP RX will fill in timestamp
u2_eth_packet_t pkt;
memset(&pkt, 0, sizeof(pkt));
pkt.ehdr.dst = *host;
+ pkt.ehdr.src = *ethernet_mac_addr();
pkt.ehdr.ethertype = U2_ETHERTYPE;
u2p_set_word0(&pkt.fixed, 0, 0);
// DSP RX will fill in timestamp
u2_eth_packet_t pkt __attribute__((aligned (4)));
pkt.ehdr.dst = dst_mac_addr;
- // src filled in by mac
+ pkt.ehdr.src = *ethernet_mac_addr();
pkt.ehdr.ethertype = U2_ETHERTYPE;
// fill ALL buffers for debugging
u2_eth_packet_t pkt;
memset(&pkt, 0, sizeof(pkt));
pkt.ehdr.dst = *host;
+ pkt.ehdr.src = *ethernet_mac_addr();
pkt.ehdr.ethertype = U2_ETHERTYPE;
u2p_set_word0(&pkt.fixed, 0, 0);
// DSP RX will fill in timestamp
u2_eth_packet_t pkt;
memset(&pkt, 0, sizeof(pkt));
//pkt.ehdr.dst = *host;
+ pkt.ehdr.src = *ethernet_mac_addr();
pkt.ehdr.ethertype = U2_ETHERTYPE;
u2p_set_word0(&pkt.fixed,
U2P_TX_IMMEDIATE | U2P_TX_START_OF_BURST, 0);
u2_eth_packet_t pkt;
memset(&pkt, 0, sizeof(pkt));
pkt.ehdr.dst = *host;
+ pkt.ehdr.src = *ethernet_mac_addr();
pkt.ehdr.ethertype = U2_ETHERTYPE;
u2p_set_word0(&pkt.fixed, 0, 0);
// DSP RX will fill in timestamp