xhci: create one unified function to calculate TRB TD remainder.
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 9 Oct 2015 10:30:08 +0000 (13:30 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Oct 2015 06:34:22 +0000 (23:34 -0700)
commitc840d6ce772d47c777070ca4bbbfbf21d8d727a3
treeefdb74b3d0be19abcbc53383b640746cc2d91500
parentb1630da0589dbf520e4cf565eda6a74c5a813962
xhci: create one unified function to calculate TRB TD remainder.

xhci versions 1.0 and later report the untransferred data remaining in a
TD a bit differently than older hosts.

We used to have separate functions for these, and needed to check host
version before calling the right function.

Now Mediatek host has an additional quirk on how it uses the TD Size
field for remaining data. To prevent yet another function for calculating
remainder we instead want to make one quirk friendly unified function.

Tested-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.h