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