qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 28/30] usb: convert to hotplug handler API


From: Igor Mammedov
Subject: Re: [Qemu-devel] [PATCH 28/30] usb: convert to hotplug handler API
Date: Thu, 25 Sep 2014 12:55:09 +0200

On Thu, 25 Sep 2014 09:50:58 +0200
Gerd Hoffmann <address@hidden> wrote:

> On Mi, 2014-09-24 at 17:39 +0200, Igor Mammedov wrote:
> > On Wed, 24 Sep 2014 15:23:41 +0200
> > Gerd Hoffmann <address@hidden> wrote:
> > 
> > >   Hi,
> > > 
> > > > > Can't we do this in usb_bus_new instead of duplicating in every host
> > > > > adapter?
> > > > 
> > > > So you would make TYPE_USB_BUS the hotplug handler itself, instead of
> > > > the controller?
> > > 
> > > I was more thinking of just setting the callback in common code, but if
> > > we can attach the hotplug interface to the usb bus itself not the usb
> > > host adapters that would be even better.  And it'll probably kill some
> > > headache for the companion controller case.
> > How making bus a HotplugHandler itself will help with companion controller?
> 
> When uhci acts as ehci companion it registers the ports with ehci and
> doesn't manage its own usb bus.  ehci will call uhci port ops as needed
> (depending on ehci configuration).
> 
> When attaching the hotplug interface to the host controller you'll have
> to explicitly handle the companion case somehow.
> 
> When attaching the hotplug interface to the usb bus everything should
> just work.  Additional bonus is that you also don't have to touch the
> host controller code at all then, it should be doable by changing
> hw/usb/bus.c only.
hotplug-handler.[plug|unplug] callbacks are class wide, so if
USB bus might ever need to have different callbacks depending on
host it might not work.

But since so far it uses the only qdev_simple_device_unplug_cb(),
having BUS as hotplug-handler should work too.


> 
> cheers,
>   Gerd
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]