int flexcop_pid_feed_control(struct flexcop_device *fc, struct dvb_demux_feed *dvbdmxfeed, int onoff) { int max_pid_filter = 6; max_pid_filter -= 6 * fc->skip_6_hw_pid_filter; max_pid_filter += 32 * fc->has_32_hw_pid_filter; fc->feedcount += onoff ? 1 : -1; /* the number of PIDs/Feed currently requested */ if (dvbdmxfeed->index >= max_pid_filter) fc->extra_feedcount += onoff ? 1 : -1; /* toggle complete-TS-streaming when: * - pid_filtering is not enabled and it is the first or last feed requested * - pid_filtering is enabled, * - but the number of requested feeds is exceeded * - or the requested pid is 0x2000 */ if (!fc->pid_filtering && fc->feedcount == onoff) flexcop_toggle_fullts_streaming(fc, onoff); if (fc->pid_filtering) { flexcop_pid_control \ (fc, dvbdmxfeed->index, dvbdmxfeed->pid, onoff); if (fc->extra_feedcount > 0) flexcop_toggle_fullts_streaming(fc, 1); else if (dvbdmxfeed->pid == 0x2000) flexcop_toggle_fullts_streaming(fc, onoff); else flexcop_toggle_fullts_streaming(fc, 0); } /* if it was the first or last feed request change the stream-status */ if (fc->feedcount == onoff) { flexcop_rcv_data_ctrl(fc, onoff); if (fc->stream_control) /* device specific stream control */ fc->stream_control(fc, onoff); /* feeding stopped -> reset the flexcop filter*/ if (onoff == 0) { flexcop_reset_block_300(fc); flexcop_hw_filter_init(fc); } } return 0; }
int flexcop_device_initialize(struct flexcop_device *fc) { int ret; ibi_zero.raw = 0; flexcop_reset(fc); flexcop_determine_revision(fc); flexcop_sram_init(fc); flexcop_hw_filter_init(fc); flexcop_smc_ctrl(fc, 0); ret = flexcop_dvb_init(fc); if (ret) goto error; /* i2c has to be done before doing EEProm stuff - * because the EEProm is accessed via i2c */ ret = flexcop_i2c_init(fc); if (ret) goto error; /* do the MAC address reading after initializing the dvb_adapter */ if (fc->get_mac_addr(fc, 0) == 0) { u8 *b = fc->dvb_adapter.proposed_mac; info("MAC address = %pM", b); flexcop_set_mac_filter(fc,b); flexcop_mac_filter_ctrl(fc,1); } else warn("reading of MAC address failed.\n"); ret = flexcop_frontend_init(fc); if (ret) goto error; flexcop_device_name(fc,"initialization of","complete"); return 0; error: flexcop_device_exit(fc); return ret; }
int flexcop_device_initialize(struct flexcop_device *fc) { int ret; ibi_zero.raw = 0; flexcop_reset(fc); flexcop_determine_revision(fc); flexcop_sram_init(fc); flexcop_hw_filter_init(fc); flexcop_smc_ctrl(fc, 0); if ((ret = flexcop_dvb_init(fc))) goto error; /* do the MAC address reading after initializing the dvb_adapter */ if (fc->get_mac_addr(fc, 0) == 0) { u8 *b = fc->dvb_adapter.proposed_mac; info("MAC address = %02x:%02x:%02x:%02x:%02x:%02x", b[0],b[1],b[2],b[3],b[4],b[5]); flexcop_set_mac_filter(fc,b); flexcop_mac_filter_ctrl(fc,1); } else warn("reading of MAC address failed.\n"); if ((ret = flexcop_i2c_init(fc))) goto error; if ((ret = flexcop_frontend_init(fc))) goto error; flexcop_device_name(fc,"initialization of","complete"); ret = 0; goto success; error: flexcop_device_exit(fc); success: return ret; }
int flexcop_device_initialize(struct flexcop_device *fc) { int ret; ibi_zero.raw = 0; flexcop_reset(fc); flexcop_determine_revision(fc); flexcop_sram_init(fc); flexcop_hw_filter_init(fc); flexcop_smc_ctrl(fc, 0); ret = flexcop_dvb_init(fc); if (ret) goto error; ret = flexcop_i2c_init(fc); if (ret) goto error; if (fc->get_mac_addr(fc, 0) == 0) { u8 *b = fc->dvb_adapter.proposed_mac; info("MAC address = %pM", b); flexcop_set_mac_filter(fc,b); flexcop_mac_filter_ctrl(fc,1); } else warn("reading of MAC address failed.\n"); ret = flexcop_frontend_init(fc); if (ret) goto error; flexcop_device_name(fc,"initialization of","complete"); return 0; error: flexcop_device_exit(fc); return ret; }
int flexcop_pid_feed_control(struct flexcop_device *fc, struct dvb_demux_feed *dvbdmxfeed, int onoff) { int max_pid_filter = 6 + fc->has_32_hw_pid_filter*32; fc->feedcount += onoff ? 1 : -1; if (dvbdmxfeed->index >= max_pid_filter) fc->extra_feedcount += onoff ? 1 : -1; if (!fc->pid_filtering && fc->feedcount == onoff) flexcop_toggle_fullts_streaming(fc, onoff); if (fc->pid_filtering) { flexcop_pid_control \ (fc, dvbdmxfeed->index, dvbdmxfeed->pid, onoff); if (fc->extra_feedcount > 0) flexcop_toggle_fullts_streaming(fc, 1); else if (dvbdmxfeed->pid == 0x2000) flexcop_toggle_fullts_streaming(fc, onoff); else flexcop_toggle_fullts_streaming(fc, 0); } if (fc->feedcount == onoff) { flexcop_rcv_data_ctrl(fc, onoff); if (fc->stream_control) fc->stream_control(fc, onoff); if (onoff == 0) { flexcop_reset_block_300(fc); flexcop_hw_filter_init(fc); } } return 0; }