net: Add a helper to queue a buffer in a net_if instance
Makes code cleaner so it won't be necessary to access the net_if internal queue directly. Change-Id: I119a54e0639843093fa0da6f11e590e8990525d8 Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
parent
b19f26bbbc
commit
d0b382c345
|
@ -193,6 +193,16 @@ static inline struct device *net_if_get_device(struct net_if *iface)
|
|||
return iface->dev;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Queue a packet into net if's TX queue
|
||||
* @param iface Pointer to a network interface structure
|
||||
* @param buf Pointer on a net buffer to queue
|
||||
*/
|
||||
static inline void net_if_queue_tx(struct net_if *iface, struct net_buf *buf)
|
||||
{
|
||||
nano_fifo_put(&iface->tx_queue, buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get an network interface's link address
|
||||
* @param iface Pointer to a network interface structure
|
||||
|
|
|
@ -380,7 +380,7 @@ int net_send_data(struct net_buf *buf)
|
|||
}
|
||||
#endif
|
||||
|
||||
nano_fifo_put(&net_nbuf_iface(buf)->tx_queue, buf);
|
||||
net_if_queue_tx(net_nbuf_iface(buf), buf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue