[media] dvb_usb_v2: add debug macro dvb_usb_dbg_usb_control_msg
authorAntti Palosaari <crope@iki.fi>
Wed, 22 Aug 2012 22:41:59 +0000 (19:41 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 15 Sep 2012 14:35:58 +0000 (11:35 -0300)
For dumping usb_control_msg().

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/dvb-usb-v2/dvb_usb.h

index 5a53c6231fc2d0c742b8f6312de66432081d7669..bae16a1189d66deed84242f0c7fd26be398f77b7 100644 (file)
 #define fe_to_priv(fe) (fe_to_d(fe)->priv)
 #define d_to_priv(d) (d->priv)
 
+#define dvb_usb_dbg_usb_control_msg(udev, r, t, v, i, b, l) { \
+       char *direction; \
+       if (t == (USB_TYPE_VENDOR | USB_DIR_OUT)) \
+               direction = ">>>"; \
+       else \
+               direction = "<<<"; \
+       dev_dbg(&udev->dev, "%s: %02x %02x %02x %02x %02x %02x %02x %02x " \
+                       "%s %*ph\n",  __func__, t, r, v & 0xff, v >> 8, \
+                       i & 0xff, i >> 8, l & 0xff, l >> 8, direction, l, b); \
+}
+
 #define DVB_USB_STREAM_BULK(endpoint_, count_, size_) { \
        .type = USB_BULK, \
        .count = count_, \