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