From 338aae940f6d7607a5a54b0f51e790d792e8f931 Mon Sep 17 00:00:00 2001 From: Adam Duskett Date: Fri, 12 Apr 2024 16:06:50 -0600 Subject: [PATCH] libs/dahdi-linux: bump to latest git head Fixes compiling against linux >= 6.6 Signed-off-by: Adam Duskett --- libs/dahdi-linux/Makefile | 6 +- .../patches/003-fix-oslec-build.patch | 2 +- .../100-add-support-for-hfc-s-pci.patch | 10 +- .../130-DAHLIN-371-pld-linux-math64.patch | 14 +-- ...0-dahdi-use-fallthrough-where-needed.patch | 114 +----------------- ...-fix-always-true-compilation-warning.patch | 60 --------- ...han-fix-bug-if-clause-does-not-guard.patch | 28 ----- ...204-dahdi-skip-checking-on-releasing.patch | 38 ------ .../205-dahdi-xpp-fix-wrong-printf-to-d.patch | 2 +- 9 files changed, 21 insertions(+), 253 deletions(-) delete mode 100644 libs/dahdi-linux/patches/201-dahdi-fix-always-true-compilation-warning.patch delete mode 100644 libs/dahdi-linux/patches/202-dahdi-sysfs-chan-fix-bug-if-clause-does-not-guard.patch delete mode 100644 libs/dahdi-linux/patches/204-dahdi-skip-checking-on-releasing.patch diff --git a/libs/dahdi-linux/Makefile b/libs/dahdi-linux/Makefile index 168d404c..08d7756f 100644 --- a/libs/dahdi-linux/Makefile +++ b/libs/dahdi-linux/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/asterisk/dahdi-linux.git -PKG_SOURCE_DATE=2023-09-21 -PKG_SOURCE_VERSION:=1bb9088f2baff8c4e3fec536044cc48072cf9905 -PKG_MIRROR_HASH:=6a15a0383deeb7f9cc36a55bfa5bec13d225e738b1723faf15b25df74665198b +PKG_SOURCE_DATE=2024-04-12 +PKG_SOURCE_VERSION:=83d89b64d9151dbe4eb53b9ebc8640a08fcf4d63 +PKG_MIRROR_HASH:=67acfb62213270050d941643cb763c315cc6a2682a94fc517975707918e42ecb PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=LICENSE diff --git a/libs/dahdi-linux/patches/003-fix-oslec-build.patch b/libs/dahdi-linux/patches/003-fix-oslec-build.patch index 4b2b2a0e..8318f359 100644 --- a/libs/dahdi-linux/patches/003-fix-oslec-build.patch +++ b/libs/dahdi-linux/patches/003-fix-oslec-build.patch @@ -1,6 +1,6 @@ --- a/drivers/dahdi/Kbuild +++ b/drivers/dahdi/Kbuild -@@ -64,9 +64,8 @@ obj-m += $(DAHDI_MODULES_EXTRA) +@@ -72,9 +72,8 @@ obj-m += $(DAHDI_MODULES_EXTRA) # If you want to build OSLEC, include the code in the standard location: # drivers/staging/echo . The DAHDI OSLEC echo canceller will be built as # well: diff --git a/libs/dahdi-linux/patches/100-add-support-for-hfc-s-pci.patch b/libs/dahdi-linux/patches/100-add-support-for-hfc-s-pci.patch index 7a8d9458..84c97ca9 100644 --- a/libs/dahdi-linux/patches/100-add-support-for-hfc-s-pci.patch +++ b/libs/dahdi-linux/patches/100-add-support-for-hfc-s-pci.patch @@ -1,8 +1,8 @@ --- a/drivers/dahdi/Kbuild +++ b/drivers/dahdi/Kbuild -@@ -12,6 +12,7 @@ obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCT - obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTC4XXP) += wctc4xxp/ +@@ -13,6 +13,7 @@ obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTC4XXP) += wctc4xxp/ obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTDM24XXP) += wctdm24xxp/ + obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTE12XP) += wcte12xp/ obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTE13XP) += wcte13xp.o +obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_HFCS) += hfcs/ @@ -10,9 +10,9 @@ ifneq (,$(filter y m,$(CONFIG_FW_LOADER))) --- a/drivers/dahdi/Kconfig +++ b/drivers/dahdi/Kconfig -@@ -235,4 +235,14 @@ config DAHDI_DYNAMIC_LOC - If unsure, say Y. +@@ -282,6 +282,16 @@ config DAHDI_WCTE11XP + If unsure, say Y. +config DAHDI_HFCS + tristate "Support for various HFC-S PCI BRI adapters" @@ -25,6 +25,8 @@ + If unsure, say Y. + source "drivers/dahdi/xpp/Kconfig" + + config DAHDI_OPVXA1200 --- /dev/null +++ b/drivers/dahdi/hfcs/base.c @@ -0,0 +1,1742 @@ diff --git a/libs/dahdi-linux/patches/130-DAHLIN-371-pld-linux-math64.patch b/libs/dahdi-linux/patches/130-DAHLIN-371-pld-linux-math64.patch index 87351c5b..85c8d975 100644 --- a/libs/dahdi-linux/patches/130-DAHLIN-371-pld-linux-math64.patch +++ b/libs/dahdi-linux/patches/130-DAHLIN-371-pld-linux-math64.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -1768,11 +1769,13 @@ out: +@@ -1771,11 +1772,13 @@ out: static void xbus_fill_proc_queue(struct seq_file *sfile, struct xframe_queue *q) { @@ -35,7 +35,7 @@ #include "xbus-pcm.h" #include "xbus-core.h" #include "xpp_dahdi.h" -@@ -129,7 +130,7 @@ static int xpp_ticker_step(struct xpp_ti +@@ -129,7 +130,7 @@ static int xpp_ticker_step(struct xpp_ticker *ticker, const ktime_t t) usec = ktime_us_delta(ticker->last_sample, ticker->first_sample); ticker->first_sample = ticker->last_sample; @@ -44,7 +44,7 @@ cycled = 1; } ticker->count++; -@@ -497,7 +498,7 @@ static void send_drift(xbus_t *xbus, int +@@ -497,7 +498,7 @@ static void send_drift(xbus_t *xbus, int drift) XBUS_DBG(SYNC, xbus, "%sDRIFT adjust %s (%d) (last update %lld seconds ago)\n", (disable_pll_sync) ? "Fake " : "", msg, drift, @@ -63,7 +63,7 @@ #include #ifdef PROTOCOL_DEBUG #include -@@ -249,11 +250,9 @@ static DEVICE_ATTR_READER(driftinfo_show +@@ -249,11 +250,9 @@ static DEVICE_ATTR_READER(driftinfo_show, dev, buf) /* * Calculate lost ticks time */ @@ -85,7 +85,7 @@ #include "xframe_queue.h" #include "xbus-core.h" #include "dahdi_debug.h" -@@ -40,10 +41,11 @@ static void __xframe_dump_queue(struct x +@@ -40,10 +41,11 @@ static void __xframe_dump_queue(struct xframe_queue *q) THIS_MODULE->name, q->name); list_for_each_entry_reverse(xframe, &q->head, frame_list) { xpacket_t *pack = (xpacket_t *)&xframe->packets[0]; @@ -100,7 +100,7 @@ dump_packet(prefix, pack, 1); } } -@@ -60,11 +62,13 @@ static bool __xframe_enqueue(struct xfra +@@ -60,11 +62,13 @@ static bool __xframe_enqueue(struct xframe_queue *q, xframe_t *xframe) if (q->count >= q->max_count) { q->overflows++; if ((overflow_cnt++ % 1000) < 5) { @@ -127,7 +127,7 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) #include #else -@@ -891,7 +892,7 @@ static void xpp_send_callback(struct urb +@@ -891,7 +892,7 @@ static void xpp_send_callback(struct urb *urb) usec = 0; /* System clock jumped */ if (usec > xusb->max_tx_delay) xusb->max_tx_delay = usec; diff --git a/libs/dahdi-linux/patches/200-dahdi-use-fallthrough-where-needed.patch b/libs/dahdi-linux/patches/200-dahdi-use-fallthrough-where-needed.patch index 5e613b79..6104271a 100644 --- a/libs/dahdi-linux/patches/200-dahdi-use-fallthrough-where-needed.patch +++ b/libs/dahdi-linux/patches/200-dahdi-use-fallthrough-where-needed.patch @@ -7,60 +7,12 @@ Use fallthrough instead of comment to fix compilation warning. Signed-off-by: Christian Marangi --- - drivers/dahdi/dahdi-base.c | 14 +++++++------- - drivers/dahdi/wcaxx-base.c | 2 ++ - drivers/dahdi/wctdm24xxp/base.c | 2 ++ - drivers/dahdi/xpp/card_global.c | 2 +- - 4 files changed, 12 insertions(+), 8 deletions(-) + drivers/dahdi/dahdi-base.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c -@@ -7930,7 +7930,7 @@ static inline void __dahdi_process_getau - memset(getlin, 0, DAHDI_CHUNKSIZE * sizeof(short)); - txb[0] = DAHDI_LIN2X(0, ms); - memset(txb + 1, txb[0], DAHDI_CHUNKSIZE - 1); -- /* fallthrough */ -+ fallthrough; - case DAHDI_CONF_CONF: /* Normal conference mode */ - if (is_pseudo_chan(ms)) /* if pseudo-channel */ - { -@@ -7954,7 +7954,7 @@ static inline void __dahdi_process_getau - memset(txb + 1, txb[0], DAHDI_CHUNKSIZE - 1); - break; - } -- /* fall through */ -+ fallthrough; - case DAHDI_CONF_CONFMON: /* Conference monitor mode */ - if (ms->confmode & DAHDI_CONF_LISTENER) { - /* Subtract out last sample written to conf */ -@@ -8493,7 +8493,7 @@ static void __dahdi_hooksig_pvt(struct d - break; - } - #endif -- /* fallthrough */ -+ fallthrough; - case DAHDI_SIG_FXSGS: /* FXS Groundstart */ - if (rxsig == DAHDI_RXSIG_ONHOOK) { - chan->ringdebtimer = RING_DEBOUNCE_TIME; -@@ -8512,7 +8512,7 @@ static void __dahdi_hooksig_pvt(struct d - chan->gotgs = 1; - } - } -- /* fallthrough */ -+ fallthrough; - case DAHDI_SIG_FXOLS: /* FXO Loopstart */ - case DAHDI_SIG_FXOKS: /* FXO Kewlstart */ - switch(rxsig) { -@@ -8612,7 +8612,7 @@ void dahdi_rbsbits(struct dahdi_chan *ch - __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_START); - break; - } -- /* Fall through */ -+ fallthrough; - case DAHDI_SIG_EM_E1: - case DAHDI_SIG_FXOLS: /* FXO Loopstart */ - case DAHDI_SIG_FXOKS: /* FXO Kewlstart */ -@@ -8630,7 +8630,7 @@ void dahdi_rbsbits(struct dahdi_chan *ch +@@ -8645,7 +8645,7 @@ void dahdi_rbsbits(struct dahdi_chan *chan, int cursig) break; case DAHDI_SIG_FXSKS: /* FXS Kewlstart */ case DAHDI_SIG_FXSGS: /* FXS Groundstart */ @@ -69,63 +21,3 @@ Signed-off-by: Christian Marangi case DAHDI_SIG_FXSLS: if (!(cursig & DAHDI_BBIT)) { /* Check for ringing first */ -@@ -9059,7 +9059,7 @@ static inline void __dahdi_process_putau - memcpy(ss->putlin, putlin, DAHDI_CHUNKSIZE * sizeof(short)); - break; - } -- /* fall through */ -+ fallthrough; - case DAHDI_CONF_CONFANN: /* Conference with announce */ - if (ms->confmode & DAHDI_CONF_TALKER) { - /* Store temp value */ ---- a/drivers/dahdi/wcaxx-base.c -+++ b/drivers/dahdi/wcaxx-base.c -@@ -1456,7 +1456,7 @@ wcaxx_check_battery_lost(struct wcaxx *w - break; - case BATTERY_UNKNOWN: - mod_hooksig(wc, mod, DAHDI_RXSIG_ONHOOK); -- /* fallthrough */ -+ fallthrough; - case BATTERY_PRESENT: - fxo->battery_state = BATTERY_DEBOUNCING_LOST; - fxo->battdebounce_timer = wc->framecount + battdebounce; -@@ -1567,7 +1567,7 @@ wcaxx_check_battery_present(struct wcaxx - break; - case BATTERY_UNKNOWN: - mod_hooksig(wc, mod, DAHDI_RXSIG_OFFHOOK); -- /* fallthrough */ -+ fallthrough; - case BATTERY_LOST: - fxo->battery_state = BATTERY_DEBOUNCING_PRESENT; - fxo->battdebounce_timer = wc->framecount + battdebounce; ---- a/drivers/dahdi/wctdm24xxp/base.c -+++ b/drivers/dahdi/wctdm24xxp/base.c -@@ -1964,7 +1964,7 @@ wctdm_check_battery_lost(struct wctdm *w - break; - case BATTERY_UNKNOWN: - mod_hooksig(wc, mod, DAHDI_RXSIG_ONHOOK); -- /* fallthrough */ -+ fallthrough; - case BATTERY_PRESENT: - fxo->battery_state = BATTERY_DEBOUNCING_LOST; - fxo->battdebounce_timer = wc->framecount + battdebounce; -@@ -2074,7 +2074,7 @@ wctdm_check_battery_present(struct wctdm - break; - case BATTERY_UNKNOWN: - mod_hooksig(wc, mod, DAHDI_RXSIG_OFFHOOK); -- /* fallthrough */ -+ fallthrough; - case BATTERY_LOST: - fxo->battery_state = BATTERY_DEBOUNCING_PRESENT; - fxo->battdebounce_timer = wc->framecount + battdebounce; ---- a/drivers/dahdi/xpp/card_global.c -+++ b/drivers/dahdi/xpp/card_global.c -@@ -148,7 +148,7 @@ static int execute_chip_command(xpd_t *x - XPD_NOTICE(xpd, - "'I' is deprecated in register commands. " - "Use 'S' instead.\n"); -- /* fall through */ -+ fallthrough; - case 'S': - do_subreg = 1; - num_args += 2; /* register + subreg */ diff --git a/libs/dahdi-linux/patches/201-dahdi-fix-always-true-compilation-warning.patch b/libs/dahdi-linux/patches/201-dahdi-fix-always-true-compilation-warning.patch deleted file mode 100644 index 353e9c2a..00000000 --- a/libs/dahdi-linux/patches/201-dahdi-fix-always-true-compilation-warning.patch +++ /dev/null @@ -1,60 +0,0 @@ -From eea6daaa4cae1ddcd8e32c8b9e4273ba3244838c Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Fri, 12 May 2023 20:19:04 +0200 -Subject: [PATCH 2/6] dahdi: fix always true compilation warning - -Fix always true compilation warning on statically allocated array. Check -content of the array instead. - -Signed-off-by: Christian Marangi ---- - drivers/dahdi/dahdi-base.c | 6 +++--- - drivers/dahdi/dahdi_dynamic_ethmf.c | 2 +- - drivers/dahdi/xpp/xbus-core.c | 2 +- - 3 files changed, 5 insertions(+), 5 deletions(-) - ---- a/drivers/dahdi/dahdi-base.c -+++ b/drivers/dahdi/dahdi-base.c -@@ -928,9 +928,9 @@ static int dahdi_seq_show(struct seq_fil - if (!s) - return -ENODEV; - -- if (s->name) -+ if (*(s->name)) - seq_printf(sfile, "Span %d: %s ", s->spanno, s->name); -- if (s->desc) -+ if (*(s->desc)) - seq_printf(sfile, "\"%s\"", s->desc); - else - seq_printf(sfile, "\"\""); -@@ -969,7 +969,7 @@ static int dahdi_seq_show(struct seq_fil - for (x = 0; x < s->channels; x++) { - struct dahdi_chan *chan = s->chans[x]; - -- if (chan->name) -+ if (*(chan->name)) - seq_printf(sfile, "\t%4d %s ", chan->channo, - chan->name); - ---- a/drivers/dahdi/dahdi_dynamic_ethmf.c -+++ b/drivers/dahdi/dahdi_dynamic_ethmf.c -@@ -535,7 +535,7 @@ static void ztdethmf_destroy(struct dahd - kfree(z->msgbuf); - kfree(z); - } else { -- if (z && z->span && z->span->name) { -+ if (z && z->span && *(z->span->name)) { - printk(KERN_ERR "Cannot find interface for %s\n", - z->span->name); - } ---- a/drivers/dahdi/xpp/xbus-core.c -+++ b/drivers/dahdi/xpp/xbus-core.c -@@ -120,7 +120,7 @@ int xbus_check_unique(xbus_t *xbus) - { - if (!xbus) - return -ENOENT; -- if (xbus->label && *(xbus->label)) { -+ if (*(xbus->label)) { - xbus_t *xbus_old; - - XBUS_DBG(DEVICES, xbus, "Checking LABEL='%s'\n", xbus->label); diff --git a/libs/dahdi-linux/patches/202-dahdi-sysfs-chan-fix-bug-if-clause-does-not-guard.patch b/libs/dahdi-linux/patches/202-dahdi-sysfs-chan-fix-bug-if-clause-does-not-guard.patch deleted file mode 100644 index b8870941..00000000 --- a/libs/dahdi-linux/patches/202-dahdi-sysfs-chan-fix-bug-if-clause-does-not-guard.patch +++ /dev/null @@ -1,28 +0,0 @@ -From d0699f781e96df6c1fd10551c92fa27695b297da Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Fri, 12 May 2023 20:19:45 +0200 -Subject: [PATCH 3/6] dahdi-sysfs-chan: fix bug if clause does not guard - -Fix bug if clause does not guard by a typo by missing the if clause and -not correctly removing the device. - -Signed-off-by: Christian Marangi ---- - drivers/dahdi/dahdi-sysfs-chan.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/dahdi/dahdi-sysfs-chan.c -+++ b/drivers/dahdi/dahdi-sysfs-chan.c -@@ -381,10 +381,11 @@ static void fixed_devfiles_remove(void) - return; - for (i = 0; i < ARRAY_SIZE(fixed_minors); i++) { - void *d = fixed_minors[i].dev; -- if (d && !IS_ERR(d)) -+ if (d && !IS_ERR(d)) { - dahdi_dbg(DEVICES, "Removing fixed device file %s\n", - fixed_minors[i].name); - DEL_DAHDI_DEV(fixed_minors[i].minor); -+ } - } - } - diff --git a/libs/dahdi-linux/patches/204-dahdi-skip-checking-on-releasing.patch b/libs/dahdi-linux/patches/204-dahdi-skip-checking-on-releasing.patch deleted file mode 100644 index 24bbf81f..00000000 --- a/libs/dahdi-linux/patches/204-dahdi-skip-checking-on-releasing.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 88cfe20bcd0be443fc7613fd287147d1c54b5f7f Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Fri, 12 May 2023 20:21:39 +0200 -Subject: [PATCH 5/6] dahdi: skip checking on releasing - -Skip checking on releasing since xb is statically allocated and always -present. - -Signed-off-by: Christian Marangi ---- - drivers/dahdi/wcte13xp-base.c | 3 +-- - drivers/dahdi/wcte43x-base.c | 3 +-- - 2 files changed, 2 insertions(+), 4 deletions(-) - ---- a/drivers/dahdi/wcte13xp-base.c -+++ b/drivers/dahdi/wcte13xp-base.c -@@ -2707,8 +2707,7 @@ static int __devinit te13xp_init_one(str - return 0; - - fail_exit: -- if (&wc->xb) -- wcxb_release(&wc->xb); -+ wcxb_release(&wc->xb); - - free_wc(wc); - return res; ---- a/drivers/dahdi/wcte43x-base.c -+++ b/drivers/dahdi/wcte43x-base.c -@@ -3521,8 +3521,7 @@ static int __devinit t43x_init_one(struc - return 0; - - fail_exit: -- if (&wc->xb) -- wcxb_release(&wc->xb); -+ wcxb_release(&wc->xb); - - if (debug) - dev_info(&wc->xb.pdev->dev, "***At fail_exit in init_one***\n"); diff --git a/libs/dahdi-linux/patches/205-dahdi-xpp-fix-wrong-printf-to-d.patch b/libs/dahdi-linux/patches/205-dahdi-xpp-fix-wrong-printf-to-d.patch index 52b90367..3dca2fcc 100644 --- a/libs/dahdi-linux/patches/205-dahdi-xpp-fix-wrong-printf-to-d.patch +++ b/libs/dahdi-linux/patches/205-dahdi-xpp-fix-wrong-printf-to-d.patch @@ -13,7 +13,7 @@ Signed-off-by: Christian Marangi --- a/drivers/dahdi/xpp/xbus-core.c +++ b/drivers/dahdi/xpp/xbus-core.c -@@ -1772,7 +1772,7 @@ static void xbus_fill_proc_queue(struct +@@ -1775,7 +1775,7 @@ static void xbus_fill_proc_queue(struct s32 rem; s64 lag_sec = div_s64_rem(q->worst_lag_usec, 1000, &rem); seq_printf(sfile,