Lines Matching refs:seg
42 struct xhci_segment *seg; in xhci_segment_alloc() local
46 seg = kzalloc(sizeof *seg, flags); in xhci_segment_alloc()
47 if (!seg) in xhci_segment_alloc()
50 seg->trbs = dma_pool_alloc(xhci->segment_pool, flags, &dma); in xhci_segment_alloc()
51 if (!seg->trbs) { in xhci_segment_alloc()
52 kfree(seg); in xhci_segment_alloc()
56 memset(seg->trbs, 0, TRB_SEGMENT_SIZE); in xhci_segment_alloc()
60 seg->trbs[i].link.control |= cpu_to_le32(TRB_CYCLE); in xhci_segment_alloc()
62 seg->dma = dma; in xhci_segment_alloc()
63 seg->next = NULL; in xhci_segment_alloc()
65 return seg; in xhci_segment_alloc()
68 static void xhci_segment_free(struct xhci_hcd *xhci, struct xhci_segment *seg) in xhci_segment_free() argument
70 if (seg->trbs) { in xhci_segment_free()
71 dma_pool_free(xhci->segment_pool, seg->trbs, seg->dma); in xhci_segment_free()
72 seg->trbs = NULL; in xhci_segment_free()
74 kfree(seg); in xhci_segment_free()
80 struct xhci_segment *seg; in xhci_free_segments_for_ring() local
82 seg = first->next; in xhci_free_segments_for_ring()
83 while (seg != first) { in xhci_free_segments_for_ring()
84 struct xhci_segment *next = seg->next; in xhci_free_segments_for_ring()
85 xhci_segment_free(xhci, seg); in xhci_free_segments_for_ring()
86 seg = next; in xhci_free_segments_for_ring()
185 struct xhci_segment *seg, in xhci_insert_segment_mapping() argument
191 key = (unsigned long)(seg->dma >> TRB_SEGMENT_SHIFT); in xhci_insert_segment_mapping()
206 struct xhci_segment *seg) in xhci_remove_segment_mapping() argument
210 key = (unsigned long)(seg->dma >> TRB_SEGMENT_SHIFT); in xhci_remove_segment_mapping()
222 struct xhci_segment *seg; in xhci_update_stream_segment_mapping() local
229 seg = first_seg; in xhci_update_stream_segment_mapping()
232 ring, seg, mem_flags); in xhci_update_stream_segment_mapping()
235 if (seg == last_seg) in xhci_update_stream_segment_mapping()
237 seg = seg->next; in xhci_update_stream_segment_mapping()
238 } while (seg != first_seg); in xhci_update_stream_segment_mapping()
243 failed_seg = seg; in xhci_update_stream_segment_mapping()
244 seg = first_seg; in xhci_update_stream_segment_mapping()
246 xhci_remove_segment_mapping(trb_address_map, seg); in xhci_update_stream_segment_mapping()
247 if (seg == failed_seg) in xhci_update_stream_segment_mapping()
249 seg = seg->next; in xhci_update_stream_segment_mapping()
250 } while (seg != first_seg); in xhci_update_stream_segment_mapping()
257 struct xhci_segment *seg; in xhci_remove_stream_mapping() local
262 seg = ring->first_seg; in xhci_remove_stream_mapping()
264 xhci_remove_segment_mapping(ring->trb_address_map, seg); in xhci_remove_stream_mapping()
265 seg = seg->next; in xhci_remove_stream_mapping()
266 } while (seg != ring->first_seg); in xhci_remove_stream_mapping()
429 struct xhci_segment *seg = ring->first_seg; in xhci_reinit_cached_ring() local
433 memset(seg->trbs, 0, in xhci_reinit_cached_ring()
437 seg->trbs[i].link.control |= in xhci_reinit_cached_ring()
441 xhci_link_segments(xhci, seg, seg->next, type); in xhci_reinit_cached_ring()
442 seg = seg->next; in xhci_reinit_cached_ring()
443 } while (seg != ring->first_seg); in xhci_reinit_cached_ring()
1904 struct xhci_segment *seg; in xhci_test_trb_in_td() local
1909 seg = trb_in_td(xhci, input_seg, start_trb, end_trb, input_dma, false); in xhci_test_trb_in_td()
1910 if (seg != result_seg) { in xhci_test_trb_in_td()
1922 result_seg, seg); in xhci_test_trb_in_td()
2323 struct xhci_segment *seg; in xhci_mem_init() local
2483 for (val = 0, seg = xhci->event_ring->first_seg; val < ERST_NUM_SEGS; val++) { in xhci_mem_init()
2485 entry->seg_addr = cpu_to_le64(seg->dma); in xhci_mem_init()
2488 seg = seg->next; in xhci_mem_init()