Lines Matching refs:p

128     USBPacket                        *p;  member
378 static USBHostRequest *usb_host_req_alloc(USBHostDevice *s, USBPacket *p, in usb_host_req_alloc() argument
384 r->p = p; in usb_host_req_alloc()
409 static USBHostRequest *usb_host_req_find(USBHostDevice *s, USBPacket *p) in usb_host_req_find() argument
414 if (r->p == p) { in usb_host_req_find()
427 if (r->p == NULL) { in usb_host_req_complete_ctrl()
431 r->p->status = status_map[xfer->status]; in usb_host_req_complete_ctrl()
432 r->p->actual_length = xfer->actual_length; in usb_host_req_complete_ctrl()
460 trace_usb_host_req_complete(s->bus_num, s->addr, r->p, in usb_host_req_complete_ctrl()
461 r->p->status, r->p->actual_length); in usb_host_req_complete_ctrl()
462 usb_generic_async_ctrl_complete(USB_DEVICE(s), r->p); in usb_host_req_complete_ctrl()
477 if (r->p == NULL) { in usb_host_req_complete_data()
481 r->p->status = status_map[xfer->status]; in usb_host_req_complete_data()
483 usb_packet_copy(r->p, r->buffer, xfer->actual_length); in usb_host_req_complete_data()
485 trace_usb_host_req_complete(s->bus_num, s->addr, r->p, in usb_host_req_complete_data()
486 r->p->status, r->p->actual_length); in usb_host_req_complete_data()
487 if (usb_host_use_combining(r->p->ep)) { in usb_host_req_complete_data()
488 usb_combined_input_packet_complete(USB_DEVICE(s), r->p); in usb_host_req_complete_data()
490 usb_packet_complete(USB_DEVICE(s), r->p); in usb_host_req_complete_data()
503 bool inflight = (r->p && r->p->state == USB_PACKET_ASYNC); in usb_host_req_abort()
506 r->p->status = USB_RET_NODEV; in usb_host_req_abort()
507 trace_usb_host_req_complete(s->bus_num, s->addr, r->p, in usb_host_req_abort()
508 r->p->status, r->p->actual_length); in usb_host_req_abort()
509 if (r->p->ep->nr == 0) { in usb_host_req_abort()
510 usb_generic_async_ctrl_complete(USB_DEVICE(s), r->p); in usb_host_req_abort()
512 usb_packet_complete(USB_DEVICE(s), r->p); in usb_host_req_abort()
514 r->p = NULL; in usb_host_req_abort()
647 static bool usb_host_iso_data_copy(USBHostIsoXfer *xfer, USBPacket *p) in usb_host_iso_data_copy() argument
653 if (p->pid == USB_TOKEN_OUT) { in usb_host_iso_data_copy()
654 psize = p->iov.size; in usb_host_iso_data_copy()
662 if (psize > p->iov.size) { in usb_host_iso_data_copy()
664 psize = p->iov.size; in usb_host_iso_data_copy()
667 usb_packet_copy(p, buf, psize); in usb_host_iso_data_copy()
673 static void usb_host_iso_data_in(USBHostDevice *s, USBPacket *p) in usb_host_iso_data_in() argument
680 ring = usb_host_iso_find(s, p->ep); in usb_host_iso_data_in()
682 ring = usb_host_iso_alloc(s, p->ep); in usb_host_iso_data_in()
688 if (usb_host_iso_data_copy(xfer, p)) { in usb_host_iso_data_in()
708 trace_usb_host_iso_start(s->bus_num, s->addr, p->ep->nr); in usb_host_iso_data_in()
718 static void usb_host_iso_data_out(USBHostDevice *s, USBPacket *p) in usb_host_iso_data_out() argument
725 ring = usb_host_iso_find(s, p->ep); in usb_host_iso_data_out()
727 ring = usb_host_iso_alloc(s, p->ep); in usb_host_iso_data_out()
739 trace_usb_host_iso_out_of_bufs(s->bus_num, s->addr, p->ep->nr); in usb_host_iso_data_out()
746 usb_host_iso_data_copy(xfer, p); in usb_host_iso_data_out()
770 trace_usb_host_iso_start(s->bus_num, s->addr, p->ep->nr); in usb_host_iso_data_out()
1276 static void usb_host_cancel_packet(USBDevice *udev, USBPacket *p) in usb_host_cancel_packet() argument
1281 if (p->combined) { in usb_host_cancel_packet()
1282 usb_combined_packet_cancel(udev, p); in usb_host_cancel_packet()
1286 trace_usb_host_req_canceled(s->bus_num, s->addr, p); in usb_host_cancel_packet()
1288 r = usb_host_req_find(s, p); in usb_host_cancel_packet()
1289 if (r && r->p) { in usb_host_cancel_packet()
1290 r->p = NULL; /* mark as dead */ in usb_host_cancel_packet()
1409 static void usb_host_set_config(USBHostDevice *s, int config, USBPacket *p) in usb_host_set_config() argument
1420 p->status = USB_RET_STALL; in usb_host_set_config()
1427 p->status = usb_host_claim_interfaces(s, config); in usb_host_set_config()
1428 if (p->status != USB_RET_SUCCESS) { in usb_host_set_config()
1435 USBPacket *p) in usb_host_set_interface() argument
1445 p->status = USB_RET_STALL; in usb_host_set_interface()
1452 p->status = USB_RET_STALL; in usb_host_set_interface()
1463 static void usb_host_handle_control(USBDevice *udev, USBPacket *p, in usb_host_handle_control() argument
1471 trace_usb_host_req_control(s->bus_num, s->addr, p, request, value, index); in usb_host_handle_control()
1474 p->status = USB_RET_NODEV; in usb_host_handle_control()
1475 trace_usb_host_req_emulated(s->bus_num, s->addr, p, p->status); in usb_host_handle_control()
1482 trace_usb_host_req_emulated(s->bus_num, s->addr, p, p->status); in usb_host_handle_control()
1486 usb_host_set_config(s, value & 0xff, p); in usb_host_handle_control()
1487 trace_usb_host_req_emulated(s->bus_num, s->addr, p, p->status); in usb_host_handle_control()
1491 usb_host_set_interface(s, index, value, p); in usb_host_handle_control()
1492 trace_usb_host_req_emulated(s->bus_num, s->addr, p, p->status); in usb_host_handle_control()
1500 trace_usb_host_req_emulated(s->bus_num, s->addr, p, p->status); in usb_host_handle_control()
1505 r = usb_host_req_alloc(s, p, (request >> 8) & USB_DIR_IN, length + 8); in usb_host_handle_control()
1526 p->status = USB_RET_NODEV; in usb_host_handle_control()
1527 trace_usb_host_req_complete(s->bus_num, s->addr, p, in usb_host_handle_control()
1528 p->status, p->actual_length); in usb_host_handle_control()
1535 p->status = USB_RET_ASYNC; in usb_host_handle_control()
1538 static void usb_host_handle_data(USBDevice *udev, USBPacket *p) in usb_host_handle_data() argument
1545 if (usb_host_use_combining(p->ep) && p->state == USB_PACKET_SETUP) { in usb_host_handle_data()
1546 p->status = USB_RET_ADD_TO_QUEUE; in usb_host_handle_data()
1550 trace_usb_host_req_data(s->bus_num, s->addr, p, in usb_host_handle_data()
1551 p->pid == USB_TOKEN_IN, in usb_host_handle_data()
1552 p->ep->nr, p->iov.size); in usb_host_handle_data()
1555 p->status = USB_RET_NODEV; in usb_host_handle_data()
1556 trace_usb_host_req_emulated(s->bus_num, s->addr, p, p->status); in usb_host_handle_data()
1559 if (p->ep->halted) { in usb_host_handle_data()
1560 p->status = USB_RET_STALL; in usb_host_handle_data()
1561 trace_usb_host_req_emulated(s->bus_num, s->addr, p, p->status); in usb_host_handle_data()
1565 switch (usb_ep_get_type(udev, p->pid, p->ep->nr)) { in usb_host_handle_data()
1567 size = usb_packet_size(p); in usb_host_handle_data()
1568 r = usb_host_req_alloc(s, p, p->pid == USB_TOKEN_IN, size); in usb_host_handle_data()
1570 usb_packet_copy(p, r->buffer, size); in usb_host_handle_data()
1572 ep = p->ep->nr | (r->in ? USB_DIR_IN : 0); in usb_host_handle_data()
1573 if (p->stream) { in usb_host_handle_data()
1575 libusb_fill_bulk_stream_transfer(r->xfer, s->dh, ep, p->stream, in usb_host_handle_data()
1581 p->status = USB_RET_STALL; in usb_host_handle_data()
1592 r = usb_host_req_alloc(s, p, p->pid == USB_TOKEN_IN, p->iov.size); in usb_host_handle_data()
1594 usb_packet_copy(p, r->buffer, p->iov.size); in usb_host_handle_data()
1596 ep = p->ep->nr | (r->in ? USB_DIR_IN : 0); in usb_host_handle_data()
1598 r->buffer, p->iov.size, in usb_host_handle_data()
1603 if (p->pid == USB_TOKEN_IN) { in usb_host_handle_data()
1604 usb_host_iso_data_in(s, p); in usb_host_handle_data()
1606 usb_host_iso_data_out(s, p); in usb_host_handle_data()
1608 trace_usb_host_req_complete(s->bus_num, s->addr, p, in usb_host_handle_data()
1609 p->status, p->actual_length); in usb_host_handle_data()
1612 p->status = USB_RET_STALL; in usb_host_handle_data()
1613 trace_usb_host_req_complete(s->bus_num, s->addr, p, in usb_host_handle_data()
1614 p->status, p->actual_length); in usb_host_handle_data()
1620 p->status = USB_RET_NODEV; in usb_host_handle_data()
1621 trace_usb_host_req_complete(s->bus_num, s->addr, p, in usb_host_handle_data()
1622 p->status, p->actual_length); in usb_host_handle_data()
1629 p->status = USB_RET_ASYNC; in usb_host_handle_data()