BZ: 30607
This patch added basic notification function used to send uevents
to userspace for usb warnings.
Change-Id: I8cac8481d087a59eb069971207e75bb97ab7f3b5
Signed-off-by: Wu, Hao <hao.wu@intel.com>
Reviewed-on: http://android.intel.com:8080/49176
Reviewed-by: Zhuang, Jin Can <jin.can.zhuang@intel.com>
Reviewed-by: Tang, Richard <richard.tang@intel.com>
Reviewed-by: Tang, Jianqiang <jianqiang.tang@intel.com>
Reviewed-by: Meng, Zhe <zhe.meng@intel.com>
Tested-by: Meng, Zhe <zhe.meng@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
{
blocking_notifier_call_chain(&usb_notifier_list, USB_BUS_REMOVE, ubus);
}
+
+void usb_notify_warning(struct usb_device *udev, int error)
+{
+ char *notsupport[2] = { "USB_WARNING=DEVICE_NOT_SUPPORT", NULL };
+ char *notrespond[2] = { "USB_WARNING=DEVICE_NOT_RESPONDING", NULL };
+ char **uevent_envp = NULL;
+
+ if (error == -ETIMEDOUT)
+ uevent_envp = notrespond;
+ else
+ uevent_envp = notsupport;
+
+ kobject_uevent_env(&udev->dev.kobj, KOBJ_CHANGE, uevent_envp);
+}
extern void usb_notify_add_bus(struct usb_bus *ubus);
extern void usb_notify_remove_bus(struct usb_bus *ubus);
+/* uevent notify stuff */
+extern void usb_notify_warning(struct usb_device *udev, int error);