Skip to content

Instantly share code, notes, and snippets.

@wilane
Created January 12, 2016 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wilane/e2f2ddcce81bde2ad81a to your computer and use it in GitHub Desktop.
Save wilane/e2f2ddcce81bde2ad81a to your computer and use it in GitHub Desktop.
Debian 8 (Jessie), linux-3.16.7-ckt11-1, Sangoma wanpipe-7.0.14 Failure

Observation

The wanpipe-7.0.14 package refused to compile against my kernel version 3.16.7-ckt11-1 and using DAHDI built from the contents of the repo:

apt-get install \
    libpri1.4 \
    asterisk-dahdi \
    linux-headers-$(uname -r) \
    dahdi-source
m-a a-i dahdi

Resolution

Found a few links that helped me along the way:

Compilation Patch

I ended up hacking together a patch that worked... (See the other attached file)

Continued Failures

When trying to modprobe wanpipe, the modules fails to insert:

$ modprobe wanpipe
ERROR: could not insert 'wanpipe': Invalid argument

And we can see this in dmesg -T:

[Fri Jul 17 14:43:44 2015] WANPIPE(tm) Hardware Support Module  7.0.14.0 (c) 1994-2013 Sangoma Technologies Inc
[Fri Jul 17 14:43:44 2015] usbcore: registered new interface driver sdlausb
[Fri Jul 17 14:43:44 2015] WANPIPE(tm) Interface Support Module 7.0.14.0 (c) 1994-2013 Sangoma Technologies Inc
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for dahdi_hdlc_putbuf
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol dahdi_hdlc_putbuf (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for _dahdi_ec_span
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol _dahdi_ec_span (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for dahdi_alarm_notify
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol dahdi_alarm_notify (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for dahdi_hdlc_getbuf
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol dahdi_hdlc_getbuf (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for __dahdi_mulaw
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol __dahdi_mulaw (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for _dahdi_receive
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol _dahdi_receive (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for dahdi_create_device
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol dahdi_create_device (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for dahdi_qevent_lock
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol dahdi_qevent_lock (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for dahdi_hooksig
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol dahdi_hooksig (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for dahdi_unregister_device
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol dahdi_unregister_device (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for dahdi_register_device
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol dahdi_register_device (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for __dahdi_ec_chunk
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol __dahdi_ec_chunk (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for dahdi_hdlc_finish
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol dahdi_hdlc_finish (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for dahdi_alarm_channel
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol dahdi_alarm_channel (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for dahdi_free_device
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol dahdi_free_device (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for dahdi_rbsbits
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol dahdi_rbsbits (err -22)
[Fri Jul 17 14:43:44 2015] wanpipe: no symbol version for _dahdi_transmit
[Fri Jul 17 14:43:44 2015] wanpipe: Unknown symbol _dahdi_transmit (err -22)
[Fri Jul 17 14:43:44 2015] usbcore: deregistering interface driver sdlausb
diff --git a/patches/kdrivers/src/net/sdladrv.c b/patches/kdrivers/src/net/sdladrv.c
index 86b053f..a8fd4ce 100644
--- a/patches/kdrivers/src/net/sdladrv.c
+++ b/patches/kdrivers/src/net/sdladrv.c
@@ -110,6 +110,17 @@
****************************************************************************
*/
+/**
+ * Patch for kernels > 3.6
+ */
+#ifndef pci_dev_b
+#define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list)
+#endif
+
+#ifndef pci_bus_b
+#define pci_bus_b(n) list_entry(n, struct pci_bus, node)
+#endif
+
#ifdef __OpenBSD__
# undef WANDEBUG /* Uncomment this line for debug purpose */
#endif
diff --git a/patches/kdrivers/src/wanrouter/af_wanpipe.c b/patches/kdrivers/src/wanrouter/af_wanpipe.c
index aec2543..2d395d1 100644
--- a/patches/kdrivers/src/wanrouter/af_wanpipe.c
+++ b/patches/kdrivers/src/wanrouter/af_wanpipe.c
@@ -393,13 +393,13 @@ static int wanpipe_listen_rcv (struct sk_buff *skb, struct sock *sk)
* processes. */
if (!skb){
sk->sk_state = WANSOCK_BIND_LISTEN;
- sk->sk_data_ready(sk,0);
+ sk->sk_data_ready(sk);
return 0;
}
if (sk->sk_state != WANSOCK_LISTEN){
printk(KERN_INFO "af_wanpipe: Listen rcv in disconnected state!\n");
- sk->sk_data_ready(sk,0);
+ sk->sk_data_ready(sk);
return -EINVAL;
}
@@ -493,7 +493,7 @@ static int wanpipe_listen_rcv (struct sk_buff *skb, struct sock *sk)
* the dev field in the accept function.*/
skb_set_owner_r(skb, sk);
- sk->sk_data_ready(sk,skb->len);
+ sk->sk_data_ready(sk);
skb_queue_tail(&sk->sk_receive_queue, skb);
return 0;
@@ -750,14 +750,14 @@ static int wanpipe_api_sock_rcv(struct sk_buff *skb, netdevice_t *dev, struct s
}else{
if (sock_queue_rcv_skb(sk,skb)<0){
AF_SKB_DEC(skb->truesize);
- sk->sk_data_ready(sk,0);
+ sk->sk_data_ready(sk);
return -ENOMEM;
}
}
#else
if (sock_queue_rcv_skb(sk,skb)<0){
AF_SKB_DEC(skb->truesize);
- sk->sk_data_ready(sk,0);
+ sk->sk_data_ready(sk);
return -ENOMEM;
}
#endif
@@ -767,7 +767,7 @@ static int wanpipe_api_sock_rcv(struct sk_buff *skb, netdevice_t *dev, struct s
* Do not set the sock lcn number here, since
* cmd is not guaranteed to be executed on the
* board, thus Lcn could be wrong */
- sk->sk_data_ready(sk,skb->len);
+ sk->sk_data_ready(sk);
KFREE_SKB(skb);
break;
case WAN_PACKET_ERR:
@@ -1761,7 +1761,7 @@ int wanpipe_notifier(struct notifier_block *this, unsigned long msg, void *data)
dev_put((struct net_device *)SK_PRIV(sk)->dev);
SK_PRIV(sk)->dev=NULL;
}
- sk->sk_data_ready(sk,0);
+ sk->sk_data_ready(sk);
}
break;
}
@@ -1866,7 +1866,7 @@ static int wanpipe_api_connected(struct net_device *dev, struct sock *sk)
DEBUG_TEST("%s: API Connected!\n",__FUNCTION__);
sk->sk_state = WANSOCK_CONNECTED;
- sk->sk_data_ready(sk,0);
+ sk->sk_data_ready(sk);
return 0;
}
@@ -1881,7 +1881,7 @@ static int wanpipe_api_connecting(struct net_device *dev, struct sock *sk)
DEBUG_TEST("%s: API Connecting!\n",__FUNCTION__);
sk->sk_state = WANSOCK_CONNECTING;
- sk->sk_data_ready(sk,0);
+ sk->sk_data_ready(sk);
return 0;
}
@@ -1896,7 +1896,7 @@ static int wanpipe_api_disconnected(struct sock *sk)
sk->sk_state == WANSOCK_LISTEN) {
sk->sk_state = WANSOCK_DISCONNECTED;
- sk->sk_data_ready(sk,0);
+ sk->sk_data_ready(sk);
return 0;
}
@@ -1909,7 +1909,7 @@ static int wanpipe_api_disconnected(struct sock *sk)
sk->sk_state = WANSOCK_DISCONNECTED;
- sk->sk_data_ready(sk,0);
+ sk->sk_data_ready(sk);
return 0;
}
@@ -2009,7 +2009,7 @@ static int sk_poll_wake (struct sock *sk)
if (!wansk_is_zapped(sk))
return -EINVAL;
- sk->sk_data_ready(sk,0);
+ sk->sk_data_ready(sk);
return 0;
}
diff --git a/patches/kdrivers/src/wanrouter/af_wanpipe_datascope.c b/patches/kdrivers/src/wanrouter/af_wanpipe_datascope.c
index 40fa002..d9e10a0 100644
--- a/patches/kdrivers/src/wanrouter/af_wanpipe_datascope.c
+++ b/patches/kdrivers/src/wanrouter/af_wanpipe_datascope.c
@@ -471,7 +471,7 @@ void wanpipe_wakup_sk_attached_to_parent(struct sock *parent_sk)
for (i=0;i<MAX_PARENT_PROT_NUM;i++){
if ((sk=PPRIV(parent_sk)->sk_to_prot_map[i]) != NULL){
sk->sk_state = parent_sk->sk_state;
- sk->sk_data_ready(sk,0);
+ sk->sk_data_ready(sk);
}
}
}
@@ -637,7 +637,7 @@ static int wanpipe_rx_prot_data(void **map, unsigned short protocol, struct sk_b
}
if ((err=sock_queue_rcv_skb(sk,skb))<0){
- sk->sk_data_ready(sk,0);
+ sk->sk_data_ready(sk);
if (net_ratelimit()){
DEBUG_EVENT("%s: Sock failed to rx on prot %s: sock full: err %i truesize %i sktotal %i skblen %i!\n",
__FUNCTION__,
diff --git a/Setup b/Setup
index c6dfcf2..8b263f2 100755
--- a/Setup
+++ b/Setup
@@ -976,6 +976,9 @@ get_kernel_ver ()
done < $1/Makefile
+ KVER=$(uname -r | cut -d. -f1)
+ KLVL=$(uname -r | cut -d. -f2)
+ KPATCH=$(uname -r | cut -d. -f3 | egrep -o '^[0-9]+')
KERNEL_VERSION=$KVER"."$KPATCH"."$KLVL$KEVER
if [ "$KVER" -eq "3" ]; then
@@ -7611,7 +7614,7 @@ else
LINUXDRIVERS_NET="drivers/net/wan"
DEFAULT_PROTOCOLS=$DEFAULT_PROTOCOLS"-ADSL-ATM"
else
- eval "uname -r | grep \"^3.0.*\" > /dev/null"
+ eval "uname -r | grep \"^3\.\" > /dev/null"
if [ $? -eq 0 ]; then
KERN_VER=30
LINUXDRIVERS_NET="drivers/net/wan"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment