diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2009-09-04 13:53:09 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-23 09:46:39 -0400 |
commit | 63a0d9abd18cdcf5a985029c266c6bfe0511768f (patch) | |
tree | 2ae717082d022b2a86a64b86dee48ddfb2be0627 /drivers/usb/host/xhci.h | |
parent | 9e221be815cd263480928248bfd4541497017a1b (diff) |
USB: xhci: Endpoint representation refactoring.
The xhci_ring structure contained information that is really related to an
endpoint, not a ring. This will cause problems later when endpoint
streams are supported and there are multiple rings per endpoint.
Move the endpoint state and cancellation information into a new virtual
endpoint structure, xhci_virt_ep. The list of TRBs to be cancelled should
be per endpoint, not per ring, for easy access. There can be only one TRB
that the endpoint stopped on after a stop endpoint command (even with
streams enabled); move the stopped TRB information into the new virtual
endpoint structure. Also move the 31 endpoint rings and temporary ring
storage from the virtual device structure (xhci_virt_device) into the
virtual endpoint structure (xhci_virt_ep).
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/xhci.h')
-rw-r--r-- | drivers/usb/host/xhci.h | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index a7728aa91582..627092286d1b 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -625,6 +625,23 @@ struct xhci_input_control_ctx { | |||
625 | /* add context bitmasks */ | 625 | /* add context bitmasks */ |
626 | #define ADD_EP(x) (0x1 << x) | 626 | #define ADD_EP(x) (0x1 << x) |
627 | 627 | ||
628 | struct xhci_virt_ep { | ||
629 | struct xhci_ring *ring; | ||
630 | /* Temporary storage in case the configure endpoint command fails and we | ||
631 | * have to restore the device state to the previous state | ||
632 | */ | ||
633 | struct xhci_ring *new_ring; | ||
634 | unsigned int ep_state; | ||
635 | #define SET_DEQ_PENDING (1 << 0) | ||
636 | #define EP_HALTED (1 << 1) | ||
637 | /* ---- Related to URB cancellation ---- */ | ||
638 | struct list_head cancelled_td_list; | ||
639 | unsigned int cancels_pending; | ||
640 | /* The TRB that was last reported in a stopped endpoint ring */ | ||
641 | union xhci_trb *stopped_trb; | ||
642 | struct xhci_td *stopped_td; | ||
643 | }; | ||
644 | |||
628 | struct xhci_virt_device { | 645 | struct xhci_virt_device { |
629 | /* | 646 | /* |
630 | * Commands to the hardware are passed an "input context" that | 647 | * Commands to the hardware are passed an "input context" that |
@@ -637,13 +654,7 @@ struct xhci_virt_device { | |||
637 | struct xhci_container_ctx *out_ctx; | 654 | struct xhci_container_ctx *out_ctx; |
638 | /* Used for addressing devices and configuration changes */ | 655 | /* Used for addressing devices and configuration changes */ |
639 | struct xhci_container_ctx *in_ctx; | 656 | struct xhci_container_ctx *in_ctx; |
640 | 657 | struct xhci_virt_ep eps[31]; | |
641 | /* FIXME when stream support is added */ | ||
642 | struct xhci_ring *ep_rings[31]; | ||
643 | /* Temporary storage in case the configure endpoint command fails and we | ||
644 | * have to restore the device state to the previous state | ||
645 | */ | ||
646 | struct xhci_ring *new_ep_rings[31]; | ||
647 | struct completion cmd_completion; | 658 | struct completion cmd_completion; |
648 | /* Status of the last command issued for this device */ | 659 | /* Status of the last command issued for this device */ |
649 | u32 cmd_status; | 660 | u32 cmd_status; |
@@ -945,15 +956,6 @@ struct xhci_ring { | |||
945 | struct xhci_segment *deq_seg; | 956 | struct xhci_segment *deq_seg; |
946 | unsigned int deq_updates; | 957 | unsigned int deq_updates; |
947 | struct list_head td_list; | 958 | struct list_head td_list; |
948 | /* ---- Related to URB cancellation ---- */ | ||
949 | struct list_head cancelled_td_list; | ||
950 | unsigned int cancels_pending; | ||
951 | unsigned int state; | ||
952 | #define SET_DEQ_PENDING (1 << 0) | ||
953 | #define EP_HALTED (1 << 1) | ||
954 | /* The TRB that was last reported in a stopped endpoint ring */ | ||
955 | union xhci_trb *stopped_trb; | ||
956 | struct xhci_td *stopped_td; | ||
957 | /* | 959 | /* |
958 | * Write the cycle state into the TRB cycle field to give ownership of | 960 | * Write the cycle state into the TRB cycle field to give ownership of |
959 | * the TRB to the host controller (if we are the producer), or to check | 961 | * the TRB to the host controller (if we are the producer), or to check |
@@ -1236,11 +1238,10 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, | |||
1236 | unsigned int slot_id, unsigned int ep_index, | 1238 | unsigned int slot_id, unsigned int ep_index, |
1237 | struct xhci_td *cur_td, struct xhci_dequeue_state *state); | 1239 | struct xhci_td *cur_td, struct xhci_dequeue_state *state); |
1238 | void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci, | 1240 | void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci, |
1239 | struct xhci_ring *ep_ring, unsigned int slot_id, | 1241 | unsigned int slot_id, unsigned int ep_index, |
1240 | unsigned int ep_index, struct xhci_dequeue_state *deq_state); | 1242 | struct xhci_dequeue_state *deq_state); |
1241 | void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, | 1243 | void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, |
1242 | struct usb_device *udev, | 1244 | struct usb_device *udev, unsigned int ep_index); |
1243 | unsigned int ep_index, struct xhci_ring *ep_ring); | ||
1244 | void xhci_queue_config_ep_quirk(struct xhci_hcd *xhci, | 1245 | void xhci_queue_config_ep_quirk(struct xhci_hcd *xhci, |
1245 | unsigned int slot_id, unsigned int ep_index, | 1246 | unsigned int slot_id, unsigned int ep_index, |
1246 | struct xhci_dequeue_state *deq_state); | 1247 | struct xhci_dequeue_state *deq_state); |