Re: [PATCH 3/9] usb/gadget: change sysfs parent device for USB Ethernet

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

 



On Thu, 11 Apr 2013, Andrzej Pietrasiewicz wrote:

> This adds a new sysfs root device to serve as a replacement for
> devices which are available only when a gadget is being bound.
> 
> It is motivated by adding configfs support to USB Ethernet functions.
> When configfs is there, we would like to be able to mkdir some function
> directory, e.g.:
> 
> $ mkdir functions/ecm.usb0
> 
> and have the usb0 available in the system (albeit in an unconfigured,
> or default state) at this very point, which is _way_ before the gadget

What do you mean by "available in the system"?

> is actually bound. However, this poses a chicken and egg problem.
> In order for the interface to appear in the system, it needs to be

What interface are you talking about?  Is it a USB interface, a network
interface, a programming interface, a user interface, or some other
sort of interface?

> registered with register_netdev. But in order to register it, its
> parent device must be known and it becomes known only later during
> gadget's bind.

Why must this happen before the gadget driver is bound?  What can't it
happen after the driver is bound and before the gadget is connected to 
a host?

> This patch adds a /sys/devices/usb_gadget root device, which is registered
> during module_init of libcomposite, so it is available at any time for
> all libcomposite users and is used as a parent device for USB Ethernet
> devices instead of the gadget->dev.

I can't understand the reasoning here.  It's like saying I should be 
able to configure the network settings for my ethernet controller 
before the e100 driver is bound to it.

Are you sure this is necessary?

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