diff options
Diffstat (limited to 'include/linux/usb.h')
| -rw-r--r-- | include/linux/usb.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index ce1323c4e47c..739f1fd1cc15 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -1085,7 +1085,7 @@ typedef void (*usb_complete_t)(struct urb *); | |||
| 1085 | * Alternatively, drivers may pass the URB_NO_xxx_DMA_MAP transfer flags, | 1085 | * Alternatively, drivers may pass the URB_NO_xxx_DMA_MAP transfer flags, |
| 1086 | * which tell the host controller driver that no such mapping is needed since | 1086 | * which tell the host controller driver that no such mapping is needed since |
| 1087 | * the device driver is DMA-aware. For example, a device driver might | 1087 | * the device driver is DMA-aware. For example, a device driver might |
| 1088 | * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map(). | 1088 | * allocate a DMA buffer with usb_alloc_coherent() or call usb_buffer_map(). |
| 1089 | * When these transfer flags are provided, host controller drivers will | 1089 | * When these transfer flags are provided, host controller drivers will |
| 1090 | * attempt to use the dma addresses found in the transfer_dma and/or | 1090 | * attempt to use the dma addresses found in the transfer_dma and/or |
| 1091 | * setup_dma fields rather than determining a dma address themselves. | 1091 | * setup_dma fields rather than determining a dma address themselves. |
| @@ -1366,11 +1366,23 @@ static inline int usb_urb_dir_out(struct urb *urb) | |||
| 1366 | return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT; | 1366 | return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT; |
| 1367 | } | 1367 | } |
| 1368 | 1368 | ||
| 1369 | void *usb_buffer_alloc(struct usb_device *dev, size_t size, | 1369 | void *usb_alloc_coherent(struct usb_device *dev, size_t size, |
| 1370 | gfp_t mem_flags, dma_addr_t *dma); | 1370 | gfp_t mem_flags, dma_addr_t *dma); |
| 1371 | void usb_buffer_free(struct usb_device *dev, size_t size, | 1371 | void usb_free_coherent(struct usb_device *dev, size_t size, |
| 1372 | void *addr, dma_addr_t dma); | 1372 | void *addr, dma_addr_t dma); |
| 1373 | 1373 | ||
| 1374 | /* Compatible macros while we switch over */ | ||
| 1375 | static inline void *usb_buffer_alloc(struct usb_device *dev, size_t size, | ||
| 1376 | gfp_t mem_flags, dma_addr_t *dma) | ||
| 1377 | { | ||
| 1378 | return usb_alloc_coherent(dev, size, mem_flags, dma); | ||
| 1379 | } | ||
| 1380 | static inline void usb_buffer_free(struct usb_device *dev, size_t size, | ||
| 1381 | void *addr, dma_addr_t dma) | ||
| 1382 | { | ||
| 1383 | return usb_free_coherent(dev, size, addr, dma); | ||
| 1384 | } | ||
| 1385 | |||
| 1374 | #if 0 | 1386 | #if 0 |
| 1375 | struct urb *usb_buffer_map(struct urb *urb); | 1387 | struct urb *usb_buffer_map(struct urb *urb); |
| 1376 | void usb_buffer_dmasync(struct urb *urb); | 1388 | void usb_buffer_dmasync(struct urb *urb); |
