Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165049
b: refs/heads/master
c: a50c8aa
h: refs/heads/master
i:
  165047: e076171
v: v3
  • Loading branch information
Sarah Sharp authored and Greg Kroah-Hartman committed Sep 23, 2009
1 parent 73395a4 commit 7c7c919
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 913a8a344ffcaf0b4a586d6662a2c66a7106557d
refs/heads/master: a50c8aa953c65fd690eca03a2618ac445a3da05d
46 changes: 29 additions & 17 deletions trunk/drivers/usb/host/xhci-ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,34 @@ static void handle_reset_ep_completion(struct xhci_hcd *xhci,
}
}

/* Check to see if a command in the device's command queue matches this one.
* Signal the completion or free the command, and return 1. Return 0 if the
* completed command isn't at the head of the command list.
*/
static int handle_cmd_in_cmd_wait_list(struct xhci_hcd *xhci,
struct xhci_virt_device *virt_dev,
struct xhci_event_cmd *event)
{
struct xhci_command *command;

if (list_empty(&virt_dev->cmd_list))
return 0;

command = list_entry(virt_dev->cmd_list.next,
struct xhci_command, cmd_list);
if (xhci->cmd_ring->dequeue != command->command_trb)
return 0;

command->status =
GET_COMP_CODE(event->status);
list_del(&command->cmd_list);
if (command->completion)
complete(command->completion);
else
xhci_free_command(xhci, command);
return 1;
}

static void handle_cmd_completion(struct xhci_hcd *xhci,
struct xhci_event_cmd *event)
{
Expand Down Expand Up @@ -724,24 +752,8 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
break;
case TRB_TYPE(TRB_CONFIG_EP):
virt_dev = xhci->devs[slot_id];
/* Check to see if a command in the device's command queue
* matches this one. Signal the completion or free the command.
*/
if (!list_empty(&virt_dev->cmd_list)) {
struct xhci_command *command;
command = list_entry(virt_dev->cmd_list.next,
struct xhci_command, cmd_list);
if (xhci->cmd_ring->dequeue == command->command_trb) {
command->status =
GET_COMP_CODE(event->status);
list_del(&command->cmd_list);
if (command->completion)
complete(command->completion);
else
xhci_free_command(xhci, command);
}
if (handle_cmd_in_cmd_wait_list(xhci, virt_dev, event))
break;
}
/*
* Configure endpoint commands can come from the USB core
* configuration or alt setting changes, or because the HW
Expand Down

0 comments on commit 7c7c919

Please sign in to comment.