drivers/media/pci/mantis/mantis_dvb.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/mantis/mantis_dvb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/mantis/mantis_dvb.c- Extension
.c- Size
- 7151 bytes
- Lines
- 291
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/bitops.hlinux/signal.hlinux/sched.hlinux/interrupt.hlinux/pci.hlinux/i2c.hmedia/dmxdev.hmedia/dvbdev.hmedia/dvb_demux.hmedia/dvb_frontend.hmedia/dvb_net.hmantis_common.hmantis_dma.hmantis_ca.hmantis_ioc.hmantis_dvb.h
Detected Declarations
function mantis_frontend_powerfunction mantis_frontend_soft_resetfunction mantis_frontend_shutdownfunction mantis_dvb_start_feedfunction mantis_dvb_stop_feedfunction mantis_dvb_initfunction mantis_dvb_exitexport mantis_frontend_powerexport mantis_frontend_soft_resetexport mantis_dvb_initexport mantis_dvb_exit
Annotated Snippet
if (result < 0) {
dprintk(MANTIS_ERROR, 1, "!!! NO Frontends found !!!");
goto err5;
} else {
if (mantis->fe == NULL) {
result = -ENOMEM;
dprintk(MANTIS_ERROR, 1, "FE <NULL>");
goto err5;
}
result = dvb_register_frontend(&mantis->dvb_adapter, mantis->fe);
if (result) {
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;
/* Error conditions .. */
err5:
cancel_work_sync(&mantis->bh_work);
dvb_net_release(&mantis->dvbnet);
if (mantis->fe) {
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;
}
EXPORT_SYMBOL_GPL(mantis_dvb_init);
int mantis_dvb_exit(struct mantis_pci *mantis)
{
int err;
if (mantis->fe) {
/* mantis_ca_exit(mantis); */
err = mantis_frontend_shutdown(mantis);
if (err != 0)
dprintk(MANTIS_ERROR, 1, "Frontend exit while POWER ON! <%d>", err);
dvb_unregister_frontend(mantis->fe);
dvb_frontend_detach(mantis->fe);
}
cancel_work_sync(&mantis->bh_work);
dvb_net_release(&mantis->dvbnet);
mantis->demux.dmx.remove_frontend(&mantis->demux.dmx, &mantis->fe_mem);
mantis->demux.dmx.remove_frontend(&mantis->demux.dmx, &mantis->fe_hw);
dvb_dmxdev_release(&mantis->dmxdev);
dvb_dmx_release(&mantis->demux);
dprintk(MANTIS_DEBUG, 1, "dvb_unregister_adapter");
dvb_unregister_adapter(&mantis->dvb_adapter);
return 0;
}
EXPORT_SYMBOL_GPL(mantis_dvb_exit);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/bitops.h`, `linux/signal.h`, `linux/sched.h`, `linux/interrupt.h`, `linux/pci.h`, `linux/i2c.h`, `media/dmxdev.h`.
- Detected declarations: `function mantis_frontend_power`, `function mantis_frontend_soft_reset`, `function mantis_frontend_shutdown`, `function mantis_dvb_start_feed`, `function mantis_dvb_stop_feed`, `function mantis_dvb_init`, `function mantis_dvb_exit`, `export mantis_frontend_power`, `export mantis_frontend_soft_reset`, `export mantis_dvb_init`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.