本文整理汇总了C++中dvb_dmx_release函数的典型用法代码示例。如果您正苦于以下问题:C++ dvb_dmx_release函数的具体用法?C++ dvb_dmx_release怎么用?C++ dvb_dmx_release使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dvb_dmx_release函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: au0828_dvb_unregister
void au0828_dvb_unregister(struct au0828_dev *dev)
{
struct au0828_dvb *dvb = &dev->dvb;
dprintk(1, "%s()\n", __func__);
if (dvb->frontend == NULL)
return;
dvb_net_release(&dvb->net);
dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem);
dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw);
dvb_dmxdev_release(&dvb->dmxdev);
dvb_dmx_release(&dvb->demux);
dvb_unregister_frontend(dvb->frontend);
dvb_frontend_detach(dvb->frontend);
dvb_unregister_adapter(&dvb->adapter);
}
开发者ID:458941968,项目名称:mini2440-kernel-2.6.29,代码行数:18,代码来源:au0828-dvb.c
示例2: vtunerc_exit
static void __exit vtunerc_exit(void)
{
struct dvb_demux *dvbdemux;
struct dmx_demux *dmx;
int idx;
vtunerc_unregister_ctrldev(&config);
for (idx = 0; idx < config.devices; idx++) {
struct vtunerc_ctx *ctx = vtunerc_tbl[idx];
if(!ctx)
continue;
vtunerc_tbl[idx] = NULL;
#ifdef CONFIG_PROC_FS
remove_proc_entry(ctx->procname, NULL);
kfree(ctx->procname);
#endif
vtunerc_frontend_clear(ctx);
dvbdemux = &ctx->demux;
dmx = &dvbdemux->dmx;
dmx->disconnect_frontend(dmx);
dmx->remove_frontend(dmx, &ctx->mem_frontend);
dmx->remove_frontend(dmx, &ctx->hw_frontend);
dvb_dmxdev_release(&ctx->dmxdev);
dvb_dmx_release(dvbdemux);
dvb_unregister_adapter(&ctx->dvb_adapter);
// free allocated buffer
if(ctx->kernel_buf != NULL) {
kfree(ctx->kernel_buf);
printk(KERN_INFO "vtunerc%d: deallocated buffer of %Zu bytes\n", idx, ctx->kernel_buf_size);
ctx->kernel_buf = NULL;
ctx->kernel_buf_size = 0;
}
kfree(ctx);
}
printk(KERN_NOTICE "vtunerc: unloaded successfully\n");
}
开发者ID:spali,项目名称:vtuner.linux-driver,代码行数:44,代码来源:vtunerc_main.c
示例3: cx18_dvb_unregister
void cx18_dvb_unregister(struct cx18_stream *stream)
{
struct cx18 *cx = stream->cx;
struct cx18_dvb *dvb = &stream->dvb;
struct dvb_adapter *dvb_adapter;
struct dvb_demux *dvbdemux;
struct dmx_demux *dmx;
CX18_INFO("unregister DVB\n");
dvb_adapter = &dvb->dvb_adapter;
dvbdemux = &dvb->demux;
dmx = &dvbdemux->dmx;
dmx->close(dmx);
dvb_net_release(&dvb->dvbnet);
dmx->remove_frontend(dmx, &dvb->mem_frontend);
dmx->remove_frontend(dmx, &dvb->hw_frontend);
dvb_dmxdev_release(&dvb->dmxdev);
dvb_dmx_release(dvbdemux);
dvb_unregister_frontend(dvb->fe);
dvb_frontend_detach(dvb->fe);
dvb_unregister_adapter(dvb_adapter);
}
开发者ID:mpalmer,项目名称:linux-2.6,代码行数:24,代码来源:cx18-dvb.c
示例4: em28xx_register_dvb
//.........这里部分代码省略.........
/* Ensure all frontends negotiate bus access */
dvb->fe[0]->ops.ts_bus_ctrl = em28xx_dvb_bus_ctrl;
if (dvb->fe[1])
dvb->fe[1]->ops.ts_bus_ctrl = em28xx_dvb_bus_ctrl;
dvb->adapter.priv = &dev->i2c_bus[dev->def_i2c_bus];
/* register frontend */
result = dvb_register_frontend(&dvb->adapter, dvb->fe[0]);
if (result < 0) {
printk(KERN_WARNING "%s: dvb_register_frontend failed (errno = %d)\n",
dev->name, result);
goto fail_frontend0;
}
/* register 2nd frontend */
if (dvb->fe[1]) {
result = dvb_register_frontend(&dvb->adapter, dvb->fe[1]);
if (result < 0) {
printk(KERN_WARNING "%s: 2nd dvb_register_frontend failed (errno = %d)\n",
dev->name, result);
goto fail_frontend1;
}
}
/* register demux stuff */
dvb->demux.dmx.capabilities =
DMX_TS_FILTERING | DMX_SECTION_FILTERING |
DMX_MEMORY_BASED_FILTERING;
dvb->demux.priv = dvb;
dvb->demux.filternum = 256;
dvb->demux.feednum = 256;
dvb->demux.start_feed = em28xx_start_feed;
dvb->demux.stop_feed = em28xx_stop_feed;
result = dvb_dmx_init(&dvb->demux);
if (result < 0) {
printk(KERN_WARNING "%s: dvb_dmx_init failed (errno = %d)\n",
dev->name, result);
goto fail_dmx;
}
dvb->dmxdev.filternum = 256;
dvb->dmxdev.demux = &dvb->demux.dmx;
dvb->dmxdev.capabilities = 0;
result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter);
if (result < 0) {
printk(KERN_WARNING "%s: dvb_dmxdev_init failed (errno = %d)\n",
dev->name, result);
goto fail_dmxdev;
}
dvb->fe_hw.source = DMX_FRONTEND_0;
result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw);
if (result < 0) {
printk(KERN_WARNING "%s: add_frontend failed (DMX_FRONTEND_0, errno = %d)\n",
dev->name, result);
goto fail_fe_hw;
}
dvb->fe_mem.source = DMX_MEMORY_FE;
result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem);
if (result < 0) {
printk(KERN_WARNING "%s: add_frontend failed (DMX_MEMORY_FE, errno = %d)\n",
dev->name, result);
goto fail_fe_mem;
}
result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw);
if (result < 0) {
printk(KERN_WARNING "%s: connect_frontend failed (errno = %d)\n",
dev->name, result);
goto fail_fe_conn;
}
/* register network adapter */
dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx);
return 0;
fail_fe_conn:
dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem);
fail_fe_mem:
dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw);
fail_fe_hw:
dvb_dmxdev_release(&dvb->dmxdev);
fail_dmxdev:
dvb_dmx_release(&dvb->demux);
fail_dmx:
if (dvb->fe[1])
dvb_unregister_frontend(dvb->fe[1]);
dvb_unregister_frontend(dvb->fe[0]);
fail_frontend1:
if (dvb->fe[1])
dvb_frontend_detach(dvb->fe[1]);
fail_frontend0:
dvb_frontend_detach(dvb->fe[0]);
dvb_unregister_adapter(&dvb->adapter);
fail_adapter:
return result;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:101,代码来源:em28xx-dvb.c
示例5: flexcop_dvb_init
static int flexcop_dvb_init(struct flexcop_device *fc)
{
int ret = dvb_register_adapter(&fc->dvb_adapter,
"FlexCop Digital TV device", fc->owner,
fc->dev, adapter_nr);
if (ret < 0) {
err("error registering DVB adapter");
return ret;
}
fc->dvb_adapter.priv = fc;
fc->demux.dmx.capabilities = (DMX_TS_FILTERING | DMX_SECTION_FILTERING
| DMX_MEMORY_BASED_FILTERING);
fc->demux.priv = fc;
fc->demux.filternum = fc->demux.feednum = FC_MAX_FEED;
fc->demux.start_feed = flexcop_dvb_start_feed;
fc->demux.stop_feed = flexcop_dvb_stop_feed;
fc->demux.write_to_decoder = NULL;
ret = dvb_dmx_init(&fc->demux);
if (ret < 0) {
err("dvb_dmx failed: error %d", ret);
goto err_dmx;
}
fc->hw_frontend.source = DMX_FRONTEND_0;
fc->dmxdev.filternum = fc->demux.feednum;
fc->dmxdev.demux = &fc->demux.dmx;
fc->dmxdev.capabilities = 0;
ret = dvb_dmxdev_init(&fc->dmxdev, &fc->dvb_adapter);
if (ret < 0) {
err("dvb_dmxdev_init failed: error %d", ret);
goto err_dmx_dev;
}
ret = fc->demux.dmx.add_frontend(&fc->demux.dmx, &fc->hw_frontend);
if (ret < 0) {
err("adding hw_frontend to dmx failed: error %d", ret);
goto err_dmx_add_hw_frontend;
}
fc->mem_frontend.source = DMX_MEMORY_FE;
ret = fc->demux.dmx.add_frontend(&fc->demux.dmx, &fc->mem_frontend);
if (ret < 0) {
err("adding mem_frontend to dmx failed: error %d", ret);
goto err_dmx_add_mem_frontend;
}
ret = fc->demux.dmx.connect_frontend(&fc->demux.dmx, &fc->hw_frontend);
if (ret < 0) {
err("connect frontend failed: error %d", ret);
goto err_connect_frontend;
}
ret = dvb_net_init(&fc->dvb_adapter, &fc->dvbnet, &fc->demux.dmx);
if (ret < 0) {
err("dvb_net_init failed: error %d", ret);
goto err_net;
}
fc->init_state |= FC_STATE_DVB_INIT;
return 0;
err_net:
fc->demux.dmx.disconnect_frontend(&fc->demux.dmx);
err_connect_frontend:
fc->demux.dmx.remove_frontend(&fc->demux.dmx, &fc->mem_frontend);
err_dmx_add_mem_frontend:
fc->demux.dmx.remove_frontend(&fc->demux.dmx, &fc->hw_frontend);
err_dmx_add_hw_frontend:
dvb_dmxdev_release(&fc->dmxdev);
err_dmx_dev:
dvb_dmx_release(&fc->demux);
err_dmx:
dvb_unregister_adapter(&fc->dvb_adapter);
return ret;
}
开发者ID:forgivemyheart,项目名称:linux,代码行数:78,代码来源:flexcop.c
示例6: fdtv_dvb_register
int fdtv_dvb_register(struct firedtv *fdtv, const char *name)
{
int err;
err = dvb_register_adapter(&fdtv->adapter, name,
THIS_MODULE, fdtv->device, adapter_nr);
if (err < 0)
goto fail_log;
/*DMX_TS_FILTERING | DMX_SECTION_FILTERING*/
fdtv->demux.dmx.capabilities = 0;
fdtv->demux.priv = fdtv;
fdtv->demux.filternum = 16;
fdtv->demux.feednum = 16;
fdtv->demux.start_feed = fdtv_start_feed;
fdtv->demux.stop_feed = fdtv_stop_feed;
fdtv->demux.write_to_decoder = NULL;
err = dvb_dmx_init(&fdtv->demux);
if (err)
goto fail_unreg_adapter;
fdtv->dmxdev.filternum = 16;
fdtv->dmxdev.demux = &fdtv->demux.dmx;
fdtv->dmxdev.capabilities = 0;
err = dvb_dmxdev_init(&fdtv->dmxdev, &fdtv->adapter);
if (err)
goto fail_dmx_release;
fdtv->frontend.source = DMX_FRONTEND_0;
err = fdtv->demux.dmx.add_frontend(&fdtv->demux.dmx, &fdtv->frontend);
if (err)
goto fail_dmxdev_release;
err = fdtv->demux.dmx.connect_frontend(&fdtv->demux.dmx,
&fdtv->frontend);
if (err)
goto fail_rem_frontend;
err = dvb_net_init(&fdtv->adapter, &fdtv->dvbnet, &fdtv->demux.dmx);
if (err)
goto fail_disconnect_frontend;
fdtv_frontend_init(fdtv, name);
err = dvb_register_frontend(&fdtv->adapter, &fdtv->fe);
if (err)
goto fail_net_release;
err = fdtv_ca_register(fdtv);
if (err)
dev_info(fdtv->device,
"Conditional Access Module not enabled\n");
return 0;
fail_net_release:
dvb_net_release(&fdtv->dvbnet);
fail_disconnect_frontend:
fdtv->demux.dmx.close(&fdtv->demux.dmx);
fail_rem_frontend:
fdtv->demux.dmx.remove_frontend(&fdtv->demux.dmx, &fdtv->frontend);
fail_dmxdev_release:
dvb_dmxdev_release(&fdtv->dmxdev);
fail_dmx_release:
dvb_dmx_release(&fdtv->demux);
fail_unreg_adapter:
dvb_unregister_adapter(&fdtv->adapter);
fail_log:
dev_err(fdtv->device, "DVB initialization failed\n");
return err;
}
开发者ID:020gzh,项目名称:linux,代码行数:73,代码来源:firedtv-dvb.c
示例7: mantis_dvb_init
//.........这里部分代码省略.........
mantis->demux.priv = mantis;
mantis->demux.filternum = 256;
mantis->demux.feednum = 256;
mantis->demux.start_feed = mantis_dvb_start_feed;
mantis->demux.stop_feed = mantis_dvb_stop_feed;
mantis->demux.write_to_decoder = NULL;
dprintk(MANTIS_DEBUG, 1, "dvb_dmx_init");
result = dvb_dmx_init(&mantis->demux);
if (result < 0) {
dprintk(MANTIS_ERROR, 1, "dvb_dmx_init failed, ERROR=%d", result);
goto err0;
}
mantis->dmxdev.filternum = 256;
mantis->dmxdev.demux = &mantis->demux.dmx;
mantis->dmxdev.capabilities = 0;
dprintk(MANTIS_DEBUG, 1, "dvb_dmxdev_init");
result = dvb_dmxdev_init(&mantis->dmxdev, &mantis->dvb_adapter);
if (result < 0) {
dprintk(MANTIS_ERROR, 1, "dvb_dmxdev_init failed, ERROR=%d", result);
goto err1;
}
mantis->fe_hw.source = DMX_FRONTEND_0;
result = mantis->demux.dmx.add_frontend(&mantis->demux.dmx, &mantis->fe_hw);
if (result < 0) {
dprintk(MANTIS_ERROR, 1, "dvb_dmx_init failed, ERROR=%d", result);
goto err2;
}
mantis->fe_mem.source = DMX_MEMORY_FE;
result = mantis->demux.dmx.add_frontend(&mantis->demux.dmx, &mantis->fe_mem);
if (result < 0) {
dprintk(MANTIS_ERROR, 1, "dvb_dmx_init failed, ERROR=%d", result);
goto err3;
}
result = mantis->demux.dmx.connect_frontend(&mantis->demux.dmx, &mantis->fe_hw);
if (result < 0) {
dprintk(MANTIS_ERROR, 1, "dvb_dmx_init failed, ERROR=%d", result);
goto err4;
}
dvb_net_init(&mantis->dvb_adapter, &mantis->dvbnet, &mantis->demux.dmx);
tasklet_init(&mantis->tasklet, mantis_dma_xfer, (unsigned long) mantis);
tasklet_disable(&mantis->tasklet);
if (mantis->hwconfig) {
result = config->frontend_init(mantis, mantis->fe);
if (result < 0) {
dprintk(MANTIS_ERROR, 1, "!!! NO Frontends found !!!");
goto err5;
} else {
if (mantis->fe == NULL) {
dprintk(MANTIS_ERROR, 1, "FE <NULL>");
goto err5;
}
if (dvb_register_frontend(&mantis->dvb_adapter, mantis->fe)) {
dprintk(MANTIS_ERROR, 1, "ERROR: Frontend registration failed");
if (mantis->fe->ops.release)
mantis->fe->ops.release(mantis->fe);
mantis->fe = NULL;
goto err5;
}
}
}
return 0;
/* */
err5:
tasklet_kill(&mantis->tasklet);
dvb_net_release(&mantis->dvbnet);
dvb_unregister_frontend(mantis->fe);
dvb_frontend_detach(mantis->fe);
err4:
mantis->demux.dmx.remove_frontend(&mantis->demux.dmx, &mantis->fe_mem);
err3:
mantis->demux.dmx.remove_frontend(&mantis->demux.dmx, &mantis->fe_hw);
err2:
dvb_dmxdev_release(&mantis->dmxdev);
err1:
dvb_dmx_release(&mantis->demux);
err0:
dvb_unregister_adapter(&mantis->dvb_adapter);
return result;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:101,代码来源:mantis_dvb.c
示例8: as102_dvb_register
int as102_dvb_register(struct as102_dev_t *as102_dev)
{
struct device *dev = &as102_dev->bus_adap.usb_dev->dev;
int ret;
ret = dvb_register_adapter(&as102_dev->dvb_adap,
as102_dev->name, THIS_MODULE,
dev, adapter_nr);
if (ret < 0) {
dev_err(dev, "%s: dvb_register_adapter() failed: %d\n",
__func__, ret);
return ret;
}
as102_dev->dvb_dmx.priv = as102_dev;
as102_dev->dvb_dmx.filternum = pid_filtering ? 16 : 256;
as102_dev->dvb_dmx.feednum = 256;
as102_dev->dvb_dmx.start_feed = as102_dvb_dmx_start_feed;
as102_dev->dvb_dmx.stop_feed = as102_dvb_dmx_stop_feed;
as102_dev->dvb_dmx.dmx.capabilities = DMX_TS_FILTERING |
DMX_SECTION_FILTERING;
as102_dev->dvb_dmxdev.filternum = as102_dev->dvb_dmx.filternum;
as102_dev->dvb_dmxdev.demux = &as102_dev->dvb_dmx.dmx;
as102_dev->dvb_dmxdev.capabilities = 0;
ret = dvb_dmx_init(&as102_dev->dvb_dmx);
if (ret < 0) {
dev_err(dev, "%s: dvb_dmx_init() failed: %d\n", __func__, ret);
goto edmxinit;
}
ret = dvb_dmxdev_init(&as102_dev->dvb_dmxdev, &as102_dev->dvb_adap);
if (ret < 0) {
dev_err(dev, "%s: dvb_dmxdev_init() failed: %d\n",
__func__, ret);
goto edmxdinit;
}
ret = as102_dvb_register_fe(as102_dev, &as102_dev->dvb_fe);
if (ret < 0) {
dev_err(dev, "%s: as102_dvb_register_frontend() failed: %d",
__func__, ret);
goto efereg;
}
/* init bus mutex for token locking */
mutex_init(&as102_dev->bus_adap.lock);
/* init start / stop stream mutex */
mutex_init(&as102_dev->sem);
/*
* try to load as102 firmware. If firmware upload failed, we'll be
* able to upload it later.
*/
if (fw_upload)
try_then_request_module(as102_fw_upload(&as102_dev->bus_adap),
"firmware_class");
pr_info("Registered device %s", as102_dev->name);
return 0;
efereg:
dvb_dmxdev_release(&as102_dev->dvb_dmxdev);
edmxdinit:
dvb_dmx_release(&as102_dev->dvb_dmx);
edmxinit:
dvb_unregister_adapter(&as102_dev->dvb_adap);
return ret;
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:72,代码来源:as102_drv.c
示例9: kzalloc
/*static*/ int __init StmLoadModule(void)
{
int Result;
int i;
short int AdapterNumbers[] = { -1 };
DvbContext = kzalloc(sizeof(struct DvbContext_s), GFP_KERNEL);
if (DvbContext == NULL)
{
DVB_ERROR("Unable to allocate device memory\n");
return -ENOMEM;
}
#ifdef __TDT__
memset(DvbContext, 0, sizeof * DvbContext);
#endif
#ifdef __TDT__
if (swts)
printk("swts ->routing streams from dvr0 to tsm to pti to player\n");
else
printk("no swts ->routing streams from dvr0 direct to the player\n");
#endif
#if DVB_API_VERSION < 5
Result = dvb_register_adapter(&DvbContext->DvbAdapter, MODULE_NAME, THIS_MODULE, NULL);
#else
Result = dvb_register_adapter(&DvbContext->DvbAdapter, MODULE_NAME, THIS_MODULE, NULL, AdapterNumbers);
#endif
if (Result < 0)
{
DVB_ERROR("Failed to register adapter (%d)\n", Result);
kfree(DvbContext);
DvbContext = NULL;
return -ENOMEM;
}
mutex_init(&(DvbContext->Lock));
mutex_lock(&(DvbContext->Lock));
/*{{{ Register devices*/
for (i = 0; i < DVB_MAX_DEVICES_PER_ADAPTER; i++)
{
struct DeviceContext_s* DeviceContext = &DvbContext->DeviceContext[i];
struct dvb_demux* DvbDemux = &DeviceContext->DvbDemux;
struct dmxdev* DmxDevice = &DeviceContext->DmxDevice;
struct dvb_device* DvrDevice;
#ifdef __TDT__
//sylvester: wenn der stream vom user kommt soll WriteToDecoder nix
//tun, da das ja hier schon passiert. keine ahnung wie man das ansonsten
//verhindern soll;-)
DeviceContext->dvr_write = 0;
#endif
DeviceContext->DvbContext = DvbContext;
#if defined (USE_KERNEL_DEMUX)
memset(DvbDemux, 0, sizeof(struct dvb_demux));
#ifdef __TDT__
DvbDemux->dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERING | DMX_TS_DESCRAMBLING;
/* currently only dummy to avoid EINVAL error. Later we need it for second frontend ?! */
DvbDemux->dmx.set_source = SetSource;
#else
DvbDemux->dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERING;
#endif
DvbDemux->priv = DeviceContext;
DvbDemux->filternum = 32;
DvbDemux->feednum = 32;
DvbDemux->start_feed = StartFeed;
DvbDemux->stop_feed = StopFeed;
#ifdef __TDT__
DvbDemux->write_to_decoder = WriteToDecoder;
#else
DvbDemux->write_to_decoder = NULL;
#endif
Result = dvb_dmx_init(DvbDemux);
if (Result < 0)
{
DVB_ERROR("dvb_dmx_init failed (errno = %d)\n", Result);
return Result;
}
memset(DmxDevice, 0, sizeof(struct dmxdev));
DmxDevice->filternum = DvbDemux->filternum;
DmxDevice->demux = &DvbDemux->dmx;
DmxDevice->capabilities = 0;
Result = dvb_dmxdev_init(DmxDevice, &DvbContext->DvbAdapter);
if (Result < 0)
{
DVB_ERROR("dvb_dmxdev_init failed (errno = %d)\n", Result);
dvb_dmx_release(DvbDemux);
return Result;
}
DvrDevice = DvrInit(DmxDevice->dvr_dvbdev->fops);
#ifdef __TDT__
printk("%d: DeviceContext %p, DvbDemux %p, DmxDevice %p\n", i, DeviceContext, DvbDemux, DmxDevice);
#endif
/* Unregister the built-in dvr device and replace it with our own version */
dvb_unregister_device(DmxDevice->dvr_dvbdev);
dvb_register_device(&DvbContext->DvbAdapter,
&DmxDevice->dvr_dvbdev,
DvrDevice, DmxDevice, DVB_DEVICE_DVR);
DeviceContext->MemoryFrontend.source = DMX_MEMORY_FE;
Result = DvbDemux->dmx.add_frontend(&DvbDemux->dmx, &DeviceContext->MemoryFrontend);
if (Result < 0)
{
DVB_ERROR("add_frontend failed (errno = %d)\n", Result);
dvb_dmxdev_release(DmxDevice);
dvb_dmx_release(DvbDemux);
//.........这里部分代码省略.........
开发者ID:miciomaxx,项目名称:driver,代码行数:101,代码来源:dvb_module.c
示例10: SysDVBRegisterAdapter
//.........这里部分代码省略.........
p->name, ret);
goto fail2;
}
DBG_fCDVB("init demux devices, dmxdev_sw=%p\n", &p->dmxdev_sw);
p->dmxdev_sw.filternum = max_filters;
p->dmxdev_sw.demux = &p->demux_sw.dmx;
p->dmxdev_sw.capabilities = 0;
ret = dvb_dmxdev_init(&p->dmxdev_sw, p->adapter);
if(ret) {
#if 0
printk(KERN_WARNING "%s: failed to init dmxdev\n",
p->name);
#else
SysPrintk(KERN_WARNING "%s: failed to init dmxdev\n",
p->name);
#endif
goto fail3;
}
DBG_fCDVB("add h/w frontend\n");
p->hw_frontend.source = DMX_FRONTEND_0;
ret = p->demux_sw.dmx.add_frontend(&p->demux_sw.dmx,
&p->hw_frontend);
if(ret < 0) {
#if 0
printk(KERN_WARNING "%s: cannot add hw frontend\n",
p->name);
#else
SysPrintk(KERN_WARNING "%s: cannot add hw frontend, ret=%d\n",
p->name, ret);
#endif
goto fail4;
}
DBG_fCDVB("add memory frontend\n");
p->mem_frontend.source = DMX_MEMORY_FE;
ret = p->demux_sw.dmx.add_frontend(&p->demux_sw.dmx,
&p->mem_frontend);
if(ret < 0) {
#if 0
printk(KERN_WARNING "%s: cannot add mem frontend\n",
p->name);
#else
SysPrintk(KERN_WARNING "%s: cannot add mem frontend\n",
p->name);
#endif
goto fail5;
}
ret = p->demux_sw.dmx.connect_frontend(
&p->demux_sw.dmx,
&p->mem_frontend);
if(ret < 0) {
#if 0
printk(KERN_WARNING "%s: cannot connect frontend\n",
p->name);
#else
SysPrintk(KERN_WARNING "%s: cannot connect frontend, ret=%d\n",
p->name, ret);
#endif
goto fail6;
}
DBG_fCDVB("done\n");
goto done;
fail6:
p->demux_sw.dmx.remove_frontend(&p->demux_sw.dmx,
&p->mem_frontend);
fail5:
p->demux_sw.dmx.remove_frontend(&p->demux_sw.dmx,
&p->hw_frontend);
fail4:
dvb_dmxdev_release(&p->dmxdev_sw);
fail3:
dvb_dmx_release(&p->demux_sw);
fail2:
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
dvb_unregister_i2c_bus(master_xfer, p->i2c_bus->adapter,
p->i2c_bus->id);
#endif
dvb_unregister_adapter(p->adapter);
fail1:
#if DVB_REG_NEWSTYLE
#if 0
kfree(p->adapter);
#else
SysKFree(p->adapter);
#endif
fail0:
#endif
done:
return ret;
}
开发者ID:blackwarthog,项目名称:avermedia-a828,代码行数:101,代码来源:osdep_dvb.c
示例11: vtunerc_init
static int __init vtunerc_init(void)
{
struct vtunerc_ctx *ctx = NULL;
struct dvb_demux *dvbdemux;
struct dmx_demux *dmx;
int ret = -EINVAL, i, idx;
printk(KERN_INFO "virtual DVB adapter driver, version "
VTUNERC_MODULE_VERSION
", (c) 2010-11 Honza Petrous, SmartImp.cz\n");
request_module("dvb-core"); /* FIXME: dunno which way it should work :-/ */
for (idx = 0; idx < config.devices; idx++) {
ctx = kzalloc(sizeof(struct vtunerc_ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;
vtunerc_tbl[idx] = ctx;
ctx->idx = idx;
ctx->config = &config;
ctx->ctrldev_request.type = -1;
ctx->ctrldev_response.type = -1;
init_waitqueue_head(&ctx->ctrldev_wait_request_wq);
init_waitqueue_head(&ctx->ctrldev_wait_response_wq);
/* dvb */
/* create new adapter */
ret = dvb_register_adapter(&ctx->dvb_adapter, DRIVER_NAME,
THIS_MODULE, NULL, adapter_nr);
if (ret < 0)
goto err_kfree;
ctx->dvb_adapter.priv = ctx;
memset(&ctx->demux, 0, sizeof(ctx->demux));
dvbdemux = &ctx->demux;
dvbdemux->priv = ctx;
dvbdemux->filternum = MAX_PIDTAB_LEN;
dvbdemux->feednum = MAX_PIDTAB_LEN;
dvbdemux->start_feed = vtunerc_start_feed;
dvbdemux->stop_feed = vtunerc_stop_feed;
dvbdemux->dmx.capabilities = 0;
ret = dvb_dmx_init(dvbdemux);
if (ret < 0)
goto err_dvb_unregister_adapter;
dmx = &dvbdemux->dmx;
ctx->hw_frontend.source = DMX_FRONTEND_0;
ctx->mem_frontend.source = DMX_MEMORY_FE;
ctx->dmxdev.filternum = MAX_PIDTAB_LEN;
ctx->dmxdev.demux = dmx;
ret = dvb_dmxdev_init(&ctx->dmxdev, &ctx->dvb_adapter);
if (ret < 0)
goto err_dvb_dmx_release;
ret = dmx->add_frontend(dmx, &ctx->hw_frontend);
if (ret < 0)
goto err_dvb_dmxdev_release;
ret = dmx->add_frontend(dmx, &ctx->mem_frontend);
if (ret < 0)
goto err_remove_hw_frontend;
ret = dmx->connect_frontend(dmx, &ctx->hw_frontend);
if (ret < 0)
goto err_remove_mem_frontend;
sema_init(&ctx->xchange_sem, 1);
sema_init(&ctx->ioctl_sem, 1);
sema_init(&ctx->tswrite_sem, 1);
/* init pid table */
for (i = 0; i < MAX_PIDTAB_LEN; i++)
ctx->pidtab[i] = PID_UNKNOWN;
#ifdef CONFIG_PROC_FS
{
char procfilename[64];
sprintf(procfilename, VTUNERC_PROC_FILENAME,
ctx->idx);
ctx->procname = my_strdup(procfilename);
if (create_proc_read_entry(ctx->procname, 0, NULL,
vtunerc_read_proc,
ctx) == 0)
printk(KERN_WARNING
"vtunerc%d: Unable to register '%s' proc file\n",
ctx->idx, ctx->procname);
}
#endif
}
vtunerc_register_ctrldev(ctx);
out:
//.........这里部分代码省略.........
开发者ID:gdachs,项目名称:vtuner,代码行数:101,代码来源:vtunerc_main.c
示例12: printk
struct stfe *stfe_create(void *private_data, void *start_feed, void *stop_feed)
{
struct stfe *stfe;
int channel;
int result;
if (!(stfe = kmalloc(sizeof(struct stfe), GFP_KERNEL)))
return NULL;
printk("%s: Allocated stfe @ 0x%p\n", __FUNCTION__, stfe);
memset(stfe, 0, sizeof(struct stfe));
sema_init(&stfe->sem, 0);
up(&stfe->sem);
for (channel = 0; channel < STFE_MAXCHANNEL; ++channel)
{
stfe->channel[channel].id = channel;
stfe->channel[channel].stfe = stfe;
stfe->channel[channel].havana_id = private_data;
}
dvb_register_adapter(&stfe->adapter, "ST Generic Front End Driver", THIS_MODULE, NULL, adapter_nr);
stfe->adapter.priv = stfe;
memset(&stfe->dvb_demux, 0, sizeof(stfe->dvb_demux));
stfe->dvb_demux.dmx.capabilities =
DMX_TS_FILTERING | DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERING;
stfe->dvb_demux.priv = private_data;
stfe->dvb_demux.filternum = 48;
stfe->dvb_demux.feednum = STFE_MAXCHANNEL;
stfe->dvb_demux.start_feed = start_feed;
stfe->dvb_demux.stop_feed = stop_feed;
stfe->dvb_demux.write_to_decoder = NULL; /* write_to_decoder;*/
if ((result = dvb_dmx_init(&stfe->dvb_demux)) < 0)
{
printk("stfe_init: dvb_dmx_init failed (errno = %d)\n",
result);
goto err;
}
stfe->dmxdev.filternum = stfe->dvb_demux.filternum;
stfe->dmxdev.demux = &stfe->dvb_demux.dmx;
stfe->dmxdev.capabilities = 0;
if ((result = dvb_dmxdev_init(&stfe->dmxdev, &stfe->adapter)) < 0)
{
printk("stfe_init: dvb_dmxdev_init failed (errno = %d)\n",
result);
dvb_dmx_release(&stfe->dvb_demux);
goto err;
}
stfe->hw_frontend.source = DMX_FRONTEND_0;
result = stfe->dvb_demux.dmx.add_frontend(&stfe->dvb_demux.dmx, &stfe->hw_frontend);
if (result < 0)
return NULL;
stfe->mem_frontend.source = DMX_MEMORY_FE;
result = stfe->dvb_demux.dmx.add_frontend(&stfe->dvb_demux.dmx, &stfe->mem_frontend);
if (result < 0)
return NULL;
result = stfe->dvb_demux.dmx.connect_frontend(&stfe->dvb_demux.dmx, &stfe->hw_frontend);
if (result < 0)
return NULL;
stfe->driver_data = private_data;
//i2c_add_driver(&st_tuner_i2c_driver);
return stfe;
err:
return NULL;
}
开发者ID:Audioniek,项目名称:driver,代码行数:61,代码来源:st-common.c
示例13: mpq_tspp_dmx_init
/**
* Initialize a single demux device.
*
* @mpq_adapter: MPQ DVB adapter
* @mpq_demux: The demux device to initialize
*
* Return error code
*/
static int mpq_tspp_dmx_init(
struct dvb_adapter *mpq_adapter,
struct mpq_demux *mpq_demux)
{
int result;
MPQ_DVB_DBG_PRINT("%s executed\n", __func__);
/* Set the kernel-demux object capabilities */
mpq_demux->demux.dmx.capabilities =
DMX_TS_FILTERING |
DMX_PES_FILTERING |
DMX_SECTION_FILTERING |
DMX_MEMORY_BASED_FILTERING |
DMX_CRC_CHECKING |
DMX_TS_DESCRAMBLING;
/* Set dvb-demux "virtual" function pointers */
mpq_demux->demux.priv = (void *)mpq_demux;
mpq_demux->demux.filternum = TSPP_MAX_SECTION_FILTER_NUM;
mpq_demux->demux.feednum = MPQ_MAX_DMX_FILES;
mpq_demux->demux.start_feed = mpq_tspp_dmx_start_filtering;
mpq_demux->demux.stop_feed = mpq_tspp_dmx_stop_filtering;
mpq_demux->demux.write_to_decoder = NULL;
mpq_demux->demux.decoder_fullness_init = NULL;
mpq_demux->demux.decoder_fullness_wait = NULL;
mpq_demux->demux.decoder_fullness_abort = NULL;
mpq_demux->demux.decoder_buffer_status = NULL;
mpq_demux->demux.reuse_decoder_buffer = NULL;
mpq_demux->demux.set_secure_mode = NULL;
mpq_demux->demux.oob_command = NULL;
mpq_demux->demux.convert_ts = NULL;
/* Initialize dvb_demux object */
result = dvb_dmx_init(&mpq_demux->demux);
if (result < 0) {
MPQ_ERR_PRINT("%s: dvb_dmx_init failed\n", __func__);
goto init_failed;
}
/* Now initailize the dmx-dev object */
mpq_demux->dmxdev.filternum = MPQ_MAX_DMX_FILES;
mpq_demux->dmxdev.demux = &mpq_demux->demux.dmx;
mpq_demux->dmxdev.capabilities = DMXDEV_CAP_DUPLEX;
mpq_demux->dmxdev.demux->set_source = mpq_dmx_set_source;
mpq_demux->dmxdev.demux->get_caps = mpq_tspp_dmx_get_caps;
result = dvb_dmxdev_init(&mpq_demux->dmxdev, mpq_adapter);
if (result < 0) {
MPQ_DVB_ERR_PRINT("%s: dvb_dmxdev_init failed (errno=%d)\n",
__func__,
result);
goto init_failed_dmx_release;
}
return 0;
init_failed_dmx_release:
dvb_dmx_release(&mpq_demux->demux);
init_failed:
return result;
}
开发者ID:adis1313,项目名称:android_kernel_samsung_msm8974,代码行数:72,代码来源:mpq_dmx_plugin_tspp_v2.c
示例14: aml_dvb_dmx_init
static int aml_dvb_dmx_init(struct aml_dvb *advb, struct aml_dmx *dmx, int id)
{
int i, ret;
#ifndef CONFIG_OF
struct resource *res;
char buf[32];
#endif
switch(id){
case 0:
dmx->dmx_irq = INT_DEMUX;
break;
case 1:
dmx->dmx_irq = INT_DEMUX_1;
break;
case 2:
dmx->dmx_irq = INT_DEMUX_2;
break;
}
#ifndef CONFIG_OF
snprintf(buf, sizeof(buf), "demux%d_irq", id);
res = platform_get_resource_byname(advb->pdev, IORESOURCE_IRQ, buf);
if (res) {
dmx->dmx_irq = res->start;
}
#endif
dmx->source = -1;
dmx->dump_ts_select = 0;
dmx->dvr_irq = -1;
dmx->demux.dmx.capabilities = (DMX_TS_FILTERING | DMX_SECTION_FILTERING | DMX_PES_FILTERING | DMX_MEMORY_BASED_FILTERING | DMX_TS_DESCRAMBLING);
dmx->demux.filternum = dmx->demux.feednum = FILTER_COUNT;
dmx->demux.priv = advb;
dmx->demux.start_feed = aml_dmx_hw_start_feed;
dmx->demux.stop_feed = aml_dmx_hw_stop_feed;
dmx->demux.write_to_decoder = NULL;
if ((ret = dvb_dmx_init(&dmx->demux)) < 0) {
pr_error("dvb_dmx failed: error %d\n",ret);
goto error_dmx_init;
}
dmx->dmxdev.filternum = dmx->demux.feednum;
dmx->dmxdev.demux = &dmx->demux.dmx;
dmx->dmxdev.capabilities = 0;
if ((ret = dvb_dmxdev_init(&dmx->dmxdev, &advb->dvb_adapter)) < 0) {
pr_error("dvb_dmxdev_init failed: error %d\n",ret);
goto error_dmxdev_init;
}
for (i=0; i<DMX_DEV_COUNT; i++) {
int source = i+DMX_FRONTEND_0;
dmx->hw_fe[i].source = source;
if ((ret = dmx->demux.dmx.add_frontend(&dmx->demux.dmx, &dmx->hw_fe[i])) < 0) {
pr_error("adding hw_frontend to dmx failed: error %d",ret);
dmx->hw_fe[i].source = 0;
goto error_add_hw_fe;
}
}
dmx->mem_fe.source = DMX_MEMORY_FE;
if ((ret = dmx->demux.dmx.add_frontend(&dmx->demux.dmx, &dmx->mem_fe)) < 0) {
pr_error("adding mem_frontend to dmx failed: error %d",ret);
goto error_add_mem_fe;
}
if ((ret = dmx->demux.dmx.connect_frontend(&dmx->demux.dmx, &dmx->hw_fe[1])) < 0) {
pr_error("connect frontend failed: error %d",ret);
goto error_connect_fe;
}
dmx->id = id;
dmx->aud_chan = -1;
dmx->vid_chan = -1;
dmx->sub_chan = -1;
dmx->pcr_chan = -1;
if ((ret = aml_dmx_hw_init(dmx)) <0) {
pr_error("demux hw init error %d", ret);
dmx->id = -1;
goto error_dmx_hw_init;
}
dvb_net_init(&advb->dvb_adapter, &dmx->dvb_net, &dmx->demux.dmx);
return 0;
error_dmx_hw_init:
error_connect_fe:
dmx->demux.dmx.remove_frontend(&dmx->demux.dmx, &dmx->mem_fe);
error_add_mem_fe:
error_add_hw_fe:
for (i=0; i<DMX_DEV_COUNT; i++) {
if (dmx->hw_fe[i].source)
dmx->demux.dmx.remove_frontend(&dmx->demux.dmx, &dmx->hw_fe[i]);
}
dvb_dmxdev_release(&dmx->dmxdev);
error_dmxdev_init:
dvb_dmx_release(&dmx->demux);
//.........这里部分代码省略.........
开发者ID:akuster,项目名称:linux-meson,代码行数:101,代码来源:aml_dvb.c
示例15: saa716x_dvb_init
//.........这里部分代码省略.........
saa716x_adap->demux.filternum = 256;
saa716x_adap->demux.feednum = 256;
saa716x_adap->demux.start_feed = saa716x_dvb_start_feed;
saa716x_adap->demux.stop_feed = saa716x_dvb_stop_feed;
saa716x_adap->demux.write_to_decoder = NULL;
dprintk(SAA716x_DEBUG, 1, "dvb_dmx_init");
if ((result = dvb_dmx_init(&saa716x_adap->demux)) < 0) {
dprintk(SAA716x_ERROR, 1, "dvb_dmx_init failed, ERROR=%d", result);
goto err0;
}
saa716x_adap->dmxdev.filternum = 256;
saa716x_adap->dmxdev.demux = &saa716x_adap->demux.dmx;
saa716x_adap->dmxdev.capabilities = 0;
dprintk(SAA716x_DEBUG, 1, "dvb_dmxdev_init");
if ((result = dvb_dmxdev_init(&saa716x_adap->dmxdev,
&saa716x_adap->dvb_adapter)) < 0) {
dprintk(SAA716x_ERROR, 1, "dvb_dmxdev_init failed, ERROR=%d", result);
goto err1;
}
saa716x_adap->fe_hw.source = DMX_FRONTEND_0;
if ((result = saa716x_adap->demux.dmx.add_frontend(&saa716x_adap->demux.dmx,
&saa716x_adap->fe_hw)) < 0) {
dprintk(SAA716x_ERROR, 1, "dvb_dmx_init failed, ERROR=%d", result);
goto err2;
}
saa716x_adap->fe_mem.source = DMX_MEMORY_FE;
if ((result = saa716x_adap->demux.dmx.add_frontend(&saa716x_adap->demux.dmx,
&saa716x_adap->fe_mem)) < 0) {
dprintk(SAA716x_ERROR, 1, "dvb_dmx_init failed, ERROR=%d", result);
goto err3;
}
if ((result = saa716x_adap->demux.dmx.connect_frontend(&saa716x_adap->demux.dmx,
&saa716x_adap->fe_hw)) < 0) {
dprintk(SAA716x_ERROR, 1, "dvb_dmx_init failed, ERROR=%d", result);
goto err4;
}
dvb_net_init(&saa716x_adap->dvb_adapter, &saa716x_adap->dvb_net, &saa716x_adap->demux.dmx);
// tasklet_init(&saa716x_adap->tasklet, saa716x_dma_xfer, (unsigned long) saa716x);
dprintk(SAA716x_DEBUG, 1, "Frontend Init");
saa716x_adap->saa716x = saa716x;
if (config->frontend_attach) {
result = config->frontend_attach(saa716x_adap, i);
if (result < 0)
dprintk(SAA716x_ERROR, 1, "SAA716x frontend attach failed");
if (saa716x_adap->fe == NULL) {
dprintk(SAA716x_ERROR, 1, "A frontend driver was not found for [%04x:%04x] subsystem [%04x:%04x]\n",
saa716x->pdev->vendor,
saa716x->pdev->device,
saa716x->pdev->subsystem_vendor,
saa716x->pdev->subsystem_device);
} else {
result = dvb_register_frontend(&saa716x_adap->dvb_adapter, saa716x_adap->fe);
if (result < 0) {
dprintk(SAA716x_ERROR, 1, "SAA716x register frontend failed");
goto err6;
}
}
} else {
dprintk(SAA716x_ERROR, 1, "Frontend attach = NULL");
}
saa716x_fgpi_init(saa716x, config->adap_config[i].ts_port);
saa716x_adap++;
}
return 0;
/* Error conditions */
err6:
dvb_frontend_detach(saa716x_adap->fe);
err4:
saa716x_adap->demux.dmx.remove_frontend(&saa716x_adap->demux.dmx, &saa716x_adap->fe_mem);
err3:
saa716x_adap->demux.dmx.remove_frontend(&saa716x_adap->demux.dmx, &saa716x_adap->fe_hw);
err2:
dvb_dmxdev_release(&saa716x_adap->dmxdev);
err1:
dvb_dmx_release(&saa716x_adap->demux);
err0:
dvb_unregister_adapter(&saa716x_adap->dvb_adapter);
return result;
}
开发者ID:mona66,项目名称:sifbox-beta4,代码行数:101,代码来源:saa716x_adap.c
示例16: cx18_dvb_register
int cx18_dvb_register(struct cx18_stream *stream)
{
struct cx18 *cx = stream->cx;
struct cx18_dvb *dvb = stream->dvb;
struct dvb_adapter *dvb_adapter;
struct dvb_demux *dvbdemux;
struct dmx_demux *dmx;
int ret;
if (!dvb)
return -EINVAL;
dvb->enabled = 0;
dvb->stream = stream;
ret = dvb_register_adapter(&dvb->dvb_adapter,
CX18_DRIVER_NAME,
THIS_MODULE, &cx->pci_dev->dev, adapter_nr);
if (ret < 0)
goto err_out;
dvb_adapter = &dvb->dvb_adapter;
dvbdemux = &dvb->demux;
dvbdemux->priv = (void *)stream;
dvbdemux->filternum = 256;
dvbdemux->feednum = 256;
dvbdemux->start_feed = cx18_dvb_start_feed;
dvbdemux->stop_feed = cx18_dvb_stop_feed;
dvbdemux->dmx.capabilities = (DMX_TS_FILTERING |
DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERING);
ret = dvb_dmx_init(dvbdemux);
if (ret < 0)
goto err_dvb_unregister_adapter;
dmx = &dvbdemux->dmx;
dvb->hw_frontend.source = DMX_FRONTEND_0;
dvb->mem_frontend.source = DMX_MEMORY_FE;
dvb->dmxdev.filternum = 256;
dvb->dmxdev.demux = dmx;
ret = dvb_dmxdev_init(&dvb->dmxdev, dvb_adapter);
if (ret < 0)
goto err_dvb_dmx_release;
ret = dmx->add_frontend(dmx, &dvb->hw_frontend);
if (ret < 0)
goto err_dvb_dmxdev_release;
ret = dmx->add_frontend(dmx, &dvb->mem_frontend);
if (ret < 0)
goto err_remove_hw_frontend;
ret = dmx->connect_frontend(dmx, &dvb->hw_frontend);
if (ret < 0)
goto err_remove_mem_frontend;
ret = dvb_register(stream);
if (ret < 0)
goto err_disconnect_frontend;
dvb_net_init(dvb_adapter, &dvb->dvbnet, dmx);
CX18_INFO("DVB Frontend registered\n");
CX18_INFO("Registered DVB adapter%d for %s (%d x %d.%02d kB)\n",
stream->dvb->dvb_adapter.num, stream->name,
stream->buffers, stream->buf_size/1024,
(stream->buf_size * 100 / 1024) % 100);
mutex_init(&dvb->feedlock);
dvb->enabled = 1;
return ret;
err_disconnect_frontend:
dmx->disconnect_frontend(dmx);
err_remove_mem_frontend:
dmx->remove_frontend(dmx, &dvb->mem_frontend);
err_remove_hw_frontend:
dmx->remove_frontend(dmx, &dvb->hw_frontend);
err_dvb_dmxdev_release:
dvb_dmxdev_release(&dvb->dmxdev);
err_dvb_dmx_release:
dvb_dmx_release(dvbdemux);
err_dvb_unregister_adapter:
dvb_unregister_adapter(dvb_adapter);
err_out:
return ret;
}
开发者ID:AshishNamdev,项目名称:linux,代码行数:91,代码来源:cx18-dvb.c
示例17: smsdvb_hotplug
//.........这里部分代码省略.........
client->demux.feednum = 32;
client->demux.start_feed = smsdvb_start_feed;
client->demux.stop_feed = smsdvb_stop_feed;
rc = dvb_dmx_init(&client->demux);
if (rc < 0) {
pr_err("dvb_dmx_init failed %d\n", rc);
goto dvbdmx_error;
}
/* init dmxdev */
client->dmxdev.filternum = 32;
client->dmxdev.demux = &client->demux.dmx;
client->dmxdev.capabilities = 0;
rc = dvb_dmxdev_init(&client->dmxdev, &client->adapter);
if (rc < 0) {
pr_err("dvb_dmxdev_init failed %d\n", rc);
goto dmxdev_error;
}
/* init and register frontend */
memcpy(&client->frontend.ops, &smsdvb_fe_ops,
sizeof(struct dvb_frontend_ops));
switch (smscore_get_device_mode(coredev)) {
case DEVICE_MODE_DVBT:
case DEVICE_MODE_DVBT_BDA:
client->frontend.ops.delsys[0] = SYS_DVBT;
break;
case DEVICE_MODE_ISDBT:
case DEVICE_MODE_ISDBT_BDA:
client->frontend.ops.delsys[0] = SYS_ISDBT;
break;
}
rc = dvb_register_frontend(&client->adapter, &client->frontend);
if (rc < 0) {
pr_err("frontend registration failed %d\n", rc);
goto frontend_error;
}
params.initial_id = 1;
params.data_type = MSG_SMS_DVBT_BDA_DATA;
params.onresponse_handler = smsdvb_onresponse;
params.onremove_handler = smsdvb_onremove;
params.context = client;
rc = smscore_register_client(coredev, ¶ms, &client->smsclient);
if (rc < 0) {
pr_err("smscore_register_client() failed %d\n", rc);
goto client_error;
}
client->coredev = coredev;
init_completion(&client->tune_done);
init_completion(&client->stats_done);
kmutex_lock(&g_smsdvb_clientslock);
list_add(&client->entry, &g_smsdvb_clients);
kmutex_unlock(&g_smsdvb_clientslock);
client->event_fe_state = -1;
client->event_unc_state = -1;
sms_board_dvb3_event(client, DVB3_EVENT_HOTPLUG);
sms_board_setup(coredev);
if (smsdvb_debugfs_create(client) < 0)
pr_info("failed to create debugfs node\n");
rc = dvb_create_media_graph(&client->adapter, true);
if (rc < 0) {
pr_err("dvb_create_media_graph failed %d\n", rc);
goto client_error;
}
pr_info("DVB interface registered.\n");
return 0;
client_error:
dvb_unregister_frontend(&client->frontend);
frontend_error:
dvb_dmxdev_release(&client->dmxdev);
dmxdev_error:
dvb_dmx_relea
|
请发表评论