summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/uvc/uvcvideo.h
diff options
context:
space:
mode:
authorKieran Bingham2017-03-14 23:03:23 +0100
committerMauro Carvalho Chehab2018-12-05 09:06:16 +0100
commit811496c9679a7bf58a4e8af739fc2ee927345469 (patch)
treec7bc4d3e0fb7135553ddbcbcbd0dc4f0d7c71e00 /drivers/media/usb/uvc/uvcvideo.h
parentmedia: seco-cec: add missing header file to fix build (diff)
downloadkernel-qcow2-linux-811496c9679a7bf58a4e8af739fc2ee927345469.tar.gz
kernel-qcow2-linux-811496c9679a7bf58a4e8af739fc2ee927345469.tar.xz
kernel-qcow2-linux-811496c9679a7bf58a4e8af739fc2ee927345469.zip
media: uvcvideo: Refactor URB descriptors
We currently store three separate arrays for each URB reference we hold. Objectify the data needed to track URBs into a single uvc_urb structure, allowing better object management and tracking of the URB. All accesses to the data pointers through stream, are converted to use a uvc_urb pointer for consistency. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/usb/uvc/uvcvideo.h')
-rw-r--r--drivers/media/usb/uvc/uvcvideo.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index 2b4bb13d4d1d..81f29b9e4118 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -490,6 +490,20 @@ struct uvc_stats_stream {
#define UVC_METATADA_BUF_SIZE 1024
+/**
+ * struct uvc_urb - URB context management structure
+ *
+ * @urb: the URB described by this context structure
+ * @buffer: memory storage for the URB
+ * @dma: DMA coherent addressing for the urb_buffer
+ */
+struct uvc_urb {
+ struct urb *urb;
+
+ char *buffer;
+ dma_addr_t dma;
+};
+
struct uvc_streaming {
struct list_head list;
struct uvc_device *dev;
@@ -538,9 +552,7 @@ struct uvc_streaming {
u32 max_payload_size;
} bulk;
- struct urb *urb[UVC_URBS];
- char *urb_buffer[UVC_URBS];
- dma_addr_t urb_dma[UVC_URBS];
+ struct uvc_urb uvc_urb[UVC_URBS];
unsigned int urb_size;
u32 sequence;