qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functi


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functions
Date: Thu, 21 Jun 2012 08:43:13 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20120601 Thunderbird/10.0.5

  Hi,

>>> Why leave pci accessors and not implement usb_memory_rw() wrappers?
>>
>> Well, "usb" is a bit too generic, ehci and ohci would each need to have
>> their own sets of wrappers. But yes, that's possible... is it really
>> worth it ? There's nothing fundamentally wrong with using the dma_*
>> accessors.
> 
> So is using the pci accessors wrong?
> 
> I'm not saying you should go and convert every caller of the pci_
> functions, I just want a clear policy on what interface devices should use.

usb device emulations should use usb_packet_copy()

usb host adapters emulations should use either usb_packet_map() +
usb_packet_unmap(), or use usb_packet_addbuf(), then copy from/to the
buffer using whatever is approximate.  For pci host controller that is
pci_memory_rw().  For ohci which exists in both pci and non-pci variants
it looks reasonable to me to get a iommu handle in bus-specific code,
then use dma_memory_rw with that handle directly in the common code paths.

cheers,
  Gerd



reply via email to

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