From b217b020a573a2c05007d451f7e81f0b2c852331 Mon Sep 17 00:00:00 2001 From: likewise Date: Wed, 5 May 2004 15:09:13 +0000 Subject: [PATCH] Changed PAD_ETH_SIZE into ETH_PAD_SIZE for consistency with de-facto lwIP naming convention. --- src/core/pbuf.c | 3 ++- src/include/netif/etharp.h | 8 ++++---- src/netif/ethernetif.c | 26 +++++++++++++------------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/core/pbuf.c b/src/core/pbuf.c index 47608f74..10f73a5f 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -453,9 +453,10 @@ pbuf_realloc(struct pbuf *p, u16_t new_len) * * The ->payload, ->tot_len and ->len fields are adjusted. * - * @param hdr_size Number of bytes to increment header size which + * @param hdr_size_inc Number of bytes to increment header size which * increases the size of the pbuf. New space is on the front. * (Using a negative value decreases the header size.) + * If hdr_size_inc is 0, this function does nothing and returns succesful. * * PBUF_ROM and PBUF_REF type buffers cannot have their sizes increased, so * the call will fail. A check is made that the increase in header size does diff --git a/src/include/netif/etharp.h b/src/include/netif/etharp.h index b9ffed57..ae12726f 100644 --- a/src/include/netif/etharp.h +++ b/src/include/netif/etharp.h @@ -35,8 +35,8 @@ #ifndef __NETIF_ETHARP_H__ #define __NETIF_ETHARP_H__ -#ifndef PAD_ETH_SIZE -#define PAD_ETH_SIZE 0 +#ifndef ETH_PAD_SIZE +#define ETH_PAD_SIZE 0 #endif #include "lwip/pbuf.h" @@ -55,8 +55,8 @@ PACK_STRUCT_END PACK_STRUCT_BEGIN struct eth_hdr { -#if PAD_ETH_SIZE - PACK_STRUCT_FIELD(u8_t padding[PAD_ETH_SIZE]); +#if ETH_PAD_SIZE + PACK_STRUCT_FIELD(u8_t padding[ETH_PAD_SIZE]); #endif PACK_STRUCT_FIELD(struct eth_addr dest); PACK_STRUCT_FIELD(struct eth_addr src); diff --git a/src/netif/ethernetif.c b/src/netif/ethernetif.c index 344fe149..f7ad781f 100644 --- a/src/netif/ethernetif.c +++ b/src/netif/ethernetif.c @@ -103,8 +103,8 @@ low_level_output(struct ethernetif *ethernetif, struct pbuf *p) initiate transfer(); -#if PAD_ETH_SIZE - pbuf_header(p, -PAD_ETH_SIZE); /* drop the padding word */ +#if ETH_PAD_SIZE + pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */ #endif for(q = p; q != NULL; q = q->next) { @@ -116,8 +116,8 @@ low_level_output(struct ethernetif *ethernetif, struct pbuf *p) signal that packet should be sent(); -#if PAD_ETH_SIZE - pbuf_header(p, PAD_ETH_SIZE); /* reclaim the padding word */ +#if ETH_PAD_SIZE + pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */ #endif #ifdef LINK_STATS @@ -145,8 +145,8 @@ low_level_input(struct ethernetif *ethernetif) variable. */ len = ; -#if PAD_ETH_SIZE - len += PAD_ETH_SIZE; /* allow room for Ethernet padding */ +#if ETH_PAD_SIZE + len += ETH_PAD_SIZE; /* allow room for Ethernet padding */ #endif /* We allocate a pbuf chain of pbufs from the pool. */ @@ -154,22 +154,22 @@ low_level_input(struct ethernetif *ethernetif) if (p != NULL) { -#if PAD_ETH_SIZE - pbuf_header(p, -PAD_ETH_SIZE); /* drop the padding word */ +#if ETH_PAD_SIZE + pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */ #endif /* We iterate over the pbuf chain until we have read the entire - packet into the pbuf. */ + * packet into the pbuf. */ for(q = p; q != NULL; q = q->next) { /* Read enough bytes to fill this pbuf in the chain. The - available data in the pbuf is given by the q->len - variable. */ + * available data in the pbuf is given by the q->len + * variable. */ read data into(q->payload, q->len); } acknowledge that packet has been read(); -#if PAD_ETH_SIZE - pbuf_header(p, PAD_ETH_SIZE); /* reclaim the padding word */ +#if ETH_PAD_SIZE + pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */ #endif #ifdef LINK_STATS