aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/core/devio.c27
-rw-r--r--include/linux/usbdevice_fs.h7
2 files changed, 28 insertions, 6 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 039ba23cc8b6..6c4cd82d7d14 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -948,8 +948,11 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
948 int ret, ifnum = -1; 948 int ret, ifnum = -1;
949 int is_in; 949 int is_in;
950 950
951 if (uurb->flags & ~(USBDEVFS_URB_ISO_ASAP|USBDEVFS_URB_SHORT_NOT_OK| 951 if (uurb->flags & ~(USBDEVFS_URB_ISO_ASAP |
952 URB_NO_FSBR|URB_ZERO_PACKET)) 952 USBDEVFS_URB_SHORT_NOT_OK |
953 USBDEVFS_URB_NO_FSBR |
954 USBDEVFS_URB_ZERO_PACKET |
955 USBDEVFS_URB_NO_INTERRUPT))
953 return -EINVAL; 956 return -EINVAL;
954 if (!uurb->buffer) 957 if (!uurb->buffer)
955 return -EINVAL; 958 return -EINVAL;
@@ -1104,8 +1107,24 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1104 as->urb->pipe = (uurb->type << 30) | 1107 as->urb->pipe = (uurb->type << 30) |
1105 __create_pipe(ps->dev, uurb->endpoint & 0xf) | 1108 __create_pipe(ps->dev, uurb->endpoint & 0xf) |
1106 (uurb->endpoint & USB_DIR_IN); 1109 (uurb->endpoint & USB_DIR_IN);
1107 as->urb->transfer_flags = uurb->flags | 1110
1108 (is_in ? URB_DIR_IN : URB_DIR_OUT); 1111 /* This tedious sequence is necessary because the URB_* flags
1112 * are internal to the kernel and subject to change, whereas
1113 * the USBDEVFS_URB_* flags are a user API and must not be changed.
1114 */
1115 u = (is_in ? URB_DIR_IN : URB_DIR_OUT);
1116 if (uurb->flags & USBDEVFS_URB_ISO_ASAP)
1117 u |= URB_ISO_ASAP;
1118 if (uurb->flags & USBDEVFS_URB_SHORT_NOT_OK)
1119 u |= URB_SHORT_NOT_OK;
1120 if (uurb->flags & USBDEVFS_URB_NO_FSBR)
1121 u |= URB_NO_FSBR;
1122 if (uurb->flags & USBDEVFS_URB_ZERO_PACKET)
1123 u |= URB_ZERO_PACKET;
1124 if (uurb->flags & USBDEVFS_URB_NO_INTERRUPT)
1125 u |= URB_NO_INTERRUPT;
1126 as->urb->transfer_flags = u;
1127
1109 as->urb->transfer_buffer_length = uurb->buffer_length; 1128 as->urb->transfer_buffer_length = uurb->buffer_length;
1110 as->urb->setup_packet = (unsigned char *)dr; 1129 as->urb->setup_packet = (unsigned char *)dr;
1111 as->urb->start_frame = uurb->start_frame; 1130 as->urb->start_frame = uurb->start_frame;
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h
index 17cb108b7db0..3118ede2c67b 100644
--- a/include/linux/usbdevice_fs.h
+++ b/include/linux/usbdevice_fs.h
@@ -77,8 +77,11 @@ struct usbdevfs_connectinfo {
77 unsigned char slow; 77 unsigned char slow;
78}; 78};
79 79
80#define USBDEVFS_URB_SHORT_NOT_OK 1 80#define USBDEVFS_URB_SHORT_NOT_OK 0x01
81#define USBDEVFS_URB_ISO_ASAP 2 81#define USBDEVFS_URB_ISO_ASAP 0x02
82#define USBDEVFS_URB_NO_FSBR 0x20
83#define USBDEVFS_URB_ZERO_PACKET 0x40
84#define USBDEVFS_URB_NO_INTERRUPT 0x80
82 85
83#define USBDEVFS_URB_TYPE_ISO 0 86#define USBDEVFS_URB_TYPE_ISO 0
84#define USBDEVFS_URB_TYPE_INTERRUPT 1 87#define USBDEVFS_URB_TYPE_INTERRUPT 1