Commit 24b84925 authored by Alexander Viro's avatar Alexander Viro Committed by Stephen Hemminger

[wan hdlc] hdlc_open() switched to net_device

Beginning of hdlc fixes.  hdlc_open() switched from hdlc_device to net_device.
parent b4629aeb
...@@ -181,7 +181,7 @@ static int c101_open(struct net_device *dev) ...@@ -181,7 +181,7 @@ static int c101_open(struct net_device *dev)
port_t *port = hdlc_to_port(hdlc); port_t *port = hdlc_to_port(hdlc);
int result; int result;
result = hdlc_open(hdlc); result = hdlc_open(dev);
if (result) if (result)
return result; return result;
......
...@@ -1022,7 +1022,7 @@ static int dscc4_open(struct net_device *dev) ...@@ -1022,7 +1022,7 @@ static int dscc4_open(struct net_device *dev)
if ((dscc4_loopback_check(dpriv) < 0) || !dev->hard_start_xmit) if ((dscc4_loopback_check(dpriv) < 0) || !dev->hard_start_xmit)
goto err; goto err;
if ((ret = hdlc_open(hdlc))) if ((ret = hdlc_open(dev)))
goto err; goto err;
ppriv = dpriv->pci_priv; ppriv = dpriv->pci_priv;
......
...@@ -1309,7 +1309,7 @@ fst_open ( struct net_device *dev ) ...@@ -1309,7 +1309,7 @@ fst_open ( struct net_device *dev )
{ {
int err; int err;
err = hdlc_open ( dev_to_hdlc ( dev )); err = hdlc_open (dev);
if ( err ) if ( err )
return err; return err;
......
...@@ -108,8 +108,9 @@ void hdlc_set_carrier(int on, hdlc_device *hdlc) ...@@ -108,8 +108,9 @@ void hdlc_set_carrier(int on, hdlc_device *hdlc)
/* Must be called by hardware driver when HDLC device is being opened */ /* Must be called by hardware driver when HDLC device is being opened */
int hdlc_open(hdlc_device *hdlc) int hdlc_open(struct net_device *dev)
{ {
hdlc_device *hdlc = dev_to_hdlc(dev);
#ifdef DEBUG_LINK #ifdef DEBUG_LINK
printk(KERN_DEBUG "hdlc_open carrier %i open %i\n", printk(KERN_DEBUG "hdlc_open carrier %i open %i\n",
hdlc->carrier, hdlc->open); hdlc->carrier, hdlc->open);
...@@ -129,11 +130,11 @@ int hdlc_open(hdlc_device *hdlc) ...@@ -129,11 +130,11 @@ int hdlc_open(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 if (netif_carrier_ok(&hdlc->netdev)) } else if (netif_carrier_ok(dev))
netif_carrier_off(&hdlc->netdev); netif_carrier_off(dev);
hdlc->open = 1; hdlc->open = 1;
......
...@@ -221,7 +221,7 @@ static int n2_open(struct net_device *dev) ...@@ -221,7 +221,7 @@ static int n2_open(struct net_device *dev)
u8 mcr = inb(io + N2_MCR) | (port->phy_node ? TX422_PORT1:TX422_PORT0); u8 mcr = inb(io + N2_MCR) | (port->phy_node ? TX422_PORT1:TX422_PORT0);
int result; int result;
result = hdlc_open(hdlc); result = hdlc_open(dev);
if (result) if (result)
return result; return result;
......
...@@ -3157,7 +3157,7 @@ int cpc_open(struct net_device *dev) ...@@ -3157,7 +3157,7 @@ int cpc_open(struct net_device *dev)
d->if_ptr = &hdlc->state.ppp.pppdev; d->if_ptr = &hdlc->state.ppp.pppdev;
} }
result = hdlc_open(hdlc); result = hdlc_open(dev);
if (hdlc->proto.id == IF_PROTO_PPP) { if (hdlc->proto.id == IF_PROTO_PPP) {
dev->priv = d; dev->priv = d;
} }
......
...@@ -425,7 +425,7 @@ static int wanxl_open(struct net_device *dev) ...@@ -425,7 +425,7 @@ static int wanxl_open(struct net_device *dev)
printk(KERN_ERR "%s: port already open\n", port_name(port)); printk(KERN_ERR "%s: port already open\n", port_name(port));
return -EIO; return -EIO;
} }
if ((i = hdlc_open(hdlc)) != 0) if ((i = hdlc_open(dev)) != 0)
return i; return i;
port->tx_in = port->tx_out = 0; port->tx_in = port->tx_out = 0;
......
...@@ -229,7 +229,7 @@ static __inline__ void debug_frame(const struct sk_buff *skb) ...@@ -229,7 +229,7 @@ static __inline__ void debug_frame(const struct sk_buff *skb)
/* Must be called by hardware driver when HDLC device is being opened */ /* Must be called by hardware driver when HDLC device is being opened */
int hdlc_open(hdlc_device *hdlc); 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(hdlc_device *hdlc); void hdlc_close(hdlc_device *hdlc);
/* Called by hardware driver when DCD line level changes */ /* Called by hardware driver when DCD line level changes */
......
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