On Wed, Mar 14, 2012, Tobias Ulmer wrote:
> I have a couple of machines with an EHCI controller that refuses to work
> with memory above 2G, causing all kinds of trouble. This diff enables
> setting a bus_dma boundary and allows me to make off-site backups again.
>
> Due to the bus_dma pool being shared across all HCs, it was necessary to
> pull the allocator apart and allow for restrictions on a host controller
> basis.
> +void
> +usb_mem_init(struct usb_mem **um, bus_size_t boundary)
> +{
> + *um = malloc(sizeof(struct usb_mem), M_USB, M_WAITOK|M_ZERO);
> +
> + LIST_INIT(&(*um)->um_blk_freelist);
> + LIST_INIT(&(*um)->um_frag_freelist);
> + (*um)->um_boundary = boundary;
> + (*um)->um_blk_nfree = 0;
> @@ -120,6 +120,7 @@ struct usbd_bus {
> #define USBREV_STR { "unknown", "pre 1.0", "1.0", "1.1", "2.0" }
> void *soft; /* soft interrupt cookie */
> bus_dma_tag_t dmatag; /* DMA tag */
> + struct usb_mem *umem; /* DMA memory pool */
I don't think it's necessary to allocate this structure. Just stick
it in usbd_bus entirely.