Lines Matching refs:urb

32  * stub_complete - completion handler of a usbip urb
33 * @urb: pointer to the urb completed
35 * When a urb has completed, the USB core driver calls this function mostly in
36 * the interrupt context. To return the result of a urb, the completed urb is
40 void stub_complete(struct urb *urb)
42 struct stub_priv *priv = (struct stub_priv *) urb->context;
46 usbip_dbg_stub_tx("complete! status %d\n", urb->status);
48 switch (urb->status) {
53 dev_info(&urb->dev->dev,
57 dev_info(&urb->dev->dev,
61 dev_info(&urb->dev->dev, "endpoint %d is stalled\n",
62 usb_pipeendpoint(urb->pipe));
65 dev_info(&urb->dev->dev, "device removed?\n");
68 dev_info(&urb->dev->dev,
69 "urb completion with non-zero status %d\n",
70 urb->status);
83 if (urb->status && !priv->urb_status)
84 priv->urb_status = urb->status;
90 /* link a urb to the queue of tx. */
93 usbip_dbg_stub_tx("ignore urb for closed connection\n");
96 stub_enqueue_ret_unlink(sdev, priv->seqnum, urb->status);
117 static void setup_ret_submit_pdu(struct usbip_header *rpdu, struct urb *urb)
119 struct stub_priv *priv = (struct stub_priv *) urb->context;
122 usbip_pack_pdu(rpdu, urb, USBIP_RET_SUBMIT, 1);
161 struct urb *urb = priv->urbs[0];
175 if (urb->actual_length > 0 && !urb->transfer_buffer &&
176 !urb->num_sgs) {
178 "urb: actual_length %d transfer_buffer null\n",
179 urb->actual_length);
183 if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS)
184 iovnum = 2 + urb->number_of_packets;
185 else if (usb_pipein(urb->pipe) && urb->actual_length > 0 &&
186 urb->num_sgs)
187 iovnum = 1 + urb->num_sgs;
188 else if (usb_pipein(urb->pipe) && priv->sgl)
203 setup_ret_submit_pdu(&pdu_header, urb);
223 if (usb_pipein(urb->pipe) && priv->sgl) {
237 } else if (usb_pipein(urb->pipe) &&
238 usb_pipetype(urb->pipe) != PIPE_ISOCHRONOUS &&
239 urb->actual_length > 0) {
240 if (urb->num_sgs) {
241 unsigned int copy = urb->actual_length;
244 for_each_sg(urb->sg, sg, urb->num_sgs, i) {
260 iov[iovnum].iov_base = urb->transfer_buffer;
261 iov[iovnum].iov_len = urb->actual_length;
264 txsize += urb->actual_length;
265 } else if (usb_pipein(urb->pipe) &&
266 usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS) {
277 for (i = 0; i < urb->number_of_packets; i++) {
278 iov[iovnum].iov_base = urb->transfer_buffer +
279 urb->iso_frame_desc[i].offset;
281 urb->iso_frame_desc[i].actual_length;
283 txsize += urb->iso_frame_desc[i].actual_length;
286 if (txsize != sizeof(pdu_header) + urb->actual_length) {
288 "actual length of urb %d does not match iso packet sizes %zu\n",
289 urb->actual_length,
299 if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS) {
302 iso_buffer = usbip_alloc_iso_desc_pdu(urb, &len);