Lines Matching refs:req

134 static void xhci_dbc_giveback(struct dbc_request *req, int status)
138 struct xhci_dbc *dbc = req->dbc;
141 list_del_init(&req->list_pending);
142 req->trb_dma = 0;
143 req->trb = NULL;
145 if (req->status == -EINPROGRESS)
146 req->status = status;
148 trace_xhci_dbc_giveback_request(req);
151 req->dma,
152 req->length,
153 dbc_ep_dma_direction(req));
157 req->complete(dbc, req);
161 static void xhci_dbc_flush_single_request(struct dbc_request *req)
163 union xhci_trb *trb = req->trb;
171 xhci_dbc_giveback(req, -ESHUTDOWN);
176 struct dbc_request *req, *tmp;
178 list_for_each_entry_safe(req, tmp, &dep->list_pending, list_pending)
179 xhci_dbc_flush_single_request(req);
191 struct dbc_request *req;
200 req = kzalloc(sizeof(*req), flags);
201 if (!req)
204 req->dbc = dbc;
205 INIT_LIST_HEAD(&req->list_pending);
206 INIT_LIST_HEAD(&req->list_pool);
207 req->direction = direction;
209 trace_xhci_dbc_alloc_request(req);
211 return req;
215 dbc_free_request(struct dbc_request *req)
217 trace_xhci_dbc_free_request(req);
219 kfree(req);
246 struct dbc_request *req)
251 struct xhci_dbc *dbc = req->dbc;
255 num_trbs = count_trbs(req->dma, req->length);
260 addr = req->dma;
263 length = TRB_LEN(req->length);
271 req->trb = ring->enqueue;
272 req->trb_dma = xhci_trb_virt_to_dma(ring->enq_seg, ring->enqueue);
295 dbc_ep_do_queue(struct dbc_request *req)
298 struct xhci_dbc *dbc = req->dbc;
300 struct dbc_ep *dep = &dbc->eps[req->direction];
302 if (!req->length || !req->buf)
305 req->actual = 0;
306 req->status = -EINPROGRESS;
308 req->dma = dma_map_single(dev,
309 req->buf,
310 req->length,
312 if (dma_mapping_error(dev, req->dma)) {
317 ret = xhci_dbc_queue_bulk_tx(dep, req);
321 req->dma,
322 req->length,
327 list_add_tail(&req->list_pending, &dep->list_pending);
332 int dbc_ep_queue(struct dbc_request *req)
335 struct xhci_dbc *dbc = req->dbc;
341 if (req->direction != BULK_IN &&
342 req->direction != BULK_OUT)
347 ret = dbc_ep_do_queue(req);
352 trace_xhci_dbc_queue_request(req);
690 struct dbc_request *req = NULL, *r;
722 req = r;
727 if (!req) {
732 trace_xhci_dbc_handle_transfer(ring, &req->trb->generic);
735 req->actual = req->length - remain_length;
736 xhci_dbc_giveback(req, status);