Re: [PATCH 1/2] USB: Allow HCDs to specifiy their DMA alignment requirements

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

 



Oliver Neukum wrote:
> You are not handling the case of drivers mapping buffers
> themselves. You need to export this attribute to the drivers.
>
>   
This is true.

Actually I think it is possible for the driver to obtain the value
(albeit in a rather roundabout way):
given a struct usb_device *:

    bus_to_hcd(usb_device->bus)->driver->dma_align_shift

Granted that is very ugly. I'm also not sure if bus_to_hcd() is intended for
driver use or just the usb core.

The last pointer dereference could be avoided by adding the shift to
struct usb_hcd.
However that would mean either making a copy there (which I don't like
much as
it  violates the Dont Repeat Yourself principle) or using that instead
of struct hc_driver

I prefer using struct  hc_driver since that allows a declarative style
definition
in the HCD.

Or were you thinking of another way entirely of exporting this to the
drivers?

Regards,
Martin

--
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