Browse Source

new dddvb-dkms - uploaded2-3-base-testing-PPA

mango 8 months ago
parent
commit
90d7be7d90
100 changed files with 38291 additions and 0 deletions
  1. 1
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/.pc/.quilt_patches
  2. 1
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/.pc/.quilt_series
  3. 1
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/.pc/.version
  4. 0
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/.pc/applied-patches
  5. 27
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/Makefile
  6. 295
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/common.postinst
  7. 196
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/CHANGELOG
  8. 339
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/COPYING.GPLv2
  9. 7
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/Kbuild
  10. 26
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/Makefile
  11. 17
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/README.md
  12. 20
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/Makefile
  13. 206
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/cit.c
  14. 61
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/citin.c
  15. 55
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/citout.c
  16. 1
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/ddflash.c
  17. 1
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/ddtest.c
  18. 1
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/flash.c
  19. 1
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/flash.h
  20. 354
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/flashprog.c
  21. 36
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/modt.c
  22. 20
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/octonet/Makefile
  23. 747
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/octonet/ddflash.c
  24. 1584
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/octonet/ddtest.c
  25. 625
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/octonet/flash.c
  26. 65
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/octonet/flash.h
  27. 68
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/octonet/ns.h
  28. 37
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/octonet/octokey.c
  29. 83
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/octonet/octonet.c
  30. 167
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/pls.c
  31. 33
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/setmod.c
  32. 47
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/setmod2.c
  33. 83
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/setmod3.c
  34. 11
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/Kbuild
  35. 46
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/Kconfig
  36. 14
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/Makefile
  37. 14
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/Makefile.kernel
  38. 345
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-ci.c
  39. 4655
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-core.c
  40. 819
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-hw.c
  41. 223
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-i2c.c
  42. 114
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-i2c.h
  43. 178
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-io.c
  44. 97
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-io.h
  45. 521
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-m4.c
  46. 474
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-main.c
  47. 526
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-max.c
  48. 377
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-mci.c
  49. 763
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-mci.h
  50. 1903
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-modulator.c
  51. 491
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-ns.c
  52. 645
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-regs.h
  53. 518
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge-sx8.c
  54. 572
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/ddbridge.h
  55. 169
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddbridge/octonet-main.c
  56. 5
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddip/Kbuild
  57. 18
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddip/Makefile
  58. 24
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/ddip/ddip.c
  59. 70
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dkms.conf
  60. 7
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/docs/adapter_alloc
  61. 104
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/docs/bbframes
  62. 51
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/docs/ci
  63. 130
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/docs/modulator
  64. 89
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/docs/octopusnet
  65. 104
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/docs/octopusnet.multicast
  66. 9
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/docs/octopusnetpro
  67. 30
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/docs/redirect
  68. 42
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/Kconfig
  69. 12
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/Makefile
  70. 12
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/Makefile.kernel
  71. 589
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/demux.h
  72. 1292
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dmxdev.c
  73. 115
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dmxdev.h
  74. 1973
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_ca_en50221.c
  75. 142
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_ca_en50221.h
  76. 1298
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_demux.c
  77. 145
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_demux.h
  78. 603
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_filter.c
  79. 246
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_filter.h
  80. 2822
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_frontend.c
  81. 817
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_frontend.h
  82. 141
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_math.c
  83. 66
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_math.h
  84. 1651
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_net.c
  85. 63
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_net.h
  86. 259
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_netstream.c
  87. 93
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_netstream.h
  88. 425
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_ringbuffer.c
  89. 280
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvb_ringbuffer.h
  90. 989
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvbdev.c
  91. 322
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/dvb-core/dvbdev.h
  92. 838
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/frontends/Kconfig
  93. 38
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/frontends/Makefile
  94. 123
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/frontends/Makefile.kernel
  95. 787
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/frontends/cxd2099.c
  96. 53
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/frontends/cxd2099.h
  97. 2693
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/frontends/cxd2843.c
  98. 31
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/frontends/cxd2843.h
  99. 10
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/frontends/drxk.h
  100. 0
    0
      d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/frontends/drxk_a3.mc

+ 1
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/.pc/.quilt_patches View File

@@ -0,0 +1 @@
1
+debian/patches

+ 1
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/.pc/.quilt_series View File

@@ -0,0 +1 @@
1
+series

+ 1
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/.pc/.version View File

@@ -0,0 +1 @@
1
+2

+ 0
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/.pc/applied-patches View File


+ 27
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/Makefile View File

@@ -0,0 +1,27 @@
1
+#/usr/bin/make
2
+SRC = $(DESTDIR)/usr/src
3
+SHARE = $(DESTDIR)/usr/share/$(NAME)-dkms
4
+
5
+all:
6
+
7
+clean:
8
+
9
+install:
10
+
11
+#source tree
12
+ifeq ("$(wildcard $(NAME)-$(VERSION))", "$(NAME)-$(VERSION)")
13
+	install -d "$(SRC)"
14
+	cp -a $(NAME)-$(VERSION) $(SRC)
15
+endif
16
+
17
+#tarball, possibly with binaries
18
+ifeq ("$(wildcard $(NAME)-$(VERSION).dkms.tar.gz)", "$(NAME)-$(VERSION).dkms.tar.gz")
19
+	install -d "$(SHARE)"
20
+	install -m 644 $(NAME)-$(VERSION).dkms.tar.gz "$(SHARE)"
21
+endif
22
+
23
+#postinst, only if we are supporting legacy mode
24
+ifeq ("$(wildcard common.postinst)", "common.postinst")
25
+	install -d "$(SHARE)"
26
+	install -m 755 $(PREFIX)/usr/lib/dkms/common.postinst $(SHARE)/postinst
27
+endif

+ 295
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/common.postinst View File

@@ -0,0 +1,295 @@
1
+#!/bin/sh
2
+# Copyright (C) 2002-2005 Flavio Stanchina
3
+# Copyright (C) 2005-2006 Aric Cyr
4
+# Copyright (C) 2007 Mario Limonciello
5
+# Copyright (C) 2009 Alberto Milone
6
+
7
+set -e
8
+
9
+uname_s=$(uname -s)
10
+
11
+_get_kernel_dir() {
12
+    KVER=$1
13
+    case ${uname_s} in
14
+	Linux)		DIR="/lib/modules/$KVER/build" ;;
15
+	GNU/kFreeBSD)	DIR="/usr/src/kfreebsd-headers-$KVER/sys" ;;
16
+    esac
17
+    echo $DIR
18
+}
19
+
20
+_check_kernel_dir() {
21
+    DIR=$(_get_kernel_dir $1)
22
+    case ${uname_s} in
23
+	Linux)		test -e $DIR/include ;;
24
+	GNU/kFreeBSD)	test -e $DIR/kern && test -e $DIR/conf/kmod.mk ;;
25
+	*)		return 1 ;;
26
+    esac
27
+    return $?
28
+}
29
+
30
+# Check the existence of a kernel named as $1
31
+_is_kernel_name_correct() {
32
+    CORRECT="no"
33
+    KERNEL_NAME=$1
34
+
35
+    for kernel in /boot/config-*; do
36
+        KERNEL=${kernel#*-}
37
+        if [ "${KERNEL}" = "${KERNEL_NAME}" ]; then
38
+            CORRECT="yes"
39
+            break
40
+        fi
41
+    done
42
+
43
+    echo $CORRECT
44
+}
45
+
46
+
47
+# Get the most recent kernel on Debian based systems. This keeps
48
+# into account both the version and the ABI. If the current kernel
49
+# is the most recent kernel then the function will print a null string.
50
+_get_newest_kernel_debian() {
51
+    NEWEST_KERNEL=
52
+    NEWEST_VERSION=
53
+    NEWEST_ABI=
54
+
55
+    for kernel in /boot/config-*; do
56
+        KERNEL=${kernel#*-}
57
+        KERNEL_VERSION=${KERNEL%%-*}
58
+        ABI=${KERNEL#*-}
59
+        ABI=${ABI%%-*}
60
+
61
+        if [ -z "$NEWEST_KERNEL" ]; then
62
+            # The 1st time get a version which is bigger than $1
63
+            COMPARE_TO=$1
64
+        else
65
+            # Get the biggest version
66
+            COMPARE_TO="$NEWEST_VERSION-$NEWEST_ABI"
67
+        fi
68
+
69
+        # if $kernel is greater than $COMPARE_TO
70
+        if [ `dpkg --compare-versions "$KERNEL_VERSION-$ABI" gt "$COMPARE_TO" && echo "yes" || \
71
+              echo "no"` = "yes" ]; then
72
+            NEWEST_KERNEL=$KERNEL
73
+            NEWEST_VERSION=$KERNEL_VERSION
74
+            NEWEST_ABI=$ABI
75
+        fi
76
+    done
77
+
78
+    echo "$NEWEST_KERNEL"
79
+}
80
+
81
+# Get the most recent kernel in Rhel based systems. If the current kernel
82
+# is the most recent kernel then the function will print a null string.
83
+_get_newest_kernel_rhel() {
84
+    NEWEST_KERNEL=
85
+
86
+    LAST_INSTALLED_KERNEL=$(rpm -q --whatprovides kernel  --last | grep kernel -m1 | cut -f1 -d' ')
87
+
88
+    LIK_FORMATTED_NAME=$(rpm -q $LAST_INSTALLED_KERNEL --queryformat="%{VERSION}-%{RELEASE}.%{ARCH}\n")
89
+
90
+    if [ `echo $LIK_FORMATTED_NAME | grep 2.6 >/dev/null` ]; then
91
+        # Fedora and Suse
92
+        NEWEST_KERNEL=$LIK_FORMATTED_NAME
93
+    else
94
+        # Hack for Mandriva where $LIK_FORMATTED_NAME is broken
95
+        LIK_NAME=$(rpm -q $LAST_INSTALLED_KERNEL --queryformat="%{NAME}\n")
96
+        LIK_TYPE=${LIK_NAME#kernel-}
97
+        LIK_TYPE=${LIK_TYPE%%-*}
98
+        LIK_STRIPPED=${LIK_NAME#kernel-}
99
+        LIK_STRIPPED=${LIK_STRIPPED#$LIK_TYPE-}
100
+        LIK_STRIPPED_BASE=${LIK_STRIPPED%%-*}
101
+        LIK_STRIPPED_END=${LIK_STRIPPED#$LIK_STRIPPED_BASE-}
102
+        LIK_FINAL=$LIK_STRIPPED_BASE-$LIK_TYPE-$LIK_STRIPPED_END
103
+
104
+        NEWEST_KERNEL=$LIK_FINAL
105
+    fi
106
+
107
+    echo $NEWEST_KERNEL
108
+}
109
+
110
+# Get the newest kernel on Debian and Rhel based systems.
111
+get_newest_kernel() {
112
+    NEWEST_KERNEL=
113
+    # Try Debian first as rpm can be installed in Debian based distros
114
+    if [ -e /usr/bin/dpkg ]; then
115
+        # If DEB based
116
+        CURRENT_KERNEL=$1
117
+        CURRENT_VERSION=${CURRENT_KERNEL%%-*}
118
+        CURRENT_ABI=${CURRENT_KERNEL#*-}
119
+        CURRENT_FLAVOUR=${CURRENT_ABI#*-}
120
+        CURRENT_ABI=${CURRENT_ABI%%-*}
121
+        NEWEST_KERNEL=$(_get_newest_kernel_debian "$CURRENT_VERSION-$CURRENT_ABI")
122
+
123
+    elif [ `which rpm >/dev/null` ]; then
124
+        # If RPM based
125
+        NEWEST_KERNEL=$(_get_newest_kernel_rhel)
126
+    fi
127
+
128
+    # Make sure that kernel name that we extracted corresponds to an installed
129
+    # kernel
130
+    if [ -n "$NEWEST_KERNEL" ] && [ `_is_kernel_name_correct $NEWEST_KERNEL` = "no" ]; then
131
+        NEWEST_KERNEL=
132
+    fi
133
+
134
+    echo $NEWEST_KERNEL
135
+}
136
+
137
+NAME=$1
138
+VERSION=$2
139
+TARBALL_ROOT=$3
140
+ARCH=$4
141
+UPGRADE=$5
142
+
143
+if [ -z "$NAME" ] || [ -z "$VERSION" ]; then
144
+    echo "Need NAME, and VERSION defined"
145
+    echo "ARCH is optional"
146
+    exit 1
147
+fi
148
+
149
+KERNELS=$(ls /lib/modules/)
150
+CURRENT_KERNEL=$(uname -r)
151
+
152
+#We never want to keep an older version side by side to prevent conflicts
153
+if [ -e "/var/lib/dkms/$NAME/$VERSION" ]; then
154
+    echo "Removing old $NAME-$VERSION DKMS files..."
155
+    dkms remove -m $NAME -v $VERSION --all
156
+fi
157
+
158
+#Load new files, by source package and by tarball
159
+if [ -f "$TARBALL_ROOT/$NAME-$VERSION.dkms.tar.gz" ]; then
160
+    if ! dkms ldtarball --archive "$TARBALL_ROOT/$NAME-$VERSION.dkms.tar.gz"; then
161
+        echo ""
162
+        echo ""
163
+        echo "Unable to load DKMS tarball $TARBALL_ROOT/$NAME-$VERSION.dkms.tar.gz."
164
+        echo "Common causes include: "
165
+        echo " - You must be using DKMS 2.1.0.0 or later to support binaries only"
166
+        echo "   distribution specific archives."
167
+        echo " - Corrupt distribution specific archive"
168
+        echo ""
169
+        echo ""
170
+        exit 2
171
+    fi
172
+elif [ -d "/usr/src/$NAME-$VERSION" ]; then
173
+    echo "Loading new $NAME-$VERSION DKMS files..."
174
+    dkms add -m $NAME -v $VERSION > /dev/null
175
+fi
176
+
177
+# On 1st installation, let us look for a directory
178
+# in /lib/modules which matches `uname -r`. If none
179
+# is found it is possible that buildd is being used
180
+# and that uname -r is giving us the name of the
181
+# kernel used by the buildd machine.
182
+#
183
+# If this is the case we try to build the kernel
184
+# module for each kernel which has a directory in
185
+# /lib/modules. Furthermore we will have to tell
186
+# DKMS which architecture it should build the module
187
+# for (e.g. if the buildd machine is using a
188
+# 2.6.24-23-xen 64bit kernel).
189
+#
190
+# NOTE: if the headers are not installed then the
191
+#       module won't be built, as usual
192
+if [ -z "$UPGRADE" ]; then
193
+    echo "First Installation: checking all kernels..."
194
+    for KERNEL in $KERNELS; do
195
+        if [ ${KERNEL} = ${CURRENT_KERNEL} ]; then
196
+            # Kernel found
197
+            KERNELS=$CURRENT_KERNEL
198
+            break
199
+        fi
200
+    done
201
+else
202
+    KERNELS=$CURRENT_KERNEL
203
+fi
204
+
205
+# Here we look for the most recent kernel so that we can
206
+# build the module for it (in addition to doing it for the
207
+# current kernel.
208
+NEWEST_KERNEL=$(get_newest_kernel "$KERNELS")
209
+
210
+# If the current kernel doesn't come from the host of a chroot
211
+if [ `_is_kernel_name_correct $CURRENT_KERNEL` = "yes" ]; then
212
+    # See if it's worth building the module for both the newest kernel
213
+    # and for the current kernel
214
+    if [ -n "$NEWEST_KERNEL" ] && [ ${CURRENT_KERNEL} != ${NEWEST_KERNEL} ]; then
215
+        echo "Building for $CURRENT_KERNEL and $NEWEST_KERNEL"
216
+        KERNELS="$CURRENT_KERNEL $NEWEST_KERNEL"
217
+    else
218
+        echo "Building only for $CURRENT_KERNEL"
219
+    fi
220
+# The current kernel is not useful as it's the host's
221
+else
222
+    echo "It is likely that $CURRENT_KERNEL belongs to a chroot's host"
223
+
224
+    # Let's use only the newest kernel
225
+    if [ -n "$NEWEST_KERNEL" ]; then
226
+        KERNELS="$NEWEST_KERNEL"
227
+        echo "Building only for $NEWEST_KERNEL"
228
+    fi
229
+fi
230
+
231
+if [ -n "$ARCH" ]; then
232
+    if which lsb_release >/dev/null && [ $(lsb_release -s -i) = "Ubuntu" ]; then
233
+        case $ARCH in
234
+            amd64)
235
+                ARCH="x86_64"
236
+                ;;
237
+            lpia|i?86)
238
+                ARCH="i686"
239
+                ;;
240
+        esac
241
+    fi
242
+    echo "Building for architecture $ARCH"
243
+    ARCH="-a $ARCH"
244
+fi
245
+
246
+for KERNEL in $KERNELS; do
247
+    dkms_status=`dkms status -m $NAME -v $VERSION -k $KERNEL $ARCH`
248
+    if [ `echo $KERNEL | grep -c "BOOT"` -gt 0 ]; then
249
+        echo ""
250
+        echo "Module build and install for $KERNEL was skipped as "
251
+        echo "it is a BOOT variant"
252
+        continue
253
+    fi
254
+
255
+
256
+    #if the module isn't yet built, try to build it
257
+    if [ `echo $dkms_status | grep -c ": built"` -eq 0 ]; then
258
+        if [ ! -L /var/lib/dkms/$NAME/$VERSION/source ]; then
259
+            echo "This package appears to be a binaries-only package"
260
+            echo " you will not be able to build against kernel $KERNEL"
261
+            echo " since the package source was not provided"
262
+            continue
263
+        fi
264
+        if _check_kernel_dir $KERNEL; then
265
+            echo "Building initial module for $KERNEL"
266
+            set +e
267
+            dkms build -m $NAME -v $VERSION -k $KERNEL $ARCH > /dev/null
268
+            case $? in
269
+            9)
270
+                set -e
271
+                echo "Skipped."
272
+                continue
273
+                ;;
274
+            0)
275
+                set -e
276
+                echo "Done."
277
+                ;;
278
+            *)
279
+                exit $?
280
+                ;;
281
+            esac
282
+            dkms_status=`dkms status -m $NAME -v $VERSION -k $KERNEL $ARCH`
283
+        else
284
+            echo "Module build for the currently running kernel was skipped since the"
285
+            echo "kernel source for this kernel does not seem to be installed."
286
+        fi
287
+    fi
288
+
289
+    #if the module is built (either pre-built or just now), install it
290
+    if [ `echo $dkms_status | grep -c ": built"` -eq 1 ] && 
291
+       [ `echo $dkms_status | grep -c ": installed"` -eq 0 ]; then
292
+        dkms install -m $NAME -v $VERSION -k $KERNEL $ARCH
293
+    fi
294
+done
295
+

+ 196
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/CHANGELOG View File

@@ -0,0 +1,196 @@
1
+0.9.29 compiles with most kernels up to 4.11.1
2
+
3
+see git commit messages for newer changes
4
+
5
+0.9.24 2016.08.03
6
+- suport new V2 modulator cards
7
+
8
+0.9.19c 2015.07.20
9
+- MAX S8:
10
+  do not turn on diseqc and tuners on init
11
+  of to save power
12
+  turn off tuners when not used
13
+- support new Octopus CI in flashprog
14
+
15
+0.9.19b 2015.06.15
16
+- fix version number
17
+- option "old_quattro=1" for old MAX S8 input numbering
18
+  new is "VL VH HL HH", old is "VL HL VH HH"
19
+- set drive strength in mxl5xx to 1 to fix problems with
20
+  8th demod
21
+
22
+0.9.19 2015.06.14
23
+- lock flash access
24
+- support serial numbers for newer cards
25
+
26
+0.9.18 2015.05.05
27
+- support GT links
28
+- fixes for mxl5xx tuning
29
+  (prevent simultaneous tuning inside 100ms)
30
+- allow dynamic fmode change
31
+
32
+0.9.18 (beta) 2015.01.24
33
+- initial support of GT links
34
+- fixes for mxl5xx tuning
35
+
36
+0.9.17 2015.01.10
37
+- support input modes for MAX S8 4/8
38
+	ddbridge parameter fmode:
39
+	fmode = 0  : demod 0 & 4 on input 0, demod 1 & 5 on input 1, etc.
40
+	             input for each frontend can be changed with ioctl DTV_INPUT
41
+	fmode = 1  : connect all lines to QUAD LNB
42
+	fmode = 2  : connect to QUATTRO LNB: input 0=V,L, 1=H,L, 2=V,H, 3=H,H
43
+	fmode = 3  : all demods on input 0
44
+	             send JESS or SCR commands from application
45
+
46
+- preparations for support of GT links
47
+
48
+0.9.16 2014.12.19
49
+- support MAX S8 4/8 production card
50
+
51
+0.9.15a 2014.07.29
52
+- last minute fixes
53
+
54
+0.9.15 2014.06.24
55
+- support MAX S8 4/8 prototype
56
+
57
+0.9.14b 2014.04.24
58
+- fix fe read lockup in cxd2843
59
+
60
+0.9.14a 2014.04.23
61
+- fix Cine S2 V7 PCIe ID
62
+
63
+0.9.14 2014.04.20
64
+- support for CineCT V7 with C2
65
+- initial support for STV0910/STV6111/LNBH25
66
+- more coding style cleanups
67
+- API changes for modulator
68
+
69
+0.9.13 2014.03.25
70
+- support for CineCT V7
71
+
72
+0.9.12 2014.02.17
73
+- support for SNR in XO2 and LED connected to XO2
74
+
75
+0.9.11 2014.02.04
76
+
77
+- kernel style cleanups
78
+- attr alloc fixes for modulator card
79
+
80
+0.9.10 2013.10.09 
81
+
82
+- Bugfixes CXD2843
83
+  support slice id
84
+
85
+0.9.9 2013.08.14
86
+
87
+- support for CXD2843 DVB-C/T/C2/T2 demod
88
+
89
+0.9.7 2013.04.15
90
+
91
+- Octopus Net complete
92
+
93
+- changes for 3.8 kernels
94
+
95
+
96
+0.9.6 2012.09.26
97
+
98
+- basic Octopus Net support
99
+
100
+
101
+0.9.5 2012.08.05
102
+
103
+- cleanup
104
+
105
+0.9.4 2012.07.11
106
+
107
+- support for new modulator bitstream 1.1
108
+
109
+0.9.3 2012.06.13
110
+
111
+- add hwid, remap attributes
112
+
113
+0.9.2 2012.06.08
114
+
115
+- fix cxd2099 address writing optmization
116
+
117
+- add setting of TS output gap size through sysfs 
118
+  gap_size = (gap_value*2)+4
119
+  bit rate = 72 Mbps * 188 / gap_size
120
+
121
+0.9.1 2012.05.01
122
+
123
+- support for reworked DVB-C modulator
124
+
125
+- support for multiple channels
126
+
127
+- move some funktions from tasklets back into 
128
+  interrupt in those cases where it is more efficient
129
+
130
+
131
+0.9.0 2012.03.05
132
+
133
+- initial support of DVB-C modulator card
134
+
135
+- rework of redirect mechanism to support modulator
136
+
137
+
138
+0.8.5 2012.01.30
139
+
140
+- init DMA_BUFFER_CONTROL before starting input/output
141
+  in case it was not stopped properly before reboot
142
+  (can only happen on cards on PCIe extensions without reset line)
143
+
144
+
145
+0.8.4 2012.01.04
146
+
147
+- support for reading bridge serial number
148
+
149
+- test code for proper start/stop of redirected streams
150
+
151
+
152
+0.8.3 2011.12.18 
153
+
154
+- add support for EEProms on 0x50
155
+
156
+- make flashprog safer to use for end users
157
+
158
+- lost of kernel coding style adjustments
159
+
160
+
161
+0.8.2 2011.10.14 
162
+
163
+- added some documentation in docs/
164
+
165
+0.8.1 2011.10.13 
166
+
167
+- signal strength and SNR for STV0367/TDA18212 combo
168
+
169
+- serial number support via sysfs
170
+
171
+
172
+0.8 2011.07.30
173
+
174
+- Support for DVB-C/T cards with stv0367 demod and TDA18212 tuner 
175
+ 
176
+- loopback TS for testing
177
+
178
+- support of octopus cards with fan, led and temperature sensors
179
+  via attributes.
180
+
181
+- redirect of TS to CI and back
182
+
183
+
184
+0.7 2011.06.14
185
+
186
+- Add IDs for new cards in ddbridge driver
187
+
188
+- Change dvb adapter allocation for ddbridge driver
189
+  Configurable with module parameter adapter_alloc:
190
+  
191
+  0 = one adapter per io (old behavior)
192
+  1 = one per tab with io present (tab connected to something)
193
+  2 = one per tab regardless of something connected or not
194
+  3 = one adapter for all devices of one card
195
+
196
+

+ 339
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/COPYING.GPLv2 View File

@@ -0,0 +1,339 @@
1
+                    GNU GENERAL PUBLIC LICENSE
2
+                       Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+                            Preamble
10
+
11
+  The licenses for most software are designed to take away your
12
+freedom to share and change it.  By contrast, the GNU General Public
13
+License is intended to guarantee your freedom to share and change free
14
+software--to make sure the software is free for all its users.  This
15
+General Public License applies to most of the Free Software
16
+Foundation's software and to any other program whose authors commit to
17
+using it.  (Some other Free Software Foundation software is covered by
18
+the GNU Lesser General Public License instead.)  You can apply it to
19
+your programs, too.
20
+
21
+  When we speak of free software, we are referring to freedom, not
22
+price.  Our General Public Licenses are designed to make sure that you
23
+have the freedom to distribute copies of free software (and charge for
24
+this service if you wish), that you receive source code or can get it
25
+if you want it, that you can change the software or use pieces of it
26
+in new free programs; and that you know you can do these things.
27
+
28
+  To protect your rights, we need to make restrictions that forbid
29
+anyone to deny you these rights or to ask you to surrender the rights.
30
+These restrictions translate to certain responsibilities for you if you
31
+distribute copies of the software, or if you modify it.
32
+
33
+  For example, if you distribute copies of such a program, whether
34
+gratis or for a fee, you must give the recipients all the rights that
35
+you have.  You must make sure that they, too, receive or can get the
36
+source code.  And you must show them these terms so they know their
37
+rights.
38
+
39
+  We protect your rights with two steps: (1) copyright the software, and
40
+(2) offer you this license which gives you legal permission to copy,
41
+distribute and/or modify the software.
42
+
43
+  Also, for each author's protection and ours, we want to make certain
44
+that everyone understands that there is no warranty for this free
45
+software.  If the software is modified by someone else and passed on, we
46
+want its recipients to know that what they have is not the original, so
47
+that any problems introduced by others will not reflect on the original
48
+authors' reputations.
49
+
50
+  Finally, any free program is threatened constantly by software
51
+patents.  We wish to avoid the danger that redistributors of a free
52
+program will individually obtain patent licenses, in effect making the
53
+program proprietary.  To prevent this, we have made it clear that any
54
+patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+  The precise terms and conditions for copying, distribution and
57
+modification follow.
58
+
59
+                    GNU GENERAL PUBLIC LICENSE
60
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+  0. This License applies to any program or other work which contains
63
+a notice placed by the copyright holder saying it may be distributed
64
+under the terms of this General Public License.  The "Program", below,
65
+refers to any such program or work, and a "work based on the Program"
66
+means either the Program or any derivative work under copyright law:
67
+that is to say, a work containing the Program or a portion of it,
68
+either verbatim or with modifications and/or translated into another
69
+language.  (Hereinafter, translation is included without limitation in
70
+the term "modification".)  Each licensee is addressed as "you".
71
+
72
+Activities other than copying, distribution and modification are not
73
+covered by this License; they are outside its scope.  The act of
74
+running the Program is not restricted, and the output from the Program
75
+is covered only if its contents constitute a work based on the
76
+Program (independent of having been made by running the Program).
77
+Whether that is true depends on what the Program does.
78
+
79
+  1. You may copy and distribute verbatim copies of the Program's
80
+source code as you receive it, in any medium, provided that you
81
+conspicuously and appropriately publish on each copy an appropriate
82
+copyright notice and disclaimer of warranty; keep intact all the
83
+notices that refer to this License and to the absence of any warranty;
84
+and give any other recipients of the Program a copy of this License
85
+along with the Program.
86
+
87
+You may charge a fee for the physical act of transferring a copy, and
88
+you may at your option offer warranty protection in exchange for a fee.
89
+
90
+  2. You may modify your copy or copies of the Program or any portion
91
+of it, thus forming a work based on the Program, and copy and
92
+distribute such modifications or work under the terms of Section 1
93
+above, provided that you also meet all of these conditions:
94
+
95
+    a) You must cause the modified files to carry prominent notices
96
+    stating that you changed the files and the date of any change.
97
+
98
+    b) You must cause any work that you distribute or publish, that in
99
+    whole or in part contains or is derived from the Program or any
100
+    part thereof, to be licensed as a whole at no charge to all third
101
+    parties under the terms of this License.
102
+
103
+    c) If the modified program normally reads commands interactively
104
+    when run, you must cause it, when started running for such
105
+    interactive use in the most ordinary way, to print or display an
106
+    announcement including an appropriate copyright notice and a
107
+    notice that there is no warranty (or else, saying that you provide
108
+    a warranty) and that users may redistribute the program under
109
+    these conditions, and telling the user how to view a copy of this
110
+    License.  (Exception: if the Program itself is interactive but
111
+    does not normally print such an announcement, your work based on
112
+    the Program is not required to print an announcement.)
113
+
114
+These requirements apply to the modified work as a whole.  If
115
+identifiable sections of that work are not derived from the Program,
116
+and can be reasonably considered independent and separate works in
117
+themselves, then this License, and its terms, do not apply to those
118
+sections when you distribute them as separate works.  But when you
119
+distribute the same sections as part of a whole which is a work based
120
+on the Program, the distribution of the whole must be on the terms of
121
+this License, whose permissions for other licensees extend to the
122
+entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+Thus, it is not the intent of this section to claim rights or contest
125
+your rights to work written entirely by you; rather, the intent is to
126
+exercise the right to control the distribution of derivative or
127
+collective works based on the Program.
128
+
129
+In addition, mere aggregation of another work not based on the Program
130
+with the Program (or with a work based on the Program) on a volume of
131
+a storage or distribution medium does not bring the other work under
132
+the scope of this License.
133
+
134
+  3. You may copy and distribute the Program (or a work based on it,
135
+under Section 2) in object code or executable form under the terms of
136
+Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+    a) Accompany it with the complete corresponding machine-readable
139
+    source code, which must be distributed under the terms of Sections
140
+    1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+    b) Accompany it with a written offer, valid for at least three
143
+    years, to give any third party, for a charge no more than your
144
+    cost of physically performing source distribution, a complete
145
+    machine-readable copy of the corresponding source code, to be
146
+    distributed under the terms of Sections 1 and 2 above on a medium
147
+    customarily used for software interchange; or,
148
+
149
+    c) Accompany it with the information you received as to the offer
150
+    to distribute corresponding source code.  (This alternative is
151
+    allowed only for noncommercial distribution and only if you
152
+    received the program in object code or executable form with such
153
+    an offer, in accord with Subsection b above.)
154
+
155
+The source code for a work means the preferred form of the work for
156
+making modifications to it.  For an executable work, complete source
157
+code means all the source code for all modules it contains, plus any
158
+associated interface definition files, plus the scripts used to
159
+control compilation and installation of the executable.  However, as a
160
+special exception, the source code distributed need not include
161
+anything that is normally distributed (in either source or binary
162
+form) with the major components (compiler, kernel, and so on) of the
163
+operating system on which the executable runs, unless that component
164
+itself accompanies the executable.
165
+
166
+If distribution of executable or object code is made by offering
167
+access to copy from a designated place, then offering equivalent
168
+access to copy the source code from the same place counts as
169
+distribution of the source code, even though third parties are not
170
+compelled to copy the source along with the object code.
171
+
172
+  4. You may not copy, modify, sublicense, or distribute the Program
173
+except as expressly provided under this License.  Any attempt
174
+otherwise to copy, modify, sublicense or distribute the Program is
175
+void, and will automatically terminate your rights under this License.
176
+However, parties who have received copies, or rights, from you under
177
+this License will not have their licenses terminated so long as such
178
+parties remain in full compliance.
179
+
180
+  5. You are not required to accept this License, since you have not
181
+signed it.  However, nothing else grants you permission to modify or
182
+distribute the Program or its derivative works.  These actions are
183
+prohibited by law if you do not accept this License.  Therefore, by
184
+modifying or distributing the Program (or any work based on the
185
+Program), you indicate your acceptance of this License to do so, and
186
+all its terms and conditions for copying, distributing or modifying
187
+the Program or works based on it.
188
+
189
+  6. Each time you redistribute the Program (or any work based on the
190
+Program), the recipient automatically receives a license from the
191
+original licensor to copy, distribute or modify the Program subject to
192
+these terms and conditions.  You may not impose any further
193
+restrictions on the recipients' exercise of the rights granted herein.
194
+You are not responsible for enforcing compliance by third parties to
195
+this License.
196
+
197
+  7. If, as a consequence of a court judgment or allegation of patent
198
+infringement or for any other reason (not limited to patent issues),
199
+conditions are imposed on you (whether by court order, agreement or
200
+otherwise) that contradict the conditions of this License, they do not
201
+excuse you from the conditions of this License.  If you cannot
202
+distribute so as to satisfy simultaneously your obligations under this
203
+License and any other pertinent obligations, then as a consequence you
204
+may not distribute the Program at all.  For example, if a patent
205
+license would not permit royalty-free redistribution of the Program by
206
+all those who receive copies directly or indirectly through you, then
207
+the only way you could satisfy both it and this License would be to
208
+refrain entirely from distribution of the Program.
209
+
210
+If any portion of this section is held invalid or unenforceable under
211
+any particular circumstance, the balance of the section is intended to
212
+apply and the section as a whole is intended to apply in other
213
+circumstances.
214
+
215
+It is not the purpose of this section to induce you to infringe any
216
+patents or other property right claims or to contest validity of any
217
+such claims; this section has the sole purpose of protecting the
218
+integrity of the free software distribution system, which is
219
+implemented by public license practices.  Many people have made
220
+generous contributions to the wide range of software distributed
221
+through that system in reliance on consistent application of that
222
+system; it is up to the author/donor to decide if he or she is willing
223
+to distribute software through any other system and a licensee cannot
224
+impose that choice.
225
+
226
+This section is intended to make thoroughly clear what is believed to
227
+be a consequence of the rest of this License.
228
+
229
+  8. If the distribution and/or use of the Program is restricted in
230
+certain countries either by patents or by copyrighted interfaces, the
231
+original copyright holder who places the Program under this License
232
+may add an explicit geographical distribution limitation excluding
233
+those countries, so that distribution is permitted only in or among
234
+countries not thus excluded.  In such case, this License incorporates
235
+the limitation as if written in the body of this License.
236
+
237
+  9. The Free Software Foundation may publish revised and/or new versions
238
+of the General Public License from time to time.  Such new versions will
239
+be similar in spirit to the present version, but may differ in detail to
240
+address new problems or concerns.
241
+
242
+Each version is given a distinguishing version number.  If the Program
243
+specifies a version number of this License which applies to it and "any
244
+later version", you have the option of following the terms and conditions
245
+either of that version or of any later version published by the Free
246
+Software Foundation.  If the Program does not specify a version number of
247
+this License, you may choose any version ever published by the Free Software
248
+Foundation.
249
+
250
+  10. If you wish to incorporate parts of the Program into other free
251
+programs whose distribution conditions are different, write to the author
252
+to ask for permission.  For software which is copyrighted by the Free
253
+Software Foundation, write to the Free Software Foundation; we sometimes
254
+make exceptions for this.  Our decision will be guided by the two goals
255
+of preserving the free status of all derivatives of our free software and
256
+of promoting the sharing and reuse of software generally.
257
+
258
+                            NO WARRANTY
259
+
260
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
262
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
266
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
267
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+REPAIR OR CORRECTION.
269
+
270
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+POSSIBILITY OF SUCH DAMAGES.
279
+
280
+                     END OF TERMS AND CONDITIONS
281
+
282
+            How to Apply These Terms to Your New Programs
283
+
284
+  If you develop a new program, and you want it to be of the greatest
285
+possible use to the public, the best way to achieve this is to make it
286
+free software which everyone can redistribute and change under these terms.
287
+
288
+  To do so, attach the following notices to the program.  It is safest
289
+to attach them to the start of each source file to most effectively
290
+convey the exclusion of warranty; and each file should have at least
291
+the "copyright" line and a pointer to where the full notice is found.
292
+
293
+    <one line to give the program's name and a brief idea of what it does.>
294
+    Copyright (C) <year>  <name of author>
295
+
296
+    This program is free software; you can redistribute it and/or modify
297
+    it under the terms of the GNU General Public License as published by
298
+    the Free Software Foundation; either version 2 of the License, or
299
+    (at your option) any later version.
300
+
301
+    This program is distributed in the hope that it will be useful,
302
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
304
+    GNU General Public License for more details.
305
+
306
+    You should have received a copy of the GNU General Public License along
307
+    with this program; if not, write to the Free Software Foundation, Inc.,
308
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+Also add information on how to contact you by electronic and paper mail.
311
+
312
+If the program is interactive, make it output a short notice like this
313
+when it starts in an interactive mode:
314
+
315
+    Gnomovision version 69, Copyright (C) year name of author
316
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+    This is free software, and you are welcome to redistribute it
318
+    under certain conditions; type `show c' for details.
319
+
320
+The hypothetical commands `show w' and `show c' should show the appropriate
321
+parts of the General Public License.  Of course, the commands you use may
322
+be called something other than `show w' and `show c'; they could even be
323
+mouse-clicks or menu items--whatever suits your program.
324
+
325
+You should also get your employer (if you work as a programmer) or your
326
+school, if any, to sign a "copyright disclaimer" for the program, if
327
+necessary.  Here is a sample; alter the names:
328
+
329
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+  <signature of Ty Coon>, 1 April 1989
333
+  Ty Coon, President of Vice
334
+
335
+This General Public License does not permit incorporating your program into
336
+proprietary programs.  If your program is a subroutine library, you may
337
+consider it more useful to permit linking proprietary applications with the
338
+library.  If this is what you want to do, use the GNU Lesser General
339
+Public License instead of this License.

+ 7
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/Kbuild View File

@@ -0,0 +1,7 @@
1
+#
2
+# Makefile for the kernel multimedia device drivers.
3
+#
4
+
5
+obj-y        := dvb-core/	\
6
+		ddbridge/       \
7
+		frontends/

+ 26
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/Makefile View File

@@ -0,0 +1,26 @@
1
+kernelver ?= $(shell uname -r)
2
+KDIR	?= /lib/modules/$(kernelver)/build
3
+PWD	:= $(shell pwd)
4
+
5
+MODDEFS := CONFIG_DVB_CORE=m CONFIG_DVB_DDBRIDGE=m CONFIG_DVB_DRXK=m CONFIG_DVB_TDA18271C2DD=m CONFIG_DVB_CXD2099=m CONFIG_DVB_LNBP21=m  CONFIG_DVB_STV090x=m CONFIG_DVB_STV6110x=m CONFIG_DVB_STV0367=m CONFIG_DVB_TDA18212=m CONFIG_DVB_STV0367DD=m CONFIG_DVB_TDA18212DD=m CONFIG_DVB_OCTONET=m CONFIG_DVB_CXD2843=m CONFIG_DVB_STV0910=m CONFIG_DVB_STV6111=m CONFIG_DVB_LNBH25=m CONFIG_DVB_MXL5XX=m CONFIG_DVB_NET=m
6
+
7
+all: 
8
+	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) $(MODDEFS) modules
9
+	$(MAKE) -C apps
10
+
11
+libdddvb:
12
+	$(MAKE) -C lib
13
+
14
+libdddvb-install:
15
+	$(MAKE) -C lib install
16
+
17
+dep:
18
+	DIR=`pwd`; (cd $(TOPDIR); make SUBDIRS=$$DIR dep)
19
+
20
+install: all
21
+	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules_install
22
+
23
+clean:
24
+	rm -rf */.*.o.d */*.o */*.ko */*.mod.c */.*.cmd .tmp_versions Module* modules*
25
+
26
+

+ 17
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/README.md View File

@@ -0,0 +1,17 @@
1
+# DDBridge Driver
2
+
3
+### Patches
4
+We can only accept patches which don't break compilation for older kernels (as far back as 2.6.37).
5
+
6
+Due to this and other changes not approved by us the kernel version of the ddbridge driver might contain
7
+incompatiblities to this driver package.
8
+
9
+### Prepare for Building
10
+
11
+   TBD
12
+  
13
+### Building
14
+
15
+   TBD
16
+  
17
+  

+ 20
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/Makefile View File

@@ -0,0 +1,20 @@
1
+all: cit citin flashprog modt ddtest setmod ddflash setmod2 pls setmod3
2
+
3
+cit: cit.c
4
+	$(CC) -o cit cit.c -lpthread
5
+
6
+modt: modt.c
7
+	$(CC) -o modt modt.c -lpthread
8
+
9
+setmod: setmod.c
10
+	$(CC) -o setmod setmod.c -I../include/
11
+
12
+setmod2: setmod2.c
13
+	$(CC) -o setmod2 setmod2.c -I../include/
14
+
15
+setmod3: setmod3.c
16
+	$(CC) -o setmod3 setmod3.c -I../include/
17
+
18
+%.o: %.c
19
+	$(CC) $(CFLAGS) -o $@ $<
20
+

+ 206
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/cit.c View File

@@ -0,0 +1,206 @@
1
+#include <stdio.h>
2
+#include <ctype.h>
3
+#include <string.h>
4
+#include <unistd.h>
5
+#include <sys/types.h>
6
+#include <sys/stat.h>
7
+#include <stdint.h>
8
+#include <stdlib.h>
9
+#include <fcntl.h>
10
+#include <sys/ioctl.h>
11
+#include <pthread.h>
12
+#include <getopt.h>
13
+
14
+uint32_t adapter = 0, device = 0, snum = 256, rnum = 256;
15
+
16
+uint8_t fill[188]={0x47, 0x1f, 0xff, 0x10,
17
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
18
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
19
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
20
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
21
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
22
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
23
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
24
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
25
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
26
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
27
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
28
+		   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff };
29
+
30
+uint8_t ts[188]={0x47, 0x0a, 0xaa, 0x00,
31
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
32
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
33
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
34
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
35
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
36
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
37
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
38
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
39
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
40
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
41
+   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
42
+		   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff };
43
+
44
+void proc_buf(uint8_t *buf, uint32_t *d)
45
+{
46
+	uint32_t c;
47
+	static uint32_t tc=0;
48
+	
49
+
50
+	if (buf[1]==0x1f && buf[2]==0xff) {
51
+		//printf("fill\n");
52
+		return;
53
+	}
54
+	if (buf[1]==0x9f && buf[2]==0xff) {
55
+		//printf("fill\n");
56
+		return;
57
+	}
58
+	if (buf[1]==0x1a && buf[2]==0xbb) {
59
+		tc++;
60
+		if (!(tc&0xfff))
61
+			printf("T %d\n", tc);
62
+		return;
63
+	}
64
+	//printf("%02x %02x %02x %02x\n", buf[0], buf[1], buf [2], buf[3]);
65
+	if (buf[1]!=0x0a || buf[2]!=0xaa)
66
+		return;
67
+	c=(buf[4]<<24)|(buf[5]<<16)|(buf[6]<<8)|buf[7];
68
+	if (c!=*d) {
69
+		printf("CONT ERROR: got %08x  expected %08x\n", c, *d);
70
+		*d=c;
71
+	} else {
72
+		if (memcmp(ts+8, buf+8, 180))
73
+			printf("error\n");
74
+		if (!(c&0xffff)) {
75
+			printf("R %08x\r", c);
76
+			fflush(0);
77
+		}
78
+	}
79
+	(*d)++;
80
+}
81
+
82
+void *get_ts(void *a)
83
+{
84
+	uint8_t *buf;
85
+	int len, off;
86
+	int fdi;
87
+	char fname[80];
88
+	uint32_t d=0;
89
+
90
+	buf = malloc(188*rnum);
91
+	if (!buf)
92
+		return NULL;
93
+	sprintf(fname, "/dev/dvb/adapter%u/ci%u", adapter, device);
94
+	printf("using %s for reading\n", fname);
95
+	fdi = open(fname, O_RDONLY);
96
+	if (fdi == -1) {
97
+		printf("Failed to open %s for read: %m\n", fname);
98
+		return NULL;
99
+	}
100
+	 
101
+	while (1) {
102
+		memset(buf, 0, 188*rnum);
103
+		len=read(fdi, buf, 188*rnum);
104
+		if (len<0)
105
+			continue;
106
+		//printf("read %u\n", len);
107
+		if (buf[0]!=0x47) {
108
+			read(fdi, buf, 1);
109
+			continue;
110
+		}
111
+		for (off=0; off<len; off+=188) {
112
+			proc_buf(buf+off, &d);
113
+		}
114
+	}	
115
+}
116
+
117
+
118
+int send(void)
119
+{
120
+	uint8_t *buf, *cts;
121
+	int i;
122
+	uint32_t c=0;
123
+	int fdo;
124
+	char fname[80];
125
+	
126
+	buf = malloc(188*snum);
127
+	if (!buf)
128
+		return -1;
129
+	sprintf(fname, "/dev/dvb/adapter%u/ci%u", adapter, device);
130
+	printf("using %s for writing\n", fname);
131
+	fdo=open(fname, O_WRONLY);
132
+	if (fdo == -1) {
133
+		printf("Failed to open %s to write: %m\n", fname);
134
+		exit(2);
135
+	}
136
+
137
+	while (1) {
138
+		for (i=0; i<snum; i++) {
139
+			cts=buf+i*188;
140
+			memcpy(cts, ts, 188);
141
+			cts[4]=(c>>24);
142
+			cts[5]=(c>>16);
143
+			cts[6]=(c>>8);
144
+			cts[7]=c;
145
+			//write(fdo, fill, 188);
146
+			//printf("S %d\n", c); 
147
+			c++;
148
+			//usleep(100000+0xffff&rand());
149
+			//usleep(1000);
150
+		}
151
+		write(fdo, buf, 188*snum);
152
+	}
153
+}
154
+
155
+
156
+int main(int argc, char **argv)
157
+{
158
+	pthread_t th;
159
+
160
+	while (1) {
161
+                int option_index = 0;
162
+		int c;
163
+                static struct option long_options[] = {
164
+			{"adapter", required_argument, 0, 'a'},
165
+			{"device", required_argument, 0, 'd'},
166
+			{"snum", required_argument, 0, 's'},
167
+			{"rnum", required_argument, 0, 'r'},
168
+			{"help", no_argument , 0, 'h'},
169
+			{0, 0, 0, 0}
170
+		};
171
+                c = getopt_long(argc, argv, 
172
+				"a:d:h",
173
+				long_options, &option_index);
174
+		if (c==-1)
175
+ 			break;
176
+		
177
+		switch (c) {
178
+		case 'd':
179
+			device = strtoul(optarg, NULL, 10);
180
+			break;
181
+		case 'a':
182
+			adapter = strtoul(optarg, NULL, 10);
183
+			break;
184
+		case 's':
185
+			snum = strtoul(optarg, NULL, 10);
186
+			break;
187
+		case 'r':
188
+			rnum = strtoul(optarg, NULL, 10);
189
+			break;
190
+		case 'h':
191
+			printf("cit -a<adapter> -d<device>\n");
192
+			exit(-1);
193
+		default:
194
+			break;
195
+			
196
+		}
197
+	}
198
+	if (optind < argc) {
199
+		printf("Warning: unused arguments\n");
200
+	}
201
+	printf("adapter %d, device: %d\n", adapter, device);
202
+	memset(ts+8, 180, 0x5a);
203
+	pthread_create(&th, NULL, get_ts, NULL);
204
+	usleep(10000);
205
+	send();
206
+}

+ 61
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/citin.c View File

@@ -0,0 +1,61 @@
1
+#include <stdio.h>
2
+#include <ctype.h>
3
+#include <string.h>
4
+#include <unistd.h>
5
+#include <sys/types.h>
6
+#include <sys/stat.h>
7
+#include <stdint.h>
8
+#include <stdlib.h>
9
+#include <fcntl.h>
10
+#include <sys/ioctl.h>
11
+#include <linux/dvb/dmx.h>
12
+#include <linux/dvb/frontend.h>
13
+#include <linux/dvb/video.h>
14
+
15
+void proc_ts(int i, uint8_t *buf)
16
+{
17
+        uint16_t pid=0x1fff&((buf[1]<<8)|buf[2]);
18
+
19
+	if (buf[3]&0xc0) /* only descrambled packets */
20
+		return;
21
+	/* only ORF */
22
+	if (pid==160 || pid==161 || pid==1001||pid==13001 || pid==0)
23
+		write(1, buf, 188);
24
+}
25
+
26
+#define TSBUFSIZE (100*188)
27
+
28
+void citest()
29
+{
30
+        uint8_t *buf;
31
+	uint8_t id;
32
+	int i, nts;
33
+	int len;
34
+	int ts=open("/dev/dvb/adapter4/ci0", O_RDONLY);
35
+	buf=(uint8_t *)malloc(TSBUFSIZE);
36
+
37
+	
38
+	while(1) {
39
+		len=read(ts, buf, TSBUFSIZE);
40
+		if (len<0) {
41
+			continue;
42
+		}
43
+		if (buf[0]!=0x47) {
44
+			read(ts, buf, 1);
45
+			continue;
46
+		}
47
+		if (len%188) { /* should not happen */
48
+			printf("blah\n");
49
+			continue;
50
+		}
51
+		nts=len/188;
52
+		for (i=0; i<nts; i++)
53
+			proc_ts(i, buf+i*188);
54
+	}
55
+}
56
+
57
+int main()
58
+{
59
+	citest();
60
+}
61
+

+ 55
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/citout.c View File

@@ -0,0 +1,55 @@
1
+#include <stdio.h>
2
+#include <ctype.h>
3
+#include <string.h>
4
+#include <unistd.h>
5
+#include <sys/types.h>
6
+#include <sys/stat.h>
7
+#include <stdint.h>
8
+#include <stdlib.h>
9
+#include <fcntl.h>
10
+#include <sys/ioctl.h>
11
+#include <linux/dvb/dmx.h>
12
+#include <linux/dvb/frontend.h>
13
+#include <linux/dvb/video.h>
14
+
15
+#define TSBUFSIZE (100*188)
16
+
17
+void citest()
18
+{
19
+        uint8_t *buf;
20
+	uint8_t id;
21
+	int i, nts;
22
+	int len;
23
+	int ts0=open("/dev/dvb/adapter0/dvr0", O_RDONLY);
24
+	int ts1=open("/dev/dvb/adapter4/sec0", O_WRONLY);
25
+	int demux0=open("/dev/dvb/adapter0/demux0", O_RDWR);
26
+
27
+	struct dmx_pes_filter_params pesFilterParams; 
28
+	
29
+	pesFilterParams.input = DMX_IN_FRONTEND; 
30
+	pesFilterParams.output = DMX_OUT_TS_TAP; 
31
+	pesFilterParams.pes_type = DMX_PES_OTHER; 
32
+	pesFilterParams.flags = DMX_IMMEDIATE_START;
33
+  
34
+	pesFilterParams.pid = 8192;
35
+	if (ioctl(demux0, DMX_SET_PES_FILTER, &pesFilterParams) < 0) {
36
+	        printf("Could not set PES filter\n"); 
37
+		return;
38
+	}
39
+	buf=(uint8_t *)malloc(TSBUFSIZE);
40
+
41
+	while(1) {
42
+		len=read(ts0, buf, TSBUFSIZE);
43
+		if (len<=0)
44
+			break;
45
+		if (buf[0]!=0x47)
46
+			printf("oops\n");
47
+		write(ts1, buf, len);
48
+	}
49
+}
50
+
51
+int main()
52
+{
53
+	citest();
54
+}
55
+

+ 1
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/ddflash.c View File

@@ -0,0 +1 @@
1
+octonet/ddflash.c

+ 1
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/ddtest.c View File

@@ -0,0 +1 @@
1
+octonet/ddtest.c

+ 1
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/flash.c View File

@@ -0,0 +1 @@
1
+./octonet/flash.c

+ 1
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/flash.h View File

@@ -0,0 +1 @@
1
+./octonet/flash.h

+ 354
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/flashprog.c View File

@@ -0,0 +1,354 @@
1
+/*
2
+/* flashprog - Programmer for flash on Digital Devices Octopus 
3
+ *
4
+ * Copyright (C) 2010-2011 Digital Devices GmbH
5
+ *
6
+ * This program is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU General Public License
8
+ * version 2 only, as published by the Free Software Foundation.
9
+ *
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20
+ * 02110-1301, USA
21
+ * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
22
+ */
23
+
24
+#include <stdio.h>
25
+#include <stdlib.h>
26
+#include <stdint.h>
27
+#include <unistd.h>
28
+#include <getopt.h>
29
+#include <sys/types.h>
30
+#include <sys/stat.h>
31
+#include <fcntl.h>
32
+#include <string.h>
33
+#include <sys/ioctl.h>
34
+#include <linux/types.h>
35
+
36
+#include "flash.h"
37
+
38
+void get_id(int ddb, struct ddb_id *ddbid) {
39
+	uint8_t id[4];
40
+
41
+	if (ioctl(ddb, IOCTL_DDB_ID, ddbid)>=0)
42
+		return;
43
+	memset(ddbid, 0, sizeof(*ddbid));
44
+	flashread(ddb, id, 0, 4);
45
+	printf("%02x %02x %02x %02x\n", 
46
+	       id[0], id[1], id[2], id[3]);
47
+	ddbid->subvendor=(id[0] << 8) | id[1];
48
+	ddbid->subdevice=(id[2] << 8) | id[3];
49
+}
50
+
51
+int sure()
52
+{
53
+	char c;
54
+
55
+	printf("\n\nWARNING! Flashing a new FPGA image might make your card unusable!\n");
56
+	printf("\n\nWARNUNG! Das Flashen eines neuen FPGA-Images kann Ihre Karte unbrauchbar machen.\n");
57
+	printf("\n\nAre you sure? y/n?");
58
+	printf("\n\nSind Sie sicher? y/n?");
59
+	fflush(0);
60
+	c = getchar();
61
+	if (c!='y') {
62
+		printf("\nFlashing aborted.\n\n");
63
+		return -1;
64
+	}
65
+	printf("\nStarting to flash\n\n");
66
+	return 0;
67
+}
68
+
69
+
70
+int main(int argc, char **argv)
71
+{
72
+	char ddbname[80];
73
+	int type = 0;
74
+	struct ddb_id ddbid;
75
+	uint8_t *buffer;
76
+	int BufferSize = 0;
77
+	int BlockErase = 0;
78
+	uint32_t FlashOffset = 0x10000;
79
+	int ddb;
80
+	int i, err;
81
+	uint32_t SectorSize=0;
82
+	uint32_t FlashSize=0;
83
+	int Flash;
84
+
85
+	uint32_t svid=0, jump=0, dump=0;
86
+	int bin;
87
+
88
+	int ddbnum = 0;
89
+	int force = 0;
90
+	char *fname = NULL;
91
+
92
+        while (1) {
93
+                int option_index = 0;
94
+		int c;
95
+                static struct option long_options[] = {
96
+			{"svid", required_argument, NULL, 's'},
97
+			{"help", no_argument , NULL, 'h'},
98
+			{"force", no_argument , NULL, 'f'},
99
+			{0, 0, 0, 0}
100
+		};
101
+                c = getopt_long(argc, argv, 
102
+				"d:n:s:o:l:dfhjb:",
103
+				long_options, &option_index);
104
+		if (c==-1)
105
+			break;
106
+
107
+		switch (c) {
108
+		case 'b':
109
+			fname = optarg;
110
+			break;
111
+		case 'd':
112
+			dump = strtoul(optarg, NULL, 16);
113
+			break;
114
+		case 's':
115
+			svid = strtoul(optarg, NULL, 16);
116
+			break;
117
+		case 'o':
118
+			FlashOffset = strtoul(optarg, NULL, 16);
119
+			break;
120
+		case 'n':
121
+			ddbnum = strtol(optarg, NULL, 0);
122
+			break;
123
+		case 'l':
124
+			linknr = strtol(optarg, NULL, 0);
125
+			break;
126
+		case 'f':
127
+			force = 1;
128
+			break;
129
+		case 'j':
130
+			jump = 1;
131
+			break;
132
+		case 'h':
133
+		default:
134
+			break;
135
+
136
+		}
137
+	}
138
+	if (optind<argc) {
139
+		printf("Warning: unused arguments\n");
140
+	}
141
+
142
+	sprintf(ddbname, "/dev/ddbridge/card%d", ddbnum);
143
+	ddb=open(ddbname, O_RDWR);
144
+	if (ddb < 0) {
145
+		printf("Could not open device\n");
146
+		return -1;
147
+	}
148
+	Flash = flashdetect(ddb, &SectorSize, &FlashSize);
149
+
150
+	get_id(ddb, &ddbid);
151
+#if 1
152
+	printf("%04x %04x %04x %04x %08x %08x\n",
153
+	       ddbid.vendor, ddbid.device,
154
+	       ddbid.subvendor, ddbid.subdevice,
155
+	       ddbid.hw, ddbid.regmap);
156
+#endif
157
+
158
+	if (dump) {
159
+		flashdump(ddb, dump, 128);
160
+		return 0;
161
+	}
162
+
163
+	if (!SectorSize)
164
+		return 0;
165
+	
166
+	if (jump) {
167
+		uint32_t Jump = 0x200000;
168
+		
169
+		BufferSize = SectorSize;
170
+		FlashOffset = FlashSize - SectorSize;
171
+		buffer = malloc(BufferSize);
172
+		if (!buffer) {
173
+			printf("out of memory\n");
174
+			return 0;
175
+		}
176
+		memset(buffer, 0xFF, BufferSize);
177
+		memset(&buffer[BufferSize - 256 + 0x10], 0x00, 16);
178
+
179
+		buffer[BufferSize - 256 + 0x10] = 0xbd;
180
+		buffer[BufferSize - 256 + 0x11] = 0xb3;
181
+		buffer[BufferSize - 256 + 0x12] = 0xc4;
182
+		buffer[BufferSize - 256 + 0x1a] = 0xfe;
183
+		buffer[BufferSize - 256 + 0x1e] = 0x03;
184
+		buffer[BufferSize - 256 + 0x1f] = ( ( Jump >> 16 ) & 0xFF );
185
+		buffer[BufferSize - 256 + 0x20] = ( ( Jump >>  8 ) & 0xFF );
186
+		buffer[BufferSize - 256 + 0x21] = ( ( Jump       ) & 0xFF );
187
+	} else if (svid) {
188
+		BufferSize = SectorSize;
189
+		FlashOffset = 0;
190
+		
191
+		buffer = malloc(BufferSize);
192
+		if (!buffer) {
193
+			printf("out of memory\n");
194
+			return 0;
195
+		}
196
+		memset(buffer,0xFF,BufferSize);
197
+		
198
+		buffer[0] = ((svid >> 24 ) & 0xFF);
199
+		buffer[1] = ((svid >> 16 ) & 0xFF);
200
+		buffer[2] = ((svid >>  8 ) & 0xFF);
201
+		buffer[3] = ((svid       ) & 0xFF);
202
+	} else {
203
+		int fh, i;
204
+		int fsize;
205
+
206
+		if (!fname) 
207
+		switch (ddbid.device) {
208
+		case 0x0002:
209
+			fname="DVBBridgeV1A_DVBBridgeV1A.bit";
210
+			printf("Octopus 35\n");
211
+			break;
212
+		case 0x0003:
213
+			fname="DVBBridgeV1B_DVBBridgeV1B.fpga";
214
+			printf("Octopus\n");
215
+			break;
216
+		case 0x0005:
217
+			fname="DVBBridgeV2A_DD01_0005_STD.fpga";
218
+			printf("Octopus Classic\n");
219
+			break;
220
+		case 0x0006:
221
+			fname="DVBBridgeV2A_DD01_0006_STD.fpga";
222
+			printf("CineS2 V7\n");
223
+			break;
224
+		case 0x0007:
225
+			fname="DVBBridgeV2A_DD01_0007_MXL.fpga";
226
+			printf("Octopus 4/8\n");
227
+			break;
228
+		case 0x0008:
229
+			fname="DVBBridgeV2A_DD01_0008_CXD.fpga";
230
+			printf("Octopus 4/8\n");
231
+			break;
232
+		case 0x0009:
233
+			fname="DVBBridgeV2A_DD01_0009_SX8.fpga";
234
+			printf("Octopus MAXSX8\n");
235
+			break;
236
+		case 0x000a:
237
+			fname="DVBBridgeV2A_DD01_000A_M4.fpga";
238
+			printf("Octopus MAXM4\n");
239
+			break;
240
+		case 0x0011:
241
+			fname="CIBridgeV1B_CIBridgeV1B.fpga";
242
+			printf("Octopus CI\n");
243
+			break;
244
+		case 0x0012:
245
+			fname="DVBBridgeV2B_DD01_0012_STD.fpga";
246
+			printf("Octopus CI\n");
247
+			break;
248
+		case 0x0013:
249
+			fname="DVBBridgeV2B_DD01_0013_PRO.fpga";
250
+			printf("Octopus PRO\n");
251
+			break;
252
+		case 0x0020:
253
+			fname="DVBBridgeV2B_DD01_0020.fpga";
254
+			printf("Octopus GT Mini\n");
255
+			break;
256
+		case 0x0201:
257
+			fname="DVBModulatorV1B_DVBModulatorV1B.bit";
258
+			printf("Modulator\n");
259
+			break;
260
+		case 0x0203:
261
+			fname="DVBModulatorV1B_DD01_0203.fpga";
262
+			printf("Modulator Test\n");
263
+			break;
264
+		case 0x0210:
265
+			fname="DVBModulatorV2A_DD01_0210.fpga";
266
+			printf("Modulator V2\n");
267
+			break;
268
+		case 0x0220:
269
+			fname="SDRModulatorV1A_DD01_0220.fpga";
270
+			printf("SDRModulator ATV\n");
271
+			break;
272
+		case 0x0221:
273
+			fname="SDRModulatorV1A_DD01_0221_IQ.fpga";
274
+			printf("SDRModulator IQ\n");
275
+			break;
276
+		default:
277
+			printf("UNKNOWN\n");
278
+			break;
279
+		}
280
+		fh = open(fname, O_RDONLY);
281
+		if (fh < 0 ) {
282
+			printf("File %s not found \n", fname);
283
+			return 0;
284
+		}
285
+		printf("Using bitstream %s\n", fname);
286
+
287
+		fsize = lseek(fh,0,SEEK_END);
288
+		if( fsize > 4000000 || fsize < SectorSize )
289
+		{
290
+			close(fh);
291
+			printf("Invalid File Size \n");
292
+			return 0;
293
+		}
294
+		
295
+		if( Flash == ATMEL_AT45DB642D ) {
296
+			BlockErase = fsize >= 8192;
297
+			if( BlockErase )
298
+				BufferSize = (fsize + 8191) & ~8191;
299
+			else
300
+				BufferSize = (fsize + 1023) & ~1023;
301
+		} else {
302
+			BufferSize = (fsize + SectorSize - 1 ) & ~(SectorSize - 1);
303
+		}
304
+		printf(" Size     %08x, target %08x\n", BufferSize, FlashOffset);
305
+		
306
+		buffer = malloc(BufferSize);
307
+
308
+		if( buffer == NULL ) {
309
+			close(fh);
310
+			printf("out of memory\n");
311
+			return 0;
312
+		}
313
+	
314
+		memset(buffer, 0xFF, BufferSize);
315
+		lseek(fh, 0, SEEK_SET);
316
+		read(fh, buffer, fsize);
317
+		close(fh);
318
+		
319
+		if (BufferSize >= 0x10000) {
320
+			for(i = 0; i < 0x200; i += 1 ) {
321
+				if ( *(uint16_t *) (&buffer[i]) == 0xFFFF )
322
+					break;
323
+				buffer[i] = 0xFF;
324
+			}
325
+		}
326
+	}
327
+	if (!force && sure()<0)
328
+		return 0;
329
+	switch(Flash) {
330
+        case ATMEL_AT45DB642D:
331
+		err = FlashWriteAtmel(ddb,FlashOffset,buffer,BufferSize);
332
+		break;
333
+        case SSTI_SST25VF016B: 
334
+        case SSTI_SST25VF032B:
335
+		err = FlashWriteSSTI_B(ddb,FlashOffset,buffer,BufferSize);
336
+		break;
337
+        case SSTI_SST25VF064C:
338
+		err = FlashWritePageMode(ddb,FlashOffset,buffer,BufferSize,0x3C);
339
+		break;
340
+        case SPANSION_S25FL116K:
341
+        case SPANSION_S25FL164K:
342
+	case WINBOND_W25Q16JV:
343
+		err = FlashWritePageMode(ddb,FlashOffset,buffer,BufferSize,0x1C);
344
+		break;            
345
+	}
346
+	
347
+	if (err < 0) 
348
+		printf("Programming Error\n");
349
+	else
350
+		printf("Programming Done\n");
351
+	
352
+	free(buffer);
353
+	return 0;
354
+}

+ 36
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/modt.c View File

@@ -0,0 +1,36 @@
1
+#include <stdio.h>
2
+#include <ctype.h>
3
+#include <string.h>
4
+#include <unistd.h>
5
+#include <sys/types.h>
6
+#include <sys/stat.h>
7
+#include <stdint.h>
8
+#include <stdlib.h>
9
+#include <fcntl.h>
10
+#include <sys/ioctl.h>
11
+#include <pthread.h>
12
+
13
+
14
+#define SNUM 1000
15
+//671
16
+void send(void)
17
+{
18
+	uint8_t buf[188*SNUM], *cts;
19
+	int i;
20
+	uint32_t c=0;
21
+	int fdo;
22
+
23
+	fdo=open("/dev/dvb/adapter0/mod0", O_WRONLY);
24
+
25
+
26
+	while (1) {
27
+		read(0, buf, sizeof(buf));
28
+		write(fdo, buf, 188*SNUM);
29
+	}
30
+}
31
+
32
+
33
+int main()
34
+{
35
+	send();
36
+}

+ 20
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/octonet/Makefile View File

@@ -0,0 +1,20 @@
1
+all: ddtest octonet octokey ddflash
2
+
3
+install: all
4
+	install -m 0755 ddtest $(DESTDIR)/usr/bin
5
+	install -m 0755 octonet $(DESTDIR)/usr/bin
6
+	install -m 0755 octokey $(DESTDIR)/usr/bin
7
+	install -m 0755 ddflash $(DESTDIR)/usr/bin
8
+
9
+ddflash: ddflash.c
10
+	$(CC) -o ddflash ddflash.c
11
+
12
+ddtest: ddtest.c
13
+	$(CC) -o ddtest ddtest.c
14
+
15
+octonet: octonet.c
16
+	$(CC) -o octonet octonet.c
17
+
18
+octokey: octokey.c
19
+	$(CC) -o octokey octokey.c
20
+

+ 747
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/octonet/ddflash.c View File

@@ -0,0 +1,747 @@
1
+/*
2
+/* ddflash - Programmer for flash on Digital Devices devices
3
+ *
4
+ * Copyright (C) 2013 Digital Devices GmbH
5
+ *                    Ralph Metzler <rmetzler@digitaldevices.de>
6
+ *
7
+ * This program is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU General Public License
9
+ * version 3 only, as published by the Free Software Foundation.
10
+ *
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program; if not, write to the Free Software
20
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21
+ * 02110-1301, USA
22
+ * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
23
+ */
24
+
25
+#include <stdio.h>
26
+#include <stdlib.h>
27
+#include <stdint.h>
28
+#include <unistd.h>
29
+#include <getopt.h>
30
+#include <errno.h>
31
+#include <sys/types.h>
32
+#include <sys/stat.h>
33
+#include <fcntl.h>
34
+#include <string.h>
35
+#include <sys/ioctl.h>
36
+#include <linux/types.h>
37
+
38
+#include "flash.h"
39
+
40
+static int reboot(uint32_t off)
41
+{
42
+	FILE *f;
43
+	uint32_t time;
44
+
45
+	if ((f = fopen ("/sys/class/rtc/rtc0/since_epoch", "r")) == NULL)
46
+		return -1;
47
+	fscanf(f, "%u", &time);
48
+	fclose(f);
49
+
50
+	if ((f = fopen ("/sys/class/rtc/rtc0/wakealarm", "r+")) == NULL)
51
+		return -1;
52
+	fprintf(f, "%u", time + off);
53
+	fclose(f);
54
+	system("/sbin/poweroff");
55
+	return 0;
56
+}
57
+
58
+struct ddflash {
59
+	int fd;
60
+	struct ddb_id id;
61
+	uint32_t version;
62
+
63
+	uint32_t flash_type;
64
+	uint32_t sector_size;
65
+	uint32_t size;
66
+
67
+	uint32_t bufsize;
68
+	uint32_t block_erase;
69
+
70
+	uint8_t *buffer;
71
+};
72
+
73
+int flashwrite_pagemode(struct ddflash *ddf, int dev, uint32_t FlashOffset,
74
+			uint8_t LockBits, uint32_t fw_off)
75
+{
76
+	int err = 0;
77
+	uint8_t cmd[260];
78
+	int i, j;
79
+	uint32_t flen, blen;
80
+	
81
+	blen = flen = lseek(dev, 0, SEEK_END) - fw_off;
82
+	if (blen % 0xff)
83
+		blen = (blen + 0xff) & 0xffffff00; 
84
+	printf("blen = %u, flen = %u\n", blen, flen);
85
+	    
86
+	do {
87
+		cmd[0] = 0x50;  // EWSR
88
+		err = flashio(ddf->fd, cmd, 1, NULL, 0);
89
+		if (err < 0)
90
+			break;
91
+		
92
+		cmd[0] = 0x01;  // WRSR
93
+		cmd[1] = 0x00;  // BPx = 0, Unlock all blocks
94
+		err = flashio(ddf->fd, cmd, 2, NULL, 0);
95
+		if (err < 0)
96
+			break;
97
+		
98
+		for (i = 0; i < flen; i += 4096) {
99
+			if ((i & 0xFFFF) == 0)
100
+				printf(" Erase    %08x\n", FlashOffset + i);
101
+			
102
+			cmd[0] = 0x06;  // WREN
103
+			err = flashio(ddf->fd, cmd, 1, NULL, 0);
104
+			if (err < 0)
105
+				break;
106
+			
107
+			cmd[0] = 0x20;  // Sector erase ( 4Kb)
108
+			cmd[1] = ( (( FlashOffset + i ) >> 16) & 0xFF );
109
+			cmd[2] = ( (( FlashOffset + i ) >>  8) & 0xFF );
110
+			cmd[3] = 0x00;
111
+			err = flashio(ddf->fd, cmd, 4, NULL, 0);
112
+			if (err < 0)
113
+				break;
114
+
115
+			while (1) {
116
+				cmd[0] = 0x05;  // RDRS
117
+				err = flashio(ddf->fd, cmd, 1, &cmd[0], 1);
118
+				if (err < 0)
119
+					break;
120
+				if ((cmd[0] & 0x01) == 0)
121
+					break;
122
+			}
123
+			if (err < 0)
124
+				break;
125
+			
126
+		}
127
+		if (err < 0)
128
+			break;
129
+		
130
+		for (j = blen - 256; j >= 0; j -= 256 ) {
131
+			uint32_t len = 256; 
132
+			ssize_t rlen;
133
+			
134
+			if (lseek(dev, j + fw_off, SEEK_SET) < 0) {
135
+				printf("seek error\n");
136
+				return -1;
137
+			}
138
+			if (flen - j < 256) {
139
+				len = flen - j;
140
+				memset(ddf->buffer, 0xff, 256);
141
+			}
142
+			rlen = read(dev, ddf->buffer, len);
143
+			if (rlen < 0 || rlen != len) {
144
+				printf("file read error %d,%d at %u\n", rlen, errno, j);
145
+				return -1;
146
+			}
147
+			printf ("write %u bytes at %08x\n", len, j);
148
+			
149
+			
150
+			if ((j & 0xFFFF) == 0)
151
+				printf(" Programm %08x\n", FlashOffset + j);
152
+			
153
+			cmd[0] = 0x06;  // WREN
154
+			err = flashio(ddf->fd, cmd, 1, NULL, 0);
155
+			if (err < 0)
156
+				break;
157
+			
158
+			cmd[0] = 0x02;  // PP
159
+			cmd[1] = ( (( FlashOffset + j ) >> 16) & 0xFF );
160
+			cmd[2] = ( (( FlashOffset + j ) >>  8) & 0xFF );
161
+			cmd[3] = 0x00;
162
+			memcpy(&cmd[4], ddf->buffer, 256);
163
+			err = flashio(ddf->fd, cmd, 260, NULL, 0);
164
+			if (err < 0)
165
+				break;
166
+			
167
+			while(1) {
168
+				cmd[0] = 0x05;  // RDRS
169
+				err = flashio(ddf->fd, cmd,1, &cmd[0], 1);
170
+				if (err < 0)
171
+					break;
172
+				if ((cmd[0] & 0x01) == 0)
173
+					break;
174
+			}
175
+			if (err < 0)
176
+				break;
177
+			
178
+		}
179
+		if (err < 0)
180
+			break;
181
+		
182
+		cmd[0] = 0x50;  // EWSR
183
+		err = flashio(ddf->fd, cmd, 1, NULL, 0);
184
+		if (err < 0)
185
+			break;
186
+		
187
+		cmd[0] = 0x01;  // WRSR
188
+		cmd[1] = LockBits;  // BPx = 0, Lock all blocks
189
+		err = flashio(ddf->fd, cmd, 2, NULL, 0);
190
+	} while(0);
191
+	return err;
192
+}
193
+
194
+
195
+static int flashwrite_SSTI(struct ddflash *ddf, int fs, uint32_t FlashOffset, uint32_t maxlen, uint32_t fw_off)
196
+{
197
+    int err = 0;
198
+    uint8_t cmd[6];
199
+    int i, j;
200
+    uint32_t flen, blen;
201
+
202
+    blen = flen = lseek(fs, 0, SEEK_END) - fw_off;
203
+    if (blen % 0xfff)
204
+	    blen = (blen + 0xfff) & 0xfffff000; 
205
+    printf("blen = %u, flen = %u\n", blen, flen);
206
+    do {
207
+#if 1
208
+	    cmd[0] = 0x50;  // EWSR
209
+	    err = flashio(ddf->fd, cmd, 1, NULL, 0);
210
+	    if (err < 0) 
211
+		    break;
212
+
213
+	    cmd[0] = 0x01;  // WRSR
214
+	    cmd[1] = 0x00;  // BPx = 0, Unlock all blocks
215
+	    err = flashio(ddf->fd, cmd, 2, NULL, 0);
216
+	    if (err < 0 )
217
+		    break;
218
+	    
219
+	    for (i = 0; i < flen; i += 4096) {
220
+		    if ((i & 0xFFFF) == 0 )
221
+			    printf("Erase %08x\n", FlashOffset + i);
222
+		    cmd[0] = 0x06;  // WREN
223
+		    err = flashio(ddf->fd, cmd, 1, NULL, 0);
224
+		    if (err < 0 )
225
+			    break;
226
+		    
227
+		    cmd[0] = 0x20;  // Sector erase ( 4Kb)
228
+		    cmd[1] = (((FlashOffset + i ) >> 16) & 0xFF);
229
+		    cmd[2] = (((FlashOffset + i ) >>  8) & 0xFF);
230
+		    cmd[3] = 0x00;
231
+		    err = flashio(ddf->fd,cmd,4,NULL,0);
232
+		    if (err < 0 )
233
+			    break;
234
+		    
235
+		    while(1) {
236
+			    cmd[0] = 0x05;  // RDRS
237
+			    err = flashio(ddf->fd,cmd,1,&cmd[0],1);
238
+			    if (err < 0 ) break;
239
+			    if ((cmd[0] & 0x01) == 0 ) break;
240
+		    }
241
+		    if (err < 0 ) break;
242
+	    }
243
+	    if (err < 0 ) 
244
+		    break;
245
+#endif
246
+	    for (j = blen - 4096; j >= 0; j -= 4096 ) {
247
+		    uint32_t len = 4096; 
248
+		    ssize_t rlen;
249
+		    
250
+		    if (lseek(fs, j + fw_off, SEEK_SET) < 0) {
251
+			    printf("seek error\n");
252
+			    return -1;
253
+		    }
254
+		    if (flen - j < 4096) {
255
+			    len = flen - j;
256
+			    memset(ddf->buffer, 0xff, 4096);
257
+		    }
258
+   		    rlen = read(fs, ddf->buffer, len);
259
+		    if (rlen < 0 || rlen != len) {
260
+			    printf("file read error %d,%d at %u\n", rlen, errno, j);
261
+			    return -1;
262
+		    }
263
+		    printf ("write %u bytes at %08x\n", len, j);
264
+
265
+		    if ((j & 0xFFFF) == 0 )
266
+			    printf(" Program  %08x\n",FlashOffset + j);
267
+#if 1		    
268
+		    for (i = 0; i < 4096; i += 2) {
269
+			    if (i == 0) {
270
+				    cmd[0] = 0x06;  // WREN
271
+				    err = flashio(ddf->fd, cmd, 1, NULL, 0);
272
+				    if (err < 0 ) 
273
+					    break;
274
+				    
275
+				    cmd[0] = 0xAD;  // AAI
276
+				    cmd[1] = ((( FlashOffset + j ) >> 16) & 0xFF );
277
+				    cmd[2] = ((( FlashOffset + j ) >>  8) & 0xFF );
278
+				    cmd[3] = 0x00;
279
+				    cmd[4] = ddf->buffer[i];
280
+				    cmd[5] = ddf->buffer[i + 1];
281
+				    err = flashio(ddf->fd,cmd,6,NULL,0);
282
+			    } else {
283
+				    cmd[0] = 0xAD;  // AAI
284
+				    cmd[1] = ddf->buffer[i];
285
+				    cmd[2] = ddf->buffer[i + 1];
286
+				    err = flashio(ddf->fd,cmd,3,NULL,0);
287
+			    }
288
+			    if (err < 0 ) 
289
+				    break;
290
+			    
291
+			    while(1) {
292
+				    cmd[0] = 0x05;  // RDRS
293
+				    err = flashio(ddf->fd,cmd,1,&cmd[0],1);
294
+				    if (err < 0 ) break;
295
+				    if ((cmd[0] & 0x01) == 0 ) break;
296
+			    }
297
+			    if (err < 0 ) 
298
+				    break;
299
+		    }
300
+		    if (err < 0)
301
+			    break;
302
+		    
303
+		    cmd[0] = 0x04;  // WDIS
304
+		    err = flashio(ddf->fd, cmd, 1, NULL, 0);
305
+		    if (err < 0 ) 
306
+			    break;
307
+#endif
308
+	    }
309
+	    if (err < 0 ) break;
310
+	    
311
+	    cmd[0] = 0x50;  // EWSR
312
+	    err = flashio(ddf->fd,cmd,1,NULL,0);
313
+	    if (err < 0 ) break;
314
+	    
315
+	    cmd[0] = 0x01;  // WRSR
316
+	    cmd[1] = 0x1C;  // BPx = 0, Lock all blocks
317
+	    err = flashio(ddf->fd,cmd,2,NULL,0);
318
+    } while(0);
319
+    return err;
320
+}
321
+
322
+
323
+static int flashwrite(struct ddflash *ddf, int fs, uint32_t addr, uint32_t maxlen, uint32_t fw_off)
324
+{
325
+	switch (ddf->flash_type) {
326
+        case SSTI_SST25VF016B: 
327
+        case SSTI_SST25VF032B: 
328
+		return flashwrite_SSTI(ddf, fs, addr, maxlen, fw_off);
329
+        case SSTI_SST25VF064C:
330
+		return flashwrite_pagemode(ddf, fs, addr, 0x3c, fw_off);
331
+	case SPANSION_S25FL116K: 
332
+	case SPANSION_S25FL132K: 
333
+	case SPANSION_S25FL164K: 
334
+		return flashwrite_pagemode(ddf, fs, addr, 0x1c, fw_off);
335
+	}
336
+	return -1;
337
+}
338
+
339
+static int flashcmp(struct ddflash *ddf, int fs, uint32_t addr, uint32_t maxlen, uint32_t fw_off)
340
+{
341
+	off_t off;
342
+	uint32_t len;
343
+	int i, j, rlen;
344
+	uint8_t buf[256], buf2[256];
345
+	int bl = sizeof(buf);
346
+	
347
+	off = lseek(fs, 0, SEEK_END);
348
+	if (off < 0)
349
+		return -1;
350
+	len = off - fw_off;
351
+	lseek(fs, fw_off, SEEK_SET);
352
+	if (len > maxlen) {
353
+		printf("file too big\n");
354
+		return -1;
355
+	}
356
+	printf("flash file len %u, compare to %08x in flash\n", len, addr);
357
+	for (j = 0; j < len; j += bl, addr += bl) {
358
+		if (len - j < bl)
359
+			bl = len - j;
360
+		flashread(ddf->fd, buf, addr, bl);
361
+		rlen = read(fs, buf2, bl);
362
+		if (rlen < 0 || rlen != bl) {
363
+			printf("read error\n");
364
+			return -1;
365
+		}
366
+			
367
+		if (memcmp(buf, buf2, bl)) {
368
+			printf("flash differs at %08x (offset %u)\n", addr, j);
369
+			dump(buf, 32);
370
+			dump(buf2, 32);
371
+			return addr;
372
+		}
373
+	}
374
+	printf("flash same as file\n");
375
+	return -2;
376
+}
377
+
378
+
379
+static int flash_detect(struct ddflash *ddf)
380
+{
381
+	uint8_t cmd = 0x9F;
382
+	uint8_t id[3];
383
+	
384
+	int r = flashio(ddf->fd, &cmd, 1, id, 3);
385
+	if (r < 0)
386
+		return r;
387
+	
388
+	if (id[0] == 0xBF && id[1] == 0x25 && id[2] == 0x41) {
389
+		ddf->flash_type = SSTI_SST25VF016B; 
390
+		printf("Flash: SSTI  SST25VF016B 16 MBit\n");
391
+		ddf->sector_size = 4096; 
392
+		ddf->size = 0x200000; 
393
+	} else if (id[0] == 0xBF && id[1] == 0x25 && id[2] == 0x4A) {
394
+		ddf->flash_type = SSTI_SST25VF032B; 
395
+		printf("Flash: SSTI  SST25VF032B 32 MBit\n");
396
+		ddf->sector_size = 4096; 
397
+		ddf->size = 0x400000; 
398
+	} else if (id[0] == 0xBF && id[1] == 0x25 && id[2] == 0x4B) {
399
+		ddf->flash_type = SSTI_SST25VF064C; 
400
+		printf("Flash: SSTI  SST25VF064C 64 MBit\n");
401
+		ddf->sector_size = 4096; 
402
+		ddf->size = 0x800000; 
403
+	} else if (id[0] == 0x01 && id[1] == 0x40 && id[2] == 0x15) {
404
+		ddf->flash_type = SPANSION_S25FL116K;
405
+		printf("Flash: SPANSION S25FL116K 16 MBit\n");
406
+		ddf->sector_size = 4096; 
407
+		ddf->size = 0x200000; 
408
+	} else if (id[0] == 0x01 && id[1] == 0x40 && id[2] == 0x16) {
409
+		ddf->flash_type = SPANSION_S25FL132K;
410
+		printf("Flash: SPANSION S25FL132K 32 MBit\n");
411
+		ddf->sector_size = 4096; 
412
+		ddf->size = 0x400000; 
413
+	} else if (id[0] == 0x01 && id[1] == 0x40 && id[2] == 0x17) {
414
+		ddf->flash_type = SPANSION_S25FL164K;
415
+		printf("Flash: SPANSION S25FL164K 64 MBit\n");
416
+		ddf->sector_size = 4096; 
417
+		ddf->size = 0x800000; 
418
+	} else if (id[0] == 0x1F && id[1] == 0x28) {
419
+		ddf->flash_type = ATMEL_AT45DB642D; 
420
+		printf("Flash: Atmel AT45DB642D  64 MBit\n");
421
+		ddf->sector_size = 1024; 
422
+		ddf->size = 0x800000; 
423
+	} else {
424
+		printf("Unknown Flash Flash ID = %02x %02x %02x\n", id[0], id[1], id[2]);
425
+		return -1;
426
+	}
427
+	if (ddf->sector_size) {
428
+		ddf->buffer = malloc(ddf->sector_size);
429
+		//printf("allocated buffer %08x@%08x\n", ddf->sector_size, (uint32_t) ddf->buffer);
430
+		if (!ddf->buffer)
431
+			return -1;
432
+	}
433
+	return 0;
434
+}
435
+
436
+
437
+static int get_id(struct ddflash *ddf) {
438
+	uint8_t id[4];
439
+
440
+	if (ioctl(ddf->fd, IOCTL_DDB_ID, &ddf->id) < 0)
441
+		return -1;
442
+#if 1
443
+	printf("%04x %04x %04x %04x %08x %08x\n",
444
+	       ddf->id.vendor, ddf->id.device,
445
+	       ddf->id.subvendor, ddf->id.subdevice,
446
+	       ddf->id.hw, ddf->id.regmap);
447
+#endif	
448
+	return 0;
449
+}
450
+
451
+static int check_fw(struct ddflash *ddf, char *fn, uint32_t *fw_off)
452
+{
453
+	int fd, fsize, ret = 0;
454
+	off_t off;
455
+	uint32_t p, i;
456
+	uint8_t *buf;
457
+	uint8_t hdr[256];
458
+	unsigned int devid, version, length;
459
+	unsigned int cid[8];
460
+	int cids = 0;
461
+	uint32_t maxlen = 1024 * 1024;
462
+	
463
+	fd = open(fn, O_RDONLY);
464
+	if (fd < 0) {
465
+		printf("%s: not found\n", fn);
466
+		return -1;
467
+	}
468
+	off = lseek(fd, 0, SEEK_END);
469
+	if (off < 0)
470
+		return -1;
471
+	fsize = off;
472
+	if (fsize > maxlen) {
473
+		close(fd);
474
+		return -1;
475
+	}
476
+	lseek(fd, 0, SEEK_SET);	
477
+	buf = malloc(fsize);
478
+	if (!buf)
479
+		return -1;
480
+	read(fd, buf, fsize);
481
+	close(fd);
482
+	
483
+	for (p = 0; p < fsize && buf[p]; p++) {
484
+		char *key = &buf[p], *val = NULL;
485
+
486
+		for (; p < fsize && buf[p] != 0x0a; p++) {
487
+			if (buf[p] == ':') {
488
+				buf[p] = 0;
489
+				val = &buf[p + 1];
490
+			}
491
+		}
492
+		if (val == NULL || p == fsize)
493
+			break;
494
+		buf[p] = 0;
495
+		//printf("%-20s:%s\n", key, val);
496
+		if (!strcasecmp(key, "Devid")) {
497
+			sscanf(val, "%x", &devid);
498
+		} else if (!strcasecmp(key, "Compat")) {
499
+			cids = sscanf(val, "%x,%x,%x,%x,%x,%x,%x,%x",
500
+				      &cid[0], &cid[1], &cid[2], &cid[3],
501
+				      &cid[4], &cid[5], &cid[6], &cid[7]);
502
+			if (cids < 1)
503
+				break;
504
+			for (i = 0; i < cids; i++) 
505
+				if (cid[i] == ddf->id.device)
506
+					break;
507
+			if (i == cids) {
508
+				printf("%s: no compatible id\n", fn);
509
+				ret = -2; /* no compatible ID */
510
+				goto out;
511
+			}
512
+		} else if (!strcasecmp(key, "Version")) {
513
+			if (strchr(val,'.')) {
514
+				int major = 0, minor = 0;
515
+				sscanf(val,"%d.%d",&major,&minor);
516
+				version = (major << 16) + minor;
517
+			} else
518
+				sscanf(val, "%x", &version);
519
+		} else if (!strcasecmp(key, "Length")) {
520
+			sscanf(val, "%u", &length);
521
+		} 
522
+	}
523
+	p++;
524
+	*fw_off = p;
525
+	printf("devid = %04x\n", devid);
526
+	printf("version = %08x  %08x\n", version, ddf->id.hw);
527
+	printf("length = %u\n", length);
528
+	printf("fsize = %u, p = %u, f-p = %u\n", fsize, p, fsize - p);
529
+	if (devid == ddf->id.device) {
530
+		if (version <= (ddf->id.hw & 0xffffff)) {
531
+			printf("%s: old version\n", fn);
532
+			ret = -3; /* same id but no newer version */
533
+		}
534
+	} else
535
+		ret = 1;
536
+
537
+out:
538
+	free(buf);
539
+	printf("check_fw = %d\n", ret);
540
+	return ret;
541
+	
542
+}
543
+
544
+static int update_image(struct ddflash *ddf, char *fn, 
545
+			uint32_t adr, uint32_t len,
546
+			int has_header, int no_change)
547
+{
548
+	int fs, res = 0;
549
+	uint32_t fw_off = 0;
550
+
551
+	printf("Check %s\n", fn);
552
+	if (has_header) {
553
+		int ck;
554
+		
555
+		ck = check_fw(ddf, fn, &fw_off);
556
+		if (ck < 0)
557
+			return ck;
558
+		if (ck == 1 && no_change)
559
+			return 0;
560
+	}
561
+	fs = open(fn, O_RDONLY);
562
+	if (fs < 0 ) {
563
+		printf("File %s not found \n", fn);
564
+		return -1;
565
+	}
566
+	res = flashcmp(ddf, fs, adr, len, fw_off);
567
+	if (res == -2) {
568
+		printf("%s: same as flash\n", fn);
569
+	}
570
+	if (res < 0) 
571
+		goto out;
572
+	res = flashwrite(ddf, fs, adr, len, fw_off);
573
+	if (res == 0) {
574
+		res = flashcmp(ddf, fs, adr, len, fw_off);
575
+		if (res == -2) {
576
+			res = 1;
577
+		}
578
+	}
579
+ 
580
+out:
581
+	close(fs);
582
+	return res;
583
+}
584
+
585
+
586
+static int fexists(char *fn)
587
+{
588
+	struct stat b;
589
+
590
+	return (!stat(fn, &b));
591
+}
592
+
593
+static int update_flash(struct ddflash *ddf)
594
+{
595
+	char *fname;
596
+	int res, stat = 0;
597
+
598
+	switch (ddf->id.device) {
599
+	case 0x300:
600
+	case 0x301:
601
+	case 0x302:
602
+	case 0x307:
603
+		if ((res = update_image(ddf, "/boot/bs.img", 0x4000, 0x1000, 0, 0)) == 1)
604
+			stat |= 4;
605
+		if ((res = update_image(ddf, "/boot/uboot.img", 0xb0000, 0xb0000, 0, 0)) == 1)
606
+			stat |= 2;
607
+		if (fexists("/config/gtl.enabled")) {
608
+			if ((res = update_image(ddf, "/config/fpga_gtl.img", 0x10000, 0xa0000, 1, 0)) == 1)
609
+				stat |= 1;
610
+			if (res == -1)
611
+				if ((res = update_image(ddf, "/boot/fpga_gtl.img", 0x10000, 0xa0000, 1, 0)) == 1)
612
+					stat |= 1;
613
+		} else if (fexists("/config/gtl.disabled")) {
614
+			if ((res = update_image(ddf, "/config/fpga.img", 0x10000, 0xa0000, 1, 0)) == 1)
615
+				stat |= 1;
616
+			if (res == -1)
617
+				if ((res = update_image(ddf, "/boot/fpga.img", 0x10000, 0xa0000, 1, 0)) == 1)
618
+					stat |= 1;
619
+		} else {
620
+			if (ddf->id.device == 0x0307) {
621
+				if (res == -1)
622
+					if ((res = update_image(ddf, "/config/fpga_gtl.img", 0x10000, 0xa0000, 1, 1)) == 1)
623
+						stat |= 1;
624
+				if (res == -1)
625
+					if ((res = update_image(ddf, "/boot/fpga_gtl.img", 0x10000, 0xa0000, 1, 1)) == 1)
626
+						stat |= 1;
627
+			} else {
628
+				if ((res = update_image(ddf, "/config/fpga.img", 0x10000, 0xa0000, 1, 1)) == 1)
629
+					stat |= 1;
630
+				if (res == -1)
631
+					if ((res = update_image(ddf, "/boot/fpga.img", 0x10000, 0xa0000, 1, 1)) == 1)
632
+						stat |= 1;
633
+			}
634
+		}
635
+#if 1
636
+		if ( (stat&1) && (ddf->id.hw & 0xffffff) <= 0x010001) {		
637
+			if (ddf->id.device == 0x0307) {
638
+				if ((res = update_image(ddf, "/config/fpga_gtl.img", 0x160000, 0x80000, 1, 0)) == 1)
639
+					stat |= 1;
640
+				if (res == -1)
641
+					if ((res = update_image(ddf, "/boot/fpga_gtl.img", 0x160000, 0x80000, 1, 0)) == 1)
642
+						stat |= 1;
643
+			} else {
644
+				if ((res = update_image(ddf, "/config/fpga.img", 0x160000, 0x80000, 1, 0)) == 1)
645
+					stat |= 1;
646
+				if (res == -1)
647
+					if ((res = update_image(ddf, "/boot/fpga.img", 0x160000, 0x80000, 1, 0)) == 1)
648
+						stat |= 1;
649
+			
650
+			}
651
+		}
652
+#endif
653
+
654
+		break;
655
+	case 0x320:
656
+		//fname="/boot/DVBNetV1A_DD01_0300.bit";
657
+		fname="/boot/fpga.img";
658
+		if ((res = update_image(ddf, fname, 0x10000, 0x100000, 1, 0)) == 1)
659
+			stat |= 1;
660
+		return stat;
661
+		break;
662
+	case 0x322:
663
+		//fname="/boot/DVBNetV1A_DD01_0300.bit";
664
+		fname="/boot/fpga.img";
665
+		if ((res = update_image(ddf, fname, 0x10000, 0x100000, 1, 0)) == 1)
666
+			stat |= 1;
667
+		return stat;
668
+		break;
669
+	default:
670
+		return 0;
671
+	}
672
+	return stat;
673
+}
674
+
675
+int main(int argc, char **argv)
676
+{
677
+	struct ddflash ddf;
678
+	char ddbname[80];
679
+	uint8_t *buffer = 0;
680
+	uint32_t FlashOffset = 0x10000;
681
+	int i, err, res;
682
+	int ddbnum = 0;
683
+
684
+	uint32_t svid, jump, flash;
685
+
686
+	memset(&ddf, 0, sizeof(ddf));
687
+
688
+        while (1) {
689
+                int option_index = 0;
690
+		int c;
691
+                static struct option long_options[] = {
692
+			{"svid", required_argument, NULL, 's'},
693
+			{"help", no_argument , NULL, 'h'},
694
+			{0, 0, 0, 0}
695
+		};
696
+                c = getopt_long(argc, argv, 
697
+				"d:n:s:o:l:dfhj",
698
+				long_options, &option_index);
699
+		if (c==-1)
700
+			break;
701
+
702
+		switch (c) {
703
+		case 's':
704
+			svid = strtoul(optarg, NULL, 16);
705
+			break;
706
+		case 'o':
707
+			FlashOffset = strtoul(optarg, NULL, 16);
708
+			break;
709
+		case 'n':
710
+			ddbnum = strtol(optarg, NULL, 0);
711
+			break;
712
+		case 'j':
713
+			jump = 1;
714
+			break;
715
+		case 'h':
716
+		default:
717
+			break;
718
+
719
+		}
720
+	}
721
+	if (optind < argc) {
722
+		printf("Warning: unused arguments\n");
723
+	}
724
+	sprintf(ddbname, "/dev/ddbridge/card%d", ddbnum);
725
+	while ((ddf.fd = open(ddbname, O_RDWR)) < 0) {
726
+		if (errno == EBUSY)
727
+			usleep(100000);
728
+		else {
729
+			printf("Could not open device\n");
730
+			return -1;
731
+		}
732
+	}
733
+	flash = flash_detect(&ddf);
734
+	if (flash < 0)
735
+		return -1;
736
+	get_id(&ddf);
737
+
738
+	res = update_flash(&ddf);
739
+
740
+	if (ddf.buffer)
741
+		free(ddf.buffer);
742
+	if (res < 0)
743
+		return res;
744
+	if (res & 1)
745
+		reboot(40);
746
+	return res;
747
+}

+ 1584
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/octonet/ddtest.c
File diff suppressed because it is too large
View File


+ 625
- 0
d/dddvb-dkms-0.9.37.1easyVDR0/dddvb-0.9.37.1easyVDR0/apps/octonet/flash.c View File

@@ -0,0 +1,625 @@
1
+enum {
2
+	UNKNOWN_FLASH = 0,
3
+	ATMEL_AT45DB642D = 1,
4
+	SSTI_SST25VF016B = 2,
5
+	SSTI_SST25VF032B = 3,
6
+	SSTI_SST25VF064C = 4,
7
+	SPANSION_S25FL116K = 5,
8
+	SPANSION_S25FL132K = 6,
9
+	SPANSION_S25FL164K = 7,
10
+	WINBOND_W25Q16JV = 8,
11
+};
12
+
13
+static uint32_t linknr = 0;
14
+
15
+int flashio(int ddb, uint8_t *wbuf, uint32_t wlen, uint8_t *rbuf, uint32_t rlen)
16
+{
17
+	struct ddb_flashio fio = {
18
+		.write_buf=wbuf,
19
+		.write_len=wlen,
20
+		.read_buf=rbuf,
21
+		.read_len=rlen,
22
+		.link=linknr,
23
+	};
24
+	
25
+	return ioctl(ddb, IOCTL_DDB_FLASHIO, &fio);
26
+}
27
+
28
+int FlashDetect(int dev)
29
+{
30
+	uint8_t Cmd = 0x9F;
31
+	uint8_t Id[3];
32
+	
33
+	int r = flashio(dev, &Cmd, 1, Id, 3);
34
+	if (r < 0) 
35
+		return r;
36
+	
37
+	if (Id[0] == 0xBF && Id[1] == 0x25 && Id[2] == 0x41)
38
+		r = SSTI_SST25VF016B; 
39
+	else if (Id[0] == 0xBF && Id[1] == 0x25 && Id[2] == 0x4A)
40
+		r = SSTI_SST25VF032B; 
41
+	else if ( Id[0] == 0xBF && Id[1] == 0x25 && Id[2] == 0x4B )
42
+		r = SSTI_SST25VF064C; 
43
+	else if ( Id[0] == 0x01 && Id[1] == 0x40 && Id[2] == 0x15 )
44
+		r = SPANSION_S25FL116K; 
45
+	else if ( Id[0] == 0x01 && Id[1] == 0x40 && Id[2] == 0x16 )
46
+		r = SPANSION_S25FL132K; 
47
+	else if ( Id[0] == 0x01 && Id[1] == 0x40 && Id[2] == 0x17 )
48
+		r = SPANSION_S25FL164K; 
49
+	else if ( Id[0] == 0x1F && Id[1] == 0x28)
50
+		r = ATMEL_AT45DB642D; 
51
+	else if ( Id[0] == 0xef && Id[1] == 0x40 && Id[2] == 0x15 )
52
+		r = WINBOND_W25Q16JV; 
53
+	else 
54
+		r = UNKNOWN_FLASH;
55
+	
56
+	switch(r) {
57
+        case UNKNOWN_FLASH : 
58
+		printf("Unknown Flash Flash ID = %02x %02x %02x\n",Id[0],Id[1],Id[2]); 
59
+		break;
60
+        case ATMEL_AT45DB642D : 
61
+		printf("Flash: Atmel AT45DB642D  64 MBit\n"); 
62
+		break;
63
+        case SSTI_SST25VF016B : 
64
+		printf("Flash: SSTI  SST25VF016B 16 MBit\n"); 
65
+		break;
66
+        case SSTI_SST25VF032B : 
67
+		printf("Flash: SSTI  SST25VF032B 32 MBit\n"); 
68
+		break;
69
+        case SSTI_SST25VF064C :
70
+		printf("Flash: SSTI  SST25VF064C 64 MBit\n");
71
+		break;