From e616065fb8a23a29ce6db97abfceeff51dba379c Mon Sep 17 00:00:00 2001 From: Sarah Sharp Date: Wed, 9 Dec 2009 15:59:06 -0800 Subject: [PATCH] --- yaml --- r: 185235 b: refs/heads/master c: b45b506911247008f694dcaf1d8220a4942ebc4f h: refs/heads/master i: 185233: 8b99334dff64957de019242dfde52d9cba735980 185231: 8e0237a70871d98ba20d0f96cc415c821435a0c4 v: v3 --- [refs] | 2 +- trunk/drivers/usb/host/xhci-ring.c | 22 +++++++++++++++------- trunk/drivers/usb/host/xhci.h | 1 + 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 4b8ed2b20c53..f03aaf4c4900 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a1d78c16bd31a715785e21967ac6110b386a3c1f +refs/heads/master: b45b506911247008f694dcaf1d8220a4942ebc4f diff --git a/trunk/drivers/usb/host/xhci-ring.c b/trunk/drivers/usb/host/xhci-ring.c index ee7bc7ecbc59..f43e073dee96 100644 --- a/trunk/drivers/usb/host/xhci-ring.c +++ b/trunk/drivers/usb/host/xhci-ring.c @@ -1080,6 +1080,20 @@ static int xhci_requires_manual_halt_cleanup(struct xhci_hcd *xhci, return 0; } +int xhci_is_vendor_info_code(struct xhci_hcd *xhci, unsigned int trb_comp_code) +{ + if (trb_comp_code >= 224 && trb_comp_code <= 255) { + /* Vendor defined "informational" completion code, + * treat as not-an-error. + */ + xhci_dbg(xhci, "Vendor defined info completion code %u\n", + trb_comp_code); + xhci_dbg(xhci, "Treating code as success.\n"); + return 1; + } + return 0; +} + /* * If this function returns an error condition, it means it got a Transfer * event with a corrupted Slot ID, Endpoint ID, or TRB DMA address. @@ -1196,13 +1210,7 @@ static int handle_tx_event(struct xhci_hcd *xhci, status = -ENOSR; break; default: - if (trb_comp_code >= 224 && trb_comp_code <= 255) { - /* Vendor defined "informational" completion code, - * treat as not-an-error. - */ - xhci_dbg(xhci, "Vendor defined info completion code %u\n", - trb_comp_code); - xhci_dbg(xhci, "Treating code as success.\n"); + if (xhci_is_vendor_info_code(xhci, trb_comp_code)) { status = 0; break; } diff --git a/trunk/drivers/usb/host/xhci.h b/trunk/drivers/usb/host/xhci.h index 902be9647c60..20122ec75d94 100644 --- a/trunk/drivers/usb/host/xhci.h +++ b/trunk/drivers/usb/host/xhci.h @@ -1276,6 +1276,7 @@ dma_addr_t xhci_trb_virt_to_dma(struct xhci_segment *seg, union xhci_trb *trb); struct xhci_segment *trb_in_td(struct xhci_segment *start_seg, union xhci_trb *start_trb, union xhci_trb *end_trb, dma_addr_t suspect_dma); +int xhci_is_vendor_info_code(struct xhci_hcd *xhci, unsigned int trb_comp_code); void xhci_ring_cmd_db(struct xhci_hcd *xhci); void *xhci_setup_one_noop(struct xhci_hcd *xhci); void xhci_handle_event(struct xhci_hcd *xhci);