ensure kernel >= 5.0 is happy

dummy_hcd now checks wMaxPacketSize

Change-Id: I3ca4fa3948b5eb9995e0c9f679713ad860dd118e
diff --git a/ccid/README.linux-dummy_hcd-ffs b/ccid/README.linux-dummy_hcd-ffs
index bb628b6..2b98eff 100644
--- a/ccid/README.linux-dummy_hcd-ffs
+++ b/ccid/README.linux-dummy_hcd-ffs
@@ -2,7 +2,8 @@
 ============
 
 * you need dummy_hcd.ko, i.e. a kernel compiled with CONFIG_USB_DUMMY_HCD=m
-* you need a fixed usb_f_fs.ko, which doesn't make blind assumptions about
+* kernel version >= 5.0 does NOT require patching
+* kernel version < 5.0 needs a fixed usb_f_fs.ko, which doesn't make blind assumptions about
   everything being a HID descriptor.  See CCID.patch
 
 On a stock Debian system, this works as follows (kernel versions will change over time,
diff --git a/ccid/ccid_main_functionfs.c b/ccid/ccid_main_functionfs.c
index 81cf225..26bb525 100644
--- a/ccid/ccid_main_functionfs.c
+++ b/ccid/ccid_main_functionfs.c
@@ -2,6 +2,7 @@
 #include <errno.h>
 #include <stdint.h>
 #include <endian.h>
+#include <signal.h>
 #include <sys/types.h>
 #include <linux/usb/functionfs.h>
 
@@ -87,20 +88,22 @@
 			.bEndpointAddress = 1 | USB_DIR_IN,
 			.bmAttributes = USB_ENDPOINT_XFER_INT,
 			.wMaxPacketSize = 64,
+			.bInterval = 1,
 		},
+		// dummy_hcd expects a valid wMaxPacketSize!
 		.ep_out = {
 			.bLength = sizeof(descriptors.fs_descs.ep_out),
 			.bDescriptorType = USB_DT_ENDPOINT,
 			.bEndpointAddress = 2 | USB_DIR_OUT,
 			.bmAttributes = USB_ENDPOINT_XFER_BULK,
-			/* .wMaxPacketSize = autoconfiguration (kernel) */
+			.wMaxPacketSize = 64,
 		},
 		.ep_in = {
 			.bLength = sizeof(descriptors.fs_descs.ep_in),
 			.bDescriptorType = USB_DT_ENDPOINT,
 			.bEndpointAddress = 3 | USB_DIR_IN,
 			.bmAttributes = USB_ENDPOINT_XFER_BULK,
-			/* .wMaxPacketSize = autoconfiguration (kernel) */
+			.wMaxPacketSize = 64,
 		},
 	},
 };