Re: [OPW] USB subsystem questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 18 Feb 2014, Valentina Manea wrote:

> I managed to get it working but I think what I did is rather flawed.
> 
> The problem is where I get that struct dev_state *owner parameter
> from. The closest to this I found to be the filelist member in struct
> usb_device. So I got the owner as:
> 
> owner = list_entry(udev->filelist.next, struct dev_state, list);
> 
> This works but that list is supposed to be the list of open files for
> that device. No files are opened in this case. Should I initialize a
> struct dev_state variable similary to usbdev_open()?

You don't have to do anything special.  The dev_state pointer isn't 
used for anything besides identification, so you only have to make sure 
that it is unique.  For example, you could take the address of your 
private data structure and cast it to struct dev_state *.

> Unrelated to this, USB/IP still has a problem when the device is no
> longer shared. In this case, the device should be rebound to the old
> drivers and be used normally. While resetting the configuration
> triggers a new binding process for interface drivers, on the core
> level, where usbip-host driver is, the device remains unbound.
> One hack-ish way to solve this would be to manually rebind the device
> to the old driver.
> Is there any better way to trigger a new driver binding at core level?

device_attach(&udev->dev).

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux