Lines Matching refs:seg
31 struct qdf_flex_mem_segment *seg; in qdf_flex_mem_seg_alloc() local
35 seg = qdf_talloc(pool, total_size); in qdf_flex_mem_seg_alloc()
36 if (!seg) in qdf_flex_mem_seg_alloc()
39 seg->dynamic = true; in qdf_flex_mem_seg_alloc()
40 seg->bytes = (uint8_t *)(seg + 1); in qdf_flex_mem_seg_alloc()
41 seg->used_bitmap = 0; in qdf_flex_mem_seg_alloc()
42 qdf_list_insert_back(&pool->seg_list, &seg->node); in qdf_flex_mem_seg_alloc()
44 return seg; in qdf_flex_mem_seg_alloc()
60 struct qdf_flex_mem_segment *seg, *next; in qdf_flex_mem_deinit() local
64 qdf_list_for_each_del(&pool->seg_list, seg, next, node) { in qdf_flex_mem_deinit()
65 QDF_BUG(!seg->used_bitmap); in qdf_flex_mem_deinit()
66 if (seg->used_bitmap) in qdf_flex_mem_deinit()
69 qdf_list_remove_node(&pool->seg_list, &seg->node); in qdf_flex_mem_deinit()
70 if (seg->dynamic) in qdf_flex_mem_deinit()
71 qdf_tfree(seg); in qdf_flex_mem_deinit()
78 struct qdf_flex_mem_segment *seg; in __qdf_flex_mem_alloc() local
80 qdf_list_for_each(&pool->seg_list, seg, node) { in __qdf_flex_mem_alloc()
84 index = qdf_ffz(seg->used_bitmap); in __qdf_flex_mem_alloc()
90 seg->used_bitmap ^= (QDF_FM_BITMAP)1 << index; in __qdf_flex_mem_alloc()
91 ptr = &seg->bytes[index * pool->item_size]; in __qdf_flex_mem_alloc()
97 seg = qdf_flex_mem_seg_alloc(pool); in __qdf_flex_mem_alloc()
98 if (!seg) in __qdf_flex_mem_alloc()
101 seg->used_bitmap = 1; in __qdf_flex_mem_alloc()
103 return seg->bytes; in __qdf_flex_mem_alloc()
123 struct qdf_flex_mem_segment *seg) in qdf_flex_mem_seg_free() argument
125 if (!seg->dynamic) in qdf_flex_mem_seg_free()
131 qdf_list_remove_node(&pool->seg_list, &seg->node); in qdf_flex_mem_seg_free()
132 qdf_tfree(seg); in qdf_flex_mem_seg_free()
137 struct qdf_flex_mem_segment *seg; in __qdf_flex_mem_free() local
142 qdf_list_for_each(&pool->seg_list, seg, node) { in __qdf_flex_mem_free()
143 low_addr = seg->bytes; in __qdf_flex_mem_free()
152 seg->used_bitmap ^= (QDF_FM_BITMAP)1 << index; in __qdf_flex_mem_free()
153 if (!seg->used_bitmap) in __qdf_flex_mem_free()
154 qdf_flex_mem_seg_free(pool, seg); in __qdf_flex_mem_free()