Hello, I am using W6100 in MACRAW mode with LWIP stack (on my host controller).
When I send a packet over SOCKET0, it seems like w6100 is sending it out without adding source and destination MAC addresses.
My test setup:
- Host controller operates w6100 over SPI in MACRAW mode
- W6100 is connected to my PC over Ethernet cable
- I am using Wireshark to monitor traffic over Ethernet interface
Code:
ctlwizchip(CW_SYS_UNLOCK, &syslock);
setSHAR(gWIZNETINFO.mac);
setSn_DHAR(0, DHAR);
setSn_MR(0, 7);
ret = socket(0, Sn_MR_MACRAW, 0, SF_ETHER_OWN);
uint8_t pbuf[SL_ETH_PKT_LEN] = {0};
int i = 0;
for (i = 0; i < SL_ETH_PKT_LEN; i++)
pbuf[i] = i;
while (1)
{
send(0, pbuf, 64);
//delay
}
I understand that send/recv APIs are only for TCP, IPv4/6 modes. So, I have by-passed
if ((tmp != SOCK_ESTABLISHED) && (tmp != SOCK_CLOSE_WAIT))
check in the API so that I am able to write on SOCKET0 buffer.
So, my payload is: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f . . . 40
However, at my PCs end Wireshark is showing SRC address as 06 07 08 09 0a 0b. So, it seems like MAC of W6100 did not append Ethernet MAC headers to my payload.
Am I supposed to add MAC headers in my application? Or am I doing something wrong?
Also, are there any sample codes/resources available for MACRAW mode?
Thanks!