aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/lmc
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/lmc
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/lmc')
-rw-r--r--drivers/net/wan/lmc/lmc_main.c19
-rw-r--r--drivers/net/wan/lmc/lmc_proto.c17
2 files changed, 12 insertions, 24 deletions
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index feac3b99f8fe..45b1822c962d 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -806,6 +806,16 @@ static int lmc_attach(struct net_device *dev, unsigned short encoding,
806 return -EINVAL; 806 return -EINVAL;
807} 807}
808 808
809static const struct net_device_ops lmc_ops = {
810 .ndo_open = lmc_open,
811 .ndo_stop = lmc_close,
812 .ndo_change_mtu = hdlc_change_mtu,
813 .ndo_start_xmit = hdlc_start_xmit,
814 .ndo_do_ioctl = lmc_ioctl,
815 .ndo_tx_timeout = lmc_driver_timeout,
816 .ndo_get_stats = lmc_get_stats,
817};
818
809static int __devinit lmc_init_one(struct pci_dev *pdev, 819static int __devinit lmc_init_one(struct pci_dev *pdev,
810 const struct pci_device_id *ent) 820 const struct pci_device_id *ent)
811{ 821{
@@ -849,11 +859,7 @@ static int __devinit lmc_init_one(struct pci_dev *pdev,
849 dev->type = ARPHRD_HDLC; 859 dev->type = ARPHRD_HDLC;
850 dev_to_hdlc(dev)->xmit = lmc_start_xmit; 860 dev_to_hdlc(dev)->xmit = lmc_start_xmit;
851 dev_to_hdlc(dev)->attach = lmc_attach; 861 dev_to_hdlc(dev)->attach = lmc_attach;
852 dev->open = lmc_open; 862 dev->netdev_ops = &lmc_ops;
853 dev->stop = lmc_close;
854 dev->get_stats = lmc_get_stats;
855 dev->do_ioctl = lmc_ioctl;
856 dev->tx_timeout = lmc_driver_timeout;
857 dev->watchdog_timeo = HZ; /* 1 second */ 863 dev->watchdog_timeo = HZ; /* 1 second */
858 dev->tx_queue_len = 100; 864 dev->tx_queue_len = 100;
859 sc->lmc_device = dev; 865 sc->lmc_device = dev;
@@ -1059,9 +1065,6 @@ static int lmc_open(struct net_device *dev)
1059 if ((err = lmc_proto_open(sc)) != 0) 1065 if ((err = lmc_proto_open(sc)) != 0)
1060 return err; 1066 return err;
1061 1067
1062 dev->do_ioctl = lmc_ioctl;
1063
1064
1065 netif_start_queue(dev); 1068 netif_start_queue(dev);
1066 sc->extra_stats.tx_tbusy0++; 1069 sc->extra_stats.tx_tbusy0++;
1067 1070
diff --git a/drivers/net/wan/lmc/lmc_proto.c b/drivers/net/wan/lmc/lmc_proto.c
index 94b4c208b013..044a48175c42 100644
--- a/drivers/net/wan/lmc/lmc_proto.c
+++ b/drivers/net/wan/lmc/lmc_proto.c
@@ -51,30 +51,15 @@
51void lmc_proto_attach(lmc_softc_t *sc) /*FOLD00*/ 51void lmc_proto_attach(lmc_softc_t *sc) /*FOLD00*/
52{ 52{
53 lmc_trace(sc->lmc_device, "lmc_proto_attach in"); 53 lmc_trace(sc->lmc_device, "lmc_proto_attach in");
54 switch(sc->if_type){ 54 if (sc->if_type == LMC_NET) {
55 case LMC_PPP:
56 {
57 struct net_device *dev = sc->lmc_device;
58 dev->do_ioctl = lmc_ioctl;
59 }
60 break;
61 case LMC_NET:
62 {
63 struct net_device *dev = sc->lmc_device; 55 struct net_device *dev = sc->lmc_device;
64 /* 56 /*
65 * They set a few basics because they don't use HDLC 57 * They set a few basics because they don't use HDLC
66 */ 58 */
67 dev->flags |= IFF_POINTOPOINT; 59 dev->flags |= IFF_POINTOPOINT;
68
69 dev->hard_header_len = 0; 60 dev->hard_header_len = 0;
70 dev->addr_len = 0; 61 dev->addr_len = 0;
71 } 62 }
72 case LMC_RAW: /* Setup the task queue, maybe we should notify someone? */
73 {
74 }
75 default:
76 break;
77 }
78 lmc_trace(sc->lmc_device, "lmc_proto_attach out"); 63 lmc_trace(sc->lmc_device, "lmc_proto_attach out");
79} 64}
80 65