1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019-2021 Broadcom
6 /* Linked List Header File */
13 /* linked list entry */
15 struct ll_entry *prev;
16 struct ll_entry *next;
21 struct ll_entry *head;
22 struct ll_entry *tail;
27 * Linked list initialization.
29 * [in] ll, linked list to be initialized
31 void ll_init(struct ll *ll);
34 * Linked list insert head
36 * [in] ll, linked list where element is inserted
37 * [in] entry, entry to be added
39 void ll_insert(struct ll *ll, struct ll_entry *entry);
44 * [in] ll, linked list where element is removed
45 * [in] entry, entry to be deleted
47 void ll_delete(struct ll *ll, struct ll_entry *entry);
50 * Linked list return next entry without deleting it
52 * Useful in performing search
54 * [in] Entry in the list
56 static inline struct ll_entry *ll_next(struct ll_entry *entry)
62 * Linked list return the head of the list without removing it
64 * Useful in performing search
66 * [in] ll, linked list
68 static inline struct ll_entry *ll_head(struct ll *ll)
74 * Linked list return the tail of the list without removing it
76 * Useful in performing search
78 * [in] ll, linked list
80 static inline struct ll_entry *ll_tail(struct ll *ll)
86 * Linked list return the number of entries in the list
88 * [in] ll, linked list
90 static inline uint32_t ll_cnt(struct ll *ll)