aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/hdlc_fr.c
diff options
context:
space:
mode:
authorKrzysztof Hałasa <khc@pm.waw.pl>2009-01-08 16:52:11 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-21 17:03:37 -0500
commit991990a12de42281f81b4e3a6471586d2d0caf6a (patch)
tree7b7ad34cf8218dab2ddd882a87b7c7a687b7d2ee /drivers/net/wan/hdlc_fr.c
parentdff3fde7be8f08c78914fca3d25e1cffe7625faa (diff)
WAN: Convert generic HDLC drivers to netdev_ops.
Also remove unneeded last_rx update from Synclink drivers. Synclink part mostly by Stephen Hemminger. Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan/hdlc_fr.c')
-rw-r--r--drivers/net/wan/hdlc_fr.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index f1ddd7c3459c..70e57cebc955 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -444,18 +444,6 @@ static int pvc_xmit(struct sk_buff *skb, struct net_device *dev)
444 return 0; 444 return 0;
445} 445}
446 446
447
448
449static int pvc_change_mtu(struct net_device *dev, int new_mtu)
450{
451 if ((new_mtu < 68) || (new_mtu > HDLC_MAX_MTU))
452 return -EINVAL;
453 dev->mtu = new_mtu;
454 return 0;
455}
456
457
458
459static inline void fr_log_dlci_active(pvc_device *pvc) 447static inline void fr_log_dlci_active(pvc_device *pvc)
460{ 448{
461 printk(KERN_INFO "%s: DLCI %d [%s%s%s]%s %s\n", 449 printk(KERN_INFO "%s: DLCI %d [%s%s%s]%s %s\n",
@@ -1068,6 +1056,14 @@ static void pvc_setup(struct net_device *dev)
1068 dev->addr_len = 2; 1056 dev->addr_len = 2;
1069} 1057}
1070 1058
1059static const struct net_device_ops pvc_ops = {
1060 .ndo_open = pvc_open,
1061 .ndo_stop = pvc_close,
1062 .ndo_change_mtu = hdlc_change_mtu,
1063 .ndo_start_xmit = pvc_xmit,
1064 .ndo_do_ioctl = pvc_ioctl,
1065};
1066
1071static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type) 1067static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
1072{ 1068{
1073 hdlc_device *hdlc = dev_to_hdlc(frad); 1069 hdlc_device *hdlc = dev_to_hdlc(frad);
@@ -1104,11 +1100,7 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
1104 *(__be16*)dev->dev_addr = htons(dlci); 1100 *(__be16*)dev->dev_addr = htons(dlci);
1105 dlci_to_q922(dev->broadcast, dlci); 1101 dlci_to_q922(dev->broadcast, dlci);
1106 } 1102 }
1107 dev->hard_start_xmit = pvc_xmit; 1103 dev->netdev_ops = &pvc_ops;
1108 dev->open = pvc_open;
1109 dev->stop = pvc_close;
1110 dev->do_ioctl = pvc_ioctl;
1111 dev->change_mtu = pvc_change_mtu;
1112 dev->mtu = HDLC_MAX_MTU; 1104 dev->mtu = HDLC_MAX_MTU;
1113 dev->tx_queue_len = 0; 1105 dev->tx_queue_len = 0;
1114 dev->ml_priv = pvc; 1106 dev->ml_priv = pvc;
@@ -1260,8 +1252,6 @@ static int fr_ioctl(struct net_device *dev, struct ifreq *ifr)
1260 state(hdlc)->dce_pvc_count = 0; 1252 state(hdlc)->dce_pvc_count = 0;
1261 } 1253 }
1262 memcpy(&state(hdlc)->settings, &new_settings, size); 1254 memcpy(&state(hdlc)->settings, &new_settings, size);
1263
1264 dev->hard_start_xmit = hdlc->xmit;
1265 dev->type = ARPHRD_FRAD; 1255 dev->type = ARPHRD_FRAD;
1266 return 0; 1256 return 0;
1267 1257