Lines Matching refs:p

182     USBPacket *p = s->packet;  in usb_msd_packet_complete()  local
191 usb_packet_complete(&s->dev, p); in usb_msd_packet_complete()
211 static void usb_msd_copy_data(MSDState *s, USBPacket *p) in usb_msd_copy_data() argument
214 len = p->iov.size - p->actual_length; in usb_msd_copy_data()
217 usb_packet_copy(p, scsi_req_get_buf(s->req) + s->scsi_off, len); in usb_msd_copy_data()
229 static void usb_msd_send_status(MSDState *s, USBPacket *p) in usb_msd_send_status() argument
234 p->iov.size); in usb_msd_send_status()
237 len = MIN(sizeof(s->csw), p->iov.size); in usb_msd_send_status()
238 usb_packet_copy(p, &s->csw, len); in usb_msd_send_status()
245 USBPacket *p = s->packet; in usb_msd_transfer_data() local
254 if (p) { in usb_msd_transfer_data()
255 usb_msd_copy_data(s, p); in usb_msd_transfer_data()
256 p = s->packet; in usb_msd_transfer_data()
257 if (p && p->actual_length == p->iov.size) { in usb_msd_transfer_data()
258 p->status = USB_RET_SUCCESS; /* Clear previous ASYNC status */ in usb_msd_transfer_data()
267 USBPacket *p = s->packet; in usb_msd_command_complete() local
280 usb_msd_send_status(s, p); in usb_msd_command_complete()
283 usb_msd_send_status(s, p); in usb_msd_command_complete()
287 int len = (p->iov.size - p->actual_length); in usb_msd_command_complete()
288 usb_packet_skip(p, len); in usb_msd_command_complete()
298 p->status = USB_RET_SUCCESS; /* Clear previous ASYNC status */ in usb_msd_command_complete()
345 static void usb_msd_handle_control(USBDevice *dev, USBPacket *p, in usb_msd_handle_control() argument
352 ret = usb_desc_handle_control(dev, p, request, value, index, length, data); in usb_msd_handle_control()
379 p->actual_length = 1; in usb_msd_handle_control()
382 p->status = USB_RET_STALL; in usb_msd_handle_control()
387 static void usb_msd_cancel_io(USBDevice *dev, USBPacket *p) in usb_msd_cancel_io() argument
391 assert(s->packet == p); in usb_msd_cancel_io()
399 static void usb_msd_handle_data(USBDevice *dev, USBPacket *p) in usb_msd_handle_data() argument
404 uint8_t devep = p->ep->nr; in usb_msd_handle_data()
409 p->status = USB_RET_STALL; in usb_msd_handle_data()
413 switch (p->pid) { in usb_msd_handle_data()
420 if (p->iov.size != 31) { in usb_msd_handle_data()
424 usb_packet_copy(p, &cbw, 31); in usb_msd_handle_data()
459 trace_usb_msd_data_out(p->iov.size, s->data_len); in usb_msd_handle_data()
460 if (p->iov.size > s->data_len) { in usb_msd_handle_data()
465 usb_msd_copy_data(s, p); in usb_msd_handle_data()
468 len = p->iov.size - p->actual_length; in usb_msd_handle_data()
470 usb_packet_skip(p, len); in usb_msd_handle_data()
480 if (p->actual_length < p->iov.size) { in usb_msd_handle_data()
482 s->packet = p; in usb_msd_handle_data()
483 p->status = USB_RET_ASYNC; in usb_msd_handle_data()
498 if (s->data_len != 0 || p->iov.size < 13) { in usb_msd_handle_data()
503 s->packet = p; in usb_msd_handle_data()
504 p->status = USB_RET_ASYNC; in usb_msd_handle_data()
508 if (p->iov.size < 13) { in usb_msd_handle_data()
515 s->packet = p; in usb_msd_handle_data()
516 p->status = USB_RET_ASYNC; in usb_msd_handle_data()
518 usb_msd_send_status(s, p); in usb_msd_handle_data()
524 trace_usb_msd_data_in(p->iov.size, s->data_len, s->scsi_len); in usb_msd_handle_data()
526 usb_msd_copy_data(s, p); in usb_msd_handle_data()
529 len = p->iov.size - p->actual_length; in usb_msd_handle_data()
531 usb_packet_skip(p, len); in usb_msd_handle_data()
541 if (p->actual_length < p->iov.size && s->mode == USB_MSDM_DATAIN) { in usb_msd_handle_data()
543 s->packet = p; in usb_msd_handle_data()
544 p->status = USB_RET_ASYNC; in usb_msd_handle_data()
555 p->status = USB_RET_STALL; in usb_msd_handle_data()