Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make DAHDI build against Kernel 5.15 #8

Closed
wants to merge 6 commits into from

Conversation

laf0rge
Copy link
Contributor

@laf0rge laf0rge commented Nov 29, 2021

No description provided.

laf0rge and others added 6 commits September 11, 2020 23:56
Since kernel commit 7ce2e76a0420801fb4b53b9e6850940e6b326433, ASPM
definitions have moved from linux/pci-aspm.h to linux/pci.h
In kernel commit d56c0d45f0e27f814e87a1676b6bdccccbc252e9, procfs
switched from 'struct file_operations' to 'struct proc_ops'; we need
to change DAHDI to build with those more recent kernels.
In linux kernel commit 4d659fcb20d3d3302b429c889a73a92ff2804b9a
in May 2016, netdev->trans_start was removed and write accesses
are replaced with this helper: netif_trans_update(dev)

This makes dahdi-base.c compile against kernels >= 4.7
when CONFIG_DAHDI_NET is enabled.

Signed-off-by: Harald Welte <laforge@osmocom.org>
With 5.9 the macros HAVE_UNLOCKED_IOCTL and HAVE_COMPAT_IOCTL are gone.
I didn't figured out when they were added because it predates git (2.6.12).

I don't know if there are any user or if the current dahdi driver even builds with such an old
linux kernel version.
…ulation

The HDLC encapsulation module can add its own headers and trailers to
the packet. For correct operation in this case, it is necessary to send
a packet from DAHDI to the appropriate HDLC handler. The HDLC handler,
in turn, should call the device driver procedure to transfer the packet.

Thus, for correct processing of outgoing packets, we should use function
hdlc_start_xmit from Linux HDLC stack as a ndo_start_xmit procedure.

(Note that if the protocol handler does not provide a xmit procedure,
then function hdlc_start_xmit will call the hardware driver directly.)

In the case of DAHDI, the packet transfer procedure (device driver xmit
procedure) is set in function dahdi_ioctl_chanconfig to dahdi_xmit:

    dev_to_hdlc(chan->hdlcnetdev->netdev)->xmit = dahdi_xmit;

Asterisk-Issue: DAHLIN-381
Ever since commit ad7eab2ab014748b062507b7ac69f8e856057717
"net: split out ndo_siowandev ioctl" has been merged in 5.15-rc1,
DAHDI failed to compile with DAHDI_NET enabled due to slight differences
in handling the HDLC/WAN device related ioctl.

Signed-off-by: Harald Welte <laforge@gnumonks.org>
@ajorians
Copy link

This worked for me -- Thank you! I got an issue with the master/next branch before taking a look at the PR.

Here is what I am running:

uname -a
Linux chat 5.16.0-1-default #1 SMP Mon Jan 10 07:30:39 UTC 2022 (487d6b3) aarch64 aarch64 aarch64 GNU/Linux

My only issue was something related to stdbool.h but I think that was because I am running on Arm to which I was able to take care of. Hope that helps! 😃

@osmocom-gerrit osmocom-gerrit deleted the kernel-5.15 branch January 20, 2022 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants