15 int newfeedcount,
ret;
25 newfeedcount = adap->
feedcount + (onoff ? 1 : -1);
28 if (newfeedcount == 0) {
35 err(
"error while stopping stream.");
44 deb_ts(
"setting pid (%s): %5d %04x at index %d '%s'\n",
46 "yes" :
"no", dvbdmxfeed->
pid, dvbdmxfeed->
pid,
47 dvbdmxfeed->
index, onoff ?
"on" :
"off");
57 deb_ts(
"submitting all URBs\n");
60 deb_ts(
"controlling pid parser\n");
68 err(
"could not handle pid_parser");
76 err(
"error while enabling fifo.");
87 deb_ts(
"start pid: 0x%04x, feedtype: %d\n", dvbdmxfeed->
pid,dvbdmxfeed->
type);
88 return dvb_usb_ctrl_feed(dvbdmxfeed,1);
93 deb_ts(
"stop pid: 0x%04x, feedtype: %d\n", dvbdmxfeed->
pid, dvbdmxfeed->
type);
94 return dvb_usb_ctrl_feed(dvbdmxfeed,0);
101 adap->
dev->owner, &adap->
dev->udev->dev,
105 deb_info(
"dvb_register_adapter failed: error %d", ret);
110 if (adap->
dev->props.read_mac_address) {
111 if (adap->
dev->props.read_mac_address(adap->
dev,adap->
dvb_adap.proposed_mac) == 0)
114 err(
"MAC address reading failed.");
119 adap->
demux.priv = adap;
121 adap->
demux.filternum = 0;
122 for (i = 0; i < adap->
props.num_frontends; i++) {
123 if (adap->
demux.filternum < adap->
fe_adap[i].max_feed_count)
127 adap->
demux.start_feed = dvb_usb_start_feed;
128 adap->
demux.stop_feed = dvb_usb_stop_feed;
131 err(
"dvb_dmx_init failed: error %d",ret);
137 adap->
dmxdev.capabilities = 0;
139 err(
"dvb_dmxdev_init failed: error %d",ret);
144 &adap->
demux.dmx)) < 0) {
145 err(
"dvb_net_init failed: error %d",ret);
165 deb_info(
"unregistering DVB part\n");
176 static int dvb_usb_set_active_fe(
struct dvb_frontend *
fe,
int onoff)
180 int ret = (adap->
props.frontend_ctrl) ?
181 adap->
props.frontend_ctrl(fe, onoff) : 0;
184 err(
"frontend_ctrl request failed");
199 dvb_usb_set_active_fe(fe, 1);
214 dvb_usb_set_active_fe(fe, 0);
224 for (i = 0; i < adap->
props.num_frontends; i++) {
226 if (adap->
props.fe[i].frontend_attach ==
NULL) {
227 err(
"strange: '%s' #%d,%d "
228 "doesn't want to attach a frontend.",
229 adap->
dev->desc->name, adap->
id, i);
234 ret = adap->
props.fe[
i].frontend_attach(adap);
238 err(
"no frontend was attached by '%s'",
239 adap->
dev->desc->name);
248 adap->
fe_adap[
i].fe->ops.init = dvb_usb_fe_wakeup;
250 adap->
fe_adap[
i].fe->ops.sleep = dvb_usb_fe_sleep;
253 err(
"Frontend %d registration failed.", i);
265 if (adap->
props.fe[i].tuner_attach !=
NULL)
266 adap->
props.fe[
i].tuner_attach(adap);
279 for (; i >= 0; i--) {