Index: usb_busdma.h =================================================================== --- usb_busdma.h (revision 233234) +++ usb_busdma.h (working copy) @@ -34,7 +34,7 @@ /* defines */ -#define USB_PAGE_SIZE PAGE_SIZE /* use system PAGE_SIZE */ +#define USB_PAGE_SIZE 4096 #if (__FreeBSD_version >= 700020) #define USB_GET_DMA_TAG(dev) bus_get_dma_tag(dev) Index: usb_busdma.c =================================================================== --- usb_busdma.c (revision 233234) +++ usb_busdma.c (working copy) @@ -358,14 +358,18 @@ usb_dma_tag_create(struct usb_dma_tag *udt, if (bus_dma_tag_create ( /* parent */ udt->tag_parent->tag, /* alignment */ align, +#ifndef __sparc64__ /* boundary */ (align == 1) ? USB_PAGE_SIZE : 0, +#else + /* boundary */ 0, +#endif /* lowaddr */ (2ULL << (udt->tag_parent->dma_bits - 1)) - 1, /* highaddr */ BUS_SPACE_MAXADDR, /* filter */ NULL, /* filterarg */ NULL, /* maxsize */ size, - /* nsegments */ (align == 1 && size > 1) ? + /* nsegments */ (align == 1 && size > USB_PAGE_SIZE) ? (2 + (size / USB_PAGE_SIZE)) : 1, /* maxsegsz */ (align == 1 && size > USB_PAGE_SIZE) ? USB_PAGE_SIZE : size, @@ -516,7 +520,7 @@ usb_pc_alloc_mem(struct usb_page_cache *pc, struct * being less than "size". If that check fails we end * up using contigmalloc which is page based even for * small allocations. Try to avoid that to save - * memory, hence we sometimes to a large number of + * memory, hence we sometimes do a large number of * small allocations! */ if (size <= (USB_PAGE_SIZE / 2)) { Index: usb_transfer.c =================================================================== --- usb_transfer.c (revision 233234) +++ usb_transfer.c (working copy) @@ -217,12 +217,12 @@ usbd_transfer_setup_sub_malloc(struct usb_setup_pa * Try multi-allocation chunks to reduce the number of DMA * allocations, hence DMA allocations are slow. */ - if (size >= PAGE_SIZE) { + if (size >= USB_PAGE_SIZE) { n_dma_pc = count; n_obj = 1; } else { /* compute number of objects per page */ - n_obj = (PAGE_SIZE / size); + n_obj = (USB_PAGE_SIZE / size); /* * Compute number of DMA chunks, rounded up * to nearest one: