23 #include <linux/slab.h>
44 stream = adap->
channel.stream->stream;
93 static int pvr2_dvb_feed_thread(
void *
data)
95 int stat = pvr2_dvb_feed_func(data);
120 stream = adap->
channel.stream->stream;
154 if (ret < 0)
return ret;
156 stream = adap->
channel.stream->stream;
168 if (ret < 0)
return ret;
178 if (ret < 0)
return ret;
182 if (ret < 0)
return ret;
187 if (IS_ERR(adap->
thread)) {
188 ret = PTR_ERR(adap->
thread);
200 int ret = pvr2_dvb_stream_do_start(adap);
201 if (ret < 0) pvr2_dvb_stream_end(adap);
217 "start feeding demux");
218 ret = pvr2_dvb_stream_start(adap);
226 "stop feeding demux");
227 pvr2_dvb_stream_end(adap);
239 return pvr2_dvb_ctrl_feed(dvbdmxfeed, 1);
245 return pvr2_dvb_ctrl_feed(dvbdmxfeed, 0);
248 static int pvr2_dvb_bus_ctrl(
struct dvb_frontend *
fe,
int acquire)
262 &adap->
channel.hdw->usb_dev->dev,
266 "dvb_register_adapter failed: error %d", ret);
274 adap->
demux.priv = adap;
275 adap->
demux.filternum = 256;
276 adap->
demux.feednum = 256;
277 adap->
demux.start_feed = pvr2_dvb_start_feed;
278 adap->
demux.stop_feed = pvr2_dvb_stop_feed;
284 "dvb_dmx_init failed: error %d", ret);
290 adap->
dmxdev.capabilities = 0;
295 "dvb_dmxdev_init failed: error %d", ret);
328 if (dvb_props ==
NULL) {
338 "failed to grab control of dtv input (code=%d)",
345 "frontend_attach not defined!");
354 "frontend registration failed!");
364 if (adap->
fe->ops.analog_ops.standby)
365 adap->
fe->ops.analog_ops.standby(adap->
fe);
368 adap->
fe->ops.ts_bus_ctrl = pvr2_dvb_bus_ctrl;
372 "no frontend was attached!");
393 pvr2_dvb_stream_end(adap);
394 pvr2_dvb_frontend_exit(adap);
395 pvr2_dvb_adapter_exit(adap);
400 static void pvr2_dvb_internal_check(
struct pvr2_channel *chp)
404 if (!adap->
channel.mc_head->disconnect_flag)
return;
405 pvr2_dvb_destroy(adap);
412 if (!pvr->
hdw->hdw_desc->dvb_props) {
418 if (!adap)
return adap;
420 adap->
channel.check_func = pvr2_dvb_internal_check;
423 ret = pvr2_dvb_adapter_init(adap);
424 if (ret < 0)
goto fail1;
425 ret = pvr2_dvb_frontend_init(adap);
426 if (ret < 0)
goto fail2;
430 pvr2_dvb_adapter_exit(adap);