From 4772bfe710c1874557b3da3ba79445e7098e8116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5ns=20Ansgariusson?= Date: Wed, 25 Dec 2024 14:08:45 +0100 Subject: [PATCH] drivers: ethernet: Rename struct ring_buf -> struct ring_buffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The struct ring_buf is renamed to struct ring_buffer to be able to coexist with the sys/ring_buffer.h header file. Signed-off-by: Måns Ansgariusson --- drivers/ethernet/eth_sam_gmac.c | 22 +++++++++++----------- drivers/ethernet/eth_sam_gmac_priv.h | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/ethernet/eth_sam_gmac.c b/drivers/ethernet/eth_sam_gmac.c index e3748a86108..0c2740095c9 100644 --- a/drivers/ethernet/eth_sam_gmac.c +++ b/drivers/ethernet/eth_sam_gmac.c @@ -403,7 +403,7 @@ static inline void eth_sam_gmac_init_qav(Gmac *gmac) /* * Reset ring buffer */ -static void ring_buf_reset(struct ring_buf *rb) +static void ring_buffer_reset(struct ring_buffer *rb) { rb->head = 0U; rb->tail = 0U; @@ -412,7 +412,7 @@ static void ring_buf_reset(struct ring_buf *rb) /* * Get one 32 bit item from the ring buffer */ -static uint32_t ring_buf_get(struct ring_buf *rb) +static uint32_t ring_buffer_get(struct ring_buffer *rb) { uint32_t val; @@ -428,7 +428,7 @@ static uint32_t ring_buf_get(struct ring_buf *rb) /* * Put one 32 bit item into the ring buffer */ -static void ring_buf_put(struct ring_buf *rb, uint32_t val) +static void ring_buffer_put(struct ring_buffer *rb, uint32_t val) { rb->buf[rb->head] = val; MODULO_INC(rb->head, rb->len); @@ -528,9 +528,9 @@ static void tx_descriptors_init(Gmac *gmac, struct gmac_queue *queue) #if GMAC_MULTIPLE_TX_PACKETS == 1 /* Reset TX frame list */ - ring_buf_reset(&queue->tx_frag_list); + ring_buffer_reset(&queue->tx_frag_list); #if defined(CONFIG_PTP_CLOCK_SAM_GMAC) - ring_buf_reset(&queue->tx_frames); + ring_buffer_reset(&queue->tx_frames); #endif #endif } @@ -721,14 +721,14 @@ static void tx_completed(Gmac *gmac, struct gmac_queue *queue) k_sem_give(&queue->tx_desc_sem); /* Release net buffer to the buffer pool */ - frag = UINT_TO_POINTER(ring_buf_get(&queue->tx_frag_list)); + frag = UINT_TO_POINTER(ring_buffer_get(&queue->tx_frag_list)); net_pkt_frag_unref(frag); LOG_DBG("Dropping frag %p", frag); if (tx_desc->w1 & GMAC_TXW1_LASTBUFFER) { #if defined(CONFIG_PTP_CLOCK_SAM_GMAC) /* Release net packet to the packet pool */ - pkt = UINT_TO_POINTER(ring_buf_get(&queue->tx_frames)); + pkt = UINT_TO_POINTER(ring_buffer_get(&queue->tx_frames)); #if defined(CONFIG_NET_GPTP) hdr = check_gptp_msg(get_iface(dev_data), @@ -756,10 +756,10 @@ static void tx_error_handler(Gmac *gmac, struct gmac_queue *queue) { #if GMAC_MULTIPLE_TX_PACKETS == 1 struct net_buf *frag; - struct ring_buf *tx_frag_list = &queue->tx_frag_list; + struct ring_buffer *tx_frag_list = &queue->tx_frag_list; #if defined(CONFIG_PTP_CLOCK_SAM_GMAC) struct net_pkt *pkt; - struct ring_buf *tx_frames = &queue->tx_frames; + struct ring_buffer *tx_frames = &queue->tx_frames; #endif #endif @@ -1495,7 +1495,7 @@ static int eth_tx(const struct device *dev, struct net_pkt *pkt) "tx_desc_list overflow"); /* Account for a sent frag */ - ring_buf_put(&queue->tx_frag_list, POINTER_TO_UINT(frag)); + ring_buffer_put(&queue->tx_frag_list, POINTER_TO_UINT(frag)); /* frag is internally queued, so it requires to hold a reference */ net_pkt_frag_ref(frag); @@ -1533,7 +1533,7 @@ static int eth_tx(const struct device *dev, struct net_pkt *pkt) #if GMAC_MULTIPLE_TX_PACKETS == 1 #if defined(CONFIG_PTP_CLOCK_SAM_GMAC) /* Account for a sent frame */ - ring_buf_put(&queue->tx_frames, POINTER_TO_UINT(pkt)); + ring_buffer_put(&queue->tx_frames, POINTER_TO_UINT(pkt)); /* pkt is internally queued, so it requires to hold a reference */ net_pkt_ref(pkt); diff --git a/drivers/ethernet/eth_sam_gmac_priv.h b/drivers/ethernet/eth_sam_gmac_priv.h index 8fd5a2b257b..c2a94a1c3f1 100644 --- a/drivers/ethernet/eth_sam_gmac_priv.h +++ b/drivers/ethernet/eth_sam_gmac_priv.h @@ -208,7 +208,7 @@ enum queue_idx { #endif /** Minimal ring buffer implementation */ -struct ring_buf { +struct ring_buffer { uint32_t *buf; uint16_t len; uint16_t head; @@ -242,9 +242,9 @@ struct gmac_queue { struct net_buf **rx_frag_list; #if GMAC_MULTIPLE_TX_PACKETS == 1 - struct ring_buf tx_frag_list; + struct ring_buffer tx_frag_list; #if defined(CONFIG_PTP_CLOCK_SAM_GMAC) - struct ring_buf tx_frames; + struct ring_buffer tx_frames; #endif #endif