13 #include <linux/bitops.h>
14 #include <linux/device.h>
15 #include <linux/errno.h>
16 #include <linux/kernel.h>
17 #include <linux/module.h>
19 #include <linux/types.h>
28 static int alloc_channel(
struct firedtv *fdtv)
32 for (i = 0; i < 16; i++)
38 static void collect_channels(
struct firedtv *fdtv,
int *pidc,
u16 pid[])
42 for (i = 0, n = 0; i < 16; i++)
48 static inline void dealloc_channel(
struct firedtv *fdtv,
int i)
59 switch (dvbdmxfeed->
type) {
64 dev_err(fdtv->
device,
"can't start dmx feed: invalid type %u\n",
79 c = alloc_channel(fdtv);
83 "can't start dmx feed: invalid pes type %u\n",
89 c = alloc_channel(fdtv);
100 collect_channels(fdtv, &pidc, pids);
102 if (dvbdmxfeed->
pid == 8192) {
105 dealloc_channel(fdtv, c);
112 dealloc_channel(fdtv, c);
151 c = (
unsigned long)dvbdmxfeed->
priv;
152 dealloc_channel(fdtv, c);
153 collect_channels(fdtv, &pidc, pids);
174 fdtv->
demux.dmx.capabilities = 0;
176 fdtv->
demux.priv = fdtv;
177 fdtv->
demux.filternum = 16;
178 fdtv->
demux.feednum = 16;
185 goto fail_unreg_adapter;
187 fdtv->
dmxdev.filternum = 16;
189 fdtv->
dmxdev.capabilities = 0;
193 goto fail_dmx_release;
199 goto fail_dmxdev_release;
201 err = fdtv->
demux.dmx.connect_frontend(&fdtv->
demux.dmx,
204 goto fail_rem_frontend;
208 goto fail_disconnect_frontend;
213 goto fail_net_release;
218 "Conditional Access Module not enabled\n");
223 fail_disconnect_frontend: