188, 32768, 0, timeout); 
32768, timeout); 
static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter){	struct dmxdev *dmxdev = filter->dev;	void *mem;	int ret, i;	if (filter->state < DMXDEV_STATE_SET)		return -EINVAL;	if (filter->state >= DMXDEV_STATE_GO)		dvb_dmxdev_filter_stop(filter);	if (!(mem = filter->buffer.data)) {		mem = vmalloc(filter->buffer.size);		spin_lock_irq(&filter->dev->lock);		filter->buffer.data=mem;		spin_unlock_irq(&filter->dev->lock);		if (!filter->buffer.data)			return -ENOMEM;	}	filter->buffer.pwrite = filter->buffer.pread = 0;	switch (filter->type) {	case DMXDEV_TYPE_SEC:	{		struct dmx_sct_filter_params *para=&filter->params.sec;		struct dmx_section_filter **secfilter=&filter->filter.sec;		struct dmx_section_feed **secfeed=&filter->feed.sec;		*secfilter=NULL;		*secfeed=NULL;		/* find active filter/feed with same PID */		for (i=0; i<dmxdev->filternum; i++) {			if (dmxdev->filter[i].state >= DMXDEV_STATE_GO &&			    dmxdev->filter[i].pid == para->pid &&			    dmxdev->filter[i].type == DMXDEV_TYPE_SEC) {				*secfeed = dmxdev->filter[i].feed.sec;				break;			}		}		/* if no feed found, try to allocate new one */		if (!*secfeed) {			ret=dmxdev->demux->allocate_section_feed(dmxdev->demux,								 secfeed,						   dvb_dmxdev_section_callback);			if (ret<0) {				printk ("DVB (%s): could not alloc feed\n",					__FUNCTION__);				return ret;			}			ret=(*secfeed)->set(*secfeed, para->pid, 32768, 0,					    (para->flags & DMX_CHECK_CRC) ? 1 : 0);			if (ret<0) {				printk ("DVB (%s): could not set feed\n",					__FUNCTION__);				dvb_dmxdev_feed_restart(filter);				return ret;			}		} else {			dvb_dmxdev_feed_stop(filter);		}		ret=(*secfeed)->allocate_filter(*secfeed, secfilter);		if (ret < 0) {			dvb_dmxdev_feed_restart(filter);			filter->feed.sec->start_filtering(*secfeed);			dprintk ("could not get filter\n");			return ret;		}		(*secfilter)->priv = filter;		memcpy(&((*secfilter)->filter_value[3]),		       &(para->filter.filter[1]), DMX_FILTER_SIZE-1);		memcpy(&(*secfilter)->filter_mask[3],		       &para->filter.mask[1], DMX_FILTER_SIZE-1);		memcpy(&(*secfilter)->filter_mode[3],		       &para->filter.mode[1], DMX_FILTER_SIZE-1);		(*secfilter)->filter_value[0]=para->filter.filter[0];		(*secfilter)->filter_mask[0]=para->filter.mask[0];		(*secfilter)->filter_mode[0]=para->filter.mode[0];		(*secfilter)->filter_mask[1]=0;		(*secfilter)->filter_mask[2]=0;		filter->todo = 0;		ret = filter->feed.sec->start_filtering (filter->feed.sec);		if (ret < 0)			return ret;		dvb_dmxdev_filter_timer(filter);		break;	}	case DMXDEV_TYPE_PES:	{		struct timespec timeout = { 0 };		struct dmx_pes_filter_params *para = &filter->params.pes;		dmx_output_t otype;		int ret;		int ts_type;		enum dmx_ts_pes ts_pes;		struct dmx_ts_feed **tsfeed = &filter->feed.ts;		filter->feed.ts = NULL;		otype=para->output;		ts_pes=(enum dmx_ts_pes) para->pes_type;		if (ts_pes<DMX_PES_OTHER)			ts_type=TS_DECODER;		else			ts_type=0;		if (otype == DMX_OUT_TS_TAP)			ts_type |= TS_PACKET;		if (otype == DMX_OUT_TAP)			ts_type |= TS_PAYLOAD_ONLY|TS_PACKET;		ret=dmxdev->demux->allocate_ts_feed(dmxdev->demux,						    tsfeed,						    dvb_dmxdev_ts_callback);		if (ret<0)			return ret;		(*tsfeed)->priv = (void *) filter;		ret = (*tsfeed)->set(*tsfeed, para->pid, ts_type, ts_pes,				     188, 32768, 0, timeout);		if (ret < 0) {			dmxdev->demux->release_ts_feed(dmxdev->demux, *tsfeed);			return ret;		}		ret = filter->feed.ts->start_filtering(filter->feed.ts);		if (ret < 0) {			dmxdev->demux->release_ts_feed(dmxdev->demux, *tsfeed);			return ret;		}		break;	}	default:		return -EINVAL;	}	dvb_dmxdev_filter_state_set(filter, DMXDEV_STATE_GO);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/5d2cd1631e97f5eb9c8666ff9cd8011cd5c12e7d/dmxdev.c/clean/drivers/media/dvb/dvb-core/dmxdev.c