Lines Matching defs:taglist

34  * Function used to release the tag from taglist.
36 void pqisrc_put_tag(pqi_taglist_t *taglist, uint32_t elem)
39 OS_ACQUIRE_SPINLOCK(&(taglist->lock));
42 ASSERT(taglist->num_elem < taglist->max_elem);
44 if (taglist->num_elem < taglist->max_elem) {
45 taglist->elem_array[taglist->tail] = elem;
46 taglist->num_elem++;
47 taglist->tail = (taglist->tail + 1) % taglist->max_elem;
50 OS_RELEASE_SPINLOCK(&taglist->lock);
58 uint32_t pqisrc_get_tag(pqi_taglist_t *taglist)
64 OS_ACQUIRE_SPINLOCK(&taglist->lock);
66 ASSERT(taglist->num_elem > 0);
68 if (taglist->num_elem > 0) {
69 elem = taglist->elem_array[taglist->head];
70 taglist->num_elem--;
71 taglist->head = (taglist->head + 1) % taglist->max_elem;
74 OS_RELEASE_SPINLOCK(&taglist->lock);
83 int pqisrc_init_taglist(pqisrc_softstate_t *softs, pqi_taglist_t *taglist,
91 taglist->max_elem = max_elem;
92 taglist->num_elem = 0;
93 taglist->head = 0;
94 taglist->tail = 0;
95 taglist->elem_array = os_mem_alloc(softs,
97 if (!(taglist->elem_array)) {
98 DBG_FUNC("Unable to allocate memory for taglist\n");
103 os_strlcpy(taglist->lockname, "tag_lock", LOCKNAME_SIZE);
104 ret = os_init_spinlock(softs, &taglist->lock, taglist->lockname);
107 taglist->lockcreated=false;
110 taglist->lockcreated = true;
115 pqisrc_put_tag(taglist, i);
122 os_mem_free(softs, (char *)taglist->elem_array,
123 (taglist->max_elem * sizeof(uint32_t)));
124 taglist->elem_array = NULL;
133 void pqisrc_destroy_taglist(pqisrc_softstate_t *softs, pqi_taglist_t *taglist)
136 os_mem_free(softs, (char *)taglist->elem_array,
137 (taglist->max_elem * sizeof(uint32_t)));
138 taglist->elem_array = NULL;
140 if(taglist->lockcreated==true){
141 os_uninit_spinlock(&taglist->lock);
142 taglist->lockcreated = false;
206 * Function used to release the tag from taglist.