Add mbuf enqueue/dequeue functions
This commit is contained in:
+18
@@ -203,3 +203,21 @@ int uc_mbuf_extend_tailroom(struct MBuf *mbuf, uint32_t len)
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
void uc_mbuf_enqueue(struct MBuf *mbuf, struct TailQ *head)
|
||||
{
|
||||
uc_tailq_insert_tail(head, &mbuf->entry);
|
||||
}
|
||||
|
||||
struct MBuf *uc_mbuf_dequeue(struct TailQ *head)
|
||||
{
|
||||
struct TailQ *q;
|
||||
|
||||
if (uc_tailq_empty(head)) {
|
||||
return NULL;
|
||||
}
|
||||
q = UC_TAILQ_FIRST(head);
|
||||
uc_tailq_remove(q);
|
||||
|
||||
return UC_TAILQ_CONTAINER(q, struct MBuf, entry);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user