Lines Matching refs:seg
34 struct cdnsp_segment *seg; in cdnsp_segment_alloc() local
38 seg = kzalloc(sizeof(*seg), flags); in cdnsp_segment_alloc()
39 if (!seg) in cdnsp_segment_alloc()
42 seg->trbs = dma_pool_zalloc(pdev->segment_pool, flags, &dma); in cdnsp_segment_alloc()
43 if (!seg->trbs) { in cdnsp_segment_alloc()
44 kfree(seg); in cdnsp_segment_alloc()
49 seg->bounce_buf = kzalloc(max_packet, flags | GFP_DMA); in cdnsp_segment_alloc()
50 if (!seg->bounce_buf) in cdnsp_segment_alloc()
57 seg->trbs[i].link.control |= cpu_to_le32(TRB_CYCLE); in cdnsp_segment_alloc()
59 seg->dma = dma; in cdnsp_segment_alloc()
60 seg->next = NULL; in cdnsp_segment_alloc()
62 return seg; in cdnsp_segment_alloc()
65 dma_pool_free(pdev->segment_pool, seg->trbs, dma); in cdnsp_segment_alloc()
66 kfree(seg); in cdnsp_segment_alloc()
72 struct cdnsp_segment *seg) in cdnsp_segment_free() argument
74 if (seg->trbs) in cdnsp_segment_free()
75 dma_pool_free(pdev->segment_pool, seg->trbs, seg->dma); in cdnsp_segment_free()
77 kfree(seg->bounce_buf); in cdnsp_segment_free()
78 kfree(seg); in cdnsp_segment_free()
84 struct cdnsp_segment *seg; in cdnsp_free_segments_for_ring() local
86 seg = first->next; in cdnsp_free_segments_for_ring()
88 while (seg != first) { in cdnsp_free_segments_for_ring()
89 struct cdnsp_segment *next = seg->next; in cdnsp_free_segments_for_ring()
91 cdnsp_segment_free(pdev, seg); in cdnsp_free_segments_for_ring()
92 seg = next; in cdnsp_free_segments_for_ring()
195 struct cdnsp_segment *seg, in cdnsp_insert_segment_mapping() argument
201 key = (unsigned long)(seg->dma >> TRB_SEGMENT_SHIFT); in cdnsp_insert_segment_mapping()
218 struct cdnsp_segment *seg) in cdnsp_remove_segment_mapping() argument
222 key = (unsigned long)(seg->dma >> TRB_SEGMENT_SHIFT); in cdnsp_remove_segment_mapping()
234 struct cdnsp_segment *seg; in cdnsp_update_stream_segment_mapping() local
237 seg = first_seg; in cdnsp_update_stream_segment_mapping()
239 ret = cdnsp_insert_segment_mapping(trb_address_map, ring, seg, in cdnsp_update_stream_segment_mapping()
243 if (seg == last_seg) in cdnsp_update_stream_segment_mapping()
245 seg = seg->next; in cdnsp_update_stream_segment_mapping()
246 } while (seg != first_seg); in cdnsp_update_stream_segment_mapping()
251 failed_seg = seg; in cdnsp_update_stream_segment_mapping()
252 seg = first_seg; in cdnsp_update_stream_segment_mapping()
254 cdnsp_remove_segment_mapping(trb_address_map, seg); in cdnsp_update_stream_segment_mapping()
255 if (seg == failed_seg) in cdnsp_update_stream_segment_mapping()
257 seg = seg->next; in cdnsp_update_stream_segment_mapping()
258 } while (seg != first_seg); in cdnsp_update_stream_segment_mapping()
265 struct cdnsp_segment *seg; in cdnsp_remove_stream_mapping() local
267 seg = ring->first_seg; in cdnsp_remove_stream_mapping()
269 cdnsp_remove_segment_mapping(ring->trb_address_map, seg); in cdnsp_remove_stream_mapping()
270 seg = seg->next; in cdnsp_remove_stream_mapping()
271 } while (seg != ring->first_seg); in cdnsp_remove_stream_mapping()
1030 struct cdnsp_segment *seg; in cdnsp_alloc_erst() local
1042 seg = evt_ring->first_seg; in cdnsp_alloc_erst()
1045 entry->seg_addr = cpu_to_le64(seg->dma); in cdnsp_alloc_erst()
1048 seg = seg->next; in cdnsp_alloc_erst()