/* for acc_complete_set_string */
int string_index;
+ /* set to 1 if we have a pending start request */
+ int start_requested;
+
/* synchronize access to our device file */
atomic_t open_excl;
case ACCESSORY_GET_STRING_SERIAL:
src = dev->serial;
break;
+ case ACCESSORY_IS_START_REQUESTED:
+ return dev->start_requested;
}
if (!src)
return -EINVAL;
if (b_requestType == (USB_DIR_OUT | USB_TYPE_VENDOR)) {
if (b_request == ACCESSORY_START) {
+ dev->start_requested = 1;
schedule_delayed_work(
&dev->work, msecs_to_jiffies(10));
value = 0;
memset(dev->version, 0, sizeof(dev->version));
memset(dev->uri, 0, sizeof(dev->uri));
memset(dev->serial, 0, sizeof(dev->serial));
+ dev->start_requested = 0;
}
}
DBG(cdev, "acc_function_bind dev: %p\n", dev);
+ dev->start_requested = 0;
+
/* allocate interface ID(s) */
id = usb_interface_id(c, f);
if (id < 0)
#define ACCESSORY_GET_STRING_VERSION _IOW('M', 4, char[256])
#define ACCESSORY_GET_STRING_URI _IOW('M', 5, char[256])
#define ACCESSORY_GET_STRING_SERIAL _IOW('M', 6, char[256])
+/* returns 1 if there is a start request pending */
+#define ACCESSORY_IS_START_REQUESTED _IO('M', 7)
#endif /* __LINUX_USB_F_ACCESSORY_H */