|
@@ -7,6 +7,7 @@
|
|
#include <linux/usb.h>
|
|
#include <linux/usb.h>
|
|
#include <linux/wait.h>
|
|
#include <linux/wait.h>
|
|
#include <linux/usb/hcd.h>
|
|
#include <linux/usb/hcd.h>
|
|
|
|
+#include <linux/scatterlist.h>
|
|
|
|
|
|
#define to_urb(d) container_of(d, struct urb, kref)
|
|
#define to_urb(d) container_of(d, struct urb, kref)
|
|
|
|
|
|
@@ -413,6 +414,13 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
|
|
urb->iso_frame_desc[n].status = -EXDEV;
|
|
urb->iso_frame_desc[n].status = -EXDEV;
|
|
urb->iso_frame_desc[n].actual_length = 0;
|
|
urb->iso_frame_desc[n].actual_length = 0;
|
|
}
|
|
}
|
|
|
|
+ } else if (dev->speed != USB_SPEED_WIRELESS && urb->num_sgs) {
|
|
|
|
+ struct scatterlist *sg;
|
|
|
|
+ int i;
|
|
|
|
+
|
|
|
|
+ for_each_sg(urb->sg, sg, urb->num_sgs - 1, i)
|
|
|
|
+ if (sg->length % max)
|
|
|
|
+ return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
/* the I/O buffer must be mapped/unmapped, except when length=0 */
|
|
/* the I/O buffer must be mapped/unmapped, except when length=0 */
|