summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/em28xx/em28xx.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-11-18 15:51:08 -0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-11-18 15:51:08 -0200
commitae01a3498c4c64115313788ab68a8a99c7e8de6e (patch)
tree50130794737a0b77f3183b41f95d8e45357ff16c /linux/drivers/media/video/em28xx/em28xx.h
parenta370946d785e65e0ded57703e7e4981631ad9012 (diff)
downloadmediapointer-dvb-s2-ae01a3498c4c64115313788ab68a8a99c7e8de6e.tar.gz
mediapointer-dvb-s2-ae01a3498c4c64115313788ab68a8a99c7e8de6e.tar.bz2
em28xx: avoid allocating/dealocating memory on every control urb
From: Mauro Carvalho Chehab <mchehab@redhat.com> Before this patch, every register setup on em28xx were dynamically allocating a temporary buffer for control URB's to be handled. To avoid this ping-pong, use, instead a pre-allocated buffer. Also, be sure that read control URB's also use the buffer, instead of relying on a stack buffer. Priority: high Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/em28xx/em28xx.h')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx.h b/linux/drivers/media/video/em28xx/em28xx.h
index 97afac4b6..2e108be19 100644
--- a/linux/drivers/media/video/em28xx/em28xx.h
+++ b/linux/drivers/media/video/em28xx/em28xx.h
@@ -104,6 +104,9 @@
#define EM28XX_MIN_BUF 4
#define EM28XX_DEF_BUF 8
+/*Limits the max URB message size */
+#define URB_MAX_CTRL_SIZE 80
+
/* Params for validated field */
#define EM28XX_BOARD_NOT_VALIDATED 1
#define EM28XX_BOARD_VALIDATED 0
@@ -468,6 +471,8 @@ struct em28xx {
unsigned int *alt_max_pkt_size; /* array of wMaxPacketSize */
struct urb *urb[EM28XX_NUM_BUFS]; /* urb for isoc transfers */
char *transfer_buffer[EM28XX_NUM_BUFS]; /* transfer buffers for isoc transfer */
+ char urb_buf[URB_MAX_CTRL_SIZE]; /* urb control msg buffer */
+
/* helper funcs that call usb_control_msg */
int (*em28xx_write_regs) (struct em28xx *dev, u16 reg,
char *buf, int len);