Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250168
b: refs/heads/master
c: 68a49a4
h: refs/heads/master
v: v3
  • Loading branch information
Jarod Wilson authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent f7ccb92 commit ff8c3fb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2faa0ca82c7180f58a4b3bb3c460e5bdcdcf04c6
refs/heads/master: 68a49a4a3dc9354b6daa24dd87e4e246b6da3c13
60 changes: 27 additions & 33 deletions trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
my TTUSB, so let it undef'd unless you want to implement another
frontend. never tested.
DEBUG:
debug:
define it to > 3 for really hardcore debugging. you probably don't want
this unless the device doesn't load at all. > 2 for bandwidth statistics.
*/
Expand Down Expand Up @@ -134,20 +134,19 @@ struct ttusb {
/* ugly workaround ... don't know why it's necessary to read */
/* all result codes. */

#define DEBUG 0
static int ttusb_cmd(struct ttusb *ttusb,
const u8 * data, int len, int needresult)
{
int actual_len;
int err;
#if DEBUG >= 3
int i;

printk(">");
for (i = 0; i < len; ++i)
printk(" %02x", data[i]);
printk("\n");
#endif
if (debug >= 3) {
printk(KERN_DEBUG ">");
for (i = 0; i < len; ++i)
printk(KERN_CONT " %02x", data[i]);
printk(KERN_CONT "\n");
}

if (mutex_lock_interruptible(&ttusb->semusb) < 0)
return -EAGAIN;
Expand Down Expand Up @@ -176,13 +175,15 @@ static int ttusb_cmd(struct ttusb *ttusb,
mutex_unlock(&ttusb->semusb);
return err;
}
#if DEBUG >= 3
actual_len = ttusb->last_result[3] + 4;
printk("<");
for (i = 0; i < actual_len; ++i)
printk(" %02x", ttusb->last_result[i]);
printk("\n");
#endif

if (debug >= 3) {
actual_len = ttusb->last_result[3] + 4;
printk(KERN_DEBUG "<");
for (i = 0; i < actual_len; ++i)
printk(KERN_CONT " %02x", ttusb->last_result[i]);
printk(KERN_CONT "\n");
}

if (!needresult)
mutex_unlock(&ttusb->semusb);
return 0;
Expand Down Expand Up @@ -636,16 +637,13 @@ static void ttusb_process_frame(struct ttusb *ttusb, u8 * data, int len)
++ttusb->mux_state;
else {
ttusb->mux_state = 0;
#if DEBUG > 3
if (ttusb->insync)
printk("%02x ", data[-1]);
#else
if (ttusb->insync) {
printk("%s: lost sync.\n",
dprintk("%s: %02x\n",
__func__, data[-1]);
printk(KERN_INFO "%s: lost sync.\n",
__func__);
ttusb->insync = 0;
}
#endif
}
break;
case 3:
Expand Down Expand Up @@ -744,6 +742,9 @@ static void ttusb_process_frame(struct ttusb *ttusb, u8 * data, int len)
static void ttusb_iso_irq(struct urb *urb)
{
struct ttusb *ttusb = urb->context;
struct usb_iso_packet_descriptor *d;
u8 *data;
int len, i;

if (!ttusb->iso_streaming)
return;
Expand All @@ -755,21 +756,14 @@ static void ttusb_iso_irq(struct urb *urb)
#endif

if (!urb->status) {
int i;
for (i = 0; i < urb->number_of_packets; ++i) {
struct usb_iso_packet_descriptor *d;
u8 *data;
int len;
numpkt++;
if (time_after_eq(jiffies, lastj + HZ)) {
#if DEBUG > 2
printk
("frames/s: %d (ts: %d, stuff %d, sec: %d, invalid: %d, all: %d)\n",
numpkt * HZ / (jiffies - lastj),
numts, numstuff, numsec, numinvalid,
numts + numstuff + numsec +
numinvalid);
#endif
dprintk("frames/s: %lu (ts: %d, stuff %d, "
"sec: %d, invalid: %d, all: %d)\n",
numpkt * HZ / (jiffies - lastj),
numts, numstuff, numsec, numinvalid,
numts + numstuff + numsec + numinvalid);
numts = numstuff = numsec = numinvalid = 0;
lastj = jiffies;
numpkt = 0;
Expand Down

0 comments on commit ff8c3fb

Please sign in to comment.