From 306176bed27055da8caeb3810ac85f8d7865a4e0 Mon Sep 17 00:00:00 2001 From: "Alexei A. Smekalkine" Date: Fri, 23 Mar 2018 12:56:03 +0300 Subject: [PATCH] dahdi-base, netdev: send frame via protocol handlers, fix HDLC encapsulation 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 --- drivers/dahdi/dahdi-base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index 4fb06d9..626c31f 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -4791,7 +4791,7 @@ static const struct net_device_ops dahdi_netdev_ops = { .ndo_open = dahdi_net_open, .ndo_stop = dahdi_net_stop, .ndo_do_ioctl = dahdi_net_ioctl, - .ndo_start_xmit = dahdi_xmit, + .ndo_start_xmit = hdlc_start_xmit, }; #endif -- 2.11.0