net: unify FAR keyword usage for all net buffer memory mapped buffers

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko
2022-01-18 00:09:14 +02:00
committed by Xiang Xiao
parent fc3167b584
commit 08043fb5bc
66 changed files with 108 additions and 108 deletions
+1 -1
View File
@@ -281,7 +281,7 @@
/* This is a helper pointer for accessing the contents of Ethernet header */
#define BUF ((struct eth_hdr_s *)priv->c_dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->c_dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -260,7 +260,7 @@
* the contents of the Ethernet header
*/
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
#define IMX_BUF_SIZE ENET_ALIGN_UP(CONFIG_NET_ETH_PKTSIZE)
+1 -1
View File
@@ -244,7 +244,7 @@
* the contents of the Ethernet header
*/
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
#define IMXRT_BUF_SIZE ENET_ALIGN_UP(CONFIG_NET_ETH_PKTSIZE + \
CONFIG_NET_GUARDSIZE)
+1 -1
View File
@@ -194,7 +194,7 @@
* header
*/
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
#define KINETIS_BUF_SIZE ((CONFIG_NET_ETH_PKTSIZE & 0xfffffff0) + 0x10)
@@ -165,7 +165,7 @@
/* This is a helper pointer for accessing the contents of Ethernet header */
#define BUF ((struct eth_hdr_s *)priv->lp_dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->lp_dev.d_buf)
/* This is the number of ethernet GPIO pins that must be configured */
+1 -1
View File
@@ -498,7 +498,7 @@
* header
*/
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
/****************************************************************************
* Private Types
+2 -2
View File
@@ -257,8 +257,8 @@
* header.
*/
#define ETHBUF ((struct eth_hdr_s *)priv->eth_dev.d_buf)
#define ETH8021QWBUF ((struct eth_8021qhdr_s *)priv->eth_dev.d_buf)
#define ETHBUF ((FAR struct eth_hdr_s *)priv->eth_dev.d_buf)
#define ETH8021QWBUF ((FAR struct eth_8021qhdr_s *)priv->eth_dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -156,7 +156,7 @@ void amebaz_netdev_notify_receive(FAR struct amebaz_dev_s *priv,
NETDEV_RXPACKETS(&priv->dev);
net_lock();
oldbuf = priv->dev.d_buf;
hdr = (struct eth_hdr_s *)skb->data;
hdr = (FAR struct eth_hdr_s *)skb->data;
priv->dev.d_buf = (void *)skb->data;
priv->dev.d_len = len;
#ifdef CONFIG_NET_PKT
+1 -1
View File
@@ -239,7 +239,7 @@
/* This is a helper pointer for accessing the contents of Ethernet header */
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
#define S32K1XX_BUF_SIZE ENET_ALIGN_UP(CONFIG_NET_ETH_PKTSIZE)
+1 -1
View File
@@ -236,7 +236,7 @@
* header
*/
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -267,7 +267,7 @@
* header
*/
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -314,7 +314,7 @@
* header
*/
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -193,7 +193,7 @@
* header
*/
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -190,7 +190,7 @@
* header
*/
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -410,7 +410,7 @@
* header
*/
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -607,7 +607,7 @@
* header
*/
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -594,7 +594,7 @@
* header
*/
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -599,7 +599,7 @@
* header
*/
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -167,7 +167,7 @@
/* This is a helper pointer for accessing the contents of Ethernet header */
#define ETHBUF ((struct eth_hdr_s *)priv->ld_dev.d_buf)
#define ETHBUF ((FAR struct eth_hdr_s *)priv->ld_dev.d_buf)
#define TIVA_MAX_MDCCLK 2500000
+1 -1
View File
@@ -615,7 +615,7 @@
* header
*/
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -69,7 +69,7 @@
/* This is a helper pointer for accessing the contents of Ethernet header */
#define BUF ((struct eth_hdr_s *)priv->d_dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->d_dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -215,7 +215,7 @@
* header
*/
#define BUF ((struct eth_hdr_s *)priv->pd_dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->pd_dev.d_buf)
/* PHYs *********************************************************************/
+1 -1
View File
@@ -254,7 +254,7 @@
* header
*/
#define BUF ((struct eth_hdr_s *)priv->pd_dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->pd_dev.d_buf)
/* PHYs *********************************************************************/
+1 -1
View File
@@ -88,7 +88,7 @@
/* This is a helper pointer for accessing the contents of Ethernet header */
#define BUF ((struct eth_hdr_s *)priv->misoc_net_dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->misoc_net_dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -198,7 +198,7 @@
* header
*/
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
/* PHY return definitions */
+1 -1
View File
@@ -1077,7 +1077,7 @@ static void wlan_txtimeout_expiry(wdparm_t arg)
static void wlan_poll_work(void *arg)
{
int32_t delay_tick = WLAN_WDDELAY;
FAR struct wlan_priv_s *priv = (FAR struct wlan_priv_s *)arg;
struct wlan_priv_s *priv = (struct wlan_priv_s *)arg;
struct net_driver_s *dev = &priv->dev;
struct wlan_pktbuf *pktbuf;
+1 -1
View File
@@ -255,7 +255,7 @@ extern uintptr_t _RAM_ADDR_U_INIT_PARAM;
/* This is a helper pointer for accessing the contents of Ethernet header */
#define ETHBUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define ETHBUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -281,7 +281,7 @@
/* This is a helper pointer for accessing the contents of Ethernet header */
#define BUF ((struct eth_hdr_s *)priv->dm_dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dm_dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -181,7 +181,7 @@
/* This is a helper pointer for accessing the contents of Ethernet header */
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
/* Debug ********************************************************************/
+1 -1
View File
@@ -164,7 +164,7 @@
/* This is a helper pointer for accessing the contents of Ethernet header */
#define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->dev.d_buf)
/* Debug ********************************************************************/
+1 -1
View File
@@ -95,7 +95,7 @@
* header.
*/
#define BUF ((struct eth_hdr_s *)priv->ft_dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->ft_dev.d_buf)
/* RX/TX buffer alignment */
+5 -5
View File
@@ -457,8 +457,8 @@ static int net_rpmsg_drv_sockioctl_handler(FAR struct rpmsg_endpoint *ept,
static bool net_rpmsg_drv_is_ipv4(FAR struct net_driver_s *dev)
{
FAR struct ipv4_hdr_s *ip =
(struct ipv4_hdr_s *)(dev->d_buf + dev->d_llhdrlen);
FAR struct eth_hdr_s *eth = (struct eth_hdr_s *)dev->d_buf;
(FAR struct ipv4_hdr_s *)(dev->d_buf + dev->d_llhdrlen);
FAR struct eth_hdr_s *eth = (FAR struct eth_hdr_s *)dev->d_buf;
if (dev->d_lltype == NET_LL_ETHERNET || dev->d_lltype == NET_LL_IEEE80211)
{
@@ -475,8 +475,8 @@ static bool net_rpmsg_drv_is_ipv4(FAR struct net_driver_s *dev)
static bool net_rpmsg_drv_is_ipv6(FAR struct net_driver_s *dev)
{
FAR struct ipv6_hdr_s *ip =
(struct ipv6_hdr_s *)(dev->d_buf + dev->d_llhdrlen);
FAR struct eth_hdr_s *eth = (struct eth_hdr_s *)dev->d_buf;
(FAR struct ipv6_hdr_s *)(dev->d_buf + dev->d_llhdrlen);
FAR struct eth_hdr_s *eth = (FAR struct eth_hdr_s *)dev->d_buf;
if (dev->d_lltype == NET_LL_ETHERNET || dev->d_lltype == NET_LL_IEEE80211)
{
@@ -492,7 +492,7 @@ static bool net_rpmsg_drv_is_ipv6(FAR struct net_driver_s *dev)
#ifdef CONFIG_NET_ARP
static bool net_rpmsg_drv_is_arp(FAR struct net_driver_s *dev)
{
FAR struct eth_hdr_s *eth = (struct eth_hdr_s *)dev->d_buf;
FAR struct eth_hdr_s *eth = (FAR struct eth_hdr_s *)dev->d_buf;
if (dev->d_lltype == NET_LL_ETHERNET || dev->d_lltype == NET_LL_IEEE80211)
{
+1 -1
View File
@@ -88,7 +88,7 @@
/* This is a helper pointer for accessing the contents of Ethernet header */
#define BUF ((struct eth_hdr_s *)priv->sk_dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->sk_dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -102,7 +102,7 @@
/* This is a helper pointer for accessing the contents of Ethernet header */
#define BUF ((struct eth_hdr_s *)self->dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)self->dev.d_buf)
/****************************************************************************
* Private Types
+1 -1
View File
@@ -2271,7 +2271,7 @@ static void cdcmbim_receive(struct usbhost_cdcmbim_s *priv,
priv->netdev.d_buf = buf;
priv->netdev.d_len = len;
switch (((struct ipv4_hdr_s *)buf)->vhl & IP_VERSION_MASK)
switch (((FAR struct ipv4_hdr_s *)buf)->vhl & IP_VERSION_MASK)
{
#ifdef CONFIG_NET_IPv4
case IPv4_VERSION:
@@ -95,7 +95,7 @@
/* This is a helper pointer for accessing the contents of Ethernet header */
#define BUF ((struct eth_hdr_s *)priv->bc_dev.d_buf)
#define BUF ((FAR struct eth_hdr_s *)priv->bc_dev.d_buf)
/****************************************************************************
* Private Function Prototypes
+1 -1
View File
@@ -451,7 +451,7 @@ typedef CODE int (*devif_poll_callback_t)(FAR struct net_driver_s *dev);
* Ethernet, you will need to call the network ARP code before calling
* this function:
*
* #define BUF ((struct eth_hdr_s *)&dev->d_buf[0])
* #define BUF ((FAR struct eth_hdr_s *)&dev->d_buf[0])
* dev->d_len = ethernet_devicedrver_poll();
* if (dev->d_len > 0)
* {
+2 -2
View File
@@ -59,8 +59,8 @@
* Pre-processor Definitions
****************************************************************************/
#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0])
#define ARPBUF ((struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN])
#define ETHBUF ((FAR struct eth_hdr_s *)&dev->d_buf[0])
#define ARPBUF ((FAR struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN])
/****************************************************************************
* Public Functions
+2 -2
View File
@@ -59,8 +59,8 @@
* Pre-processor Definitions
****************************************************************************/
#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0])
#define ARPBUF ((struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN])
#define ETHBUF ((FAR struct eth_hdr_s *)&dev->d_buf[0])
#define ARPBUF ((FAR struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN])
/****************************************************************************
* Public Functions
+2 -2
View File
@@ -56,8 +56,8 @@
* Pre-processor Definitions
****************************************************************************/
#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0])
#define IPBUF ((struct arp_iphdr_s *)&dev->d_buf[ETH_HDRLEN])
#define ETHBUF ((FAR struct eth_hdr_s *)&dev->d_buf[0])
#define IPBUF ((FAR struct arp_iphdr_s *)&dev->d_buf[ETH_HDRLEN])
/****************************************************************************
* Public Functions
+3 -3
View File
@@ -59,9 +59,9 @@
* Pre-processor Definitions
****************************************************************************/
#define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0])
#define ARPBUF ((struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN])
#define IPBUF ((struct arp_iphdr_s *)&dev->d_buf[ETH_HDRLEN])
#define ETHBUF ((FAR struct eth_hdr_s *)&dev->d_buf[0])
#define ARPBUF ((FAR struct arp_hdr_s *)&dev->d_buf[ETH_HDRLEN])
#define IPBUF ((FAR struct arp_iphdr_s *)&dev->d_buf[ETH_HDRLEN])
/****************************************************************************
* Private Data
+1 -1
View File
@@ -110,7 +110,7 @@
/* Macros */
#define BUF ((FAR struct ipv4_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
#define BUF ((FAR struct ipv4_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
/****************************************************************************
* Private Data
+2 -2
View File
@@ -43,8 +43,8 @@
* Pre-processor Definitions
****************************************************************************/
#define IPv4BUF ((struct ipv4_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
#define ICMPBUF ((struct icmp_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv4_HDRLEN])
#define IPv4BUF ((FAR struct ipv4_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
#define ICMPBUF ((FAR struct icmp_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv4_HDRLEN])
#define ICMPSIZE ((dev)->d_len - IPv4_HDRLEN)
/****************************************************************************
+2 -2
View File
@@ -51,7 +51,7 @@
* Pre-processor Definitions
****************************************************************************/
#define IPv4BUF ((struct ipv4_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
#define IPv4BUF ((FAR struct ipv4_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
/* RFC 1812:
* 4.3.2.3, Original Message Header
@@ -93,7 +93,7 @@ void icmp_reply(FAR struct net_driver_s *dev, int type, int code)
{
int ipicmplen = IPv4_HDRLEN + sizeof(struct icmp_hdr_s);
FAR struct ipv4_hdr_s *ipv4 = IPv4BUF;
FAR struct icmp_hdr_s *icmp = (FAR void *)(ipv4 + 1);
FAR struct icmp_hdr_s *icmp = (FAR struct icmp_hdr_s *)(ipv4 + 1);
uint16_t datalen;
#ifdef CONFIG_NET_BROADCAST
const in_addr_t bcast = INADDR_BROADCAST;
+2 -2
View File
@@ -60,9 +60,9 @@
****************************************************************************/
#define IPv4BUF \
((struct ipv4_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
((FAR struct ipv4_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
#define ICMPBUF \
((struct icmp_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv4_HDRLEN])
((FAR struct icmp_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv4_HDRLEN])
/****************************************************************************
* Private Types
+2 -2
View File
@@ -45,10 +45,10 @@
* Pre-processor Definitions
****************************************************************************/
#define IPv6BUF ((struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
#define IPv6BUF ((FAR struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
#define ICMPv6ADVERTISE \
((struct icmpv6_neighbor_advertise_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN])
((FAR struct icmpv6_neighbor_advertise_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN])
/****************************************************************************
* Public Functions
+3 -3
View File
@@ -52,9 +52,9 @@
#define ICMPv6REPLY ((FAR struct icmpv6_echo_reply_s *)icmpv6)
#define ICMPv6SIZE ((dev)->d_len - iplen)
#define ICMPv6SOLICIT ((struct icmpv6_neighbor_solicit_s *)icmpv6)
#define ICMPv6ADVERTISE ((struct icmpv6_neighbor_advertise_s *)icmpv6)
#define ICMPv6RADVERTISE ((struct icmpv6_router_advertise_s *)icmpv6)
#define ICMPv6SOLICIT ((FAR struct icmpv6_neighbor_solicit_s *)icmpv6)
#define ICMPv6ADVERTISE ((FAR struct icmpv6_neighbor_advertise_s *)icmpv6)
#define ICMPv6RADVERTISE ((FAR struct icmpv6_router_advertise_s *)icmpv6)
#define MLDQUERY ((FAR struct mld_mcast_listen_query_s *)icmpv6)
#define MLDREPORT_V1 ((FAR struct mld_mcast_listen_report_v1_s *)icmpv6)
+2 -2
View File
@@ -45,10 +45,10 @@
* Pre-processor Definitions
****************************************************************************/
#define IPv6BUF ((struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
#define IPv6BUF ((FAR struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
#define ICMPv6ADVERTISE \
((struct icmpv6_router_advertise_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN])
((FAR struct icmpv6_router_advertise_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN])
/****************************************************************************
* Private Data
+2 -2
View File
@@ -44,9 +44,9 @@
****************************************************************************/
#define IPv6_BUF \
((struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
((FAR struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
#define ICMPv6_BUF \
((struct icmpv6_echo_reply_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN])
((FAR struct icmpv6_echo_reply_s *)&dev->d_buf[NET_LL_HDRLEN(dev) + IPv6_HDRLEN])
#define ICMPv6_SIZE \
((dev)->d_len - IPv6_HDRLEN)
+2 -2
View File
@@ -51,7 +51,7 @@
* Pre-processor Definitions
****************************************************************************/
#define IPv6BUF ((struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
#define IPv6BUF ((FAR struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
/* The latest drafts declared increase in minimal mtu up to 1280. */
@@ -88,7 +88,7 @@ void icmpv6_reply(FAR struct net_driver_s *dev, int type, int code, int data)
{
int ipicmplen = IPv6_HDRLEN + sizeof(struct icmpv6_hdr_s);
FAR struct ipv6_hdr_s *ipv6 = IPv6BUF;
FAR struct icmpv6_hdr_s *icmpv6 = (FAR void *)(ipv6 + 1);
FAR struct icmpv6_hdr_s *icmpv6 = (FAR struct icmpv6_hdr_s *)(ipv6 + 1);
uint16_t datalen;
if (net_ipv6addr_cmp(ipv6->destipaddr, g_ipv6_unspecaddr)

Some files were not shown because too many files have changed in this diff Show More