diff --git a/.git_info b/.git_info index d97e420..2d8452c 100644 --- a/.git_info +++ b/.git_info @@ -1,2 +1,2 @@ -wanpipe_linux: git ver 3b8482c -wanpipe_common: git ver e5ec437 +wanpipe_linux: git ver 94b4102 +wanpipe_common: git ver fdc6185 diff --git a/.router_version b/.router_version index 8f26aaf..e4e0c0b 100644 --- a/.router_version +++ b/.router_version @@ -1 +1 @@ -wanpipe-7.0.33 +wanpipe-7.0.34 diff --git a/Makefile b/Makefile index 8c83cb8..88d777f 100755 --- a/Makefile +++ b/Makefile @@ -355,6 +355,17 @@ KERN_TIMER_32BIT=0 EXTRA_CFLAGS+=-DKERN_TIMER_32BIT=$(KERN_TIMER_32BIT) endif +ifneq (,$(wildcard $(KDIR)/scripts/mod/modpost.c)) +KERN_MODPOST_STATIC_ERR=$(shell grep -nr "is a static " $(KDIR)/scripts/mod/modpost.c | grep error -c) +EXTRA_CFLAGS+=-DKERN_MODPOST_STATIC_ERR=$(KERN_MODPOST_STATIC_ERR) +else ifneq (,$(wildcard $(KSRC)/scripts/mod/modpost.c)) +KERN_MODPOST_STATIC_ERR=$(shell grep -nr "is a static " $(KSRC)/scripts/mod/modpost.c | grep error -c) +EXTRA_CFLAGS+=-DKERN_MODPOST_STATIC_ERR=$(KERN_MODPOST_STATIC_ERR) +else +KERN_MODPOST_STATIC_ERR=0 +EXTRA_CFLAGS+=-DKERN_MODPOST_STATIC_ERR=$(KERN_MODPOST_STATIC_ERR) +endif + # First pass, kernel Makefile reads module objects ifneq ($(KERNELRELEASE),) obj-m := sdladrv.o wanrouter.o wanpipe.o wanpipe_syncppp.o wanec.o diff --git a/Setup b/Setup index 8eb2f0c..d5be2fc 100755 --- a/Setup +++ b/Setup @@ -541,6 +541,29 @@ check_kern_ds () fi PROTOCOL_DEFINES="$PROTOCOL_DEFINES $KERN_DS_UPDATE " } + +check_kern_modpost () +{ + if [ -e $SOURCEDIR/scripts/mod/modpost.c ];then + eval "grep \"is a static \" $SOURCEDIR/scripts/mod/modpost.c | grep error >/dev/null 2>/dev/null" + if [ $? -eq 0 ]; then + KERN_MODPOST_UPDATE="-DKERN_MODPOST_STATIC_ERR=1" + else + KERN_MODPOST_UPDATE="-DKERN_MODPOST_STATIC_ERR=0" + fi + elif [ -e $DEBSRCDIR/scripts/mod/modpost.c ];then + eval "grep \"is a static \" $DEBSRCDIR/scripts/mod/modpost.c | grep error >/dev/null 2>/dev/null" + if [ $? -eq 0 ]; then + KERN_MODPOST_UPDATE="-DKERN_MODPOST_STATIC_ERR=1" + else + KERN_MODPOST_UPDATE="-DKERN_MODPOST_STATIC_ERR=0" + fi + else + KERN_MODPOST_UPDATE="-DKERN_MODPOST_STATIC_ERR=0" + fi + PROTOCOL_DEFINES="$PROTOCOL_DEFINES $KERN_MODPOST_UPDATE " +} + # ---------------------------------------------------------------------------- # Display error message. # ---------------------------------------------------------------------------- @@ -3978,6 +4001,8 @@ CFLAGS="$CC -Wp,-MD,.wanpipe.o.d -nostdinc -iwithprefix include -D__LINUX__ -Dli check_kern_ds + check_kern_modpost + if [ "$BRI_MODULE_TEST" = "YES" ]; then PROTOCOL_DEFINES="$PROTOCOL_DEFINES -DBUILD_MOD_TESTER" fi @@ -7761,7 +7786,7 @@ KERNEL_UNAME=`uname -r` PKG_NAME=wanpipe DISTR_NAME="WANPIPE" PROD=wanrouter -PROD_VER=7.0.33 +PROD_VER=7.0.34 PROD_HOME=`pwd` META_CONF=$PROD_HOME/$PROD.rc WAN_INTR_DIR=$PROD_HOME/interfaces diff --git a/deb_control/wanpipe.deb b/deb_control/wanpipe.deb index ff0712b..c8ef6ae 100644 --- a/deb_control/wanpipe.deb +++ b/deb_control/wanpipe.deb @@ -1,5 +1,5 @@ Package: wanpipe -Version: 7.0.33-0 +Version: 7.0.34-0 Section: networking Priority: optional Architecture: all diff --git a/patches/kdrivers/include/wanpipe_cdev_iface.h b/patches/kdrivers/include/wanpipe_cdev_iface.h index bccf2e2..abf64bc 100644 --- a/patches/kdrivers/include/wanpipe_cdev_iface.h +++ b/patches/kdrivers/include/wanpipe_cdev_iface.h @@ -103,6 +103,11 @@ typedef struct wanpipe_cdev_priv # define CPRIV(dev) ((wanpipe_cdev_priv_t*)(dev->priv)) +#if defined (KERN_MODPOST_STATIC_ERR) && KERN_MODPOST_STATIC_ERR > 0 +int wanpipe_cdev_tx_wake(wanpipe_cdev_t *cdev); +int wanpipe_cdev_rx_wake(wanpipe_cdev_t *cdev); +int wanpipe_cdev_event_wake(wanpipe_cdev_t *cdev); +#else static __inline int wanpipe_cdev_rx_wake(wanpipe_cdev_t *cdev) { if (!cdev || !CPRIV(cdev)) { @@ -145,6 +150,7 @@ static __inline int wanpipe_cdev_event_wake(wanpipe_cdev_t *cdev) return 0; } +#endif #else int wanpipe_cdev_tx_wake(wanpipe_cdev_t *cdev); int wanpipe_cdev_rx_wake(wanpipe_cdev_t *cdev); diff --git a/patches/kdrivers/include/wanpipe_version.h b/patches/kdrivers/include/wanpipe_version.h index c5b891e..108469d 100644 --- a/patches/kdrivers/include/wanpipe_version.h +++ b/patches/kdrivers/include/wanpipe_version.h @@ -10,14 +10,14 @@ #define WANPIPE_COMPANY "Sangoma Technologies Inc" /********** LINUX **********/ -#define WANPIPE_VERSION "7.0.33" +#define WANPIPE_VERSION "7.0.34" #define WANPIPE_SUB_VERSION "0" #define WANPIPE_LITE_VERSION "1.1.1" #if defined(__LINUX__) #define WANPIPE_VERSION_MAJOR 7 #define WANPIPE_VERSION_MINOR 0 -#define WANPIPE_VERSION_MINOR1 33 +#define WANPIPE_VERSION_MINOR1 34 #define WANPIPE_VERSION_MINOR2 0 #endif diff --git a/patches/kdrivers/src/net/wanpipe_cdev_linux.c b/patches/kdrivers/src/net/wanpipe_cdev_linux.c index dbc6928..998992b 100644 --- a/patches/kdrivers/src/net/wanpipe_cdev_linux.c +++ b/patches/kdrivers/src/net/wanpipe_cdev_linux.c @@ -470,7 +470,50 @@ int wanpipe_cdev_free(wanpipe_cdev_t *cdev) return wanpipe_free_cdev(cdev, minor,counter); } +#if defined (KERN_MODPOST_STATIC_ERR) && KERN_MODPOST_STATIC_ERR > 0 +int wanpipe_cdev_rx_wake(wanpipe_cdev_t *cdev) +{ + if (!cdev || !CPRIV(cdev)) { + DEBUG_EVENT("%s(): Error cdev->dev_ptr not initialized!\n",__FUNCTION__); + return -1; + } + if (waitqueue_active(&CPRIV(cdev)->poll_wait)){ + wake_up_interruptible(&CPRIV(cdev)->poll_wait); + } + + return 0; +} + + +int wanpipe_cdev_tx_wake(wanpipe_cdev_t *cdev) +{ + if (!cdev || !CPRIV(cdev)) { + DEBUG_EVENT("%s(): Error cdev->dev_ptr not initialized!\n",__FUNCTION__); + return -1; + } + + if (waitqueue_active(&CPRIV(cdev)->poll_wait)){ + wake_up_interruptible(&CPRIV(cdev)->poll_wait); + } + + return 0; +} + +int wanpipe_cdev_event_wake(wanpipe_cdev_t *cdev) +{ + if (!cdev || !CPRIV(cdev)) { + DEBUG_EVENT("%s(): Error cdev->dev_ptr not initialized!\n",__FUNCTION__); + return -1; + } + + if (waitqueue_active(&CPRIV(cdev)->poll_wait)){ + wake_up_interruptible(&CPRIV(cdev)->poll_wait); + } + + return 0; +} +#endif /*========================================================= diff --git a/patches/kdrivers/src/wanrouter/af_wanpipe.c b/patches/kdrivers/src/wanrouter/af_wanpipe.c index af947a1..cee7da2 100644 --- a/patches/kdrivers/src/wanrouter/af_wanpipe.c +++ b/patches/kdrivers/src/wanrouter/af_wanpipe.c @@ -1787,7 +1787,7 @@ static int wanpipe_getname(struct socket *sock, struct sockaddr *uaddr, return 0; } -#if (KERN_SOCK_NO_OPT == 0) +#if (SOCK_NO_OPT == 0) static int sock_no_setsockopt(struct socket *sock, int level, int optname, sockptr_t optval, unsigned int optlen) { return -EOPNOTSUPP; diff --git a/rpmspec/wanpipe-mod.rpmspec b/rpmspec/wanpipe-mod.rpmspec index 256ee31..47bd4b2 100644 --- a/rpmspec/wanpipe-mod.rpmspec +++ b/rpmspec/wanpipe-mod.rpmspec @@ -1,6 +1,6 @@ %define WANPIPE_VER wanpipe-modules %define name %{WANPIPE_VER} -%define version 7.0.33 +%define version 7.0.34 %define release 0 %define serial 1 %define MODULES_DIR /lib/modules diff --git a/rpmspec/wanpipe-util.rpmspec b/rpmspec/wanpipe-util.rpmspec index cd01698..3fdc9a8 100644 --- a/rpmspec/wanpipe-util.rpmspec +++ b/rpmspec/wanpipe-util.rpmspec @@ -1,6 +1,6 @@ %define WANPIPE_VER wanpipe-util %define name %{WANPIPE_VER} -%define version 7.0.33 +%define version 7.0.34 %define release 0 %define serial 1 %define UTILS_DIR /usr/sbin diff --git a/rpmspec/wanpipe.rpmspec b/rpmspec/wanpipe.rpmspec index 3106891..4d70500 100644 --- a/rpmspec/wanpipe.rpmspec +++ b/rpmspec/wanpipe.rpmspec @@ -1,7 +1,7 @@ %define KERNEL_VERSION %{?kern_ver} %define WANPIPE_VER wanpipe %define name %{WANPIPE_VER} -%define version 7.0.33 +%define version 7.0.34 %define release 0 %define serial 1 %define UTILS_DIR /usr/sbin diff --git a/samples/wanrouter b/samples/wanrouter index 620b40f..eb96078 100644 --- a/samples/wanrouter +++ b/samples/wanrouter @@ -2241,7 +2241,7 @@ init_global_params() { if [ $OSYSTEM = "Linux" ]; then - ROUTER_VERSION=7.0.33 + ROUTER_VERSION=7.0.34 IFCONFIG_LIST=ifconfig MODULE_STAT=lsmod WAN_DRIVERS="wanpipe" diff --git a/util/wanpipemon/dslpipemon.c b/util/wanpipemon/dslpipemon.c index 7c83488..882d5f2 100644 --- a/util/wanpipemon/dslpipemon.c +++ b/util/wanpipemon/dslpipemon.c @@ -77,7 +77,6 @@ extern int sock; extern wan_udp_hdr_t wan_udp; extern int protocol_cb_size; extern int trace_all_data; -unsigned int loop_counter, frame_count; /****************************************************************************** * FUNCTION PROTOTYPES * diff --git a/util/wanpipemon/wanpipemon.c b/util/wanpipemon/wanpipemon.c index e44cff7..80b0fe3 100644 --- a/util/wanpipemon/wanpipemon.c +++ b/util/wanpipemon/wanpipemon.c @@ -185,7 +185,6 @@ char TRACE_ASCII=0; char TRACE_HEX=0; char *cmd[MAX_CMD_ARG]; -FT1_LED_STATUS FT1_LED; /****************************************************************************** * FUNCTION PROTOTYPES * @@ -209,7 +208,6 @@ static char* GetMasterDevName( void ); #if 0 static void sig_handler(int sigint); #endif -int fail=0; int xml_output=0; //static sa_family_t get_if_family(char*); diff --git a/util/wanpipemon/xpipemon.c b/util/wanpipemon/xpipemon.c index 27a70c3..8274213 100644 --- a/util/wanpipemon/xpipemon.c +++ b/util/wanpipemon/xpipemon.c @@ -67,7 +67,6 @@ void flush_hdlc_stat(void); /* global for now */ static unsigned char station_config; int off_counter, green_counter, red_counter; -int loop_counter, fail; /* defines for now */ extern int lcn_number; diff --git a/util/wanpipemon_legacy/dslpipemon.c b/util/wanpipemon_legacy/dslpipemon.c index 1736eba..b6f51aa 100644 --- a/util/wanpipemon_legacy/dslpipemon.c +++ b/util/wanpipemon_legacy/dslpipemon.c @@ -82,7 +82,6 @@ extern int sock; extern wan_udp_hdr_t wan_udp; extern int protocol_cb_size; extern int trace_all_data; -unsigned int loop_counter, frame_count; /****************************************************************************** * FUNCTION PROTOTYPES * diff --git a/util/wanpipemon_legacy/wanpipemon_legacy.c b/util/wanpipemon_legacy/wanpipemon_legacy.c index 488a50f..dfc88ad 100644 --- a/util/wanpipemon_legacy/wanpipemon_legacy.c +++ b/util/wanpipemon_legacy/wanpipemon_legacy.c @@ -130,7 +130,6 @@ char TRACE_ASCII=0; char TRACE_HEX=0; char *cmd[MAX_CMD_ARG]; -FT1_LED_STATUS FT1_LED; /****************************************************************************** * FUNCTION PROTOTYPES * @@ -148,7 +147,6 @@ static int GetWANConfig(void); #if 0 static void sig_handler(int sigint); #endif -int fail=0; int xml_output=0; //static sa_family_t get_if_family(char*); diff --git a/util/wanpipemon_legacy/xpipemon.c b/util/wanpipemon_legacy/xpipemon.c index 58285fa..20a644c 100644 --- a/util/wanpipemon_legacy/xpipemon.c +++ b/util/wanpipemon_legacy/xpipemon.c @@ -64,7 +64,6 @@ void flush_hdlc_stat(void); /* global for now */ static unsigned char station_config; int off_counter, green_counter, red_counter; -int loop_counter, fail; /* defines for now */ extern int lcn_number; diff --git a/wanpipe.spec b/wanpipe.spec index 3897d5a..e2d59ff 100644 --- a/wanpipe.spec +++ b/wanpipe.spec @@ -25,7 +25,7 @@ # %define NAME wanpipe -%define VERSION 7.0.33 +%define VERSION 7.0.34 %define RELEASE 0 %define KVERSION %{?kernel} %define KSRC %{?ksrc}