Lines Matching full:transaction
108 * @CVMX_USB_STATUS_OK: The transaction / operation finished without
111 * @CVMX_USB_STATUS_CANCEL: The transaction was canceled while in flight
113 * @CVMX_USB_STATUS_ERROR: The transaction aborted with an unexpected
115 * @CVMX_USB_STATUS_STALL: The transaction received a USB STALL response
117 * @CVMX_USB_STATUS_XACTERR: The transaction failed with an error from the
119 * @CVMX_USB_STATUS_DATATGLERR: The transaction failed with a data toggle
121 * @CVMX_USB_STATUS_BABBLEERR: The transaction failed with a babble error
122 * @CVMX_USB_STATUS_FRAMEERR: The transaction failed with a frame error
238 * enum represents all of the possible stages a transaction can
241 * transaction with a simple clearing of bit 0.
255 * struct cvmx_usb_transaction - describes each pending USB transaction
260 * @type: Type of transaction, duplicated of the pipe.
261 * @flags: State flags for this transaction.
270 * @actual_bytes: Actual bytes transfer for this transaction.
304 * @transfer_type: Type of transaction supported by this pipe
1346 * @pipe: Pipe for control transaction
1354 struct cvmx_usb_transaction *transaction = in cvmx_usb_start_channel_control() local
1355 list_first_entry(&pipe->transactions, typeof(*transaction), in cvmx_usb_start_channel_control()
1358 cvmx_phys_to_ptr(transaction->control_header); in cvmx_usb_start_channel_control()
1359 int bytes_to_transfer = transaction->buffer_length - in cvmx_usb_start_channel_control()
1360 transaction->actual_bytes; in cvmx_usb_start_channel_control()
1367 switch (transaction->stage) { in cvmx_usb_start_channel_control()
1385 transaction->control_header); in cvmx_usb_start_channel_control()
1490 * Start a channel to perform the pipe's head transaction
1499 struct cvmx_usb_transaction *transaction = in cvmx_usb_start_channel() local
1500 list_first_entry(&pipe->transactions, typeof(*transaction), in cvmx_usb_start_channel()
1566 u64 dma_address = transaction->buffer + in cvmx_usb_start_channel()
1567 transaction->actual_bytes; in cvmx_usb_start_channel()
1569 if (transaction->type == CVMX_USB_TRANSFER_ISOCHRONOUS) in cvmx_usb_start_channel()
1570 dma_address = transaction->buffer + in cvmx_usb_start_channel()
1571 transaction->iso_packets[0].offset + in cvmx_usb_start_channel()
1572 transaction->actual_bytes; in cvmx_usb_start_channel()
1586 int bytes_to_transfer = transaction->buffer_length - in cvmx_usb_start_channel()
1587 transaction->actual_bytes; in cvmx_usb_start_channel()
1593 if (transaction->type == CVMX_USB_TRANSFER_ISOCHRONOUS) in cvmx_usb_start_channel()
1595 transaction->iso_packets[0].length - in cvmx_usb_start_channel()
1596 transaction->actual_bytes; in cvmx_usb_start_channel()
1609 if ((transaction->stage & 1) == 0) { in cvmx_usb_start_channel()
1610 if (transaction->type == CVMX_USB_TRANSFER_BULK) in cvmx_usb_start_channel()
1623 usbc_hcsplt.s.compsplt = (transaction->stage == in cvmx_usb_start_channel()
1652 if (transaction->actual_bytes == 0) { in cvmx_usb_start_channel()
1775 usbc_hcchar.s.eptype = transaction->type; in cvmx_usb_start_channel()
1786 /* Do transaction type specific fixups as needed */ in cvmx_usb_start_channel()
1787 switch (transaction->type) { in cvmx_usb_start_channel()
1821 transaction->xfersize = usbc_hctsiz.s.xfersize; in cvmx_usb_start_channel()
1822 transaction->pktcnt = usbc_hctsiz.s.pktcnt; in cvmx_usb_start_channel()
1824 /* Remember when we start a split transaction */ in cvmx_usb_start_channel()
1826 usb->active_split = transaction; in cvmx_usb_start_channel()
1960 *transaction, in octeon_usb_urb_complete_callback()
1995 dev_dbg(dev, "ISOCHRONOUS packet=%d of %d status=%d pipe=%p transaction=%p size=%d\n", in octeon_usb_urb_complete_callback()
1998 transaction, iso_packet[i].length); in octeon_usb_urb_complete_callback()
2016 dev_dbg(dev, "status=stall pipe=%p transaction=%p size=%d\n", in octeon_usb_urb_complete_callback()
2017 pipe, transaction, bytes_transferred); in octeon_usb_urb_complete_callback()
2021 dev_dbg(dev, "status=babble pipe=%p transaction=%p size=%d\n", in octeon_usb_urb_complete_callback()
2022 pipe, transaction, bytes_transferred); in octeon_usb_urb_complete_callback()
2026 dev_dbg(dev, "status=short pipe=%p transaction=%p size=%d\n", in octeon_usb_urb_complete_callback()
2027 pipe, transaction, bytes_transferred); in octeon_usb_urb_complete_callback()
2034 dev_dbg(dev, "status=%d pipe=%p transaction=%p size=%d\n", in octeon_usb_urb_complete_callback()
2035 status, pipe, transaction, bytes_transferred); in octeon_usb_urb_complete_callback()
2046 * Signal the completion of a transaction and free it. The
2047 * transaction will be removed from the pipe transaction list.
2050 * @pipe: Pipe the transaction is on
2051 * @transaction:
2052 * Transaction that completed
2058 struct cvmx_usb_transaction *transaction, in cvmx_usb_complete() argument
2062 if (usb->active_split == transaction) in cvmx_usb_complete()
2069 if (unlikely(transaction->type == CVMX_USB_TRANSFER_ISOCHRONOUS)) { in cvmx_usb_complete()
2071 transaction->iso_packets[0].length = transaction->actual_bytes; in cvmx_usb_complete()
2072 transaction->iso_packets[0].status = complete_code; in cvmx_usb_complete()
2078 if ((transaction->iso_number_packets > 1) && in cvmx_usb_complete()
2081 transaction->actual_bytes = 0; in cvmx_usb_complete()
2083 transaction->iso_number_packets--; in cvmx_usb_complete()
2085 transaction->iso_packets++; in cvmx_usb_complete()
2086 transaction->stage = CVMX_USB_STAGE_NON_CONTROL; in cvmx_usb_complete()
2091 /* Remove the transaction from the pipe list */ in cvmx_usb_complete()
2092 list_del(&transaction->node); in cvmx_usb_complete()
2096 transaction, in cvmx_usb_complete()
2097 transaction->actual_bytes, in cvmx_usb_complete()
2098 transaction->urb); in cvmx_usb_complete()
2099 kfree(transaction); in cvmx_usb_complete()
2103 * Submit a usb transaction to a pipe. Called for all types
2108 * @type: Transaction type
2109 * @buffer: User buffer for the transaction
2117 * For ISO, the number of packet in the transaction.
2122 * Returns: Transaction or NULL on failure.
2136 struct cvmx_usb_transaction *transaction; in cvmx_usb_submit_transaction() local
2141 transaction = kzalloc(sizeof(*transaction), GFP_ATOMIC); in cvmx_usb_submit_transaction()
2142 if (unlikely(!transaction)) in cvmx_usb_submit_transaction()
2145 transaction->type = type; in cvmx_usb_submit_transaction()
2146 transaction->buffer = buffer; in cvmx_usb_submit_transaction()
2147 transaction->buffer_length = buffer_length; in cvmx_usb_submit_transaction()
2148 transaction->control_header = control_header; in cvmx_usb_submit_transaction()
2150 transaction->iso_start_frame = iso_start_frame; in cvmx_usb_submit_transaction()
2151 transaction->iso_number_packets = iso_number_packets; in cvmx_usb_submit_transaction()
2152 transaction->iso_packets = iso_packets; in cvmx_usb_submit_transaction()
2153 transaction->urb = urb; in cvmx_usb_submit_transaction()
2154 if (transaction->type == CVMX_USB_TRANSFER_CONTROL) in cvmx_usb_submit_transaction()
2155 transaction->stage = CVMX_USB_STAGE_SETUP; in cvmx_usb_submit_transaction()
2157 transaction->stage = CVMX_USB_STAGE_NON_CONTROL; in cvmx_usb_submit_transaction()
2160 list_add_tail(&transaction->node, &pipe->transactions); in cvmx_usb_submit_transaction()
2162 list_add_tail(&transaction->node, &pipe->transactions); in cvmx_usb_submit_transaction()
2173 return transaction; in cvmx_usb_submit_transaction()
2183 * Returns: A submitted transaction or NULL on failure.
2207 * Returns: A submitted transaction or NULL on failure.
2232 * Returns: A submitted transaction or NULL on failure.
2263 * Returns: A submitted transaction or NULL on failure.
2285 * can fail if the transaction has already completed before cancel
2292 * @transaction: Transaction to cancel, returned by the submit function.
2298 struct cvmx_usb_transaction *transaction) in cvmx_usb_cancel() argument
2301 * If the transaction is the HEAD of the queue and scheduled. We need to in cvmx_usb_cancel()
2304 if (list_first_entry(&pipe->transactions, typeof(*transaction), node) == in cvmx_usb_cancel()
2305 transaction && (pipe->flags & CVMX_USB_PIPE_FLAGS_SCHEDULED)) { in cvmx_usb_cancel()
2317 * If the channel isn't enabled then the transaction already in cvmx_usb_cancel()
2328 cvmx_usb_complete(usb, pipe, transaction, CVMX_USB_STATUS_CANCEL); in cvmx_usb_cancel()
2344 struct cvmx_usb_transaction *transaction, *next; in cvmx_usb_cancel_all() local
2346 /* Simply loop through and attempt to cancel each transaction */ in cvmx_usb_cancel_all()
2347 list_for_each_entry_safe(transaction, next, &pipe->transactions, node) { in cvmx_usb_cancel_all()
2348 int result = cvmx_usb_cancel(usb, pipe, transaction); in cvmx_usb_cancel_all()
2397 struct cvmx_usb_transaction *transaction, in cvmx_usb_transfer_control() argument
2402 switch (transaction->stage) { in cvmx_usb_transfer_control()
2406 cvmx_usb_complete(usb, pipe, transaction, in cvmx_usb_transfer_control()
2412 transaction->stage = in cvmx_usb_transfer_control()
2416 cvmx_phys_to_ptr(transaction->control_header); in cvmx_usb_transfer_control()
2418 transaction->stage = CVMX_USB_STAGE_DATA; in cvmx_usb_transfer_control()
2420 transaction->stage = CVMX_USB_STAGE_STATUS; in cvmx_usb_transfer_control()
2426 cvmx_phys_to_ptr(transaction->control_header); in cvmx_usb_transfer_control()
2428 transaction->stage = CVMX_USB_STAGE_DATA; in cvmx_usb_transfer_control()
2430 transaction->stage = CVMX_USB_STAGE_STATUS; in cvmx_usb_transfer_control()
2435 transaction->stage = CVMX_USB_STAGE_DATA_SPLIT_COMPLETE; in cvmx_usb_transfer_control()
2444 transaction->actual_bytes += in cvmx_usb_transfer_control()
2447 transaction->actual_bytes += in cvmx_usb_transfer_control()
2453 transaction->stage = CVMX_USB_STAGE_STATUS; in cvmx_usb_transfer_control()
2460 transaction->stage = CVMX_USB_STAGE_STATUS; in cvmx_usb_transfer_control()
2462 transaction->stage = CVMX_USB_STAGE_DATA; in cvmx_usb_transfer_control()
2467 transaction->stage = in cvmx_usb_transfer_control()
2470 cvmx_usb_complete(usb, pipe, transaction, in cvmx_usb_transfer_control()
2474 cvmx_usb_complete(usb, pipe, transaction, CVMX_USB_STATUS_OK); in cvmx_usb_transfer_control()
2481 struct cvmx_usb_transaction *transaction, in cvmx_usb_transfer_bulk() argument
2488 * an ACK is during a split transaction. For splits we need to continue in cvmx_usb_transfer_bulk()
2492 if (transaction->stage == CVMX_USB_STAGE_NON_CONTROL) in cvmx_usb_transfer_bulk()
2493 transaction->stage = in cvmx_usb_transfer_bulk()
2497 transaction->stage = CVMX_USB_STAGE_NON_CONTROL; in cvmx_usb_transfer_bulk()
2499 cvmx_usb_complete(usb, pipe, transaction, in cvmx_usb_transfer_bulk()
2508 cvmx_usb_complete(usb, pipe, transaction, in cvmx_usb_transfer_bulk()
2515 struct cvmx_usb_transaction *transaction, in cvmx_usb_transfer_intr() argument
2520 if (transaction->stage == CVMX_USB_STAGE_NON_CONTROL) { in cvmx_usb_transfer_intr()
2521 transaction->stage = in cvmx_usb_transfer_intr()
2525 transaction->stage = CVMX_USB_STAGE_NON_CONTROL; in cvmx_usb_transfer_intr()
2528 cvmx_usb_complete(usb, pipe, transaction, in cvmx_usb_transfer_intr()
2534 cvmx_usb_complete(usb, pipe, transaction, CVMX_USB_STATUS_OK); in cvmx_usb_transfer_intr()
2540 struct cvmx_usb_transaction *transaction, in cvmx_usb_transfer_isoc() argument
2560 cvmx_usb_complete(usb, pipe, transaction, in cvmx_usb_transfer_isoc()
2565 if (transaction->stage == in cvmx_usb_transfer_isoc()
2574 cvmx_usb_complete(usb, pipe, transaction, in cvmx_usb_transfer_isoc()
2578 transaction->stage = in cvmx_usb_transfer_isoc()
2583 cvmx_usb_complete(usb, pipe, transaction, CVMX_USB_STATUS_OK); in cvmx_usb_transfer_isoc()
2603 struct cvmx_usb_transaction *transaction; in cvmx_usb_poll_channel() local
2678 transaction = list_first_entry(&pipe->transactions, in cvmx_usb_poll_channel()
2679 typeof(*transaction), in cvmx_usb_poll_channel()
2681 prefetch(transaction); in cvmx_usb_poll_channel()
2703 packets_processed = transaction->pktcnt - usbc_hctsiz.s.pktcnt; in cvmx_usb_poll_channel()
2711 bytes_this_transfer = transaction->xfersize - in cvmx_usb_poll_channel()
2715 * OUT transaction don't decrement xfersize. Instead pktcnt is in cvmx_usb_poll_channel()
2725 if (bytes_this_transfer > transaction->xfersize) in cvmx_usb_poll_channel()
2726 bytes_this_transfer = transaction->xfersize; in cvmx_usb_poll_channel()
2740 if ((transaction->stage == CVMX_USB_STAGE_SETUP) || in cvmx_usb_poll_channel()
2741 (transaction->stage == CVMX_USB_STAGE_SETUP_SPLIT_COMPLETE)) in cvmx_usb_poll_channel()
2749 transaction->actual_bytes += bytes_this_transfer; in cvmx_usb_poll_channel()
2750 if (transaction->type == CVMX_USB_TRANSFER_ISOCHRONOUS) in cvmx_usb_poll_channel()
2751 buffer_space_left = transaction->iso_packets[0].length - in cvmx_usb_poll_channel()
2752 transaction->actual_bytes; in cvmx_usb_poll_channel()
2754 buffer_space_left = transaction->buffer_length - in cvmx_usb_poll_channel()
2755 transaction->actual_bytes; in cvmx_usb_poll_channel()
2758 * We need to remember the PID toggle state for the next transaction. in cvmx_usb_poll_channel()
2759 * The hardware already updated it for the next transaction in cvmx_usb_poll_channel()
2764 * For high speed bulk out, assume the next transaction will need to do in cvmx_usb_poll_channel()
2777 * such case we just need to fail every transaction. in cvmx_usb_poll_channel()
2779 cvmx_usb_complete(usb, pipe, transaction, in cvmx_usb_poll_channel()
2786 * STALL as a response means this transaction cannot be in cvmx_usb_poll_channel()
2792 cvmx_usb_complete(usb, pipe, transaction, in cvmx_usb_poll_channel()
2800 cvmx_usb_complete(usb, pipe, transaction, in cvmx_usb_poll_channel()
2804 cvmx_usb_complete(usb, pipe, transaction, in cvmx_usb_poll_channel()
2808 cvmx_usb_complete(usb, pipe, transaction, in cvmx_usb_poll_channel()
2813 * response to a ping, as a response to a split transaction, and in cvmx_usb_poll_channel()
2818 transaction->retries = 0; in cvmx_usb_poll_channel()
2821 * again. Otherwise this transaction is complete in cvmx_usb_poll_channel()
2826 transaction, in cvmx_usb_poll_channel()
2834 transaction->retries++; in cvmx_usb_poll_channel()
2835 if ((transaction->retries & 0x3) == 0) { in cvmx_usb_poll_channel()
2837 * Rewind to the beginning of the transaction by in cvmx_usb_poll_channel()
2840 transaction->stage &= ~1; in cvmx_usb_poll_channel()
2845 transaction->retries = 0; in cvmx_usb_poll_channel()
2859 switch (transaction->type) { in cvmx_usb_poll_channel()
2861 cvmx_usb_transfer_control(usb, pipe, transaction, in cvmx_usb_poll_channel()
2867 cvmx_usb_transfer_bulk(usb, pipe, transaction, in cvmx_usb_poll_channel()
2872 cvmx_usb_transfer_intr(usb, pipe, transaction, in cvmx_usb_poll_channel()
2877 cvmx_usb_transfer_isoc(usb, pipe, transaction, in cvmx_usb_poll_channel()
2887 if (usb->active_split == transaction) in cvmx_usb_poll_channel()
2891 * transaction, but it should be retried in the future. Rewind in cvmx_usb_poll_channel()
2892 * to the beginning of the transaction by anding off the split in cvmx_usb_poll_channel()
2895 transaction->retries = 0; in cvmx_usb_poll_channel()
2896 transaction->stage &= ~1; in cvmx_usb_poll_channel()
2908 /* We'll retry the exact same transaction again */ in cvmx_usb_poll_channel()
2909 transaction->retries++; in cvmx_usb_poll_channel()
2915 cvmx_usb_complete(usb, pipe, transaction, in cvmx_usb_poll_channel()
3073 struct cvmx_usb_transaction *transaction = NULL; in octeon_usb_urb_enqueue() local
3202 transaction = cvmx_usb_submit_isochronous(usb, in octeon_usb_urb_enqueue()
3208 if (!transaction) { in octeon_usb_urb_enqueue()
3218 transaction = cvmx_usb_submit_interrupt(usb, pipe, urb); in octeon_usb_urb_enqueue()
3224 transaction = cvmx_usb_submit_control(usb, pipe, urb); in octeon_usb_urb_enqueue()
3230 transaction = cvmx_usb_submit_bulk(usb, pipe, urb); in octeon_usb_urb_enqueue()
3233 if (!transaction) { in octeon_usb_urb_enqueue()
3239 urb->hcpriv = transaction; in octeon_usb_urb_enqueue()