Changeset eb928c4 in mainline for uspace/drv/bus/usb/xhci/trb_ring.c
- Timestamp:
- 2018-01-08T00:07:00Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1102eca
- Parents:
- ecbad17
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-08 00:05:39)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-08 00:07:00)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/trb_ring.c
recbad17 reb928c4 52 52 53 53 54 /** 55 * Get the first TRB of a segment. 56 */ 54 57 static inline xhci_trb_t *segment_begin(trb_segment_t *segment) 55 58 { … … 57 60 } 58 61 62 /** 63 * Get the one-past-end TRB of a segment. 64 */ 59 65 static inline xhci_trb_t *segment_end(trb_segment_t *segment) 60 66 { … … 91 97 /** 92 98 * Initializes the ring with one segment. 93 * Event when it fails, the structure needs to be finalized.94 99 */ 95 100 int xhci_trb_ring_init(xhci_trb_ring_t *ring) … … 117 122 fibril_mutex_initialize(&ring->guard); 118 123 119 usb_log_debug2("Initialized new TRB ring."); 120 121 return EOK; 122 } 123 124 return EOK; 125 } 126 127 /** 128 * Free all segments inside the ring. 129 */ 124 130 void xhci_trb_ring_fini(xhci_trb_ring_t *ring) 125 131 { … … 150 156 } 151 157 158 /** 159 * Get the physical address of the enqueue pointer. 160 */ 152 161 static uintptr_t trb_ring_enqueue_phys(xhci_trb_ring_t *ring) 153 162 { … … 156 165 } 157 166 167 /** 168 * Decides whether the TRB will trigger an interrupt after being processed. 169 */ 158 170 static bool trb_generates_interrupt(xhci_trb_t *trb) 159 171 { … … 163 175 164 176 /** 165 * Enqueue TD scomposed of TRBs.177 * Enqueue TD composed of TRBs. 166 178 * 167 179 * This will copy specified number of TRBs chained together into the ring. The … … 256 268 /** 257 269 * Initializes an event ring. 258 * Even when it fails, the structure needs to be finalized.259 270 */ 260 271 int xhci_event_ring_init(xhci_event_ring_t *ring) … … 275 286 ring->dequeue_ptr = segment->phys; 276 287 277 if (dma_buffer_alloc(&ring->erst, PAGE_SIZE)) 288 if (dma_buffer_alloc(&ring->erst, PAGE_SIZE)) { 289 xhci_event_ring_fini(ring); 278 290 return ENOMEM; 291 } 279 292 xhci_erst_entry_t *erst = ring->erst.virt; 280 293 … … 301 314 } 302 315 316 /** 317 * Get the physical address of the dequeue pointer. 318 */ 303 319 static uintptr_t event_ring_dequeue_phys(xhci_event_ring_t *ring) 304 320 {
Note:
See TracChangeset
for help on using the changeset viewer.