diff options
author | Mauro Santos | 2015-09-29 15:29:08 +0100 |
---|---|---|
committer | Mauro Santos | 2015-09-29 15:29:08 +0100 |
commit | 7ed49954cb0ba05dfa30d6599015fc5579ad20a7 (patch) | |
tree | 0bd8427da20a1afd2e5f23b9cb4a6e536e1a8095 | |
parent | 47349f6fafa48384e45c1d41745c2b900582d40e (diff) | |
download | aur-7ed49954cb0ba05dfa30d6599015fc5579ad20a7.tar.gz |
Quick and dirty fix to build on linux >=4.2
Note: This *will* break scanning with w_scan and femon will complain with:
"Problem retrieving frontend information: Operation not supported".
Signal level, SNR and BER still seem to be reported.
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 15 | ||||
-rw-r--r-- | linux42.patch | 199 |
3 files changed, 210 insertions, 6 deletions
@@ -13,9 +13,11 @@ pkgbase = dvb-usb-rtl2832u-openpli source = dvb-usb-rtl2832u.patch::https://github.com/Xtrend-Official/meta-xtrend/raw/master/recipes-bsp/linux/linux-etxx00/dvb-usb-rtl2832.patch source = Makefile source = dvb-usb-rtl28xxu.conf + source = linux42.patch md5sums = 263f5060ff7ef969ecaad1494700230a md5sums = b91ef30d49fc0e7d8e76b39c98cf3ff6 md5sums = 063be4e255e010899574fc3cdec67120 + md5sums = bc75fc1f5a9030d6545c66642612ef3d pkgname = dvb-usb-rtl2832u-openpli @@ -16,10 +16,12 @@ install="${pkgname}.install" provides=('dvb-usb-rtl2832u') source=('dvb-usb-rtl2832u.patch::https://github.com/Xtrend-Official/meta-xtrend/raw/master/recipes-bsp/linux/linux-etxx00/dvb-usb-rtl2832.patch' 'Makefile' - 'dvb-usb-rtl28xxu.conf') + 'dvb-usb-rtl28xxu.conf' + 'linux42.patch') md5sums=('263f5060ff7ef969ecaad1494700230a' 'b91ef30d49fc0e7d8e76b39c98cf3ff6' - '063be4e255e010899574fc3cdec67120') + '063be4e255e010899574fc3cdec67120' + 'bc75fc1f5a9030d6545c66642612ef3d') PKGEXT='.pkg.tar' _extramodules="extramodules-$(uname -r | cut -f-2 -d.)-$(uname -r | cut -f3- -d-)" @@ -27,18 +29,19 @@ _kernver="$(cat /usr/lib/modules/${_extramodules}/version)" build() { cd "$srcdir" - + [[ -e build_dir ]] && rm -r build_dir mkdir build_dir cd build_dir # Get the sources from OpenPLi kernel patch patch -p5 < "$srcdir/dvb-usb-rtl2832u.patch" &> /dev/null && return 1 - + # Copy Makefile cp "$srcdir/Makefile" . - + ## Patches go here ## + patch -p1 < "$srcdir/linux42.patch" # Build module export KBUILD_SRC="/usr/lib/modules/${_kernver}/build" @@ -50,4 +53,4 @@ package() { install -D -m644 "${srcdir}/dvb-usb-rtl28xxu.conf" "${pkgdir}/etc/modprobe.d/dvb-usb-rtl28xxu.conf" install -D -m644 "${srcdir}/build_dir/dvb-usb-rtl2832u.ko" "${pkgdir}/usr/lib/modules/${_extramodules}/dvb-usb-rtl2832u.ko" sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "${startdir}/${install}" -} +} diff --git a/linux42.patch b/linux42.patch new file mode 100644 index 000000000000..9b59190fc0b3 --- /dev/null +++ b/linux42.patch @@ -0,0 +1,199 @@ +diff -urZ a/rtl2832u_fe.c b/rtl2832u_fe.c +--- a/rtl2832u_fe.c 2015-09-29 14:47:15.833563000 +0100 ++++ b/rtl2832u_fe.c 2015-09-29 15:22:18.565323000 +0100 +@@ -2770,10 +2770,16 @@ + } + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) + static int + rtl2832_read_status( + struct dvb_frontend* fe, + fe_status_t* status) ++#else ++static int ++rtl2832_read_status( ++ struct dvb_frontend* fe) ++#endif + { + struct rtl2832_state* p_state = fe->demodulator_priv; + int is_lock; +@@ -2787,7 +2793,9 @@ + return -1; + } + ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) + *status = 0; //3initialize "status" ++ #endif + + if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) ) goto mutex_error; + +@@ -2800,7 +2808,9 @@ + + if( p_state->pNim->IsSignalLocked(p_state->pNim, &is_lock) ) goto error; + +- if( is_lock==YES ) *status|= (FE_HAS_CARRIER| FE_HAS_VITERBI| FE_HAS_LOCK| FE_HAS_SYNC| FE_HAS_SIGNAL); ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) ++ if( is_lock==YES ) *status|= (FE_HAS_CARRIER| FE_HAS_VITERBI| FE_HAS_LOCK| FE_HAS_SYNC| FE_HAS_SIGNAL); ++ #endif + + snr = snr_num/snr_dem; + +@@ -2827,7 +2837,9 @@ + //if(p_state->pNim2836->pDemod->IsSignalLocked(p_state->pNim2836->pDemod, &is_lock)) + // goto error; + +- if( is_lock==YES ) *status|= (FE_HAS_CARRIER| FE_HAS_VITERBI| FE_HAS_LOCK| FE_HAS_SYNC| FE_HAS_SIGNAL); ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) ++ if( is_lock==YES ) *status|= (FE_HAS_CARRIER| FE_HAS_VITERBI| FE_HAS_LOCK| FE_HAS_SYNC| FE_HAS_SIGNAL); ++ #endif + + deb_info("%s :******RTL2836 Signal Lock=%d******\n", __FUNCTION__, is_lock); + } +@@ -2842,7 +2854,9 @@ + + if(p_state->pNim2840->IsSignalLocked(p_state->pNim2840, &is_lock) != FUNCTION_SUCCESS) goto error; + +- if( is_lock==YES ) *status|= (FE_HAS_CARRIER| FE_HAS_VITERBI| FE_HAS_LOCK| FE_HAS_SYNC| FE_HAS_SIGNAL); ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) ++ if( is_lock==YES ) *status|= (FE_HAS_CARRIER| FE_HAS_VITERBI| FE_HAS_LOCK| FE_HAS_SYNC| FE_HAS_SIGNAL); ++ #endif + + deb_info("%s :******RTL2840 Signal Lock=%d******\n", __FUNCTION__, is_lock); + +@@ -3338,12 +3352,20 @@ + } + + #ifdef V4L2_ONLY_DVB_V5 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) + static int + rtl2832_tune(struct dvb_frontend *fe, + bool re_tune, + unsigned int mode_flags, + unsigned int *delay, + fe_status_t *status) ++#else ++static int ++rtl2832_tune(struct dvb_frontend *fe, ++ bool re_tune, ++ unsigned int mode_flags, ++ unsigned int *delay) ++#endif + { + //struct dvb_frontend_private *fepriv = fe->frontend_priv; + // fe_status_t s = 0; +@@ -3352,7 +3374,9 @@ + + if(p_state->rtl2832_audio_video_mode != RTK_AUDIO) + { ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) + *status = 256; ++ #endif + deb_info("%s: can't set parameter now\n",__FUNCTION__); + return 0; + } +@@ -3360,7 +3384,9 @@ + if (re_tune) + retval = rtl2832_set_parameters_fm(fe); + if(retval < 0) ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) + *status = 256;//FESTATE_ERROR; ++ #endif + //else + // status = 16;//FESTATE_TUNED; + +@@ -3370,12 +3396,20 @@ + return 0; + } + #else ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) + static int + rtl2832_tune(struct dvb_frontend *fe, + struct dvb_frontend_parameters *params, + unsigned int mode_flags, + unsigned int *delay, + fe_status_t *status) ++#else ++static int ++rtl2832_tune(struct dvb_frontend *fe, ++ struct dvb_frontend_parameters *params, ++ unsigned int mode_flags, ++ unsigned int *delay) ++#endif + { + + //struct dvb_frontend_private *fepriv = fe->frontend_priv; +@@ -3390,14 +3424,18 @@ + + if(p_state->rtl2832_audio_video_mode != RTK_AUDIO) + { +- *status = 256; ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) ++ *status = 256; ++ #endif + deb_info("%s: can't set parameter now\n",__FUNCTION__); + return 0; + } + + retval = rtl2832_set_parameters_fm(fe, params); + if(retval < 0) ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) + *status = 256;//FESTATE_ERROR; ++ #endif + //else + // status = 16;//FESTATE_TUNED; + +@@ -3569,7 +3607,9 @@ + .get_frontend = rtl2832_get_parameters, + .get_tune_settings = rtl2832_get_tune_settings, + ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) + .read_status = rtl2832_read_status, ++ #endif + .read_ber = rtl2832_read_ber, + .read_signal_strength = rtl2832_read_signal_strength, + .read_snr = rtl2832_read_snr, +@@ -3610,7 +3650,9 @@ + .get_frontend = rtl2832_get_parameters, + .get_tune_settings = rtl2832_get_tune_settings, + ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) + .read_status = rtl2832_read_status, ++ #endif + .read_ber = rtl2832_read_ber, + .read_signal_strength = rtl2832_read_signal_strength, + .read_snr = rtl2832_read_snr, +@@ -3618,7 +3660,9 @@ + .ts_bus_ctrl = rtl2832_ts_bus_ctrl, + + .get_frontend_algo = rtl2832_get_algo, ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) + .tune = rtl2832_tune, ++ #endif + }; + + static struct dvb_frontend_ops rtl2836_dtmb_ops = { +@@ -3651,7 +3695,9 @@ + .get_frontend = rtl2832_get_parameters, + .get_tune_settings = rtl2832_get_tune_settings, + ++ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) + .read_status = rtl2832_read_status, ++ #endif + .read_ber = rtl2832_read_ber, + .read_signal_strength = rtl2832_read_signal_strength, + .read_snr = rtl2832_read_snr, +diff -urZ a/rtl2832u.h b/rtl2832u.h +--- a/rtl2832u.h 2015-09-29 14:47:15.830229000 +0100 ++++ b/rtl2832u.h 2015-09-29 14:52:26.417991794 +0100 +@@ -115,7 +115,9 @@ + #endif + #define USB_PID_LEADTEK_WARM_1 0x6680 + #define USB_PID_LEADTEK_WARM_2 0x6F11 +-#define USB_PID_WINFAST_DTV2000DS_PLUS 0x6F12 ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) ++ #define USB_PID_WINFAST_DTV2000DS_PLUS 0x6F12 ++#endif + #define USB_PID_WINFAST_DTV_DONGLE_MINI 0x6a03 + + #ifndef USB_VID_COMPRO |