Commit b1d8dfb0 authored by Inaky Perez-Gonzalez's avatar Inaky Perez-Gonzalez Committed by Greg Kroah-Hartman
Browse files

wusb: add link wusb-usb device

We need to tie the WUSB and USB devices; the USB stack doesn't need to
know the details about the WUSB device, but needs to have a link to
it. This is needed so that the notify call back for Remove Device can
tie both and undo the device setup (sysfs files).

We connect the devices together at the Add Device notifier callback
(the wusb_dev references the usb_dev and stores it, the usb_dev
references the wusb_dev and stores it); then we do create the WUSB
sysfs files at the usb_dev sysfs directory. At Remove Device, we undo
that (thus we need the usb_dev reference).

Cross reference to functions in the WUSB substack:
Signed-off-by: default avatarInaky Perez-Gonzalez <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 3b52f128
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
struct usb_device; struct usb_device;
struct usb_driver; struct usb_driver;
struct wusb_dev;
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -480,6 +481,7 @@ struct usb_device { ...@@ -480,6 +481,7 @@ struct usb_device {
unsigned autoresume_disabled:1; unsigned autoresume_disabled:1;
unsigned skip_sys_resume:1; unsigned skip_sys_resume:1;
#endif #endif
struct wusb_dev *wusb_dev;
}; };
#define to_usb_device(d) container_of(d, struct usb_device, dev) #define to_usb_device(d) container_of(d, struct usb_device, dev)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment