From 5a900db4a50766c3869d64ba5cad7049d6a9d0a9 Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Sat, 25 Feb 2012 16:25:30 +0000 Subject: [PATCH] vhci: build kernel module & library This makefile downloads the vhci bits, hack the a little and compile them in place. One done it's left as an excercise to the reader to install the module where they want. Example board can then link/compile by adding -I../vhci/include and -L../vhci/lib to their makefile Signed-off-by: Michel Pollet --- examples/vhci/Makefile | 53 +++++++++++++++++++ ...N_LOCK_UNLOCKED-has-been-depreciated.patch | 25 +++++++++ ...hcd-0002-need-transaction-translator.patch | 25 +++++++++ ...nt-out-function-that-doesn-t-compile.patch | 29 ++++++++++ 4 files changed, 132 insertions(+) create mode 100644 examples/vhci/Makefile create mode 100644 examples/vhci/patches/hcd-0001-SPIN_LOCK_UNLOCKED-has-been-depreciated.patch create mode 100644 examples/vhci/patches/hcd-0002-need-transaction-translator.patch create mode 100644 examples/vhci/patches/vhci-0001-Comment-out-function-that-doesn-t-compile.patch diff --git a/examples/vhci/Makefile b/examples/vhci/Makefile new file mode 100644 index 0000000..6c3a0f8 --- /dev/null +++ b/examples/vhci/Makefile @@ -0,0 +1,53 @@ +# +# This makefile attempts to compile the vhci core module and the +# libusb-vhci library by downloading known tarballs, hacking them +# a little and compiling them +# +# This has been tested on debian, but coild possibly work in other +# distro. the only "real" dependency is to have the linux kernel +# header symlinked at /lib/modules/ +Date: Sun, 19 Feb 2012 17:20:55 +0100 +Subject: [PATCH 1/2] SPIN_LOCK_UNLOCKED has been depreciated + +--- + usb-vhci-hcd.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/usb-vhci-hcd.c b/usb-vhci-hcd.c +index fed46aa..b107e1b 100644 +--- a/usb-vhci-hcd.c ++++ b/usb-vhci-hcd.c +@@ -1040,7 +1040,7 @@ static int device_enum(struct device *dev, void *data) + return unlikely(*((const int *)data) == pdev->id) ? -EINVAL : 0; + } + +-static spinlock_t dev_enum_lock = SPIN_LOCK_UNLOCKED; ++static DEFINE_SPINLOCK(dev_enum_lock); + + int usb_vhci_hcd_register(const struct usb_vhci_ifc *ifc, void *context, u8 port_count, struct usb_vhci_device **vdev_ret) + { +-- +1.7.5.4 + diff --git a/examples/vhci/patches/hcd-0002-need-transaction-translator.patch b/examples/vhci/patches/hcd-0002-need-transaction-translator.patch new file mode 100644 index 0000000..5dab784 --- /dev/null +++ b/examples/vhci/patches/hcd-0002-need-transaction-translator.patch @@ -0,0 +1,25 @@ +From 11483dc8c623b93c1ab419a48387161abcf75a45 Mon Sep 17 00:00:00 2001 +From: root +Date: Sun, 19 Feb 2012 17:21:07 +0100 +Subject: [PATCH 2/2] need transaction translator + +--- + usb-vhci-hcd.c | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/usb-vhci-hcd.c b/usb-vhci-hcd.c +index b107e1b..fcb9755 100644 +--- a/usb-vhci-hcd.c ++++ b/usb-vhci-hcd.c +@@ -921,6 +921,8 @@ static int vhci_hcd_probe(struct platform_device *pdev) + if(unlikely(!hcd)) return -ENOMEM; + vdev->vhc = usbhcd_to_vhcihcd(hcd); + ++ hcd->has_tt=1; ++ + retval = usb_add_hcd(hcd, 0, 0); // calls vhci_start + if(unlikely(retval)) usb_put_hcd(hcd); + +-- +1.7.5.4 + diff --git a/examples/vhci/patches/vhci-0001-Comment-out-function-that-doesn-t-compile.patch b/examples/vhci/patches/vhci-0001-Comment-out-function-that-doesn-t-compile.patch new file mode 100644 index 0000000..0db9beb --- /dev/null +++ b/examples/vhci/patches/vhci-0001-Comment-out-function-that-doesn-t-compile.patch @@ -0,0 +1,29 @@ +From 8450b39ce40b2cc2e9e7cf3cfceaafdae2605f17 Mon Sep 17 00:00:00 2001 +From: Torbjorn Tyridal +Date: Thu, 23 Feb 2012 13:37:19 +0100 +Subject: [PATCH] Comment out function that doesn't compile + +--- + src/libusb_vhci.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/libusb_vhci.c b/src/libusb_vhci.c +index 47fc381..002d7aa 100644 +--- a/src/libusb_vhci.c ++++ b/src/libusb_vhci.c +@@ -389,8 +389,8 @@ int usb_vhci_to_iso_packets_errno(int32_t status) + return usb_vhci_to_errno(status, 0); + } + +-int32_t usb_vhci_from_iso_packets_errno(int errno) +-{ +- return usb_vhci_from_errno(errno, 0); +-} ++// int32_t usb_vhci_from_iso_packets_errno(int errno) ++// { ++// return usb_vhci_from_errno(errno, 0); ++// } + +-- +1.7.5.4 + -- 2.20.1