Commit 11b2884f authored by Alexander Viro's avatar Alexander Viro Committed by Stephen Hemminger

[wan hdlc] hdlc_set_carrier() switched to net_device.

parent 6dabb069
......@@ -139,7 +139,7 @@ static void sca_msci_intr(port_t *port)
if (stat & ST1_CDCD)
hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, card) & ST3_DCD),
dev_to_hdlc(dev));
dev);
}
......@@ -193,7 +193,7 @@ static int c101_open(struct net_device *dev)
sca_out(IE1_UDRN, MSCI0_OFFSET + IE1, port);
sca_out(IE0_TXINT, MSCI0_OFFSET + IE0, port);
hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, port) & ST3_DCD), dev_to_hdlc(dev));
hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, port) & ST3_DCD), dev);
printk(KERN_DEBUG "0x%X\n", sca_in(MSCI1_OFFSET + ST3, port));
/* enable MSCI1 CDCD interrupt */
......@@ -371,8 +371,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
}
sca_init_sync_port(card); /* Set up C101 memory */
hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, card) & ST3_DCD),
dev_to_hdlc(dev));
hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, card) & ST3_DCD), dev);
printk(KERN_INFO "%s: Moxa C101 on IRQ%u,"
" using %u TX + %u RX packets rings\n",
......
......@@ -250,7 +250,7 @@ static void sca_init_sync_port(port_t *port)
}
hdlc_set_carrier(!(sca_in(get_msci(port) + ST3, card) & ST3_DCD),
dev_to_hdlc(port_to_dev(port)));
port_to_dev(port));
}
......@@ -274,7 +274,7 @@ static inline void sca_msci_intr(port_t *port)
if (stat & ST1_CDCD)
hdlc_set_carrier(!(sca_in(msci + ST3, card) & ST3_DCD),
dev_to_hdlc(port_to_dev(port)));
port_to_dev(port));
}
#endif
......@@ -579,7 +579,7 @@ static void sca_open(struct net_device *dev)
- all DMA interrupts
*/
hdlc_set_carrier(!(sca_in(msci + ST3, card) & ST3_DCD), dev_to_hdlc(dev));
hdlc_set_carrier(!(sca_in(msci + ST3, card) & ST3_DCD), dev);
#ifdef __HD64570_H
/* MSCI TX INT and RX INT A IRQ enable */
......
......@@ -69,8 +69,9 @@ static int hdlc_rcv(struct sk_buff *skb, struct net_device *dev,
void hdlc_set_carrier(int on, hdlc_device *hdlc)
void hdlc_set_carrier(int on, struct net_device *dev)
{
hdlc_device *hdlc = dev_to_hdlc(dev);
on = on ? 1 : 0;
#ifdef DEBUG_LINK
......@@ -82,7 +83,7 @@ void hdlc_set_carrier(int on, hdlc_device *hdlc)
if (hdlc->carrier == on)
goto carrier_exit; /* no change in DCD line level */
printk(KERN_INFO "%s: carrier %s\n", hdlc_to_name(hdlc),
printk(KERN_INFO "%s: carrier %s\n", dev->name,
on ? "ON" : "off");
hdlc->carrier = on;
......@@ -92,14 +93,14 @@ void hdlc_set_carrier(int on, hdlc_device *hdlc)
if (hdlc->carrier) {
if (hdlc->proto.start)
hdlc->proto.start(hdlc);
else if (!netif_carrier_ok(&hdlc->netdev))
netif_carrier_on(&hdlc->netdev);
else if (!netif_carrier_ok(dev))
netif_carrier_on(dev);
} else { /* no carrier */
if (hdlc->proto.stop)
hdlc->proto.stop(hdlc);
else if (netif_carrier_ok(&hdlc->netdev))
netif_carrier_off(&hdlc->netdev);
else if (netif_carrier_ok(dev))
netif_carrier_off(dev);
}
carrier_exit:
......
......@@ -172,7 +172,7 @@ static inline void wanxl_cable_intr(port_t *port)
printk(KERN_INFO "%s: %s%s module, %s cable%s%s\n",
port_name(port), pm, dte, cable, dsr, dcd);
hdlc_set_carrier(value & STATUS_CABLE_DCD, &port->hdlc);
hdlc_set_carrier(value & STATUS_CABLE_DCD, port_to_dev(port));
}
......
......@@ -233,7 +233,7 @@ int hdlc_open(struct net_device *dev);
/* Must be called by hardware driver when HDLC device is being closed */
void hdlc_close(struct net_device *dev);
/* Called by hardware driver when DCD line level changes */
void hdlc_set_carrier(int on, hdlc_device *hdlc);
void hdlc_set_carrier(int on, struct net_device *dev);
/* May be used by hardware driver to gain control over HDLC device */
static __inline__ void hdlc_proto_detach(hdlc_device *hdlc)
......
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