Skip to content
Permalink
Browse files

net: ethernet: net_eth_fill_header: Remove superfluous "frag" param

Ethernet header is always filled in the first fragment of a packet,
so passing it as a separate function paramter is supefluous.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  • Loading branch information...
pfalcon authored and nashif committed Jun 12, 2018
1 parent 699023a commit e62972bb8e4b3c3f0f98fe4cce9da0564d77060d
Showing with 5 additions and 7 deletions.
  1. +0 −2 include/net/ethernet.h
  2. +3 −3 subsys/net/ip/l2/ethernet/arp.c
  3. +2 −2 subsys/net/ip/l2/ethernet/ethernet.c
@@ -378,7 +378,6 @@ struct net_if *net_eth_get_vlan_iface(struct net_if *iface, u16_t tag)
*
* @param ctx Ethernet context
* @param pkt Network packet
* @param frag Ethernet header in packet
* @param ptype Upper level protocol type (in network byte order)
* @param src Source ethernet address
* @param dst Destination ethernet address
@@ -387,7 +386,6 @@ struct net_if *net_eth_get_vlan_iface(struct net_if *iface, u16_t tag)
*/
struct net_eth_hdr *net_eth_fill_header(struct ethernet_context *ctx,
struct net_pkt *pkt,
struct net_buf *frag,
u32_t ptype,
u8_t *src,
u8_t *dst);
@@ -140,7 +140,7 @@ static inline struct net_pkt *prepare_arp(struct net_if *iface,
net_pkt_set_vlan_tag(pkt, vlan_tag);
#endif

eth = net_eth_fill_header(ctx, pkt, frag, htons(NET_ETH_PTYPE_ARP),
eth = net_eth_fill_header(ctx, pkt, htons(NET_ETH_PTYPE_ARP),
NULL, NULL);

/* If entry is not set, then we are just about to send
@@ -305,7 +305,7 @@ struct net_pkt *net_arp_prepare(struct net_pkt *pkt)
net_sprint_ll_addr(ll->addr, sizeof(struct net_eth_addr)),
net_sprint_ipv4_addr(&NET_IPV4_HDR(pkt)->src));

net_eth_fill_header(ctx, pkt, pkt->frags,
net_eth_fill_header(ctx, pkt,
htons(NET_ETH_PTYPE_IP),
ll->addr, entry->eth.addr);

@@ -411,7 +411,7 @@ static inline struct net_pkt *prepare_arp_reply(struct net_if *iface,
net_pkt_set_vlan_tag(pkt, net_pkt_vlan_tag(req));
#endif

net_eth_fill_header(ctx, pkt, frag, htons(NET_ETH_PTYPE_ARP),
net_eth_fill_header(ctx, pkt, htons(NET_ETH_PTYPE_ARP),
net_if_get_link_addr(iface)->addr,
eth_query->src.addr);

@@ -319,12 +319,12 @@ static void set_vlan_priority(struct ethernet_context *ctx,

struct net_eth_hdr *net_eth_fill_header(struct ethernet_context *ctx,
struct net_pkt *pkt,
struct net_buf *frag,
u32_t ptype,
u8_t *src,
u8_t *dst)
{
struct net_eth_hdr *hdr;
struct net_buf *frag = pkt->frags;

#if defined(CONFIG_NET_VLAN)
if (net_eth_is_vlan_enabled(ctx, net_pkt_iface(pkt))) {
@@ -498,7 +498,7 @@ static enum net_verdict ethernet_send(struct net_if *iface,

/* Then set the ethernet header.
*/
net_eth_fill_header(ctx, pkt, pkt->frags, ptype,
net_eth_fill_header(ctx, pkt, ptype,
net_pkt_ll_src(pkt)->addr,
net_pkt_ll_dst(pkt)->addr);

0 comments on commit e62972b

Please sign in to comment.
You can’t perform that action at this time.