drivers: ethernet: Rename struct ring_buf -> struct ring_buffer
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 <Mansgariusson@gmail.com>
This commit is contained in:
parent
efcc734b79
commit
4772bfe710
2 changed files with 14 additions and 14 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue