xhci: unit test ring enqueue/dequeue routines

Given the complexity of satisfying xhci 1.0+ host trb boundary
constraints, provide a test case that exercises inserting mid-segment
links into a ring.

The linker --wrap= option is used to not pollute the global identifier
space and to make it clear which standard xhci driver routines are being
mocked-up.  The --wrap= option does not come into play when both
xhci-hcd and xhci-test are built-in to the kernel, so namespace
collisions are prevented by excluding xhci-test from the build when
xhci-hcd is built-in.

It's unfortunate that this is an in-kernel test rather than userspace
and that the infrastructure is custom rather than generic.  That said,
it serves its purpose of exercising the corner cases of the scatterlist
parsing implementation in xhci.

Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
9 files changed