diff --git a/README.md b/README.md index 9020bc6..1701131 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,8 @@ Windows and Linux systems. ### Version identification -Currently, there are three different device drivers in the LinuxSDK package -named `Dta`, `DtaNw` and `Dtu`. Each driver has a distinct version number. +Currently, there are different device drivers in the LinuxSDK package named +`Dta`, `DtaNw`, `Dtu`, `DtPcie`. Each driver has a distinct version number. It is not possible to provide three different DKMS packages since these drivers interact with each other in the kernel (at least `Dta` and `DtaNw`) and contain common code. It is important that a consistent combination of drivers diff --git a/build-dektec-dkms b/build-dektec-dkms index 216fc32..2921d69 100755 --- a/build-dektec-dkms +++ b/build-dektec-dkms @@ -230,6 +230,7 @@ cp "$SDKDIR/License" \ "$SDKDIR/Readme" \ "$SDKDIR/Drivers/Dta/Source/Linux/51-dta.rules" \ "$SDKDIR/Drivers/Dtu/Source/Linux/51-dtu.rules" \ + "$SDKDIR/Drivers/DtPcie/Source/Linux/51-dtpcie.rules" \ "$SRCDIR" # In case of "prepare only", we are done. @@ -253,7 +254,7 @@ if $INSTALL; then verbose "installing dkms dektec/$VERSION" sudo rm -rf "$DKMS_INSTALL" sudo cp -r "$DKMS_DIR" "$DKMS_INSTALL" || cleanexit 1 - sudo install -m 644 -o root -g root "$SRCDIR/51-dta.rules" "$SRCDIR/51-dtu.rules" /etc/udev/rules.d/ + sudo install -m 644 -o root -g root "$SRCDIR/51-dta.rules" "$SRCDIR/51-dtu.rules" "$SRCDIR/51-dtpcie.rules" /etc/udev/rules.d/ sudo dkms install -m dektec -v "$VERSION" --force cleanexit 0 fi @@ -261,9 +262,9 @@ fi # Special uninstall operation. if $UNINSTALL; then verbose "removing dkms dektec/$VERSION" - sudo rmmod DtaNw Dta Dtu + sudo rmmod DtaNw Dta Dtu DtPcie sudo dkms remove "dektec/$VERSION" --all - sudo rm -rf "$DKMS_INSTALL" /etc/udev/rules.d/51-dta.rules /etc/udev/rules.d/51-dtu.rules + sudo rm -rf "$DKMS_INSTALL" /etc/udev/rules.d/51-dta.rules /etc/udev/rules.d/51-dtu.rules /etc/udev/rules.d/51-dtpcie.rules cleanexit 0 fi @@ -336,7 +337,7 @@ if $DEB_DISTRO; then done chmod 755 "$DEBDIR/DEBIAN/postinst" "$DEBDIR/DEBIAN/prerm" cp -rp "$SRCDIR/dektec-$VERSION" "$DEBDIR/usr/src" - install -m 644 "$SRCDIR/51-dta.rules" "$SRCDIR/51-dtu.rules" "$DEBDIR/etc/udev/rules.d" + install -m 644 "$SRCDIR/51-dta.rules" "$SRCDIR/51-dtu.rules" "$SRCDIR/51-dtpcie.rules" "$DEBDIR/etc/udev/rules.d" install -m 644 "$SRCDIR/Readme" "$SRCDIR/License" "$DEBDIR/usr/share/doc/dektec-dkms" # Build the binary package diff --git a/config/Makefile.template b/config/Makefile.template index 59885da..f0ba7ef 100644 --- a/config/Makefile.template +++ b/config/Makefile.template @@ -4,6 +4,7 @@ default: $(MAKE) -C Drivers/Dta/Source/Linux $(MAKE) -C Drivers/DtaNw/Source/Linux $(MAKE) -C Drivers/Dtu/Source/Linux + $(MAKE) -C Drivers/DtPcie/Source/Linux clean: find . \( -name '.*.o.cmd' -o -name '.*.ko.cmd' -o -name '*.mod.c' -o -name '*.o' -o -name '.*.d' -o -name '*.ko' -o -name '.tmp_versions' -o -name 'modules.order' -o -name 'Module.symvers' \) -print0 | xargs -0 rm -rf diff --git a/config/control.template b/config/control.template index cb22e4c..aaff2bb 100644 --- a/config/control.template +++ b/config/control.template @@ -8,7 +8,8 @@ Depends: dkms, linux-headers-amd64 | linux-headers-generic | linux-headers Description: Source code and DKMS setup for the Dektec device drivers. This package installs the source code and DKMS setup for the kernel modules of the Dektec device drivers. Each time the kernel is upgraded, the Dektec - modules are automatically recompiled. The provided drivers are Dta, DtaNw, Dtu. + modules are automatically recompiled. The provided drivers are Dta, DtaNw, + Dtu and DtPcie. . Dektec is a manufacturer of PC add-on cards, USB devices, IP converters and software for the professional digital-television market. Their products are diff --git a/config/dektec-dkms.spec b/config/dektec-dkms.spec index c69f441..70a6724 100644 --- a/config/dektec-dkms.spec +++ b/config/dektec-dkms.spec @@ -15,7 +15,7 @@ Requires: elfutils-libelf-devel %description Provide the source code and DKMS setup for the kernel modules of the Dektec device drivers. Each time the kernel is upgraded, the Dektec modules are -automatically recompiled. The provided drivers are Dta, DtaNw, Dtu. +automatically recompiled. The provided drivers are Dta, DtaNw, Dtu, DtPcie. Dektec is a manufacturer of PC add-on cards, USB devices, IP converters and software for the professional digital-television market. Their products are @@ -35,7 +35,7 @@ This is an independent packaging of the Dektec original drivers. rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/usr/src $RPM_BUILD_ROOT/etc/udev/rules.d cp -r dektec-%{version} $RPM_BUILD_ROOT/usr/src -install -m 644 51-dta.rules 51-dtu.rules $RPM_BUILD_ROOT/etc/udev/rules.d +install -m 644 51-dta.rules 51-dtu.rules 51-dtpcie.rules $RPM_BUILD_ROOT/etc/udev/rules.d %post [[ $(/usr/sbin/dkms status | grep dektec | grep "%{version}" | wc -l) -eq 0 ]] && /usr/sbin/dkms add -m dektec -v "%{version}" @@ -55,4 +55,5 @@ rm -rf $RPM_BUILD_ROOT /usr/src/dektec-%{version} /etc/udev/rules.d/51-dta.rules /etc/udev/rules.d/51-dtu.rules +/etc/udev/rules.d/51-dtpcie.rules %doc Readme License diff --git a/config/dkms.conf.template b/config/dkms.conf.template index f8aee6a..97d3933 100644 --- a/config/dkms.conf.template +++ b/config/dkms.conf.template @@ -17,3 +17,7 @@ DEST_MODULE_LOCATION[1]=/kernel/drivers/misc BUILT_MODULE_NAME[2]=Dtu BUILT_MODULE_LOCATION[2]=Drivers/Dtu/Source/Linux DEST_MODULE_LOCATION[2]=/kernel/drivers/misc + +BUILT_MODULE_NAME[3]=DtPcie +BUILT_MODULE_LOCATION[3]=Drivers/DtPcie/Source/Linux +DEST_MODULE_LOCATION[3]=/kernel/drivers/misc diff --git a/config/postinst.template b/config/postinst.template index 6a9b10f..4e9a98f 100755 --- a/config/postinst.template +++ b/config/postinst.template @@ -3,11 +3,11 @@ if [[ "$1" = "configure" ]]; then # Fix file permissions and ownership. - chown -R root:root /usr/src/dektec-{{VERSION}} /etc/udev/rules.d/51-dta.rules /etc/udev/rules.d/51-dtu.rules /usr/share/doc/dektec-dkms + chown -R root:root /usr/src/dektec-{{VERSION}} /etc/udev/rules.d/51-dt*.rules /usr/share/doc/dektec-dkms find /usr/src/dektec-{{VERSION}} -type f -print0 | xargs -0 chmod 644 find /usr/src/dektec-{{VERSION}} -type d -print0 | xargs -0 chmod 755 chmod 755 /usr/share/doc/dektec-dkms - chmod 644 /etc/udev/rules.d/51-dta.rules /etc/udev/rules.d/51-dtu.rules /usr/share/doc/dektec-dkms/* + chmod 644 /etc/udev/rules.d/51-dt*.rules /usr/share/doc/dektec-dkms/* # Build the initial version of the driver. [[ $(/usr/sbin/dkms status | grep dektec | grep "{{VERSION}}" | wc -l) -eq 0 ]] && /usr/sbin/dkms add -m dektec -v "{{VERSION}}" diff --git a/patches/dektec-dkms-2019.01.0.patch b/patches/dektec-dkms-2019.01.0.patch new file mode 100644 index 0000000..0bb5135 --- /dev/null +++ b/patches/dektec-dkms-2019.01.0.patch @@ -0,0 +1,53 @@ +diff -Naur dektec-dkms-2019.01.0/dektec-2019.01.0/Drivers/DtaNw/Source/Linux/DtaNwIal.c dektec-dkms-2019.01.0.fixed/dektec-2019.01.0/Drivers/DtaNw/Source/Linux/DtaNwIal.c +--- dektec-dkms-2019.01.0/dektec-2019.01.0/Drivers/DtaNw/Source/Linux/DtaNwIal.c 2019-02-13 16:15:43.437810888 +0100 ++++ dektec-dkms-2019.01.0.fixed/dektec-2019.01.0/Drivers/DtaNw/Source/Linux/DtaNwIal.c 2019-02-13 16:29:19.038926498 +0100 +@@ -79,8 +79,10 @@ + #endif + static void DtaNwEvtGetDriverInfo(struct net_device* pDevice, + struct ethtool_drvinfo* pInfo); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,20,0) + static Int DtaNwEvtGetSettings(struct net_device* pDevice, struct ethtool_cmd* pCmd); + static Int DtaNwEvtSetSettings(struct net_device* pDevice, struct ethtool_cmd* pCmd); ++#endif + UInt32 DtaNwEvtGetLink(struct net_device* pDevice); + #ifdef NO_HW_FEATURE_SUPPORT + static UInt32 DtaNwEvtGetRxCsum(struct net_device* pDevice); +@@ -105,8 +107,10 @@ + static const struct ethtool_ops EthToolOps = + { + .get_drvinfo = DtaNwEvtGetDriverInfo, ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,20,0) + .get_settings = DtaNwEvtGetSettings, + .set_settings = DtaNwEvtSetSettings, ++#endif + .get_link = DtaNwEvtGetLink, + #ifdef PERM_ADDR_SUPPORT + .get_perm_addr = DtaNwEvtGetPermAddr, +@@ -477,6 +481,7 @@ + + //-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- DtaNwEvtGetSettings -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. + // ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,20,0) + static Int DtaNwEvtGetSettings(struct net_device* pDevice, struct ethtool_cmd* pCmd) + { + DtaNwDeviceData* pDvcData = netdev_priv(pDevice); +@@ -536,9 +541,11 @@ + DtDbgOut(MAX, IAL, "Exit"); + return 0; + } ++#endif + + //-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- DtaNwEvtSetSettings -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. + // ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,20,0) + static Int DtaNwEvtSetSettings(struct net_device* pDevice, struct ethtool_cmd* pCmd) + { + DtaNwDeviceData* pDvcData = netdev_priv(pDevice); +@@ -584,6 +591,7 @@ + + return 0; + } ++#endif + + //-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- DtaNwEvtGetLink -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. + //