[patch 5/7] wusb: add link wusb-usb device

Inaky Perez-Gonzalez <inaky-VuQAYsv1563Yd54FQh9/[email protected]>
Newsgroups gmane.linux.drivers.uwb,gmane.linux.usb.devel
Message-ID <[email protected]>
wusb-add-link-wusb-usb-dev.patch (text/plain, 1.4 KB)
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-VuQAYsv1563Yd54FQh9/[email protected]>


Index: linux.hg/include/linux/usb.h
===================================================================
--- linux.hg.orig/include/linux/usb.h	2007-07-31 12:18:59.000000000 -0700
+++ linux.hg/include/linux/usb.h	2007-07-31 12:19:02.000000000 -0700
@@ -23,6 +23,7 @@
 
 struct usb_device;
 struct usb_driver;
+struct wusb_dev;
 
 /*-------------------------------------------------------------------------*/
 
@@ -429,6 +430,7 @@
 	unsigned autosuspend_disabled:1; /* autosuspend and autoresume */
 	unsigned autoresume_disabled:1;  /*  disabled by the user */
 #endif
+	struct wusb_dev *wusb_dev;
 };
 #define	to_usb_device(d) container_of(d, struct usb_device, dev)
 

-- 

Inaky
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.