mirror of
https://github.com/DigitalDevices/dddvb.git
synced 2025-03-01 10:35:23 +00:00
Compare commits
42 Commits
0.9.38-pre
...
0.9.38
Author | SHA1 | Date | |
---|---|---|---|
|
979cb7a237 | ||
|
7ce5232cd7 | ||
|
3f296bef62 | ||
|
ad01e9f508 | ||
|
e312df576c | ||
|
4b5cd433f9 | ||
|
6c068c0cc3 | ||
|
1488f326d0 | ||
|
c86cb59638 | ||
|
c78905d4a2 | ||
|
31589952a8 | ||
|
7eb5c6e658 | ||
|
172c6c93ba | ||
|
f125fd503c | ||
|
0dd4f106ab | ||
|
60426304db | ||
|
00b0036b33 | ||
|
177e71d62a | ||
|
83a6dc3a1d | ||
|
cc03d96de2 | ||
|
6336bd3689 | ||
|
be79cec76e | ||
|
24801ab41a | ||
|
390f67c03b | ||
|
fa4e3331d8 | ||
|
29cc552a6b | ||
|
42a0b65235 | ||
|
b8abf46d06 | ||
|
ce06e50881 | ||
|
22ffb0ecac | ||
|
92f2132d79 | ||
|
727fba48be | ||
|
09e8a15d78 | ||
|
45c9f076bd | ||
|
5c2757d581 | ||
|
817a464f4a | ||
|
d627e6995f | ||
|
ab4b0c8306 | ||
|
c8c1ee1835 | ||
|
002f39787a | ||
|
871821d6a0 | ||
|
2a88d220e4 |
4
Makefile
4
Makefile
@@ -1,4 +1,5 @@
|
||||
kernelver ?= $(shell uname -r)
|
||||
MDIR ?=
|
||||
KDIR ?= /lib/modules/$(kernelver)/build
|
||||
PWD := $(shell pwd)
|
||||
|
||||
@@ -29,10 +30,11 @@ dep:
|
||||
DIR=`pwd`; (cd $(TOPDIR); make KBUILD_EXTMOD=$$DIR dep)
|
||||
|
||||
install: all
|
||||
$(MAKE) -C $(KDIR) KBUILD_EXTMOD=$(PWD) modules_install
|
||||
$(MAKE) -C $(KDIR) KBUILD_EXTMOD=$(PWD) INSTALL_MOD_PATH=$(MDIR) modules_install
|
||||
depmod $(kernelver)
|
||||
|
||||
clean:
|
||||
rm -rf */.*.o.d */*.o */*.ko */*.mod.c */.*.cmd .tmp_versions Module* modules*
|
||||
$(MAKE) -C apps clean
|
||||
|
||||
|
||||
|
@@ -1,4 +1,20 @@
|
||||
all: cit citin flashprog modt ddtest setmod ddflash setmod2 pls setmod3 modconfig ddinfo getiq
|
||||
TARGETS = cit citin flashprog modt ddtest setmod ddflash setmod2 pls setmod3 modconfig ddinfo getiq modtest
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
CFLAGS = -g -Wall -Wno-unused -Wno-format
|
||||
FFMPEG := $(shell command -v ffmpeg 2> /dev/null)
|
||||
|
||||
modtest: modtest.c
|
||||
$(CC) -o modtest modtest.c -I../include/ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
|
||||
|
||||
test.ts:
|
||||
ifndef FFMPEG
|
||||
$(error "ffmpeg is not available please install to create test.ts")
|
||||
endif
|
||||
ffmpeg -f lavfi -i testsrc=duration=10:size=1280x720:rate=30 \
|
||||
-f lavfi -i sine=f=440:b=4 -shortest -metadata \
|
||||
service_provider="DD" -metadata service_name="Test" test.ts
|
||||
|
||||
cit: cit.c
|
||||
$(CC) -o cit cit.c -lpthread
|
||||
@@ -18,9 +34,19 @@ setmod3: setmod3.c
|
||||
modconfig: modconfig.c
|
||||
$(CC) -o modconfig modconfig.c -I../include/
|
||||
|
||||
clean:
|
||||
rm cit citin flashprog modt ddtest setmod ddflash setmod2 pls setmod3 modconfig ddinfo getiq
|
||||
|
||||
%: %.c
|
||||
$(CC) $(CFLAGS) -I../ddbridge -I../include/ $< -o $@
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -I../ddbridge -o $@ $<
|
||||
|
||||
|
||||
clean:
|
||||
for f in $(TARGETS) *.o *~ ; do \
|
||||
if [ -e "$$f" ]; then \
|
||||
rm "$$f" || exit 1; \
|
||||
fi \
|
||||
done
|
||||
|
@@ -276,10 +276,10 @@ int mci_cmd(int dev, struct mci_command *cmd)
|
||||
memset(&msg, 0, sizeof(msg));
|
||||
msg.link = 0;
|
||||
memcpy(&msg.cmd, cmd, sizeof(msg.cmd));
|
||||
//dump((uint8_t *) &msg.cmd, sizeof(msg.cmd));
|
||||
//dump((const uint8_t *) &msg.cmd, sizeof(msg.cmd));
|
||||
ret = ioctl(dev, IOCTL_DDB_MCI_CMD, &msg);
|
||||
if (ret < 0) {
|
||||
dprintf(2, "mci_cmd error %d\n", errno);
|
||||
dprintf(2, "mci_cmd error %d (%s)\n", errno, strerror(errno));
|
||||
return ret;
|
||||
}
|
||||
status = msg.res.status;
|
||||
@@ -458,7 +458,7 @@ int mci_lic(int dev)
|
||||
printf("MATYPE1: %02x\n", res->bb_header.matype_1);
|
||||
printf("MATYPE2: %02x\n", res->bb_header.matype_2);
|
||||
}
|
||||
dump(&res->license, sizeof(res->license));
|
||||
dump((const uint8_t *)&res->license, sizeof(res->license));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -486,7 +486,7 @@ int main(int argc, char*argv[])
|
||||
{"help", no_argument, 0, 'h'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
c = getopt_long(argc, argv, "d:c:",
|
||||
c = getopt_long(argc, argv, "d:c:",
|
||||
long_options, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
1313
apps/modtest.c
Normal file
1313
apps/modtest.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -147,7 +147,7 @@ int main(int argc, char **argv)
|
||||
if (gold != 0xffffffff) {
|
||||
if (gold < 0x3ffff) {
|
||||
root = gold2root(gold);
|
||||
printf("gold = %llu (0x%05x) root = %llu (0x%05x)\n",
|
||||
printf("gold = %u (0x%05x) root = %u (0x%05x)\n",
|
||||
gold, gold, root, root);
|
||||
} else
|
||||
printf("Invalid gold code specified.\n");
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
ddbridge-objs = ddbridge-main.o ddbridge-hw.o ddbridge-i2c.o ddbridge-ns.o ddbridge-modulator.o ddbridge-core.o ddbridge-io.o ddbridge-ci.o ddbridge-max.o ddbridge-mci.o ddbridge-sx8.o ddbridge-m4.o dvb_netstream.o
|
||||
octonet-objs = octonet-main.o ddbridge-hw.o ddbridge-i2c.o ddbridge-ns.o ddbridge-modulator.o ddbridge-core.o ddbridge-io.o ddbridge-ci.o ddbridge-max.o ddbridge-mci.o ddbridge-sx8.o ddbridge-m4.o dvb_netstream.o
|
||||
octonet-objs = octonet-main.o ddbridge-hw.o ddbridge-i2c.o ddbridge-ns.o ddbridge-core.o ddbridge-io.o ddbridge-ci.o ddbridge-max.o ddbridge-mci.o ddbridge-sx8.o ddbridge-m4.o dvb_netstream.o
|
||||
|
||||
obj-$(CONFIG_DVB_DDBRIDGE) += ddbridge.o
|
||||
obj-$(CONFIG_DVB_OCTONET) += octonet.o
|
||||
|
@@ -370,7 +370,7 @@ static int dma_alloc(struct pci_dev *pdev, struct ddb_dma *dma, int dir)
|
||||
if (!dma->vbuf[i])
|
||||
return -ENOMEM;
|
||||
}
|
||||
if (((u64)dma->vbuf[i] & 0xfff))
|
||||
if (((uintptr_t) dma->vbuf[i] & 0xfff))
|
||||
dev_err(&pdev->dev, "DMA memory at %px not aligned!\n", dma->vbuf[i]);
|
||||
}
|
||||
return 0;
|
||||
@@ -534,7 +534,9 @@ static int ddb_output_start_unlocked(struct ddb_output *output)
|
||||
ddbwritel(dev, 0, DMA_BUFFER_CONTROL(output->dma));
|
||||
}
|
||||
if (output->port->class == DDB_PORT_MOD) {
|
||||
#ifndef CONFIG_MACH_OCTONET
|
||||
err = ddbridge_mod_output_start(output);
|
||||
#endif
|
||||
} else {
|
||||
if (output->port->input[0]->port->class == DDB_PORT_LOOP)
|
||||
con = (1UL << 13) | 0x14;
|
||||
@@ -578,9 +580,11 @@ static void ddb_output_stop_unlocked(struct ddb_output *output)
|
||||
{
|
||||
struct ddb *dev = output->port->dev;
|
||||
|
||||
#ifndef CONFIG_MACH_OCTONET
|
||||
if (output->port->class == DDB_PORT_MOD)
|
||||
ddbridge_mod_output_stop(output);
|
||||
else
|
||||
#endif
|
||||
ddbwritel(dev, 0, TS_CONTROL(output));
|
||||
if (output->dma) {
|
||||
ddbwritel(dev, 0, DMA_BUFFER_CONTROL(output->dma));
|
||||
@@ -622,12 +626,14 @@ static void ddb_input_stop_unlocked(struct ddb_input *input)
|
||||
input->dma->running = 0;
|
||||
if (input->dma->stall_count)
|
||||
dev_warn(input->port->dev->dev,
|
||||
"DMA stalled %u times!\n",
|
||||
"l%ui%u: DMA stalled %u times!\n",
|
||||
input->port->lnr, input->nr,
|
||||
input->dma->stall_count);
|
||||
update_loss(input->dma);
|
||||
if (input->dma->packet_loss > 1)
|
||||
dev_warn(input->port->dev->dev,
|
||||
"%u packets lost due to low DMA performance!\n",
|
||||
"l%ui%u: %u packets lost due to low DMA performance!\n",
|
||||
input->port->lnr, input->nr,
|
||||
input->dma->packet_loss);
|
||||
}
|
||||
}
|
||||
@@ -1062,8 +1068,12 @@ static struct dvb_device dvbdev_ci = {
|
||||
static long mod_ioctl(struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
#ifndef CONFIG_MACH_OCTONET
|
||||
return ddb_dvb_usercopy(file, cmd, arg, ddbridge_mod_do_ioctl);
|
||||
}
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static const struct file_operations mod_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
@@ -1114,13 +1124,19 @@ static void dummy_release(struct dvb_frontend *fe)
|
||||
kfree(fe);
|
||||
}
|
||||
|
||||
static enum dvbfe_algo dummy_algo(struct dvb_frontend *fe)
|
||||
{
|
||||
return DVBFE_ALGO_HW;
|
||||
}
|
||||
|
||||
static struct dvb_frontend_ops dummy_ops = {
|
||||
.delsys = { SYS_DVBC_ANNEX_A, SYS_DVBS, SYS_DVBS2 },
|
||||
.delsys = { SYS_DVBC_ANNEX_A },
|
||||
.info = {
|
||||
.name = "DUMMY DVB-C/C2 DVB-T/T2",
|
||||
.frequency_stepsize_hz = 166667, /* DVB-T only */
|
||||
.frequency_min_hz = 47000000, /* DVB-T: 47125000 */
|
||||
.frequency_max_hz = 865000000, /* DVB-C: 862000000 */
|
||||
.name = "DUMMY DVB-C",
|
||||
.frequency_stepsize_hz = 0,
|
||||
.frequency_tolerance_hz = 0,
|
||||
.frequency_min_hz = 47000000,
|
||||
.frequency_max_hz = 865000000,
|
||||
.symbol_rate_min = 870000,
|
||||
.symbol_rate_max = 11700000,
|
||||
.caps = FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_32 |
|
||||
@@ -1133,6 +1149,7 @@ static struct dvb_frontend_ops dummy_ops = {
|
||||
FE_CAN_GUARD_INTERVAL_AUTO | FE_CAN_HIERARCHY_AUTO |
|
||||
FE_CAN_RECOVER | FE_CAN_MUTE_TS | FE_CAN_2G_MODULATION
|
||||
},
|
||||
.get_frontend_algo = dummy_algo,
|
||||
.release = dummy_release,
|
||||
.read_status = dummy_read_status,
|
||||
};
|
||||
@@ -1228,6 +1245,7 @@ static int demod_attach_stv0367dd(struct ddb_input *input)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DVB_DRXK
|
||||
static int tuner_attach_tda18271(struct ddb_input *input)
|
||||
{
|
||||
struct i2c_adapter *i2c = &input->port->i2c->adap;
|
||||
@@ -1246,6 +1264,7 @@ static int tuner_attach_tda18271(struct ddb_input *input)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int tuner_attach_tda18212dd(struct ddb_input *input)
|
||||
{
|
||||
@@ -1530,7 +1549,9 @@ static void dvb_input_detach(struct ddb_input *input)
|
||||
dvb_netstream_release(&dvb->dvbns);
|
||||
fallthrough;
|
||||
case 0x20:
|
||||
#ifdef CONFIG_DVB_NET
|
||||
dvb_net_release(&dvb->dvbnet);
|
||||
#endif
|
||||
fallthrough;
|
||||
case 0x12:
|
||||
dvbdemux->dmx.remove_frontend(&dvbdemux->dmx,
|
||||
@@ -1709,9 +1730,11 @@ static int dvb_input_attach(struct ddb_input *input)
|
||||
return ret;
|
||||
dvb->attached = 0x12;
|
||||
|
||||
#ifdef CONFIG_DVB_NET
|
||||
ret = dvb_net_init(adap, &dvb->dvbnet, dvb->dmxdev.demux);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
#endif
|
||||
dvb->attached = 0x20;
|
||||
|
||||
if (input->port->dev->ns_num) {
|
||||
@@ -2648,10 +2671,6 @@ static void ddb_ports_init(struct ddb *dev)
|
||||
if (!rm)
|
||||
continue;
|
||||
ports = info->port_num;
|
||||
if ((l == 0) && (info->type == DDB_MOD) &&
|
||||
(dev->link[0].ids.revision == 1)) {
|
||||
ports = ddbreadl(dev, 0x260) >> 24;
|
||||
}
|
||||
for (i = 0; i < ports; i++, p++) {
|
||||
port = &dev->port[p];
|
||||
port->dev = dev;
|
||||
@@ -2720,10 +2739,12 @@ static void ddb_ports_init(struct ddb *dev)
|
||||
ddb_input_init(port, 2 * i + 1, 1, 2 * p + 1);
|
||||
break;
|
||||
case DDB_MOD:
|
||||
#ifndef CONFIG_MACH_OCTONET
|
||||
ddb_output_init(port, i);
|
||||
ddb_irq_set(dev, 0, i + rm->irq_base_rate,
|
||||
&ddbridge_mod_rate_handler,
|
||||
&dev->output[i]);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -4429,6 +4450,41 @@ static int ddb_init_boards(struct ddb *dev)
|
||||
(link->ids.revision == 1)))
|
||||
mci_init(link);
|
||||
}
|
||||
if (l)
|
||||
continue;
|
||||
if (dev->link[0].info->type == DDB_MOD &&
|
||||
dev->link[0].info->version == 2) {
|
||||
u32 lic = ddbreadl(dev, 0x1c) & 7;
|
||||
|
||||
if (dev->link[0].ids.revision == 1)
|
||||
lic = ddbreadl(dev, 0x260) >> 24;
|
||||
|
||||
switch (lic) {
|
||||
case 0:
|
||||
case 4:
|
||||
dev->link[0].info =
|
||||
get_ddb_info(0xdd01, 0x0210, 0xdd01, 0x0000);
|
||||
break;
|
||||
case 1:
|
||||
case 8:
|
||||
dev->link[0].info =
|
||||
get_ddb_info(0xdd01, 0x0210, 0xdd01, 0x0003);
|
||||
break;
|
||||
case 2:
|
||||
case 24:
|
||||
dev->link[0].info =
|
||||
get_ddb_info(0xdd01, 0x0210, 0xdd01, 0x0001);
|
||||
break;
|
||||
case 3:
|
||||
case 16:
|
||||
dev->link[0].info =
|
||||
get_ddb_info(0xdd01, 0x0210, 0xdd01, 0x0002);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
dev_info(dev->dev, "Modulator channels: %u\n", dev->link[0].info->port_num);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -4455,8 +4511,10 @@ int ddb_init(struct ddb *dev)
|
||||
if (ddb_i2c_init(dev) < 0)
|
||||
goto fail;
|
||||
ddb_ports_init(dev);
|
||||
#ifndef CONFIG_MACH_OCTONET
|
||||
if (dev->link[0].info->type == DDB_MOD)
|
||||
ddbridge_mod_init(dev);
|
||||
#endif
|
||||
if (ddb_buffers_alloc(dev) < 0) {
|
||||
dev_info(dev->dev,
|
||||
"Could not allocate buffer memory\n");
|
||||
|
@@ -570,6 +570,17 @@ static const struct ddb_info ddb_mod_fsm_4 = {
|
||||
.lostlock_irq = 9,
|
||||
};
|
||||
|
||||
static const struct ddb_info ddb_mod_fsm = {
|
||||
.type = DDB_MOD,
|
||||
.name = "Digital Devices DVB-C FSM",
|
||||
.version = 2,
|
||||
.regmap = &octopus_mod_2_map,
|
||||
.port_num = 0,
|
||||
.temp_num = 1,
|
||||
.tempmon_irq = 8,
|
||||
.lostlock_irq = 9,
|
||||
};
|
||||
|
||||
static const struct ddb_info ddb_sdr_atv = {
|
||||
.type = DDB_MOD,
|
||||
.name = "Digital Devices SDR ATV",
|
||||
@@ -873,6 +884,7 @@ static const struct ddb_device_id ddb_device_ids[] = {
|
||||
DDB_DEVID(0x0201, 0x0002, ddb_mod),
|
||||
DDB_DEVID(0x0201, 0x0004, ddb_mod_4), /* dummy entry ! */
|
||||
DDB_DEVID(0x0203, 0x0001, ddb_mod),
|
||||
DDB_DEVID(0x0210, 0x0004, ddb_mod_fsm), /* dummy entry ! */
|
||||
DDB_DEVID(0x0210, 0x0000, ddb_mod_fsm_4), /* dummy entry ! */
|
||||
DDB_DEVID(0x0210, 0x0001, ddb_mod_fsm_24),
|
||||
DDB_DEVID(0x0210, 0x0002, ddb_mod_fsm_16),
|
||||
|
@@ -84,7 +84,7 @@ int pci_irq_vector(struct pci_dev *dev, unsigned int nr)
|
||||
/****************************************************************************/
|
||||
/****************************************************************************/
|
||||
|
||||
static void __devexit ddb_irq_disable(struct ddb *dev)
|
||||
static void ddb_irq_disable(struct ddb *dev)
|
||||
{
|
||||
if (dev->link[0].info->regmap->irq_version == 2) {
|
||||
ddbwritel(dev, 0x00000000, INTERRUPT_V2_CONTROL);
|
||||
@@ -114,7 +114,7 @@ static void __devexit ddb_msi_exit(struct ddb *dev)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void __devexit ddb_irq_exit(struct ddb *dev)
|
||||
static void ddb_irq_exit(struct ddb *dev)
|
||||
{
|
||||
ddb_irq_disable(dev);
|
||||
if (dev->msi == 2)
|
||||
@@ -283,11 +283,17 @@ static int __devinit ddb_probe(struct pci_dev *pdev,
|
||||
|
||||
pci_set_master(pdev);
|
||||
|
||||
#if (KERNEL_VERSION(5, 18, 0) <= LINUX_VERSION_CODE)
|
||||
if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)))
|
||||
if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)))
|
||||
#else
|
||||
if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
|
||||
pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
|
||||
} else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
|
||||
pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
|
||||
} else return -ENODEV;
|
||||
} else
|
||||
#endif
|
||||
return -ENODEV;
|
||||
|
||||
dev = vzalloc(sizeof(*dev));
|
||||
if (!dev)
|
||||
@@ -333,7 +339,7 @@ static int __devinit ddb_probe(struct pci_dev *pdev,
|
||||
u32 min = dev->link[0].info->hw_min;
|
||||
|
||||
dev_err(dev->dev, "Update firmware to at least version %u.%u to ensure full functionality!\n",
|
||||
(min & 0xff0000) >> 16, min & 0xffff);
|
||||
(min & 0xff0000) >> 16, min & 0xffff);
|
||||
}
|
||||
|
||||
if (dev->link[0].info->ns_num) {
|
||||
@@ -344,45 +350,22 @@ static int __devinit ddb_probe(struct pci_dev *pdev,
|
||||
if (dev->link[0].info->type != DDB_MOD)
|
||||
ddbwritel(dev, 0, DMA_BASE_WRITE);
|
||||
|
||||
if (dev->link[0].info->type == DDB_MOD
|
||||
&& dev->link[0].info->version <= 1) {
|
||||
if (dev->link[0].info->type == DDB_MOD &&
|
||||
dev->link[0].info->version <= 1) {
|
||||
if (ddbreadl(dev, 0x1c) == 4)
|
||||
dev->link[0].info =
|
||||
get_ddb_info(0xdd01, 0x0201, 0xdd01, 0x0004);
|
||||
}
|
||||
if (dev->link[0].info->type == DDB_MOD
|
||||
&& dev->link[0].info->version == 2) {
|
||||
u32 lic = ddbreadl(dev, 0x1c) & 7;
|
||||
|
||||
if (dev->link[0].info->type == DDB_MOD &&
|
||||
dev->link[0].info->version == 2) {
|
||||
if (dev->link[0].ids.revision == 1)
|
||||
lic = ddbreadl(dev, 0x260) >> 24;
|
||||
|
||||
switch (lic) {
|
||||
case 0:
|
||||
case 4:
|
||||
dev->link[0].info =
|
||||
get_ddb_info(0xdd01, 0x0210, 0xdd01, 0x0000);
|
||||
break;
|
||||
case 1:
|
||||
case 8:
|
||||
dev->link[0].info =
|
||||
get_ddb_info(0xdd01, 0x0210, 0xdd01, 0x0003);
|
||||
break;
|
||||
case 2:
|
||||
case 24:
|
||||
dev->link[0].info =
|
||||
get_ddb_info(0xdd01, 0x0210, 0xdd01, 0x0001);
|
||||
break;
|
||||
case 3:
|
||||
case 16:
|
||||
dev->link[0].info =
|
||||
get_ddb_info(0xdd01, 0x0210, 0xdd01, 0x0002);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
dev->link[0].info = get_ddb_info(0xdd01, 0x0210, 0xdd01, 0x0004);
|
||||
else if ((ddbreadl(dev, 0x1c) & 7) != 7)
|
||||
dev->link[0].info = get_ddb_info(0xdd01, 0x0210, 0xdd01, 0x0004);
|
||||
}
|
||||
dev_info(dev->dev, "device name: %s\n", dev->link[0].info->name);
|
||||
|
||||
dev_info(dev->dev, "%s\n", dev->link[0].info->name);
|
||||
dev_info(dev->dev, "HW %08x REGMAP %08x FW %u.%u\n",
|
||||
dev->link[0].ids.hwid, dev->link[0].ids.regmapid,
|
||||
(dev->link[0].ids.hwid & 0xff0000) >> 16,
|
||||
@@ -452,7 +435,6 @@ static const struct pci_device_id ddb_id_table[] __devinitconst = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, ddb_id_table);
|
||||
|
||||
|
||||
static pci_ers_result_t ddb_pci_slot_reset(struct pci_dev *dev)
|
||||
{
|
||||
pr_info("pci_slot_reset\n");
|
||||
@@ -492,7 +474,6 @@ static const struct pci_error_handlers ddb_error = {
|
||||
.resume = ddb_pci_resume,
|
||||
};
|
||||
|
||||
|
||||
static struct pci_driver ddb_pci_driver = {
|
||||
.name = "ddbridge",
|
||||
.id_table = ddb_id_table,
|
||||
|
@@ -134,6 +134,8 @@ int ddb_mci_cmd_link(struct ddb_link *link,
|
||||
struct mci_result res;
|
||||
int stat;
|
||||
|
||||
if (!link->mci_ok)
|
||||
return -EFAULT;
|
||||
if (!result)
|
||||
result = &res;
|
||||
mutex_lock(&link->mci_lock);
|
||||
@@ -294,6 +296,8 @@ void ddb_mci_proc_info(struct mci *mci, struct dtv_frontend_properties *p)
|
||||
|
||||
p->frequency =
|
||||
mci->signal_info.dvbs2_signal_info.frequency;
|
||||
p->symbol_rate =
|
||||
mci->signal_info.dvbs2_signal_info.symbol_rate;
|
||||
switch (p->delivery_system) {
|
||||
default:
|
||||
case SYS_DVBS:
|
||||
@@ -338,6 +342,8 @@ void ddb_mci_proc_info(struct mci *mci, struct dtv_frontend_properties *p)
|
||||
break;
|
||||
}
|
||||
case SYS_DVBC_ANNEX_A:
|
||||
p->modulation =
|
||||
mci->signal_info.dvbc_signal_info.constellation + 1;
|
||||
break;
|
||||
case SYS_DVBT:
|
||||
break;
|
||||
|
@@ -101,6 +101,8 @@
|
||||
|
||||
#define MCI_STATUS_OK (0x00)
|
||||
#define MCI_STATUS_UNSUPPORTED (0x80)
|
||||
#define MCI_STATUS_BUSY (0xFA)
|
||||
#define MCI_STATUS_HARDWARE_ERROR (0xFB)
|
||||
#define MCI_STATUS_INVALID_PARAMETER (0xFC)
|
||||
#define MCI_STATUS_RETRY (0xFD)
|
||||
#define MCI_STATUS_NOT_READY (0xFE)
|
||||
|
@@ -195,6 +195,48 @@ static int mod_calc_obitrate(struct ddb_mod *mod)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mod_set_stream(struct ddb_output *output)
|
||||
{
|
||||
struct ddb *dev = output->port->dev;
|
||||
u32 stream = output->nr;
|
||||
struct ddb_mod *mod = &dev->mod[output->nr];
|
||||
struct ddb_link *link = &dev->link[0];
|
||||
struct mci_result res;
|
||||
u32 channel;
|
||||
struct mci_command cmd = {
|
||||
.mod_command = MOD_SETUP_STREAM,
|
||||
.mod_channel = stream,
|
||||
.mod_stream = stream,
|
||||
.mod_setup_stream = {
|
||||
.standard = MOD_STANDARD_DVBC_8,
|
||||
.symbol_rate = mod->symbolrate,
|
||||
.qam = {
|
||||
.modulation = mod->modulation - 1,
|
||||
.rolloff = 13,
|
||||
}
|
||||
},
|
||||
};
|
||||
if (dev->link[0].info->version != 2)
|
||||
return 0;
|
||||
if (dev->link[0].ids.revision != 1)
|
||||
return 0;
|
||||
if ((dev->link[0].ids.hwid & 0xffffff) < 9065)
|
||||
return 0;
|
||||
if (!mod->frequency && !mod->symbolrate && !mod->modulation)
|
||||
return 0;
|
||||
|
||||
if (mod->frequency)
|
||||
channel = (mod->frequency - 114000000) / 8000000;
|
||||
if (!mod->symbolrate)
|
||||
mod->symbolrate = 6900000;
|
||||
if (!mod->modulation)
|
||||
mod->modulation = 5;
|
||||
cmd.mod_channel = channel;
|
||||
cmd.mod_setup_stream.symbol_rate = mod->symbolrate;
|
||||
cmd.mod_setup_stream.qam.modulation = mod->modulation - 1;
|
||||
return ddb_mci_cmd_link(link, &cmd, &res);
|
||||
}
|
||||
|
||||
static int mod_set_symbolrate(struct ddb_mod *mod, u32 srate)
|
||||
{
|
||||
struct ddb *dev = mod->port->dev;
|
||||
@@ -210,6 +252,7 @@ static int mod_set_symbolrate(struct ddb_mod *mod, u32 srate)
|
||||
}
|
||||
mod->symbolrate = srate;
|
||||
mod_calc_obitrate(mod);
|
||||
mod_set_stream(mod->port->output);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -227,6 +270,7 @@ static int mod_set_modulation(struct ddb_mod *mod,
|
||||
ddbwritel(dev, qamtab[modulation],
|
||||
CHANNEL_SETTINGS(mod->port->nr));
|
||||
mod_calc_obitrate(mod);
|
||||
mod_set_stream(mod->port->output);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -241,6 +285,7 @@ static int mod_set_frequency(struct ddb_mod *mod, u32 frequency)
|
||||
if ((freq < 114) || (freq > 874))
|
||||
return -EINVAL;
|
||||
mod->frequency = frequency;
|
||||
mod_set_stream(mod->port->output);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -330,13 +375,19 @@ int ddbridge_mod_output_start(struct ddb_output *output)
|
||||
u32 LF = 9000000UL;
|
||||
u32 d = gcd(KF, LF);
|
||||
u32 checkLF;
|
||||
#if 0
|
||||
if (dev->link[0].ids.revision == 1) {
|
||||
mod->Control |= CHANNEL_CONTROL_ENABLE_DVB;
|
||||
return -EINVAL;
|
||||
break;
|
||||
|
||||
if ((dev->link[0].ids.revision == 1)) {
|
||||
if ((dev->link[0].info->version == 2)) {
|
||||
if ((dev->link[0].ids.hwid & 0xffffff) >= 9065) {
|
||||
mod->Control |= CHANNEL_CONTROL_ENABLE_DVB;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
mod->Control |= CHANNEL_CONTROL_ENABLE_DVB;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
ddbwritel(dev, mod->modulation - 1, CHANNEL_SETTINGS(Channel));
|
||||
ddbwritel(dev, Output, CHANNEL_SETTINGS2(Channel));
|
||||
|
||||
@@ -643,7 +694,7 @@ static int mod_set_attenuator(struct ddb *dev, u32 Value)
|
||||
.mod_stream = 0,
|
||||
.mod_setup_output = {
|
||||
.connector = MOD_CONNECTOR_F,
|
||||
.num_channels = 24,
|
||||
.num_channels = dev->link[0].info->port_num,
|
||||
.unit = MOD_UNIT_DBUV,
|
||||
.channel_power = 9000 - Value * 100,
|
||||
},
|
||||
@@ -1787,7 +1838,8 @@ int ddbridge_mod_do_ioctl(struct file *file, unsigned int cmd, void *parg)
|
||||
(struct dtv_properties __user *) parg;
|
||||
int i, ret = 0;
|
||||
|
||||
if (dev->link[0].info->version >= 16 && cmd != FE_SET_PROPERTY)
|
||||
if (dev->link[0].info->version >= 16 &&
|
||||
(cmd != FE_SET_PROPERTY && cmd != IOCTL_DDB_MCI_CMD))
|
||||
return -EINVAL;
|
||||
mutex_lock(&dev->ioctl_mutex);
|
||||
switch (cmd) {
|
||||
@@ -2124,6 +2176,8 @@ int ddbridge_mod_init(struct ddb *dev)
|
||||
case 1:
|
||||
return mod_init_1(dev, 722000000);
|
||||
case 2: /* FSM */
|
||||
if ((dev->link[0].ids.hwid & 0xffffff) >= 9065)
|
||||
return mod_init_2_1(dev, 114000000);
|
||||
return mod_init_2(dev, 114000000);
|
||||
case 16: /* PAL */
|
||||
return mod_init_3(dev, 503250000);
|
||||
|
@@ -260,8 +260,8 @@
|
||||
#define LNB_CMD_DISEQC 6
|
||||
#define LNB_CMD_SCIF 7
|
||||
|
||||
#define LNB_BUSY BIT_ULL(4)
|
||||
#define LNB_TONE BIT_ULL(15)
|
||||
#define LNB_BUSY (1ULL << 4)
|
||||
#define LNB_TONE (1ULL << 15)
|
||||
|
||||
#define LNB_INTERRUPT_BASE 4
|
||||
|
||||
|
@@ -479,6 +479,9 @@ static int dvb_dmxdev_ts_callback(const u8 *buffer1, size_t buffer1_len,
|
||||
u32 *buffer_flags)
|
||||
{
|
||||
struct dmxdev_filter *dmxdevfilter = feed->priv;
|
||||
#ifdef CONFIG_DVB_MMAP
|
||||
struct dvb_vb2_ctx *ctx;
|
||||
#endif
|
||||
struct dvb_ringbuffer *buffer;
|
||||
int ret;
|
||||
|
||||
|
@@ -1282,8 +1282,11 @@ static int dvb_net_set_mac (struct net_device *dev, void *p)
|
||||
struct dvb_net_priv *priv = netdev_priv(dev);
|
||||
struct sockaddr *addr=p;
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0))
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
|
||||
#else
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
#endif
|
||||
if (netif_running(dev))
|
||||
schedule_work(&priv->restart_net_feed_wq);
|
||||
|
||||
@@ -1381,8 +1384,11 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype)
|
||||
dvbnet->dvbdev->adapter->num, if_num);
|
||||
|
||||
net->addr_len = 6;
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0))
|
||||
memcpy(net->dev_addr, dvbnet->dvbdev->adapter->proposed_mac, 6);
|
||||
|
||||
#else
|
||||
eth_hw_addr_set(net, dvbnet->dvbdev->adapter->proposed_mac);
|
||||
#endif
|
||||
dvbnet->device[if_num] = net;
|
||||
|
||||
priv = netdev_priv(net);
|
||||
|
@@ -391,7 +391,9 @@ ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t*
|
||||
idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size;
|
||||
}
|
||||
|
||||
consumed = (idx - rbuf->pread) % rbuf->size;
|
||||
consumed = idx - rbuf->pread;
|
||||
if (consumed < 0)
|
||||
consumed += rbuf->size;
|
||||
|
||||
while((dvb_ringbuffer_avail(rbuf) - consumed) > DVB_RINGBUFFER_PKTHDRSIZE) {
|
||||
|
||||
|
@@ -1,3 +1,11 @@
|
||||
#include <linux/version.h>
|
||||
|
||||
#if (KERNEL_VERSION(3, 8, 0) <= LINUX_VERSION_CODE)
|
||||
#define __devexit
|
||||
#define __devinit
|
||||
#define __devinitconst
|
||||
#endif
|
||||
|
||||
#ifndef __has_attribute
|
||||
#define __has_attribute(x) 0
|
||||
#endif
|
||||
|
@@ -329,7 +329,7 @@ static void calc_lq(struct dddvb_fe *fe)
|
||||
{
|
||||
struct dtv_fe_stats st;
|
||||
int64_t str, snr;
|
||||
uint32_t mod, fec, ber_num, ber_den, trans, pilot = 0, quality = 0, freq;
|
||||
uint32_t mod, fec, ber_num, ber_den, trans, pilot = 0, quality = 0, freq, rate;
|
||||
|
||||
get_property(fe->fd, DTV_TRANSMISSION_MODE, &fe->pls_code);
|
||||
dbgprintf(DEBUG_DVB, "fe%d: pls=0x%02x\n", fe->nr, fe->pls_code);
|
||||
@@ -362,15 +362,15 @@ static void calc_lq(struct dddvb_fe *fe)
|
||||
dbgprintf(DEBUG_DVB, "fe%d: snr=%lld ber=%llu/%llu\n",
|
||||
fe->nr, snr, ber_num, ber_den);
|
||||
dbgprintf(DEBUG_DVB, "fe%d: fec=%u mod=%u\n", fe->nr, fec, mod);
|
||||
get_property(fe->fd, DTV_FREQUENCY, &freq);
|
||||
dbgprintf(DEBUG_DVB, "fe%d: actual frequency=%u\n", fe->nr, freq);
|
||||
get_property(fe->fd, DTV_SYMBOL_RATE, &rate);
|
||||
dbgprintf(DEBUG_DVB, "fe%d: actual symbol rate=%u\n", fe->nr, rate);
|
||||
switch (fe->n_param.param[PARAM_MSYS]) {
|
||||
case SYS_DVBS:
|
||||
get_property(fe->fd, DTV_FREQUENCY, &freq);
|
||||
dbgprintf(DEBUG_DVB, "fe%d: actual frequency=%u\n", fe->nr, freq);
|
||||
quality = dvbsq(snr, fec, ber_num, ber_den);
|
||||
break;
|
||||
case SYS_DVBS2:
|
||||
get_property(fe->fd, DTV_FREQUENCY, &freq);
|
||||
dbgprintf(DEBUG_DVB, "fe%d: actual frequency=%u\n", fe->nr, freq);
|
||||
quality = dvbs2q(snr, fec, mod, ber_num, ber_den);
|
||||
break;
|
||||
case SYS_DVBC_ANNEX_A:
|
||||
|
Reference in New Issue
Block a user