[media] dvb_usb_v2: add macros to fill USB stream properties
authorAntti Palosaari <crope@iki.fi>
Sat, 16 Jun 2012 16:56:37 +0000 (13:56 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 4 Aug 2012 10:56:34 +0000 (07:56 -0300)
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/dvb-usb/dvb_usb.h

index e7015ce5b3b438aa1db51d19afb2d539a19d7d5e..56df13fbc05e8918381c8c96e07f6566863018cf 100644 (file)
 #include "dmxdev.h"
 #include "dvb-usb-ids.h"
 
-struct dvb_usb_driver_info {
-       const char *name;
-       const char *rc_map;
-       const struct dvb_usb_device_properties *props;
-};
+#define DVB_USB_STREAM_BULK(endpoint_, count_, size_) { \
+       .type = USB_BULK, \
+       .count = count_, \
+       .endpoint = endpoint_, \
+       .u = { \
+               .bulk = { \
+                       .buffersize = size_, \
+               } \
+       } \
+}
+
+#define DVB_USB_STREAM_ISOC(endpoint_, count_, frames_, size_, interval_) { \
+       .type = USB_ISOC, \
+       .count = count_, \
+       .endpoint = endpoint_, \
+       .u = { \
+               .isoc = { \
+                       .framesperurb = frames_, \
+                       .framesize = size_,\
+                       .interval = interval_, \
+               } \
+       } \
+}
 
 #define DVB_USB_DEVICE(vend, prod, props_, name_, rc) \
        .match_flags = USB_DEVICE_ID_MATCH_DEVICE, \
@@ -38,6 +56,12 @@ struct dvb_usb_driver_info {
                .rc_map = (rc), \
        })
 
+struct dvb_usb_driver_info {
+       const char *name;
+       const char *rc_map;
+       const struct dvb_usb_device_properties *props;
+};
+
 struct dvb_usb_device;
 struct dvb_usb_adapter;
 struct usb_data_stream;