mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 13:27:09 +02:00
main/dahdi-linux-vanilla: new aport (replacing dahdi-linux-hardened)
This commit is contained in:
parent
4815c17138
commit
a89bb38a67
108
main/dahdi-linux-vanilla/APKBUILD
Normal file
108
main/dahdi-linux-vanilla/APKBUILD
Normal file
@ -0,0 +1,108 @@
|
||||
# Contributor: Timo Teras <timo.teras@iki.fi>
|
||||
# Maintainer: Timo Teras <timo.teras@iki.fi>
|
||||
|
||||
_flavor=vanilla
|
||||
_kpkg=linux-$_flavor
|
||||
_kver=4.14.16
|
||||
_kpkgrel=0
|
||||
_mypkgrel=0
|
||||
|
||||
_kpkgver="$_kver-r$_kpkgrel"
|
||||
_abi_release=${_kver}-${_kpkgrel}-${_flavor}
|
||||
_realname=dahdi-linux
|
||||
|
||||
pkgname=${_realname}-${_flavor}
|
||||
pkgver=$_kver
|
||||
# when chaning _dahdiver we *must* bump _mypkgrel
|
||||
_dahdiver=2.11.1
|
||||
pkgrel=$(( $_kpkgrel + $_mypkgrel ))
|
||||
pkgdesc="Digium Asterisk Hardware Device Interface drivers $_dahdiver"
|
||||
url="http://www.asterisk.org"
|
||||
arch="x86 x86_64"
|
||||
license="GPL"
|
||||
depends="dahdi-linux linux-${_flavor}=${_kpkgver}"
|
||||
# we need wget and tar because make install downloads firmware and uses fancy
|
||||
# options for tar and wget.
|
||||
makedepends="linux-${_flavor}-dev=${_kpkgver} wget tar perl"
|
||||
install=
|
||||
subpackages="$pkgname-dev"
|
||||
provides="${_realname}-grsec=${pkgver}-r${pkgrel}"
|
||||
source="http://downloads.digium.com/pub/telephony/dahdi-linux/releases/${_realname}-$_dahdiver.tar.gz
|
||||
dahdi-depmod.patch
|
||||
dahdi-bri_dchan.patch
|
||||
dahdi-zaphfc.patch
|
||||
zaphfc-dahdi-flortz.diff
|
||||
zaphfc-dahdi-2.4.0.patch
|
||||
zaphfc-dahdi-2.5.0.patch
|
||||
zaphfc-dahdi-2.6.0.patch
|
||||
zaphfc-dahdi-2.7.0.patch
|
||||
linux-3.13.patch
|
||||
linux-4.4.patch
|
||||
linux-4.11.patch
|
||||
linux-4.13.patch
|
||||
"
|
||||
|
||||
prepare() {
|
||||
cd "$srcdir/$_realname-$_dahdiver"
|
||||
# verify the kernel version
|
||||
(
|
||||
|
||||
if [ -f "$startdir"/../linux-${_flavor}/APKBUILD ]; then
|
||||
. "$startdir"/../linux-${_flavor}/APKBUILD
|
||||
if [ "$_kver" != "$pkgver" ]; then
|
||||
die "dahdi-linux-grsec: please update _kver to $pkgver"
|
||||
fi
|
||||
if [ "$_kpkgrel" != "$pkgrel" ]; then
|
||||
die "dahdi-linux-grsec: please update _kpkgrel to $pkgrel"
|
||||
fi
|
||||
fi
|
||||
) || return 1
|
||||
|
||||
for i in $source; do
|
||||
case $i in
|
||||
*.patch|*.diff)
|
||||
msg "Applying $i"
|
||||
patch -p1 -i "$srcdir"/$i || return 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$srcdir/$_realname-$_dahdiver"
|
||||
make KVERS="${_abi_release}" DYNFS="yes" MODULES_EXTRA="zaphfc" \
|
||||
|| return 1
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir/$_realname-$_dahdiver"
|
||||
make KVERS="${_abi_release}" DYNFS="yes" MODULES_EXTRA="zaphfc" \
|
||||
DESTDIR="$pkgdir" install-modules || return 1
|
||||
rm -rf "$pkgdir"/lib/firmware "$pkgdir"/usr/lib/hotplug/firmware \
|
||||
"$pkgdir"/usr/include
|
||||
}
|
||||
|
||||
# since we sourced the APKBUILD above we got the dev() function there to
|
||||
# so we override it again.
|
||||
depends_dev="dahdi-linux-dev"
|
||||
dev() {
|
||||
default_dev
|
||||
local dir="$subpkgdir"/usr/src/dahdi-headers-${_abi_release}
|
||||
install -D "$srcdir"/$_realname-$_dahdiver/drivers/dahdi/Module.symvers \
|
||||
"$dir"/drivers/dahdi/Module.symvers
|
||||
ln -s /usr/include "$dir"/include
|
||||
}
|
||||
|
||||
sha512sums="db15d9237f157b5349de8f4cdb45573ed42e1dd25c83f900835c7e15637a19e1e95c7c990dc786c1e3f37f32419f3d009e179d27b5d16421789ff9bc76f54224 dahdi-linux-2.11.1.tar.gz
|
||||
aba01eb90d9db1c595ff22078c76aadb20900486b5794d38b7ee61fa30d2fb51be318a4d059246017640447aee03fb09bb5514c818e3caa1cd98e331ec065173 dahdi-depmod.patch
|
||||
fa2fa9e96eefc0f31a1a4a8f8f44e77936f6da0d7b74fe3c3d1f0de085621744ae4367932ac97a10b7f96b7d0954843b0bfe07a251b85434079cc6da29e243ba dahdi-bri_dchan.patch
|
||||
8ef31c9723237da83954832df5aee1f5daa23f8fefe07a1a191a2c5da2c2308001d68cee83500f7ef43166bfc0d65552b0ca5362789c5c82a7217e09362fd5fe dahdi-zaphfc.patch
|
||||
f18043fd18a05be7e49daa9d8c96c8a8c45936b14e82e30523e4d88b1620a73147f765d24d2038c4ec0855901e36e8e2b188d596f94437dfb80f6d76ab699d9d zaphfc-dahdi-flortz.diff
|
||||
8068fcbba81b819bbd14a1a324457d0febd5350d16c6443be035c50f7759010376bd92d3c7ea69b47309e02603e587387b643f64663652e162853515371a6da5 zaphfc-dahdi-2.4.0.patch
|
||||
95811d56f5567bbab1e6fac89fdc7a4d78252a54a416e884903ae2709f8922f5cd02c492de0bad5c35fdfd52250ec231ed11457e36ba33f8747c3226491882de zaphfc-dahdi-2.5.0.patch
|
||||
7533c640817f71789c922bb9a5a3b6132b5b47958770929b1c9a50a1e2e6de914e278f466a85ef99759e291e5907c56d60926c74075f4e731a9910a46c1be3ea zaphfc-dahdi-2.6.0.patch
|
||||
daca74da31c655265164a854987d45ca5ee3af1defbe2d49a9f1a70a48a43dc2bc3ceba724781ae29e3a9078b827f641d2e29809fb25101986f2f69c767d1382 zaphfc-dahdi-2.7.0.patch
|
||||
dfc2b0357dc3d2a37c45f1fcc503009cf35e99c8b174d0dd7c91ac4c2c9bb3428f9a19a3f264446069fd751441833f43e11b3b55a060865c6daca9bef74008be linux-3.13.patch
|
||||
18cc299c9b9ab05b93769c0aa68595d3b3b640b97c6ee546b9cbe551f08679557c7e2a5a8255577ab6ae7036c2210550b45066b03d04ebbe7adad1a59aba5866 linux-4.4.patch
|
||||
1ce44a927607e04013f03af7655687098397b68c0e857beb5b4d6ae09e92cac59974fd69b5be6bf6d2e4d8e5643f2ce54d9e05661da656d943b5f30c4696ef41 linux-4.11.patch
|
||||
ded7386794abad54fb9f7106e4dc0cc62da1a6b32baaed35a15820f935fe65128e9639bf27eaca392fec0750fd0ee13dbb0cbbf95b8d749085d491361a2b3da2 linux-4.13.patch"
|
22
main/dahdi-linux-vanilla/constify.patch
Normal file
22
main/dahdi-linux-vanilla/constify.patch
Normal file
@ -0,0 +1,22 @@
|
||||
--- ./drivers/dahdi/voicebus/voicebus.h.orig
|
||||
+++ ./drivers/dahdi/voicebus/voicebus.h
|
||||
@@ -89,7 +89,7 @@
|
||||
void (*handle_receive)(struct voicebus *vb, struct list_head *buffers);
|
||||
void (*handle_transmit)(struct voicebus *vb, struct list_head *buffers);
|
||||
void (*handle_error)(struct voicebus *vb);
|
||||
-};
|
||||
+} __no_const;
|
||||
|
||||
/**
|
||||
* struct voicebus_descriptor_list - A single descriptor list.
|
||||
--- ./drivers/dahdi/wctc4xxp/base.c.orig
|
||||
+++ ./drivers/dahdi/wctc4xxp/base.c
|
||||
@@ -3193,7 +3193,7 @@
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static void wctc4xxp_setup_file_operations(struct file_operations *fops)
|
||||
+static void wctc4xxp_setup_file_operations(file_operations_no_const *fops)
|
||||
{
|
||||
fops->owner = THIS_MODULE;
|
||||
fops->read = wctc4xxp_read;
|
327
main/dahdi-linux-vanilla/dahdi-2.5.0-bri-fixes.patch
Normal file
327
main/dahdi-linux-vanilla/dahdi-2.5.0-bri-fixes.patch
Normal file
@ -0,0 +1,327 @@
|
||||
Index: dahdi-linux-2.5.0/drivers/dahdi/xpp/card_bri.c
|
||||
===================================================================
|
||||
--- dahdi-linux-2.5.0.orig/drivers/dahdi/xpp/card_bri.c 2011-08-15 14:42:29.000000000 +0300
|
||||
+++ dahdi-linux-2.5.0/drivers/dahdi/xpp/card_bri.c 2011-08-15 14:51:37.000000000 +0300
|
||||
@@ -274,7 +274,6 @@
|
||||
int frame_begin;
|
||||
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
if(transmit) {
|
||||
direction = "TX";
|
||||
frame_begin = priv->txframe_begin;
|
||||
@@ -312,9 +311,7 @@
|
||||
{
|
||||
struct BRI_priv_data *priv;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
if(priv->dchan_alive == up)
|
||||
return;
|
||||
if(up) {
|
||||
@@ -332,9 +329,7 @@
|
||||
{
|
||||
struct BRI_priv_data *priv;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
if(priv->layer1_up == up)
|
||||
return;
|
||||
priv->layer1_up = up;
|
||||
@@ -348,9 +343,7 @@
|
||||
struct BRI_priv_data *priv;
|
||||
byte curr_state;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
curr_state = priv->state_register.bits.v_su_sta;
|
||||
XPD_DBG(SIGNAL, xpd, "%s\n", (on)?"ON":"OFF");
|
||||
if(on) {
|
||||
@@ -391,9 +384,7 @@
|
||||
struct BRI_priv_data *priv;
|
||||
byte curr_state;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
curr_state = priv->state_register.bits.v_su_sta;
|
||||
XPD_DBG(SIGNAL, xpd, "%s\n", (on)?"ON":"OFF");
|
||||
if(on) {
|
||||
@@ -443,7 +434,6 @@
|
||||
struct BRI_priv_data *priv;
|
||||
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
#ifdef CONFIG_DAHDI_BRI_DCHANS
|
||||
if(debug & DBG_COMMANDS)
|
||||
dump_hex_buf(xpd, "D-Chan(abort) RX: dchan_rbuf",
|
||||
@@ -460,7 +450,6 @@
|
||||
byte status;
|
||||
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
#ifdef CONFIG_DAHDI_BRI_DCHANS
|
||||
if(priv->dchan_r_idx < 4) {
|
||||
XPD_NOTICE(xpd, "D-Chan RX short frame (dchan_r_idx=%d)\n",
|
||||
@@ -503,7 +492,6 @@
|
||||
int idx;
|
||||
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
dchan_buf = dchan->readchunk;
|
||||
idx = priv->dchan_r_idx;
|
||||
if(idx + len >= DCHAN_BUFSIZE) {
|
||||
@@ -527,7 +515,6 @@
|
||||
struct BRI_priv_data *priv;
|
||||
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
#ifdef CONFIG_DAHDI_BRI_DCHANS
|
||||
dchan->bytes2receive = priv->dchan_r_idx - 1;
|
||||
dchan->eofrx = 1;
|
||||
@@ -556,10 +543,7 @@
|
||||
return 0;
|
||||
if(!SPAN_REGISTERED(xpd)) /* Nowhere to copy data */
|
||||
return 0;
|
||||
- BUG_ON(!xpd);
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
- xbus = xpd->xbus;
|
||||
dchan = XPD_CHAN(xpd, 2);
|
||||
if(!IS_OFFHOOK(xpd, 2)) { /* D-chan is used? */
|
||||
static int rate_limit;
|
||||
@@ -629,9 +613,7 @@
|
||||
return 0;
|
||||
if(!SPAN_REGISTERED(xpd)) /* Nowhere to copy data */
|
||||
return 0;
|
||||
- BUG_ON(!xpd);
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
dchan = XPD_CHAN(xpd, 2);
|
||||
if(!IS_OFFHOOK(xpd, 2)) { /* D-chan is used? */
|
||||
static int rate_limit;
|
||||
@@ -677,7 +659,6 @@
|
||||
struct BRI_priv_data *priv;
|
||||
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
dchan = XPD_CHAN(xpd, 2);
|
||||
if (dchan == chan) {
|
||||
atomic_inc(&priv->hdlc_pending);
|
||||
@@ -716,7 +697,6 @@
|
||||
int ret;
|
||||
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
#ifndef CONFIG_DAHDI_BRI_DCHANS
|
||||
if(atomic_read(&priv->hdlc_pending) == 0)
|
||||
return 0;
|
||||
@@ -769,7 +749,6 @@
|
||||
{
|
||||
struct BRI_priv_data *priv;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
priv = xpd->priv;
|
||||
XPD_DBG(PROC, xpd, "\n");
|
||||
#ifdef CONFIG_PROC_FS
|
||||
@@ -784,7 +763,6 @@
|
||||
{
|
||||
struct BRI_priv_data *priv;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
priv = xpd->priv;
|
||||
XPD_DBG(PROC, xpd, "\n");
|
||||
#ifdef CONFIG_PROC_FS
|
||||
@@ -828,7 +806,6 @@
|
||||
{
|
||||
struct BRI_priv_data *priv;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
XPD_DBG(GENERAL, xpd, "\n");
|
||||
priv = xpd->priv;
|
||||
DO_LED(xpd, GREEN_LED, BRI_LED_OFF);
|
||||
@@ -841,7 +818,6 @@
|
||||
|
||||
static int BRI_card_remove(xbus_t *xbus, xpd_t *xpd)
|
||||
{
|
||||
- BUG_ON(!xpd);
|
||||
XPD_DBG(GENERAL, xpd, "\n");
|
||||
bri_proc_remove(xbus, xpd);
|
||||
return 0;
|
||||
@@ -877,10 +853,8 @@
|
||||
struct BRI_priv_data *priv;
|
||||
int i;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
xbus = xpd->xbus;
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!xbus);
|
||||
XPD_DBG(GENERAL, xpd, "%s\n", (on)?"on":"off");
|
||||
if(!on) {
|
||||
/* Nothing to do yet */
|
||||
@@ -927,11 +901,6 @@
|
||||
|
||||
static int BRI_card_dahdi_postregistration(xpd_t *xpd, bool on)
|
||||
{
|
||||
- xbus_t *xbus;
|
||||
-
|
||||
- BUG_ON(!xpd);
|
||||
- xbus = xpd->xbus;
|
||||
- BUG_ON(!xbus);
|
||||
XPD_DBG(GENERAL, xpd, "%s\n", (on)?"on":"off");
|
||||
return(0);
|
||||
}
|
||||
@@ -956,7 +925,6 @@
|
||||
int other_led;
|
||||
int mod;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
if(IS_NT(xpd)) {
|
||||
which_led = RED_LED;
|
||||
other_led = GREEN_LED;
|
||||
@@ -965,7 +933,6 @@
|
||||
other_led = RED_LED;
|
||||
}
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
timer_count = xpd->timer_count;
|
||||
if(xpd->blink_mode) {
|
||||
if((timer_count % DEFAULT_LED_PERIOD) == 0) {
|
||||
@@ -1014,9 +981,7 @@
|
||||
{
|
||||
struct BRI_priv_data *priv;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
if(IS_NT(xpd)) {
|
||||
if (priv->t1 > HFC_TIMER_OFF) {
|
||||
if (--priv->t1 == 0) {
|
||||
@@ -1053,9 +1018,7 @@
|
||||
{
|
||||
struct BRI_priv_data *priv;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
if(!priv->initialized || !xbus->self_ticking)
|
||||
return 0;
|
||||
if(poll_interval != 0 && (priv->tick_counter % poll_interval) == 0) {
|
||||
@@ -1111,7 +1074,6 @@
|
||||
|
||||
static int BRI_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
- BUG_ON(!xpd);
|
||||
if(!XBUS_IS(xpd->xbus, READY))
|
||||
return -ENODEV;
|
||||
switch (cmd) {
|
||||
@@ -1131,7 +1093,6 @@
|
||||
|
||||
static int BRI_card_open(xpd_t *xpd, lineno_t pos)
|
||||
{
|
||||
- BUG_ON(!xpd);
|
||||
if(pos == 2) {
|
||||
LINE_DBG(SIGNAL, xpd, pos, "OFFHOOK the whole span\n");
|
||||
BIT_SET(PHONEDEV(xpd).offhook_state, 0);
|
||||
@@ -1230,12 +1191,8 @@
|
||||
{
|
||||
struct phonedev *phonedev = container_of(span, struct phonedev, span);
|
||||
xpd_t *xpd = container_of(phonedev, struct xpd, phonedev);
|
||||
- struct BRI_priv_data *priv;
|
||||
struct dahdi_chan *dchan;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
- priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
if(!XBUS_IS(xpd->xbus, READY)) {
|
||||
XPD_DBG(GENERAL, xpd, "Startup called by dahdi. No Hardware. Ignored\n");
|
||||
return -ENODEV;
|
||||
@@ -1267,11 +1224,7 @@
|
||||
{
|
||||
struct phonedev *phonedev = container_of(span, struct phonedev, span);
|
||||
xpd_t *xpd = container_of(phonedev, struct xpd, phonedev);
|
||||
- struct BRI_priv_data *priv;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
- priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
if(!XBUS_IS(xpd->xbus, READY)) {
|
||||
XPD_DBG(GENERAL, xpd, "Shutdown called by dahdi. No Hardware. Ignored\n");
|
||||
return -ENODEV;
|
||||
@@ -1292,7 +1245,6 @@
|
||||
xpd_t *main_xpd;
|
||||
unsigned long flags;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
main_xpd = xpd_byaddr(xpd->xbus, xpd->addr.unit, 0);
|
||||
if(!main_xpd) {
|
||||
XPD_DBG(DEVICES, xpd, "Unit 0 is already gone. Ignore request\n");
|
||||
@@ -1350,8 +1302,6 @@
|
||||
xpp_line_t wanted_lines;
|
||||
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
- BUG_ON(!pack);
|
||||
pcm = RPACKET_FIELD(pack, GLOBAL, PCM_WRITE, pcm);
|
||||
for(subunit = 0; subunit < MAX_SUBUNIT; subunit++) {
|
||||
xpd_t *tmp_xpd;
|
||||
@@ -1435,12 +1385,8 @@
|
||||
|
||||
static int BRI_echocancel_setmask(xpd_t *xpd, xpp_line_t ec_mask)
|
||||
{
|
||||
- struct BRI_priv_data *priv;
|
||||
int i;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
- priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
XPD_DBG(GENERAL, xpd, "0x%8X\n", ec_mask);
|
||||
if (!ECHOOPS(xpd->xbus)) {
|
||||
XPD_DBG(GENERAL, xpd,
|
||||
@@ -1466,9 +1412,7 @@
|
||||
struct bri_leds *bri_leds;
|
||||
struct BRI_priv_data *priv;
|
||||
|
||||
- BUG_ON(!xbus);
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
XPD_DBG(LEDS, xpd, "%s -> %d\n",
|
||||
(which_led)?"RED":"GREEN",
|
||||
to_led_state);
|
||||
@@ -1507,9 +1451,7 @@
|
||||
struct BRI_priv_data *priv;
|
||||
su_rd_sta_t new_state;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
if(!priv->initialized) {
|
||||
XPD_ERR(xpd, "%s called on uninitialized AB\n", __FUNCTION__);
|
||||
return;
|
||||
@@ -1621,7 +1563,6 @@
|
||||
}
|
||||
spin_lock_irqsave(&xpd->lock, flags);
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
if(REG_FIELD(info, do_subreg)) {
|
||||
XPD_DBG(REGS, xpd, "RI %02X %02X %02X\n",
|
||||
REG_FIELD(info, regnum), REG_FIELD(info, subreg), REG_FIELD(info, data_low));
|
||||
@@ -1665,7 +1606,6 @@
|
||||
{
|
||||
struct BRI_priv_data *priv;
|
||||
|
||||
- BUG_ON(!xpd);
|
||||
priv = xpd->priv;
|
||||
XPD_DBG(GENERAL, xpd, "%s\n", (on)?"ON":"OFF");
|
||||
if(on) {
|
||||
@@ -1745,7 +1685,6 @@
|
||||
return -ENODEV;
|
||||
spin_lock_irqsave(&xpd->lock, flags);
|
||||
priv = xpd->priv;
|
||||
- BUG_ON(!priv);
|
||||
len += sprintf(page + len, "%05d Layer 1: ", priv->poll_counter);
|
||||
if(priv->reg30_good) {
|
||||
len += sprintf(page + len, "%-5s ", (priv->layer1_up) ? "UP" : "DOWN");
|
167
main/dahdi-linux-vanilla/dahdi-bri_dchan.patch
Normal file
167
main/dahdi-linux-vanilla/dahdi-bri_dchan.patch
Normal file
@ -0,0 +1,167 @@
|
||||
# Translate the D channels to a standard channel data.
|
||||
# The HFC chipset provides us the D channel as data, but
|
||||
# Zaptel expects it as a standard channel with 1000 samples
|
||||
# per second.
|
||||
|
||||
Index: dahdi-linux-2.5.0/include/dahdi/kernel.h
|
||||
===================================================================
|
||||
--- dahdi-linux-2.5.0.orig/include/dahdi/kernel.h 2011-06-29 18:32:40.000000000 +0300
|
||||
+++ dahdi-linux-2.5.0/include/dahdi/kernel.h 2011-08-15 14:14:26.000000000 +0300
|
||||
@@ -413,6 +413,13 @@
|
||||
int statcount;
|
||||
int lastnumbufs;
|
||||
#endif
|
||||
+#ifdef CONFIG_DAHDI_BRI_DCHANS
|
||||
+ int bytes2receive;
|
||||
+ int maxbytes2transmit; /* size of the tx buffer in the card driver */
|
||||
+ int bytes2transmit;
|
||||
+ int eofrx;
|
||||
+ int eoftx;
|
||||
+#endif
|
||||
spinlock_t lock;
|
||||
char name[40];
|
||||
/* Specified by DAHDI */
|
||||
@@ -723,6 +730,9 @@
|
||||
DAHDI_FLAGBIT_TXUNDERRUN = 22, /*!< Transmit underrun condition */
|
||||
DAHDI_FLAGBIT_RXOVERRUN = 23, /*!< Receive overrun condition */
|
||||
DAHDI_FLAGBIT_DEVFILE = 25, /*!< Channel has a sysfs dev file */
|
||||
+#if defined(CONFIG_DAHDI_BRI_DCHANS)
|
||||
+ DAHDI_FLAGBIT_BRIDCHAN = 26, /*!< hardhdlc-like handling of the D channel */
|
||||
+#endif
|
||||
};
|
||||
|
||||
#ifdef CONFIG_DAHDI_NET
|
||||
@@ -789,6 +799,7 @@
|
||||
#define DAHDI_FLAG_BUFEVENTS DAHDI_FLAG(BUFEVENTS)
|
||||
#define DAHDI_FLAG_TXUNDERRUN DAHDI_FLAG(TXUNDERRUN)
|
||||
#define DAHDI_FLAG_RXOVERRUN DAHDI_FLAG(RXOVERRUN)
|
||||
+#define DAHDI_FLAG_BRIDCHAN DAHDI_FLAG(BRIDCHAN)
|
||||
|
||||
struct file;
|
||||
|
||||
Index: dahdi-linux-2.5.0/include/dahdi/dahdi_config.h
|
||||
===================================================================
|
||||
--- dahdi-linux-2.5.0.orig/include/dahdi/dahdi_config.h 2011-01-05 17:52:03.000000000 +0200
|
||||
+++ dahdi-linux-2.5.0/include/dahdi/dahdi_config.h 2011-08-15 14:13:01.000000000 +0300
|
||||
@@ -195,4 +195,10 @@
|
||||
*/
|
||||
/* #define CONFIG_DAHDI_MIRROR */
|
||||
|
||||
+/*
|
||||
+ * Uncomment the following for BRI D channels
|
||||
+ *
|
||||
+ */
|
||||
+#define CONFIG_DAHDI_BRI_DCHANS
|
||||
+
|
||||
#endif
|
||||
Index: dahdi-linux-2.5.0/drivers/dahdi/dahdi-base.c
|
||||
===================================================================
|
||||
--- dahdi-linux-2.5.0.orig/drivers/dahdi/dahdi-base.c 2011-07-21 19:26:31.000000000 +0300
|
||||
+++ dahdi-linux-2.5.0/drivers/dahdi/dahdi-base.c 2011-08-15 14:13:01.000000000 +0300
|
||||
@@ -7224,11 +7224,40 @@
|
||||
*(txb++) = fasthdlc_tx_run_nocheck(&ms->txhdlc);
|
||||
}
|
||||
bytes -= left;
|
||||
+#ifdef CONFIG_DAHDI_BRI_DCHANS
|
||||
+ } else if (test_bit(DAHDI_FLAGBIT_BRIDCHAN, &ms->flags)) {
|
||||
+ /*
|
||||
+ * Let's get this right, we want to transmit complete frames only.
|
||||
+ * The card driver will do the dirty HDLC work for us.
|
||||
+ * txb (transmit buffer) is supposed to be big enough to store one frame
|
||||
+ * we will make this as big as the D fifo (1KB or 2KB)
|
||||
+ */
|
||||
+
|
||||
+ /* there are 'left' bytes in the user buffer left to transmit */
|
||||
+ left = ms->writen[ms->outwritebuf] - ms->writeidx[ms->outwritebuf] - 2;
|
||||
+ if (left > ms->maxbytes2transmit) {
|
||||
+ memcpy(txb, buf + ms->writeidx[ms->outwritebuf], ms->maxbytes2transmit);
|
||||
+ ms->writeidx[ms->outwritebuf] += ms->maxbytes2transmit;
|
||||
+ txb += ms->maxbytes2transmit;
|
||||
+ ms->bytes2transmit = ms->maxbytes2transmit;
|
||||
+ ms->eoftx = 0;
|
||||
+ } else {
|
||||
+ memcpy(txb, buf + ms->writeidx[ms->outwritebuf], left);
|
||||
+ ms->writeidx[ms->outwritebuf] += left + 2;
|
||||
+ txb += left + 2;
|
||||
+ ms->bytes2transmit = left;
|
||||
+ ms->eoftx = 1;
|
||||
+ }
|
||||
+ bytes = 0;
|
||||
+#endif
|
||||
} else {
|
||||
memcpy(txb, buf + ms->writeidx[ms->outwritebuf], left);
|
||||
ms->writeidx[ms->outwritebuf]+=left;
|
||||
txb += left;
|
||||
bytes -= left;
|
||||
+#if defined(CONFIG_DAHDI_BRI_DCHANS)
|
||||
+ ms->bytes2transmit=DAHDI_CHUNKSIZE;
|
||||
+#endif
|
||||
}
|
||||
/* Check buffer status */
|
||||
if (ms->writeidx[ms->outwritebuf] >= ms->writen[ms->outwritebuf]) {
|
||||
@@ -7285,6 +7314,17 @@
|
||||
/* Transmit a flag if this is an HDLC channel */
|
||||
if (ms->flags & DAHDI_FLAG_HDLC)
|
||||
fasthdlc_tx_frame_nocheck(&ms->txhdlc);
|
||||
+#if defined(CONFIG_DAHDI_BRI_DCHANS)
|
||||
+ if (test_bit(DAHDI_FLAGBIT_BRIDCHAN, &ms->flags)) {
|
||||
+ // if (ms->bytes2transmit > 0) {
|
||||
+ // txb += 2;
|
||||
+ // ms->bytes2transmit -= 2;
|
||||
+ bytes=0;
|
||||
+ ms->eoftx = 1;
|
||||
+// printk(KERN_CRIT "zaptel EOF(%d) bytes2transmit %d\n",ms->eoftx,ms->bytes2transmit);
|
||||
+ // }
|
||||
+ }
|
||||
+#endif
|
||||
#ifdef CONFIG_DAHDI_NET
|
||||
if (dahdi_have_netdev(ms))
|
||||
netif_wake_queue(chan_to_netdev(ms));
|
||||
@@ -7346,6 +7386,12 @@
|
||||
}
|
||||
needtxunderrun += bytes;
|
||||
bytes = 0;
|
||||
+#if defined(CONFIG_DAHDI_BRI_DCHANS)
|
||||
+ } else if (test_bit(DAHDI_FLAGBIT_BRIDCHAN, &ms->flags)) {
|
||||
+ ms->bytes2transmit = 0;
|
||||
+ ms->eoftx = 0;
|
||||
+ bytes = 0;
|
||||
+#endif
|
||||
} else {
|
||||
memset(txb, DAHDI_LIN2X(0, ms), bytes); /* Lastly we use silence on telephony channels */
|
||||
needtxunderrun += bytes;
|
||||
@@ -8267,6 +8313,14 @@
|
||||
int res;
|
||||
int left, x;
|
||||
|
||||
+#if defined(CONFIG_DAHDI_BRI_DCHANS)
|
||||
+ if (test_bit(DAHDI_FLAGBIT_BRIDCHAN, &ms->flags)) {
|
||||
+ bytes = ms->bytes2receive;
|
||||
+ if (bytes < 1) return;
|
||||
+// printk(KERN_CRIT "bytes2receive %d\n",ms->bytes2receive);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
while(bytes) {
|
||||
#if defined(CONFIG_DAHDI_NET) || defined(CONFIG_DAHDI_PPP)
|
||||
skb = NULL;
|
||||
@@ -8324,6 +8378,19 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
+#ifdef CONFIG_DAHDI_BRI_DCHANS
|
||||
+ } else if (test_bit(DAHDI_FLAGBIT_BRIDCHAN, &ms->flags)) {
|
||||
+ memcpy(buf + ms->readidx[ms->inreadbuf], rxb, left);
|
||||
+ rxb += left;
|
||||
+ ms->readidx[ms->inreadbuf] += left;
|
||||
+ bytes -= left;
|
||||
+ if (ms->eofrx == 1) {
|
||||
+ eof=1;
|
||||
+ }
|
||||
+// printk(KERN_CRIT "receiving %d bytes\n",ms->bytes2receive);
|
||||
+ ms->bytes2receive = 0;
|
||||
+ ms->eofrx = 0;
|
||||
+#endif
|
||||
} else {
|
||||
/* Not HDLC */
|
||||
memcpy(buf + ms->readidx[ms->inreadbuf], rxb, left);
|
22
main/dahdi-linux-vanilla/dahdi-depmod.patch
Normal file
22
main/dahdi-linux-vanilla/dahdi-depmod.patch
Normal file
@ -0,0 +1,22 @@
|
||||
Index: dahdi-linux-2.0.0-rc4/Makefile
|
||||
===================================================================
|
||||
--- dahdi-linux-2.0.0-rc4.orig/Makefile 2008-09-09 14:07:23.000000000 +0300
|
||||
+++ dahdi-linux-2.0.0-rc4/Makefile 2008-09-09 14:12:31.000000000 +0300
|
||||
@@ -190,7 +190,7 @@
|
||||
build_tools/uninstall-modules dahdi $(KVERS)
|
||||
endif
|
||||
$(KMAKE) INSTALL_MOD_PATH=$(DESTDIR) INSTALL_MOD_DIR=dahdi modules_install
|
||||
- [ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
|
||||
+ [ -z "$(DESTDIR)" -a `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
|
||||
|
||||
uninstall-modules:
|
||||
ifdef DESTDIR
|
||||
@@ -203,7 +203,7 @@
|
||||
rm -rf /lib/modules/$(KVERS)/dahdi; \
|
||||
echo "done."; \
|
||||
fi
|
||||
- [ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
|
||||
+ [ -z "$(DESTDIR)" -a `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
|
||||
endif
|
||||
|
||||
update:
|
1429
main/dahdi-linux-vanilla/dahdi-zaphfc.patch
Normal file
1429
main/dahdi-linux-vanilla/dahdi-zaphfc.patch
Normal file
File diff suppressed because it is too large
Load Diff
12
main/dahdi-linux-vanilla/linux-3.13.patch
Normal file
12
main/dahdi-linux-vanilla/linux-3.13.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff --git a/drivers/dahdi/zaphfc.c b/drivers/dahdi/zaphfc.c
|
||||
index 0402b90..eb56f88 100644
|
||||
--- a/drivers/dahdi/zaphfc.c
|
||||
+++ b/drivers/dahdi/zaphfc.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/delay.h>
|
||||
+#include <linux/sched.h>
|
||||
#include <dahdi/kernel.h>
|
||||
#include "zaphfc.h"
|
||||
|
141
main/dahdi-linux-vanilla/linux-4.11.patch
Normal file
141
main/dahdi-linux-vanilla/linux-4.11.patch
Normal file
@ -0,0 +1,141 @@
|
||||
diff -ur dahdi-linux-2.11.1/drivers/dahdi/dahdi-base.c dahdi-linux-2.11.1-4.11/drivers/dahdi/dahdi-base.c
|
||||
--- dahdi-linux-2.11.1/drivers/dahdi/dahdi-base.c 2016-03-01 23:03:59.000000000 +0100
|
||||
+++ dahdi-linux-2.11.1-4.11/drivers/dahdi/dahdi-base.c 2017-05-09 20:34:45.170079849 +0200
|
||||
@@ -47,6 +47,9 @@
|
||||
#include <linux/kmod.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/sched.h>
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
|
||||
+#include <linux/sched/signal.h>
|
||||
+#endif
|
||||
#include <linux/list.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/mutex.h>
|
||||
diff -ur dahdi-linux-2.11.1/drivers/dahdi/dahdi_dynamic.c dahdi-linux-2.11.1-4.11/drivers/dahdi/dahdi_dynamic.c
|
||||
--- dahdi-linux-2.11.1/drivers/dahdi/dahdi_dynamic.c 2016-03-01 23:03:59.000000000 +0100
|
||||
+++ dahdi-linux-2.11.1-4.11/drivers/dahdi/dahdi_dynamic.c 2017-05-09 20:38:03.809649973 +0200
|
||||
@@ -467,7 +467,11 @@
|
||||
|
||||
/* We shouldn't have more than the two references at this point. If
|
||||
* we do, there are probably channels that are still opened. */
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
|
||||
if (atomic_read(&d->kref.refcount) > 2) {
|
||||
+#else
|
||||
+ if (kref_read(&d->kref) > 2) {
|
||||
+#endif
|
||||
dynamic_put(d);
|
||||
return -EBUSY;
|
||||
}
|
||||
diff -ur dahdi-linux-2.11.1/drivers/dahdi/wcaxx-base.c dahdi-linux-2.11.1-4.11/drivers/dahdi/wcaxx-base.c
|
||||
--- dahdi-linux-2.11.1/drivers/dahdi/wcaxx-base.c 2016-03-01 23:03:59.000000000 +0100
|
||||
+++ dahdi-linux-2.11.1-4.11/drivers/dahdi/wcaxx-base.c 2017-05-09 20:39:05.690553708 +0200
|
||||
@@ -28,6 +28,9 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/sched.h>
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
|
||||
+#include <linux/sched/signal.h>
|
||||
+#endif
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/moduleparam.h>
|
||||
diff -ur dahdi-linux-2.11.1/drivers/dahdi/wctc4xxp/base.c dahdi-linux-2.11.1-4.11/drivers/dahdi/wctc4xxp/base.c
|
||||
--- dahdi-linux-2.11.1/drivers/dahdi/wctc4xxp/base.c 2016-03-01 23:03:59.000000000 +0100
|
||||
+++ dahdi-linux-2.11.1-4.11/drivers/dahdi/wctc4xxp/base.c 2017-05-09 20:40:14.041864392 +0200
|
||||
@@ -26,6 +26,10 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/kmod.h>
|
||||
#include <linux/sched.h>
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
|
||||
+#include <linux/sched/signal.h>
|
||||
+#endif
|
||||
#include <linux/pci.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/delay.h>
|
||||
diff -ur dahdi-linux-2.11.1/drivers/dahdi/wctdm24xxp/base.c dahdi-linux-2.11.1-4.11/drivers/dahdi/wctdm24xxp/base.c
|
||||
--- dahdi-linux-2.11.1/drivers/dahdi/wctdm24xxp/base.c 2016-03-01 23:03:59.000000000 +0100
|
||||
+++ dahdi-linux-2.11.1-4.11/drivers/dahdi/wctdm24xxp/base.c 2017-05-09 20:39:47.343067209 +0200
|
||||
@@ -44,6 +44,9 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/sched.h>
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
|
||||
+#include <linux/sched/signal.h>
|
||||
+#endif
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/delay.h>
|
||||
diff -ur dahdi-linux-2.11.1/drivers/dahdi/wcte12xp/base.c dahdi-linux-2.11.1-4.11/drivers/dahdi/wcte12xp/base.c
|
||||
--- dahdi-linux-2.11.1/drivers/dahdi/wcte12xp/base.c 2016-03-01 23:03:59.000000000 +0100
|
||||
+++ dahdi-linux-2.11.1-4.11/drivers/dahdi/wcte12xp/base.c 2017-05-09 20:40:31.216160114 +0200
|
||||
@@ -40,6 +40,10 @@
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/sched.h>
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
|
||||
+#include <linux/sched/signal.h>
|
||||
+#endif
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
diff -ur dahdi-linux-2.11.1/drivers/dahdi/wcte43x-base.c dahdi-linux-2.11.1-4.11/drivers/dahdi/wcte43x-base.c
|
||||
--- dahdi-linux-2.11.1/drivers/dahdi/wcte43x-base.c 2016-03-01 23:03:59.000000000 +0100
|
||||
+++ dahdi-linux-2.11.1-4.11/drivers/dahdi/wcte43x-base.c 2017-05-09 20:38:38.996830549 +0200
|
||||
@@ -33,6 +33,10 @@
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/sched.h>
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
|
||||
+#include <linux/sched/signal.h>
|
||||
+#endif
|
||||
#include <linux/crc32.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
diff -ur dahdi-linux-2.11.1/drivers/dahdi/xpp/xbus-core.c dahdi-linux-2.11.1-4.11/drivers/dahdi/xpp/xbus-core.c
|
||||
--- dahdi-linux-2.11.1/drivers/dahdi/xpp/xbus-core.c 2016-03-01 23:03:59.000000000 +0100
|
||||
+++ dahdi-linux-2.11.1-4.11/drivers/dahdi/xpp/xbus-core.c 2017-05-09 20:41:27.973007253 +0200
|
||||
@@ -244,7 +244,11 @@
|
||||
{
|
||||
struct kref *kref = &xbus->kref;
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
|
||||
return atomic_read(&kref->refcount);
|
||||
+#else
|
||||
+ return kref_read(kref);
|
||||
+#endif
|
||||
}
|
||||
|
||||
/*------------------------- Frame Handling ------------------------*/
|
||||
diff -ur dahdi-linux-2.11.1/drivers/dahdi/xpp/xbus-sysfs.c dahdi-linux-2.11.1-4.11/drivers/dahdi/xpp/xbus-sysfs.c
|
||||
--- dahdi-linux-2.11.1/drivers/dahdi/xpp/xbus-sysfs.c 2016-03-01 23:03:59.000000000 +0100
|
||||
+++ dahdi-linux-2.11.1-4.11/drivers/dahdi/xpp/xbus-sysfs.c 2017-05-09 20:42:09.972886067 +0200
|
||||
@@ -974,7 +974,11 @@
|
||||
return;
|
||||
}
|
||||
XBUS_DBG(DEVICES, xbus, "going to unregister: refcount=%d\n",
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
|
||||
atomic_read(&astribank->kobj.kref.refcount));
|
||||
+#else
|
||||
+ kref_read(&astribank->kobj.kref));
|
||||
+#endif
|
||||
BUG_ON(dev_get_drvdata(astribank) != xbus);
|
||||
device_unregister(astribank);
|
||||
dev_set_drvdata(astribank, NULL);
|
||||
diff -ur dahdi-linux-2.11.1/drivers/dahdi/xpp/xpp_dahdi.c dahdi-linux-2.11.1-4.11/drivers/dahdi/xpp/xpp_dahdi.c
|
||||
--- dahdi-linux-2.11.1/drivers/dahdi/xpp/xpp_dahdi.c 2016-03-01 23:03:59.000000000 +0100
|
||||
+++ dahdi-linux-2.11.1-4.11/drivers/dahdi/xpp/xpp_dahdi.c 2017-05-09 20:42:55.336485638 +0200
|
||||
@@ -124,7 +124,11 @@
|
||||
{
|
||||
struct kref *kref = &xpd->kref;
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
|
||||
return atomic_read(&kref->refcount);
|
||||
+#else
|
||||
+ return kref_read(kref);
|
||||
+#endif
|
||||
}
|
||||
|
||||
xpd_t *get_xpd(const char *msg, xpd_t *xpd)
|
299
main/dahdi-linux-vanilla/linux-4.13.patch
Normal file
299
main/dahdi-linux-vanilla/linux-4.13.patch
Normal file
@ -0,0 +1,299 @@
|
||||
Index: dahdi-linux-2.11.1~dfsg/drivers/dahdi/dahdi-sysfs.c
|
||||
===================================================================
|
||||
--- dahdi-linux-2.11.1~dfsg.orig/drivers/dahdi/dahdi-sysfs.c
|
||||
+++ dahdi-linux-2.11.1~dfsg/drivers/dahdi/dahdi-sysfs.c
|
||||
@@ -214,6 +214,7 @@ static BUS_ATTR_READER(linecompat_show,
|
||||
return len;
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
|
||||
static struct device_attribute span_dev_attrs[] = {
|
||||
__ATTR_RO(name),
|
||||
__ATTR_RO(desc),
|
||||
@@ -230,6 +231,39 @@ static struct device_attribute span_dev_
|
||||
__ATTR_RO(linecompat),
|
||||
__ATTR_NULL,
|
||||
};
|
||||
+#else
|
||||
+static DEVICE_ATTR_RO(name);
|
||||
+static DEVICE_ATTR_RO(desc);
|
||||
+static DEVICE_ATTR_RO(spantype);
|
||||
+static DEVICE_ATTR_RO(local_spanno);
|
||||
+static DEVICE_ATTR_RO(alarms);
|
||||
+static DEVICE_ATTR_RO(lbo);
|
||||
+static DEVICE_ATTR_RO(syncsrc);
|
||||
+static DEVICE_ATTR_RO(is_digital);
|
||||
+static DEVICE_ATTR_RO(is_sync_master);
|
||||
+static DEVICE_ATTR_RO(basechan);
|
||||
+static DEVICE_ATTR_RO(channels);
|
||||
+static DEVICE_ATTR_RO(lineconfig);
|
||||
+static DEVICE_ATTR_RO(linecompat);
|
||||
+
|
||||
+static struct attribute *span_dev_attrs[] = {
|
||||
+ &dev_attr_name.attr,
|
||||
+ &dev_attr_desc.attr,
|
||||
+ &dev_attr_spantype.attr,
|
||||
+ &dev_attr_local_spanno.attr,
|
||||
+ &dev_attr_alarms.attr,
|
||||
+ &dev_attr_lbo.attr,
|
||||
+ &dev_attr_syncsrc.attr,
|
||||
+ &dev_attr_is_digital.attr,
|
||||
+ &dev_attr_is_sync_master.attr,
|
||||
+ &dev_attr_basechan.attr,
|
||||
+ &dev_attr_channels.attr,
|
||||
+ &dev_attr_lineconfig.attr,
|
||||
+ &dev_attr_linecompat.attr,
|
||||
+ NULL,
|
||||
+};
|
||||
+ATTRIBUTE_GROUPS(span_dev);
|
||||
+#endif
|
||||
|
||||
static ssize_t master_span_show(struct device_driver *driver, char *buf)
|
||||
{
|
||||
@@ -270,10 +304,11 @@ static struct bus_type spans_bus_type =
|
||||
.name = "dahdi_spans",
|
||||
.match = span_match,
|
||||
.uevent = span_uevent,
|
||||
- .dev_attrs = span_dev_attrs,
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
|
||||
+ .dev_attrs = span_dev_attrs,
|
||||
.drv_attrs = dahdi_attrs,
|
||||
#else
|
||||
+ .dev_groups = span_dev_groups,
|
||||
.drv_groups = dahdi_groups,
|
||||
#endif
|
||||
};
|
||||
@@ -690,6 +725,7 @@ dahdi_registration_time_show(struct devi
|
||||
return count;
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
|
||||
static struct device_attribute dahdi_device_attrs[] = {
|
||||
__ATTR(manufacturer, S_IRUGO, dahdi_device_manufacturer_show, NULL),
|
||||
__ATTR(type, S_IRUGO, dahdi_device_type_show, NULL),
|
||||
@@ -704,11 +740,48 @@ static struct device_attribute dahdi_dev
|
||||
__ATTR(registration_time, S_IRUGO, dahdi_registration_time_show, NULL),
|
||||
__ATTR_NULL,
|
||||
};
|
||||
+#else
|
||||
+static DEVICE_ATTR(manufacturer, S_IRUGO, dahdi_device_manufacturer_show, NULL);
|
||||
+static DEVICE_ATTR(type, S_IRUGO, dahdi_device_type_show, NULL);
|
||||
+static DEVICE_ATTR(span_count, S_IRUGO, dahdi_device_span_count_show, NULL);
|
||||
+static DEVICE_ATTR(hardware_id, S_IRUGO, dahdi_device_hardware_id_show, NULL);
|
||||
+static DEVICE_ATTR(location, S_IRUGO, dahdi_device_location_show, NULL);
|
||||
+static DEVICE_ATTR(auto_assign, S_IWUSR, NULL, dahdi_device_auto_assign);
|
||||
+static DEVICE_ATTR(assign_span, S_IWUSR, NULL, dahdi_device_assign_span);
|
||||
+static DEVICE_ATTR(unassign_span, S_IWUSR, NULL, dahdi_device_unassign_span);
|
||||
+/*
|
||||
+ * Using DEVICE_ATTR for spantype attribute here will conflict with the
|
||||
+ * span device attribute definition above. Define it somewhat more
|
||||
+ * manually to give it a unique name.
|
||||
+ */
|
||||
+static struct device_attribute dahdi_dev_attr_spantype =
|
||||
+ __ATTR(spantype, S_IWUSR | S_IRUGO, dahdi_spantype_show, dahdi_spantype_store);
|
||||
+static DEVICE_ATTR(registration_time, S_IRUGO, dahdi_registration_time_show, NULL);
|
||||
+
|
||||
+static struct attribute *dahdi_device_attrs[] = {
|
||||
+ &dev_attr_manufacturer.attr,
|
||||
+ &dev_attr_type.attr,
|
||||
+ &dev_attr_span_count.attr,
|
||||
+ &dev_attr_hardware_id.attr,
|
||||
+ &dev_attr_location.attr,
|
||||
+ &dev_attr_auto_assign.attr,
|
||||
+ &dev_attr_assign_span.attr,
|
||||
+ &dev_attr_unassign_span.attr,
|
||||
+ &dahdi_dev_attr_spantype.attr,
|
||||
+ &dev_attr_registration_time.attr,
|
||||
+ NULL,
|
||||
+};
|
||||
+ATTRIBUTE_GROUPS(dahdi_device);
|
||||
+#endif
|
||||
|
||||
static struct bus_type dahdi_device_bus = {
|
||||
.name = "dahdi_devices",
|
||||
.uevent = device_uevent,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
|
||||
.dev_attrs = dahdi_device_attrs,
|
||||
+#else
|
||||
+ .dev_groups = dahdi_device_groups,
|
||||
+#endif
|
||||
};
|
||||
|
||||
static void dahdi_sysfs_cleanup(void)
|
||||
Index: dahdi-linux-2.11.1~dfsg/drivers/dahdi/dahdi-sysfs-chan.c
|
||||
===================================================================
|
||||
--- dahdi-linux-2.11.1~dfsg.orig/drivers/dahdi/dahdi-sysfs-chan.c
|
||||
+++ dahdi-linux-2.11.1~dfsg/drivers/dahdi/dahdi-sysfs-chan.c
|
||||
@@ -158,6 +158,7 @@ static BUS_ATTR_READER(ec_state_show, de
|
||||
return len;
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
|
||||
static struct device_attribute chan_dev_attrs[] = {
|
||||
__ATTR_RO(name),
|
||||
__ATTR_RO(channo),
|
||||
@@ -174,6 +175,39 @@ static struct device_attribute chan_dev_
|
||||
__ATTR_RO(in_use),
|
||||
__ATTR_NULL,
|
||||
};
|
||||
+#else
|
||||
+static DEVICE_ATTR_RO(name);
|
||||
+static DEVICE_ATTR_RO(channo);
|
||||
+static DEVICE_ATTR_RO(chanpos);
|
||||
+static DEVICE_ATTR_RO(sig);
|
||||
+static DEVICE_ATTR_RO(sigcap);
|
||||
+static DEVICE_ATTR_RO(alarms);
|
||||
+static DEVICE_ATTR_RO(ec_factory);
|
||||
+static DEVICE_ATTR_RO(ec_state);
|
||||
+static DEVICE_ATTR_RO(blocksize);
|
||||
+#ifdef OPTIMIZE_CHANMUTE
|
||||
+static DEVICE_ATTR_RO(chanmute);
|
||||
+#endif
|
||||
+static DEVICE_ATTR_RO(in_use);
|
||||
+
|
||||
+static struct attribute *chan_dev_attrs[] = {
|
||||
+ &dev_attr_name.attr,
|
||||
+ &dev_attr_channo.attr,
|
||||
+ &dev_attr_chanpos.attr,
|
||||
+ &dev_attr_sig.attr,
|
||||
+ &dev_attr_sigcap.attr,
|
||||
+ &dev_attr_alarms.attr,
|
||||
+ &dev_attr_ec_factory.attr,
|
||||
+ &dev_attr_ec_state.attr,
|
||||
+ &dev_attr_blocksize.attr,
|
||||
+#ifdef OPTIMIZE_CHANMUTE
|
||||
+ &dev_attr_chanmute.attr,
|
||||
+#endif
|
||||
+ &dev_attr_in_use.attr,
|
||||
+ NULL,
|
||||
+};
|
||||
+ATTRIBUTE_GROUPS(chan_dev);
|
||||
+#endif
|
||||
|
||||
static void chan_release(struct device *dev)
|
||||
{
|
||||
@@ -196,7 +230,11 @@ static int chan_match(struct device *dev
|
||||
static struct bus_type chan_bus_type = {
|
||||
.name = "dahdi_channels",
|
||||
.match = chan_match,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
|
||||
.dev_attrs = chan_dev_attrs,
|
||||
+#else
|
||||
+ .dev_groups = chan_dev_groups,
|
||||
+#endif
|
||||
};
|
||||
|
||||
static int chan_probe(struct device *dev)
|
||||
Index: dahdi-linux-2.11.1~dfsg/drivers/dahdi/xpp/xbus-sysfs.c
|
||||
===================================================================
|
||||
--- dahdi-linux-2.11.1~dfsg.orig/drivers/dahdi/xpp/xbus-sysfs.c
|
||||
+++ dahdi-linux-2.11.1~dfsg/drivers/dahdi/xpp/xbus-sysfs.c
|
||||
@@ -339,6 +339,7 @@ static DEVICE_ATTR_READER(dahdi_registra
|
||||
return len;
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
|
||||
static struct device_attribute xbus_dev_attrs[] = {
|
||||
__ATTR_RO(connector),
|
||||
__ATTR_RO(label),
|
||||
@@ -358,6 +359,42 @@ static struct device_attribute xbus_dev_
|
||||
dahdi_registration_store),
|
||||
__ATTR_NULL,
|
||||
};
|
||||
+#else
|
||||
+static DEVICE_ATTR_RO(connector);
|
||||
+static DEVICE_ATTR_RO(label);
|
||||
+static DEVICE_ATTR_RO(status);
|
||||
+static DEVICE_ATTR_RO(timing);
|
||||
+static DEVICE_ATTR_RO(refcount_xbus);
|
||||
+static DEVICE_ATTR_RO(waitfor_xpds);
|
||||
+static DEVICE_ATTR_RO(driftinfo);
|
||||
+static DEVICE_ATTR(cls, S_IWUSR, NULL, cls_store);
|
||||
+static DEVICE_ATTR(xbus_state, S_IRUGO | S_IWUSR, xbus_state_show,
|
||||
+ xbus_state_store);
|
||||
+#ifdef SAMPLE_TICKS
|
||||
+static DEVICE_ATTR(samples, S_IWUSR | S_IRUGO, samples_show, samples_store);
|
||||
+#endif
|
||||
+static DEVICE_ATTR(dahdi_registration, S_IRUGO | S_IWUSR,
|
||||
+ dahdi_registration_show,
|
||||
+ dahdi_registration_store);
|
||||
+
|
||||
+static struct attribute *xbus_dev_attrs[] = {
|
||||
+ &dev_attr_connector.attr,
|
||||
+ &dev_attr_label.attr,
|
||||
+ &dev_attr_status.attr,
|
||||
+ &dev_attr_timing.attr,
|
||||
+ &dev_attr_refcount_xbus.attr,
|
||||
+ &dev_attr_waitfor_xpds.attr,
|
||||
+ &dev_attr_driftinfo.attr,
|
||||
+ &dev_attr_cls.attr,
|
||||
+ &dev_attr_xbus_state.attr,
|
||||
+#ifdef SAMPLE_TICKS
|
||||
+ &dev_attr_samples.attr,
|
||||
+#endif
|
||||
+ &dev_attr_dahdi_registration.attr,
|
||||
+ NULL,
|
||||
+};
|
||||
+ATTRIBUTE_GROUPS(xbus_dev);
|
||||
+#endif
|
||||
|
||||
static int astribank_match(struct device *dev, struct device_driver *driver)
|
||||
{
|
||||
@@ -457,10 +494,11 @@ static struct bus_type toplevel_bus_type
|
||||
.name = "astribanks",
|
||||
.match = astribank_match,
|
||||
.uevent = astribank_uevent,
|
||||
- .dev_attrs = xbus_dev_attrs,
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
|
||||
+ .dev_attrs = xbus_dev_attrs,
|
||||
.drv_attrs = xpp_attrs,
|
||||
#else
|
||||
+ .dev_groups = xbus_dev_groups,
|
||||
.drv_groups = xpp_groups,
|
||||
#endif
|
||||
};
|
||||
@@ -744,6 +782,7 @@ static int xpd_match(struct device *dev,
|
||||
return 1;
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
|
||||
static struct device_attribute xpd_dev_attrs[] = {
|
||||
__ATTR(chipregs, S_IRUGO | S_IWUSR, chipregs_show, chipregs_store),
|
||||
__ATTR(blink, S_IRUGO | S_IWUSR, blink_show, blink_store),
|
||||
@@ -754,11 +793,36 @@ static struct device_attribute xpd_dev_a
|
||||
__ATTR_RO(refcount_xpd),
|
||||
__ATTR_NULL,
|
||||
};
|
||||
+#else
|
||||
+DEVICE_ATTR(chipregs, S_IRUGO | S_IWUSR, chipregs_show, chipregs_store);
|
||||
+DEVICE_ATTR(blink, S_IRUGO | S_IWUSR, blink_show, blink_store);
|
||||
+DEVICE_ATTR(span, S_IRUGO | S_IWUSR, span_show, span_store);
|
||||
+DEVICE_ATTR_RO(type);
|
||||
+DEVICE_ATTR_RO(offhook);
|
||||
+DEVICE_ATTR_RO(timing_priority);
|
||||
+DEVICE_ATTR_RO(refcount_xpd);
|
||||
+
|
||||
+static struct attribute *xpd_dev_attrs[] = {
|
||||
+ &dev_attr_chipregs.attr,
|
||||
+ &dev_attr_blink.attr,
|
||||
+ &dev_attr_span.attr,
|
||||
+ &dev_attr_type.attr,
|
||||
+ &dev_attr_offhook.attr,
|
||||
+ &dev_attr_timing_priority.attr,
|
||||
+ &dev_attr_refcount_xpd.attr,
|
||||
+ NULL,
|
||||
+};
|
||||
+ATTRIBUTE_GROUPS(xpd_dev);
|
||||
+#endif
|
||||
|
||||
static struct bus_type xpd_type = {
|
||||
.name = "xpds",
|
||||
.match = xpd_match,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
|
||||
.dev_attrs = xpd_dev_attrs,
|
||||
+#else
|
||||
+ .dev_groups = xpd_dev_groups,
|
||||
+#endif
|
||||
};
|
||||
|
||||
int xpd_driver_register(struct device_driver *driver)
|
10
main/dahdi-linux-vanilla/linux-4.4.patch
Normal file
10
main/dahdi-linux-vanilla/linux-4.4.patch
Normal file
@ -0,0 +1,10 @@
|
||||
--- ./drivers/dahdi/zaphfc.c.orig
|
||||
+++ ./drivers/dahdi/zaphfc.c
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/sched.h>
|
||||
+#include <linux/vmalloc.h>
|
||||
#include <dahdi/kernel.h>
|
||||
#include "zaphfc.h"
|
||||
|
58
main/dahdi-linux-vanilla/zaphfc-dahdi-2.4.0.patch
Normal file
58
main/dahdi-linux-vanilla/zaphfc-dahdi-2.4.0.patch
Normal file
@ -0,0 +1,58 @@
|
||||
Index: dahdi-linux-2.4.0/drivers/dahdi/zaphfc.c
|
||||
===================================================================
|
||||
--- dahdi-linux-2.4.0.orig/drivers/dahdi/zaphfc.c 2010-10-26 14:41:21.000000000 +0300
|
||||
+++ dahdi-linux-2.4.0/drivers/dahdi/zaphfc.c 2010-10-26 14:50:14.000000000 +0300
|
||||
@@ -617,7 +617,7 @@
|
||||
}
|
||||
|
||||
static int zthfc_startup(struct dahdi_span *span) {
|
||||
- struct dahdi_hfc *zthfc = span->pvt;
|
||||
+ struct dahdi_hfc *zthfc = container_of(span, struct dahdi_hfc, span);
|
||||
struct hfc_card *hfctmp = zthfc->card;
|
||||
int alreadyrunning;
|
||||
|
||||
@@ -663,6 +663,19 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static const struct dahdi_span_ops zaphfc_span_ops = {
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .spanconfig = zthfc_spanconfig,
|
||||
+ .chanconfig = zthfc_chanconfig,
|
||||
+ .startup = zthfc_startup,
|
||||
+ .shutdown = zthfc_shutdown,
|
||||
+ .maint = zthfc_maint,
|
||||
+ .rbsbits = zthfc_rbsbits,
|
||||
+ .open = zthfc_open,
|
||||
+ .close = zthfc_close,
|
||||
+ .ioctl = zthfc_ioctl,
|
||||
+};
|
||||
+
|
||||
static int zthfc_initialize(struct dahdi_hfc *zthfc) {
|
||||
struct hfc_card *hfctmp = zthfc->card;
|
||||
int i;
|
||||
@@ -676,15 +689,7 @@
|
||||
sprintf(zthfc->span.desc, "HFC-S PCI A ISDN card %d [TE]", hfc_dev_count + 1);
|
||||
}
|
||||
|
||||
- zthfc->span.spanconfig = zthfc_spanconfig;
|
||||
- zthfc->span.chanconfig = zthfc_chanconfig;
|
||||
- zthfc->span.startup = zthfc_startup;
|
||||
- zthfc->span.shutdown = zthfc_shutdown;
|
||||
- zthfc->span.maint = zthfc_maint;
|
||||
- zthfc->span.rbsbits = zthfc_rbsbits;
|
||||
- zthfc->span.open = zthfc_open;
|
||||
- zthfc->span.close = zthfc_close;
|
||||
- zthfc->span.ioctl = zthfc_ioctl;
|
||||
+ zthfc->span.ops = &zaphfc_span_ops;
|
||||
|
||||
zthfc->span.channels = 3;
|
||||
zthfc->span.chans = zthfc->_chans;
|
||||
@@ -695,7 +700,6 @@
|
||||
zthfc->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_CCS; // <--- this is really BS
|
||||
zthfc->span.offset = 0;
|
||||
init_waitqueue_head(&zthfc->span.maintq);
|
||||
- zthfc->span.pvt = zthfc;
|
||||
|
||||
for (i = 0; i < zthfc->span.channels; i++) {
|
||||
memset(&(zthfc->chans[i]), 0x0, sizeof(struct dahdi_chan));
|
36
main/dahdi-linux-vanilla/zaphfc-dahdi-2.5.0.patch
Normal file
36
main/dahdi-linux-vanilla/zaphfc-dahdi-2.5.0.patch
Normal file
@ -0,0 +1,36 @@
|
||||
Index: dahdi-linux-2.5.0/drivers/dahdi/zaphfc.c
|
||||
===================================================================
|
||||
--- dahdi-linux-2.5.0.orig/drivers/dahdi/zaphfc.c 2011-08-15 14:29:51.000000000 +0300
|
||||
+++ dahdi-linux-2.5.0/drivers/dahdi/zaphfc.c 2011-08-15 14:30:11.000000000 +0300
|
||||
@@ -616,7 +616,7 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int zthfc_startup(struct dahdi_span *span) {
|
||||
+static int zthfc_startup(struct file *file, struct dahdi_span *span) {
|
||||
struct dahdi_hfc *zthfc = container_of(span, struct dahdi_hfc, span);
|
||||
struct hfc_card *hfctmp = zthfc->card;
|
||||
int alreadyrunning;
|
||||
@@ -653,12 +653,12 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int zthfc_chanconfig(struct dahdi_chan *chan, int sigtype) {
|
||||
+static int zthfc_chanconfig(struct file *file, struct dahdi_chan *chan, int sigtype) {
|
||||
// printk(KERN_CRIT "chan_config sigtype=%d\n", sigtype);
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int zthfc_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc) {
|
||||
+static int zthfc_spanconfig(struct file *file, struct dahdi_span *span, struct dahdi_lineconfig *lc) {
|
||||
span->lineconfig = lc->lineconfig;
|
||||
return 0;
|
||||
}
|
||||
@@ -699,7 +699,6 @@
|
||||
zthfc->span.deflaw = DAHDI_LAW_ALAW;
|
||||
zthfc->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_CCS; // <--- this is really BS
|
||||
zthfc->span.offset = 0;
|
||||
- init_waitqueue_head(&zthfc->span.maintq);
|
||||
|
||||
for (i = 0; i < zthfc->span.channels; i++) {
|
||||
memset(&(zthfc->chans[i]), 0x0, sizeof(struct dahdi_chan));
|
58
main/dahdi-linux-vanilla/zaphfc-dahdi-2.6.0.patch
Normal file
58
main/dahdi-linux-vanilla/zaphfc-dahdi-2.6.0.patch
Normal file
@ -0,0 +1,58 @@
|
||||
--- dahdi-linux-2.6.0/drivers/dahdi/zaphfc.c.orig 2012-01-25 14:08:58.000000000 +0200
|
||||
+++ dahdi-linux-2.6.0/drivers/dahdi/zaphfc.c 2012-01-25 14:29:26.000000000 +0200
|
||||
@@ -122,7 +122,10 @@
|
||||
}
|
||||
spin_unlock_irqrestore(&hfctmp->lock,flags);
|
||||
if (hfctmp->ztdev != NULL) {
|
||||
- dahdi_unregister(&hfctmp->ztdev->span);
|
||||
+ if (hfctmp->ztdev->ddev) {
|
||||
+ dahdi_unregister_device(hfctmp->ztdev->ddev);
|
||||
+ dahdi_free_device(hfctmp->ztdev->ddev);
|
||||
+ }
|
||||
vfree(hfctmp->ztdev);
|
||||
printk(KERN_INFO "unregistered from DAHDI.\n");
|
||||
}
|
||||
@@ -680,9 +683,15 @@
|
||||
struct hfc_card *hfctmp = zthfc->card;
|
||||
int i;
|
||||
|
||||
+ zthfc->ddev = dahdi_create_device();
|
||||
+ if (!zthfc->ddev)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ zthfc->ddev->manufacturer = "HFC";
|
||||
+
|
||||
memset(&zthfc->span, 0x0, sizeof(struct dahdi_span)); // you never can tell...
|
||||
|
||||
- sprintf(zthfc->span.name, "ZTHFC%d", hfc_dev_count + 1);
|
||||
+ sprintf(zthfc->span.name, "ZTHFC/%d", hfc_dev_count + 1);
|
||||
if (hfctmp->regs.nt_mode == 1) {
|
||||
sprintf(zthfc->span.desc, "HFC-S PCI A ISDN card %d [NT]", hfc_dev_count + 1);
|
||||
} else {
|
||||
@@ -702,13 +711,14 @@
|
||||
|
||||
for (i = 0; i < zthfc->span.channels; i++) {
|
||||
memset(&(zthfc->chans[i]), 0x0, sizeof(struct dahdi_chan));
|
||||
- sprintf(zthfc->chans[i].name, "ZTHFC%d/%d/%d", hfc_dev_count + 1,0,i + 1);
|
||||
+ sprintf(zthfc->chans[i].name, "ZTHFC/%d/%d/%d", hfc_dev_count + 1,0,i + 1);
|
||||
zthfc->chans[i].pvt = zthfc;
|
||||
zthfc->chans[i].sigcap = DAHDI_SIG_EM | DAHDI_SIG_CLEAR | DAHDI_SIG_FXSLS | DAHDI_SIG_FXSGS | DAHDI_SIG_FXSKS | DAHDI_SIG_FXOLS | DAHDI_SIG_FXOGS | DAHDI_SIG_FXOKS | DAHDI_SIG_CAS | DAHDI_SIG_SF;
|
||||
zthfc->chans[i].chanpos = i + 1;
|
||||
}
|
||||
|
||||
- if (dahdi_register(&zthfc->span,0)) {
|
||||
+ list_add_tail(&zthfc->span.device_node, &zthfc->ddev->spans);
|
||||
+ if (dahdi_register_device(zthfc->ddev, &zthfc->card->pcidev->dev)) {
|
||||
printk(KERN_CRIT "unable to register DAHDI device!\n");
|
||||
return -1;
|
||||
}
|
||||
--- dahdi-linux-2.6.0/drivers/dahdi/zaphfc.h.orig 2012-01-25 14:23:37.000000000 +0200
|
||||
+++ dahdi-linux-2.6.0/drivers/dahdi/zaphfc.h 2012-01-25 14:24:33.000000000 +0200
|
||||
@@ -339,6 +339,7 @@
|
||||
struct dahdi_span span;
|
||||
struct dahdi_chan chans[3];
|
||||
struct dahdi_chan *_chans[3];
|
||||
+ struct dahdi_device *ddev;
|
||||
struct hfc_card *card;
|
||||
} dahdi_hfc;
|
||||
|
32
main/dahdi-linux-vanilla/zaphfc-dahdi-2.7.0.patch
Normal file
32
main/dahdi-linux-vanilla/zaphfc-dahdi-2.7.0.patch
Normal file
@ -0,0 +1,32 @@
|
||||
--- dahdi-linux-2.7.0/drivers/dahdi/zaphfc.c.orig 2013-11-13 14:47:31.772140792 +0200
|
||||
+++ dahdi-linux-2.7.0/drivers/dahdi/zaphfc.c 2013-11-13 14:55:20.136270113 +0200
|
||||
@@ -687,19 +687,18 @@
|
||||
if (!zthfc->ddev)
|
||||
return -ENOMEM;
|
||||
|
||||
- zthfc->ddev->manufacturer = "HFC";
|
||||
-
|
||||
+ zthfc->ddev->manufacturer = "Cologne Chips";
|
||||
+ zthfc->ddev->devicetype = "HFC-S PCI-A ISDN";
|
||||
+ zthfc->ddev->location = kasprintf(GFP_KERNEL,
|
||||
+ "PCI Bus %02d Slot %02d",
|
||||
+ hfctmp->pcidev->bus->number,
|
||||
+ PCI_SLOT(hfctmp->pcidev->devfn) + 1);
|
||||
memset(&zthfc->span, 0x0, sizeof(struct dahdi_span)); // you never can tell...
|
||||
-
|
||||
sprintf(zthfc->span.name, "ZTHFC/%d", hfc_dev_count + 1);
|
||||
- if (hfctmp->regs.nt_mode == 1) {
|
||||
- sprintf(zthfc->span.desc, "HFC-S PCI A ISDN card %d [NT]", hfc_dev_count + 1);
|
||||
- } else {
|
||||
- sprintf(zthfc->span.desc, "HFC-S PCI A ISDN card %d [TE]", hfc_dev_count + 1);
|
||||
- }
|
||||
-
|
||||
+ sprintf(zthfc->span.desc, "HFC-S PCI A ISDN card %d [%s]",
|
||||
+ hfc_dev_count + 1, hfctmp->regs.nt_mode ? "NT" : "TE");
|
||||
+ zthfc->span.spantype = hfctmp->regs.nt_mode ? SPANTYPE_DIGITAL_BRI_NT : SPANTYPE_DIGITAL_BRI_TE;
|
||||
zthfc->span.ops = &zaphfc_span_ops;
|
||||
-
|
||||
zthfc->span.channels = 3;
|
||||
zthfc->span.chans = zthfc->_chans;
|
||||
for (i = 0; i < zthfc->span.channels; i++)
|
||||
|
1232
main/dahdi-linux-vanilla/zaphfc-dahdi-flortz.diff
Normal file
1232
main/dahdi-linux-vanilla/zaphfc-dahdi-flortz.diff
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user