@@ -3005,26 +3005,20 @@ static void giveback_first_trb(struct xhci_hcd *xhci, int slot_id,
3005
3005
xhci_ring_ep_doorbell (xhci , slot_id , ep_index , stream_id );
3006
3006
}
3007
3007
3008
- /*
3009
- * xHCI uses normal TRBs for both bulk and interrupt. When the interrupt
3010
- * endpoint is to be serviced, the xHC will consume (at most) one TD. A TD
3011
- * (comprised of sg list entries) can take several service intervals to
3012
- * transmit.
3013
- */
3014
- int xhci_queue_intr_tx (struct xhci_hcd * xhci , gfp_t mem_flags ,
3015
- struct urb * urb , int slot_id , unsigned int ep_index )
3008
+ static void check_interval (struct xhci_hcd * xhci , struct urb * urb ,
3009
+ struct xhci_ep_ctx * ep_ctx )
3016
3010
{
3017
- struct xhci_ep_ctx * ep_ctx = xhci_get_ep_ctx (xhci ,
3018
- xhci -> devs [slot_id ]-> out_ctx , ep_index );
3019
3011
int xhci_interval ;
3020
3012
int ep_interval ;
3021
3013
3022
3014
xhci_interval = EP_INTERVAL_TO_UFRAMES (le32_to_cpu (ep_ctx -> ep_info ));
3023
3015
ep_interval = urb -> interval ;
3016
+
3024
3017
/* Convert to microframes */
3025
3018
if (urb -> dev -> speed == USB_SPEED_LOW ||
3026
3019
urb -> dev -> speed == USB_SPEED_FULL )
3027
3020
ep_interval *= 8 ;
3021
+
3028
3022
/* FIXME change this to a warning and a suggestion to use the new API
3029
3023
* to set the polling interval (once the API is added).
3030
3024
*/
@@ -3039,6 +3033,22 @@ int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
3039
3033
urb -> dev -> speed == USB_SPEED_FULL )
3040
3034
urb -> interval /= 8 ;
3041
3035
}
3036
+ }
3037
+
3038
+ /*
3039
+ * xHCI uses normal TRBs for both bulk and interrupt. When the interrupt
3040
+ * endpoint is to be serviced, the xHC will consume (at most) one TD. A TD
3041
+ * (comprised of sg list entries) can take several service intervals to
3042
+ * transmit.
3043
+ */
3044
+ int xhci_queue_intr_tx (struct xhci_hcd * xhci , gfp_t mem_flags ,
3045
+ struct urb * urb , int slot_id , unsigned int ep_index )
3046
+ {
3047
+ struct xhci_ep_ctx * ep_ctx ;
3048
+
3049
+ ep_ctx = xhci_get_ep_ctx (xhci , xhci -> devs [slot_id ]-> out_ctx , ep_index );
3050
+ check_interval (xhci , urb , ep_ctx );
3051
+
3042
3052
return xhci_queue_bulk_tx (xhci , mem_flags , urb , slot_id , ep_index );
3043
3053
}
3044
3054
@@ -3720,8 +3730,6 @@ int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags,
3720
3730
struct xhci_ring * ep_ring ;
3721
3731
struct xhci_ep_ctx * ep_ctx ;
3722
3732
int start_frame ;
3723
- int xhci_interval ;
3724
- int ep_interval ;
3725
3733
int num_tds , num_trbs , i ;
3726
3734
int ret ;
3727
3735
struct xhci_virt_ep * xep ;
@@ -3749,26 +3757,7 @@ int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags,
3749
3757
* Check interval value. This should be done before we start to
3750
3758
* calculate the start frame value.
3751
3759
*/
3752
- xhci_interval = EP_INTERVAL_TO_UFRAMES (le32_to_cpu (ep_ctx -> ep_info ));
3753
- ep_interval = urb -> interval ;
3754
- /* Convert to microframes */
3755
- if (urb -> dev -> speed == USB_SPEED_LOW ||
3756
- urb -> dev -> speed == USB_SPEED_FULL )
3757
- ep_interval *= 8 ;
3758
- /* FIXME change this to a warning and a suggestion to use the new API
3759
- * to set the polling interval (once the API is added).
3760
- */
3761
- if (xhci_interval != ep_interval ) {
3762
- dev_dbg_ratelimited (& urb -> dev -> dev ,
3763
- "Driver uses different interval (%d microframe%s) than xHCI (%d microframe%s)\n" ,
3764
- ep_interval , ep_interval == 1 ? "" : "s" ,
3765
- xhci_interval , xhci_interval == 1 ? "" : "s" );
3766
- urb -> interval = xhci_interval ;
3767
- /* Convert back to frames for LS/FS devices */
3768
- if (urb -> dev -> speed == USB_SPEED_LOW ||
3769
- urb -> dev -> speed == USB_SPEED_FULL )
3770
- urb -> interval /= 8 ;
3771
- }
3760
+ check_interval (xhci , urb , ep_ctx );
3772
3761
3773
3762
/* Calculate the start frame and put it in urb->start_frame. */
3774
3763
if (HCC_CFC (xhci -> hcc_params ) && !list_empty (& ep_ring -> td_list )) {
0 commit comments