Skip to content

Commit

Permalink
wusb: add link wusb-usb device
Browse files Browse the repository at this point in the history
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:
wusb_dev_{add,rm}_ncb(). 

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Inaky Perez-Gonzalez authored and Greg Kroah-Hartman committed Apr 25, 2008
1 parent 3b52f12 commit b1d8dfb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

struct usb_device;
struct usb_driver;
struct wusb_dev;

/*-------------------------------------------------------------------------*/

Expand Down Expand Up @@ -480,6 +481,7 @@ struct usb_device {
unsigned autoresume_disabled:1;
unsigned skip_sys_resume:1;
#endif
struct wusb_dev *wusb_dev;
};
#define to_usb_device(d) container_of(d, struct usb_device, dev)

Expand Down

0 comments on commit b1d8dfb

Please sign in to comment.