diff options
| -rw-r--r-- | drivers/usb/gadget/function/f_fs.c | 5 | ||||
| -rw-r--r-- | include/uapi/linux/usb/functionfs.h | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index d8f46f6233ac..998697bd80ac 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c | |||
| @@ -2247,7 +2247,8 @@ static int __ffs_data_got_descs(struct ffs_data *ffs, | |||
| 2247 | FUNCTIONFS_HAS_MS_OS_DESC | | 2247 | FUNCTIONFS_HAS_MS_OS_DESC | |
| 2248 | FUNCTIONFS_VIRTUAL_ADDR | | 2248 | FUNCTIONFS_VIRTUAL_ADDR | |
| 2249 | FUNCTIONFS_EVENTFD | | 2249 | FUNCTIONFS_EVENTFD | |
| 2250 | FUNCTIONFS_ALL_CTRL_RECIP)) { | 2250 | FUNCTIONFS_ALL_CTRL_RECIP | |
| 2251 | FUNCTIONFS_CONFIG0_SETUP)) { | ||
| 2251 | ret = -ENOSYS; | 2252 | ret = -ENOSYS; |
| 2252 | goto error; | 2253 | goto error; |
| 2253 | } | 2254 | } |
| @@ -3142,7 +3143,7 @@ static bool ffs_func_req_match(struct usb_function *f, | |||
| 3142 | { | 3143 | { |
| 3143 | struct ffs_function *func = ffs_func_from_usb(f); | 3144 | struct ffs_function *func = ffs_func_from_usb(f); |
| 3144 | 3145 | ||
| 3145 | if (config0) | 3146 | if (config0 && !(func->ffs->user_flags & FUNCTIONFS_CONFIG0_SETUP)) |
| 3146 | return false; | 3147 | return false; |
| 3147 | 3148 | ||
| 3148 | switch (creq->bRequestType & USB_RECIP_MASK) { | 3149 | switch (creq->bRequestType & USB_RECIP_MASK) { |
diff --git a/include/uapi/linux/usb/functionfs.h b/include/uapi/linux/usb/functionfs.h index 93da4ca82dc7..acc63697a0cc 100644 --- a/include/uapi/linux/usb/functionfs.h +++ b/include/uapi/linux/usb/functionfs.h | |||
| @@ -22,6 +22,7 @@ enum functionfs_flags { | |||
| 22 | FUNCTIONFS_VIRTUAL_ADDR = 16, | 22 | FUNCTIONFS_VIRTUAL_ADDR = 16, |
| 23 | FUNCTIONFS_EVENTFD = 32, | 23 | FUNCTIONFS_EVENTFD = 32, |
| 24 | FUNCTIONFS_ALL_CTRL_RECIP = 64, | 24 | FUNCTIONFS_ALL_CTRL_RECIP = 64, |
| 25 | FUNCTIONFS_CONFIG0_SETUP = 128, | ||
| 25 | }; | 26 | }; |
| 26 | 27 | ||
| 27 | /* Descriptor of an non-audio endpoint */ | 28 | /* Descriptor of an non-audio endpoint */ |
