Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 705860 - net-misc/dahdi-3.1.0: lacks support of zaphfc driver
Summary: net-misc/dahdi-3.1.0: lacks support of zaphfc driver
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: Jaco Kroon
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-01-19 16:55 UTC by Florian Evers
Modified: 2020-03-15 17:52 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch file combining three Gentoo patches ported from dahdi-2.11.1-r1 (97-non-digium-hardware-and-oslec.diff,524.00 KB, patch)
2020-01-29 23:00 UTC, Florian Evers
Details | Diff
90-non-digium-hardware-and-oslec.patch (90-non-digium-hardware-and-oslec.patch,519.13 KB, patch)
2020-01-30 22:37 UTC, Florian Evers
Details | Diff
91-irqf-disabled.patch (91-irqf-disabled.patch,832 bytes, patch)
2020-01-30 22:37 UTC, Florian Evers
Details | Diff
92-opvxa1200-nmi.patch (92-opvxa1200-nmi.patch,507 bytes, patch)
2020-01-30 22:37 UTC, Florian Evers
Details | Diff
93-fixes-for-non-digium-hardware-and-oslec.patch (93-fixes-for-non-digium-hardware-and-oslec.patch,6.71 KB, patch)
2020-01-30 22:38 UTC, Florian Evers
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Evers 2020-01-19 16:55:11 UTC
The net-misc/dahdi ebuild in version 3.1.0 lacks support for HFC-S-based ISDN cards (the cheap ones) via the zaphfc driver (missing). The ebuild of the previous dahdi version 2.11.1-r1 introduced that support via gentoo-dahdi-patchset-1.2.4.tar.bz2. However, the required file 97-non-digium-hardware-and-oslec.diff was not included in the patch set of version 3.1.0.

Unfortunately, AFAIK, running a recent 5.4.X kernel requires the 3.1.0 line of dahdi currently lacking support of the zaphfc driver. Thus, I have to stay at kernel version 5.3.18, that was removed from the portage tree lately.

Is it planned to re-add the zaphfc driver to recent versions of dahdi? Many thanks in advance :)

Reproducible: Always

Steps to Reproduce:
1. Install dahdi-3.1.0 with dahdi-tools-3.1.0 on a 5.4.X kernel.
2. The zaphfc.ko module is not build.
3. HFC-S-based ISDN cards no longer work on kernels >= 5.4


Expected Results:  
The patch file 97-non-digium-hardware-and-oslec.diff should be added to the patch set of dahdi-3.1.0. No idea regarding architectural changes from 2.11.1 to 3.1.0 that might complicate application of that patch.
Comment 1 Jaco Kroon 2020-01-28 20:22:30 UTC
You are correct it was not.  As per the commit message for the bump:

    Unfortunately drops support for some cards previously maintained by
    tzafrir (https://notabug.org/tzafrir/dahdi-linux-extra).  Unfortunately
    by his own admission these are really old, and looks like he dropped
    support for most of those cards as well.
    
    If required, please file a bug against me and I'll see what can be done.

How is your skill set w.r.t. porting code?
Comment 2 Florian Evers 2020-01-28 21:02:52 UTC
Hi Jaco,

thanks for the hint. Sad to see that support for these devices seems to vanish. I use such an ISDN card in NT mode for my home to connect two ISDN phones to my asterisk server, and then to use SIP to connect to the network.

My skill set... I'm proficient in C++ but have only limited experience with Linux kernel programming in C. Likely I'm going to fiddle with the patch set, remove all stuff that I do not need, and try to get it compiling. I'm still hoping that the architectural changes are not big enough to render this approach useless.

However, please tell me if I can assist somehow. I would provide any help possible.

Regards,
Florian
Comment 3 Jaco Kroon 2020-01-28 21:11:41 UTC
I would really appreciate if you can migrate the full patch set.

I did look at it briefly, and it didn't look like it should be particularly hard, just more time consuming than I had time for at that point in time (things needs to be wrapped appropriately with #if blocks to handle kernel version differences).

So kernel dev is not unlike other dev ... it's just ... well, intimidating because it's the "kernel".  Libraries are just different, but there is no change in language at all.

So I reckon:

Step 1:  Get the patch.
Step 2:  Make a copy of the workdir.
Step 3:  Apply it to a workdir (ie, after ebuild ... prepare)
Step 4:  Try to make it compile (ebuild ... compile).
Step 5:  Fix errors, repeat step 4
Step 6:  Once it passes, rediff.
Step 7:  Post resulting diff here :).

I'll run a diff from the original patch to the resulting patch to double-check you (obviously), and then we take it from there?
Comment 4 Florian Evers 2020-01-28 23:09:18 UTC
Thanks for your advice. I'll give it a try, with all drivers. I'm going to post my results here :-)
Comment 5 Florian Evers 2020-01-29 22:58:25 UTC
Got it. It compiles, but it's to late to test it today. I ported all drivers :-)

One timespec issue, some macros that I removed according to similar patterns in other drivers, and some interrupt disable issues. No big deal in total.

Currently, my patch combines these three previous patches, that only make sense together:

- 97-non-digium-hardware-and-oslec.diff
- 98-irqf-disabled.diff
- 99-opvxa1200-nmi.diff

Please have a look at "the diff of the diffs", if you know how to prepare one easily... 

I'm going to upload the patch file now, and am going to conduct a first test tomorrow.

Regards,
Florian
Comment 6 Florian Evers 2020-01-29 23:00:06 UTC
Created attachment 608576 [details, diff]
Patch file combining three Gentoo patches ported from dahdi-2.11.1-r1
Comment 7 Florian Evers 2020-01-29 23:03:08 UTC
I messed the KERNEL_VERSION version numbers up. I'm going to fix that tomorrow.
Comment 8 Florian Evers 2020-01-30 22:37:07 UTC
Created attachment 609498 [details, diff]
90-non-digium-hardware-and-oslec.patch
Comment 9 Florian Evers 2020-01-30 22:37:28 UTC
Created attachment 609500 [details, diff]
91-irqf-disabled.patch
Comment 10 Florian Evers 2020-01-30 22:37:49 UTC
Created attachment 609502 [details, diff]
92-opvxa1200-nmi.patch
Comment 11 Florian Evers 2020-01-30 22:38:06 UTC
Created attachment 609504 [details, diff]
93-fixes-for-non-digium-hardware-and-oslec.patch
Comment 12 Florian Evers 2020-01-30 22:51:02 UTC
Ok, done, and made the patches much prettier. It works on my live system here with gentoo-sources-5.4.16.

If I copy those four files to /etc/portage/patches/net-misc/dahdi-3.1.0 then it compiles and works fine:

90-non-digium-hardware-and-oslec.patch
91-irqf-disabled.patch
92-opvxa1200-nmi.patch
93-fixes-for-non-digium-hardware-and-oslec.patch

I assume that these patches can be added to the Gentoo patch set directly

1.) 90-non-digium-hardware-and-oslec.patch
This is the (just) renamed file 97-non-digium-hardware-and-oslec.diff from gentoo-dahdi-patchset-1.2.4.tar.bz2 of dahdi-2.11.1-r1. No modifications.

2.) 91-irqf-disabled.patch
This is file 98-irqf-disabled.diff from gentoo-dahdi-patchset-1.2.4.tar.bz2 with small modifications.

3.) 92-opvxa1200-nmi.patch
Was 99-opvxa1200-nmi.diff in gentoo-dahdi-patchset-1.2.4.tar.bz2, no modifications.

4.) 93-fixes-for-non-digium-hardware-and-oslec.patch
My stuff fixing all the remaining issues.


Furthermore, file 03-jnet-1.0.14-dahdi-3.1.0.diff requires a fix in line 96, a "!" character is missing:

<OLD>
-       if (request_irq(gsmtmp->irq, ztgsm_interrupt, DAHDI_IRQ_SHARED, "ztgsm", gsmtmp)) {                                                                                                                         
+       if (request_irq(gsmtmp->irq, ztgsm_interrupt, IRQF_SHARED, "ztgsm", gsmtmp)) { 
</OLD>

<NEW>
-       if (request_irq(gsmtmp->irq, ztgsm_interrupt, DAHDI_IRQ_SHARED, "ztgsm", gsmtmp)) {                                                                                                                         
+       if (!request_irq(gsmtmp->irq, ztgsm_interrupt, IRQF_SHARED, "ztgsm", gsmtmp)) { 
</NEW>

Just add my four files to the gentoo patchset, after your review, and create an ebuild for -r1 :-)

Learned a lot doing this, especially that "ebuild ... unpack" does not apply patches. "ebuild ... configure" is required. 

Regards, and thanks,
Florian
Comment 13 Florian Evers 2020-03-01 18:37:51 UTC
The provided patches work fine gentoo-sources-5.5.6. Do you need any subsequent help from my side?

Regards,
Florian
Comment 14 Larry the Git Cow gentoo-dev 2020-03-15 17:52:03 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ad433d565136589746b85d094482e0fe6d78707

commit 8ad433d565136589746b85d094482e0fe6d78707
Author:     Jaco Kroon <jaco@uls.co.za>
AuthorDate: 2020-03-13 14:13:02 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2020-03-15 17:51:48 +0000

    net-misc/dahdi: rev-bump to re-introduce non-digium modules.
    
    Closes: https://bugs.gentoo.org/705860
    Package-Manager: Portage-2.3.89, Repoman-2.3.20
    Signed-off-by: Jaco Kroon <jaco@uls.co.za>
    Closes: https://github.com/gentoo/gentoo/pull/14944
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 net-misc/dahdi/Manifest              |   1 +
 net-misc/dahdi/dahdi-3.1.0-r1.ebuild | 104 +++++++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+)