Skip to content
Snippets Groups Projects
Commit 6bbea580 authored by Alessandro Rubini's avatar Alessandro Rubini
Browse files

dev/minic: tx_frame: size refers to payload only.


Several advantages:
 - normal practice: you send a buffer pointer and its own len
 - rx values is already fixed, earlier the wrong result was wrongly used
 - this detaches us from the header length. Transparent vlan ahead...

Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
parent e9ca75d4
Branches
Tags
No related merge requests found
......@@ -299,9 +299,9 @@ int minic_tx_frame(uint8_t * hdr, uint8_t * payload, uint32_t size,
memset((void *)minic.tx_head, 0x0, size + 16);
memset((void *)minic.tx_head + 4, 0, size < 60 ? 60 : size);
memcpy((void *)minic.tx_head + 4, hdr, ETH_HEADER_SIZE);
memcpy((void *)minic.tx_head + 4 + ETH_HEADER_SIZE, payload,
size - ETH_HEADER_SIZE);
memcpy((void *)minic.tx_head + 4 + ETH_HEADER_SIZE, payload, size);
size += ETH_HEADER_SIZE;
if (size < 60)
size = 60;
......
......@@ -270,7 +270,7 @@ int ptpd_netif_sendto(struct wrpc_socket * sock, struct wr_sockaddr *to, void *d
rval =
minic_tx_frame((uint8_t *) & hdr, (uint8_t *) data,
data_length + ETH_HEADER_SIZE, &hwts);
data_length, &hwts);
if (tx_timestamp) {
......
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