Lines Matching defs:command

99 	cmd = readl(&xhci->op_regs->command);
101 writel(cmd, &xhci->op_regs->command);
137 temp = readl(&xhci->op_regs->command);
141 writel(temp, &xhci->op_regs->command);
171 u32 command;
188 command = readl(&xhci->op_regs->command);
189 command |= CMD_RESET;
190 writel(command, &xhci->op_regs->command);
202 ret = xhci_handshake(&xhci->op_regs->command, CMD_RESET, 0, timeout_us);
257 val = readl(&xhci->op_regs->command);
259 writel(val, &xhci->op_regs->command);
580 * device contexts (?), set up a command ring segment (or two?), create event
638 * set command ring pointer and event ring pointer.
676 temp = readl(&xhci->op_regs->command);
680 writel(temp, &xhci->op_regs->command);
689 struct xhci_command *command;
691 command = xhci_alloc_command(xhci, false, GFP_KERNEL);
692 if (!command)
695 ret = xhci_queue_vendor_command(xhci, command, 0, 0, 0,
698 xhci_free_command(xhci, command);
825 xhci->s3.command = readl(&xhci->op_regs->command);
838 writel(xhci->s3.command, &xhci->op_regs->command);
853 /* step 2: initialize command ring buffer */
861 "// Setting command ring address to 0x%llx",
867 * The whole command ring must be cleared to zero when we suspend the host.
869 * The host doesn't save the command ring pointer in the suspend well, so we
871 * aligned, because of the reserved bits in the command ring dequeue pointer
908 * the command ring pointers.
1000 u32 command;
1036 command = readl(&xhci->op_regs->command);
1037 command &= ~CMD_RUN;
1038 writel(command, &xhci->op_regs->command);
1055 command = readl(&xhci->op_regs->command);
1056 command |= CMD_CSS;
1057 writel(command, &xhci->op_regs->command);
1111 u32 command, temp = 0;
1153 /* step 2: initialize command ring buffer */
1157 command = readl(&xhci->op_regs->command);
1158 command |= CMD_CRS;
1159 writel(command, &xhci->op_regs->command);
1242 command = readl(&xhci->op_regs->command);
1243 command |= CMD_RUN;
1244 writel(command, &xhci->op_regs->command);
1421 struct usb_device *udev, struct xhci_command *command,
1428 * we need to issue an evaluate context command and wait on it.
1436 struct xhci_command *command;
1455 "Issuing evaluate context command.");
1457 /* Set up the input context flags for the command */
1462 command = xhci_alloc_command(xhci, true, mem_flags);
1463 if (!command)
1466 command->in_ctx = xhci->devs[slot_id]->in_ctx;
1467 ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx);
1478 ep_ctx = xhci_get_ep_ctx(xhci, command->in_ctx, ep_index);
1486 ret = xhci_configure_endpoint(xhci, urb->dev, command,
1494 kfree(command->completion);
1495 kfree(command);
1630 * Transfer Ring Dequeue Pointer command. This will be the common case,
1636 * endpoint command, as noted in the xHCI 0.95 errata.
1642 * doorbell while this code is waiting for a Stop Endpoint command to complete.
1660 struct xhci_command *command;
1738 /* Queue a stop endpoint command, but only if this is
1742 command = xhci_alloc_command(xhci, false, GFP_ATOMIC);
1743 if (!command) {
1751 xhci_queue_stop_endpoint(xhci, command, urb->dev->slot_id,
1881 /* So we won't queue a reset ep command for a root hub */
1891 /* FIXME when we have to issue an evaluate endpoint command to
1990 * configure endpoint command will leave that endpoint's state
2017 xhci_warn(xhci, "Timeout while waiting for configure endpoint command\n");
2042 "ERROR: Incompatible device for endpoint configure command.\n");
2047 "Successful Endpoint Configure command");
2051 xhci_err(xhci, "ERROR: unexpected command completion code 0x%x.\n",
2067 xhci_warn(xhci, "Timeout while waiting for evaluate context command\n");
2072 "WARN: xHCI driver setup invalid evaluate context command.\n");
2077 "WARN: slot not enabled for evaluate context command.\n");
2082 "WARN: invalid context state for evaluate context command.\n");
2087 "ERROR: Incompatible device for evaluate context command.\n");
2097 "Successful evaluate context command");
2101 xhci_err(xhci, "ERROR: unexpected command completion code 0x%x.\n",
2117 * Device command and is never removed until the slot is disabled.
2145 * command completes. We can't subtract the dropped endpoints from the number
2146 * of active endpoints until the command completes because we can oversubscribe
2149 * - the first configure endpoint command drops more endpoints than it adds
2150 * - a second configure endpoint command that adds more endpoints is queued
2151 * - the first configure endpoint command fails, so the config is unchanged
2152 * - the second command may succeed, even though there isn't enough resources
2197 * Now that the command has completed, clean up the active endpoint count by
2787 /* Issue a configure endpoint command or evaluate context command
2792 struct xhci_command *command,
2801 if (!command)
2813 ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx);
2830 xhci_reserve_bandwidth(xhci, virt_dev, command->in_ctx)) {
2838 slot_ctx = xhci_get_slot_ctx(xhci, command->in_ctx);
2844 ret = xhci_queue_configure_endpoint(xhci, command,
2845 command->in_ctx->dma,
2848 ret = xhci_queue_evaluate_context(xhci, command,
2849 command->in_ctx->dma,
2862 /* Wait for the configure endpoint command to complete */
2863 wait_for_completion(command->completion);
2867 &command->status);
2870 &command->status);
2874 /* If the command failed, remove the reserved resources.
2918 struct xhci_command *command;
2931 command = xhci_alloc_command(xhci, true, GFP_KERNEL);
2932 if (!command)
2935 command->in_ctx = virt_dev->in_ctx;
2938 ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx);
2949 /* Don't issue the command if there's no endpoints to update. */
2968 ret = xhci_configure_endpoint(xhci, udev, command,
3002 kfree(command->completion);
3003 kfree(command);
3069 "reset ep command\n");
3101 * issue a configure endpoint command later.
3116 "configure endpoint command");
3167 * command issued when the STALL event was received.
3169 * The reset endpoint command may only be issued to endpoints in the halted
3172 * configure endpoint command with the Drop and Add bits set for the target
3257 xhci_dbg(xhci, "%s: Failed to queue stop ep command, %d ",
3269 /* config ep command clears toggle if add and drop ep flags are set */
3288 xhci_dbg(xhci, "%s: Failed to queue config ep command, %d ",
3449 * coordinate mass storage command queueing across multiple endpoints (basically
3453 * for each endpoint and issuing a configure endpoint command for all endpoints.
3558 /* Set up the input context for a configure endpoint command. */
3577 /* Issue and wait for the configure endpoint command */
3581 /* xHC rejected the configure endpoint command for some reason, so we
3626 * Modify the endpoint context state, submit a configure endpoint command,
3636 struct xhci_command *command;
3645 /* Set up a configure endpoint command to remove the streams rings */
3659 command = vdev->eps[ep_index].stream_info->free_streams_command;
3660 ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx);
3672 ep_ctx = xhci_get_ep_ctx(xhci, command->in_ctx, ep_index);
3676 xhci_endpoint_copy(xhci, command->in_ctx,
3681 xhci_setup_input_ctx_for_config_ep(xhci, command->in_ctx,
3686 /* Issue and wait for the configure endpoint command,
3689 ret = xhci_configure_endpoint(xhci, udev, command,
3692 /* xHC rejected the configure endpoint command for some reason, so we
3716 * Device command, or a Disable Slot command. The Reset Device command leaves
3717 * the control endpoint intact, whereas the Disable Slot command deletes it.
3752 * Wait for the Reset Device command to finish. Remove all structures
3816 /* Allocate the command structure that holds the struct completion.
3824 xhci_dbg(xhci, "Couldn't allocate command structure.\n");
3828 /* Attempt to submit the Reset Device command to the command ring */
3833 xhci_dbg(xhci, "FIXME: allocate a command ring segment\n");
3840 /* Wait for the Reset Device command to finish */
3843 /* The Reset Device command can't fail, according to the 0.95/0.96 spec,
3851 xhci_warn(xhci, "Timeout waiting for reset device command\n");
3864 xhci_dbg(xhci, "Successful reset device command.\n");
3870 "reset device command.\n", ret);
3966 struct xhci_command *command;
3971 command = xhci_alloc_command(xhci, true, GFP_KERNEL);
3972 if (!command)
3983 kfree(command);
3987 ret = xhci_queue_slot_control(xhci, command, TRB_DISABLE_SLOT,
3991 kfree(command);
3997 wait_for_completion(command->completion);
3999 if (command->status != COMP_SUCCESS)
4000 xhci_warn(xhci, "Unsuccessful disable slot %u command, status %d\n",
4001 slot_id, command->status);
4003 xhci_free_command(xhci, command);
4032 * Returns 0 if the xHC ran out of device slots, the Enable Slot command
4042 struct xhci_command *command;
4044 command = xhci_alloc_command(xhci, true, GFP_KERNEL);
4045 if (!command)
4049 ret = xhci_queue_slot_control(xhci, command, TRB_ENABLE_SLOT, 0);
4052 xhci_dbg(xhci, "FIXME: allocate a command ring segment\n");
4053 xhci_free_command(xhci, command);
4059 wait_for_completion(command->completion);
4060 slot_id = command->slot_id;
4062 if (!slot_id || command->status != COMP_SUCCESS) {
4067 xhci_free_command(xhci, command);
4071 xhci_free_command(xhci, command);
4120 * Issue an Address Device command and optionally send a corresponding
4134 struct xhci_command *command = NULL;
4174 command = xhci_alloc_command(xhci, true, GFP_KERNEL);
4175 if (!command) {
4180 command->in_ctx = virt_dev->in_ctx;
4209 ret = xhci_queue_address_device(xhci, command, virt_dev->in_ctx->dma,
4214 "FIXME: allocate a command ring segment");
4221 wait_for_completion(command->completion);
4225 * command on a timeout.
4227 switch (command->status) {
4230 xhci_warn(xhci, "Timeout while waiting for setup device command\n");
4235 xhci_err(xhci, "Setup ERROR: setup %s command for slot %d.\n",
4249 kfree(command->completion);
4250 kfree(command);
4254 "ERROR: Incompatible device for setup %s command\n", act);
4259 "Successful setup %s command", act);
4263 "ERROR: unexpected setup %s command completion code 0x%x.\n",
4264 act, command->status);
4302 if (command) {
4303 kfree(command->completion);
4304 kfree(command);
4334 * Issue an Evaluate Context command to change the Maximum Exit Latency in the
4341 struct xhci_command *command;
4362 /* Attempt to issue an Evaluate Context command to change the MEL. */
4363 command = xhci->lpm_command;
4364 ctrl_ctx = xhci_get_input_control_ctx(command->in_ctx);
4372 xhci_slot_copy(xhci, command->in_ctx, virt_dev->out_ctx);
4376 slot_ctx = xhci_get_slot_ctx(xhci, command->in_ctx);
4384 /* Issue and wait for the evaluate context command. */
4385 ret = xhci_configure_endpoint(xhci, udev, command,
5188 * evaluate context command.