Skip to contentSkip to conversation

use __dma_buffer for USB

PATCH New Roland Dreier 1 participant 1 message Jun 13, 2002 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 use __dma_buffer for USB

Use __dma_buffer to align buffer in struct usb_hub and descriptor in struct usb_device since both are used for DMA.

Patch is against 2.4.19-pre10.

Thanks,
Roland

 drivers/usb/hub.h   |    3 ++-
 include/linux/usb.h |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/usb/hub.h +2 -1
diff -Naur linux-2.4.19-pre9.orig/drivers/usb/hub.h linux-2.4.19-pre9/drivers/usb/hub.h
@@ -3,6 +3,7 @@
 
 #include <linux/list.h>
 #include <linux/compiler.h>	/* likely()/unlikely() */
+#include <asm/dma_buffer.h>
 
 /*
  * Hub request types
@@ -125,7 +126,7 @@
 
 	struct urb *urb;		/* Interrupt polling pipe */
 
-	char buffer[(USB_MAXCHILDREN + 1 + 7) / 8]; /* add 1 bit for hub status change */
+	char buffer[(USB_MAXCHILDREN + 1 + 7) / 8] __dma_buffer; /* add 1 bit for hub status change */
 					/* and add 7 bits to round up to byte boundary */
 	int error;
 	int nerrors;
include/linux/usb.h +2 -1
diff -Naur linux-2.4.19-pre9.orig/include/linux/usb.h linux-2.4.19-pre9/include/linux/usb.h
@@ -139,6 +139,7 @@
 #include <linux/interrupt.h>	/* for in_interrupt() */
 #include <linux/config.h>
 #include <linux/list.h>
+#include <asm/dma_buffer.h>
 
 #define USB_MAJOR 180
 
@@ -781,7 +782,7 @@
 	struct usb_device *parent;
 	struct usb_bus *bus;		/* Bus we're part of */
 
-	struct usb_device_descriptor descriptor;/* Descriptor */
+	struct usb_device_descriptor descriptor __dma_buffer;/* Descriptor */
 	struct usb_config_descriptor *config;	/* All of the configs */
 	struct usb_config_descriptor *actconfig;/* the active configuration */