20 #include <linux/kernel.h>
21 #include <linux/slab.h>
40 "{{Trident, tm6010}");
50 char *errmsg =
"Unknown";
54 errmsg =
"unlinked synchronuously";
57 errmsg =
"unlinked asynchronuously";
60 errmsg =
"Buffer error (overrun)";
63 errmsg =
"Stalled (device not responding)";
66 errmsg =
"Babble (bad cable?)";
69 errmsg =
"Bit-stuff error (bad cable?)";
72 errmsg =
"CRC/Timeout (could be anything)";
75 errmsg =
"Device does not respond";
79 dprintk(dev, 1,
"URB status %d [%s].\n",
82 dprintk(dev, 1,
"URB packet %d, status %d [%s].\n",
83 packet, status, errmsg);
87 static void tm6000_urb_received(
struct urb *
urb)
92 switch (urb->status) {
101 print_err_status(dev, 0, urb->status);
104 if (urb->actual_length > 0)
108 if (dev->
dvb->streams > 0) {
112 kfree(urb->transfer_buffer);
118 static int tm6000_start_stream(
struct tm6000_core *dev)
137 pipe = usb_rcvbulkpipe(dev->
udev, dev->bulk_in.endp->desc.bEndpointAddress
140 size = usb_maxpacket(dev->
udev, pipe, usb_pipeout(pipe));
153 tm6000_urb_received, dev);
179 static void tm6000_stop_stream(
struct tm6000_core *dev)
204 tm6000_start_stream(dev);
226 tm6000_stop_stream(dev);
235 static int tm6000_dvb_attach_frontend(
struct tm6000_core *dev)
239 if (dev->
caps.has_zl10353) {
245 .disable_i2c_gate_ctrl = 1,
270 ret = tm6000_dvb_attach_frontend(dev);
292 "tm6000: couldn't register frontend\n");
298 "frontend (xc3028)\n");
303 "attached to frontend!\n");
315 "tm6000: couldn't register frontend\n");
321 "frontend (xc5000)\n");
326 "attached to frontend!\n");
336 dvb->
demux.filternum = 8;
337 dvb->
demux.feednum = 8;
338 dvb->
demux.start_feed = tm6000_start_feed;
339 dvb->
demux.stop_feed = tm6000_stop_feed;
343 printk(
KERN_ERR "tm6000: dvb_dmx_init failed (errno = %d)\n", ret);
347 dvb->
dmxdev.filternum = dev->
dvb->demux.filternum;
348 dvb->
dmxdev.demux = &dev->
dvb->demux.dmx;
349 dvb->
dmxdev.capabilities = 0;
353 printk(
KERN_ERR "tm6000: dvb_dmxdev_init failed (errno = %d)\n", ret);
372 static void unregister_dvb(
struct tm6000_core *dev)
377 struct urb *bulk_urb = dvb->
bulk_urb;
379 kfree(bulk_urb->transfer_buffer);
380 bulk_urb->transfer_buffer =
NULL;
406 if (!dev->
caps.has_dvb)
410 printk(
KERN_INFO "This USB2.0 device cannot be run on a USB1.1 port. (it lacks a hardware PID filter)\n");
422 rc = register_dvb(dev);
437 if (!dev->
caps.has_dvb)
451 .name =
"TM6000 dvb Extension",
456 static int __init tm6000_dvb_register(
void)
461 static void __exit tm6000_dvb_unregister(
void)