From c2ce920468624d87ec5f91f080ea99681dae6d88 Mon Sep 17 00:00:00 2001 From: Krzysztof Halasa Date: Wed, 12 Jul 2006 13:46:12 -0700 Subject: [WAN]: converting generic HDLC to use netif_dormant*() This patch converts generic HDLC (and WAN drivers using it) from hdlc_set_carrier() to netif_dormant*() interface. WAN hardware drivers should now use netif_carrier_on|off() like other network drivers. Signed-off-by: Krzysztof Halasa Signed-off-by: David S. Miller --- drivers/net/wan/hd6457x.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'drivers/net/wan/hd6457x.c') diff --git a/drivers/net/wan/hd6457x.c b/drivers/net/wan/hd6457x.c index d3743321a977..dce2bb317b82 100644 --- a/drivers/net/wan/hd6457x.c +++ b/drivers/net/wan/hd6457x.c @@ -168,6 +168,23 @@ static inline u32 buffer_offset(port_t *port, u16 desc, int transmit) } +static inline void sca_set_carrier(port_t *port) +{ + if (!(sca_in(get_msci(port) + ST3, port_to_card(port)) & ST3_DCD)) { +#ifdef DEBUG_LINK + printk(KERN_DEBUG "%s: sca_set_carrier on\n", + port_to_dev(port)->name); +#endif + netif_carrier_on(port_to_dev(port)); + } else { +#ifdef DEBUG_LINK + printk(KERN_DEBUG "%s: sca_set_carrier off\n", + port_to_dev(port)->name); +#endif + netif_carrier_off(port_to_dev(port)); + } +} + static void sca_init_sync_port(port_t *port) { @@ -237,9 +254,7 @@ static void sca_init_sync_port(port_t *port) sca_out(DIR_BOFE, DIR_TX(phy_node(port)), card); } } - - hdlc_set_carrier(!(sca_in(get_msci(port) + ST3, card) & ST3_DCD), - port_to_dev(port)); + sca_set_carrier(port); } @@ -262,8 +277,7 @@ static inline void sca_msci_intr(port_t *port) } if (stat & ST1_CDCD) - hdlc_set_carrier(!(sca_in(msci + ST3, card) & ST3_DCD), - port_to_dev(port)); + sca_set_carrier(port); } #endif @@ -566,7 +580,7 @@ static void sca_open(struct net_device *dev) - all DMA interrupts */ - hdlc_set_carrier(!(sca_in(msci + ST3, card) & ST3_DCD), dev); + sca_set_carrier(port); #ifdef __HD64570_H /* MSCI TX INT and RX INT A IRQ enable */ -- cgit v1.2.3