Commit 115f487f authored by Harald Welte's avatar Harald Welte

DAHDI_NET: Report alarms as lost carrier to net_device

It recently occurre to me that for some strange reason the line/link
status of the E1 span was not reflected in the network device link
status.  This is odd and leads to strange behavior.

In general, it is assumed that a net_device only exhibits LOWER_UP
if there actually is a physical connection.  If you disconnect an
ethernet cable, LOWER_UP will be gone.  Same should happen on
DAHDI_NET devices.
parent d0a14099
......@@ -3891,6 +3891,23 @@ void dahdi_alarm_channel(struct dahdi_chan *chan, int alarms)
dahdi_qevent_nolock(chan, alarms ? DAHDI_EVENT_ALARM : DAHDI_EVENT_NOALARM);
}
spin_unlock_irqrestore(&chan->lock, flags);
#ifdef CONFIG_DAHDI_NET
if (dahdi_have_netdev(chan)) {
struct net_device *dev = chan_to_netdev(chan);
/* we don't really care which alarm it is,
* RED/YELLOW/BLUE/MFA/.. - they all mean that the link
* was somehow lost, and that's what matters to the
* netdev */
if (alarms) {
if (netif_carrier_ok(dev))
netif_carrier_off(dev);
} else {
if (!netif_carrier_ok(dev))
netif_carrier_on(dev);
}
}
#endif
}
struct dahdi_span *get_master_span(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment