aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/appletalk/ltpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/appletalk/ltpc.c')
-rw-r--r--drivers/net/appletalk/ltpc.c38
1 files changed, 11 insertions, 27 deletions
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c
index dc4d49605603..78cc71469136 100644
--- a/drivers/net/appletalk/ltpc.c
+++ b/drivers/net/appletalk/ltpc.c
@@ -261,7 +261,6 @@ static unsigned char *ltdmacbuf;
261 261
262struct ltpc_private 262struct ltpc_private
263{ 263{
264 struct net_device_stats stats;
265 struct atalk_addr my_addr; 264 struct atalk_addr my_addr;
266}; 265};
267 266
@@ -699,7 +698,6 @@ static int do_read(struct net_device *dev, void *cbuf, int cbuflen,
699static struct timer_list ltpc_timer; 698static struct timer_list ltpc_timer;
700 699
701static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev); 700static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev);
702static struct net_device_stats *ltpc_get_stats(struct net_device *dev);
703 701
704static int read_30 ( struct net_device *dev) 702static int read_30 ( struct net_device *dev)
705{ 703{
@@ -726,8 +724,6 @@ static int sendup_buffer (struct net_device *dev)
726 int dnode, snode, llaptype, len; 724 int dnode, snode, llaptype, len;
727 int sklen; 725 int sklen;
728 struct sk_buff *skb; 726 struct sk_buff *skb;
729 struct ltpc_private *ltpc_priv = netdev_priv(dev);
730 struct net_device_stats *stats = &ltpc_priv->stats;
731 struct lt_rcvlap *ltc = (struct lt_rcvlap *) ltdmacbuf; 727 struct lt_rcvlap *ltc = (struct lt_rcvlap *) ltdmacbuf;
732 728
733 if (ltc->command != LT_RCVLAP) { 729 if (ltc->command != LT_RCVLAP) {
@@ -779,8 +775,8 @@ static int sendup_buffer (struct net_device *dev)
779 775
780 skb_reset_transport_header(skb); 776 skb_reset_transport_header(skb);
781 777
782 stats->rx_packets++; 778 dev->stats.rx_packets++;
783 stats->rx_bytes+=skb->len; 779 dev->stats.rx_bytes += skb->len;
784 780
785 /* toss it onwards */ 781 /* toss it onwards */
786 netif_rx(skb); 782 netif_rx(skb);
@@ -904,10 +900,6 @@ static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev)
904 /* in kernel 1.3.xx, on entry skb->data points to ddp header, 900 /* in kernel 1.3.xx, on entry skb->data points to ddp header,
905 * and skb->len is the length of the ddp data + ddp header 901 * and skb->len is the length of the ddp data + ddp header
906 */ 902 */
907
908 struct ltpc_private *ltpc_priv = netdev_priv(dev);
909 struct net_device_stats *stats = &ltpc_priv->stats;
910
911 int i; 903 int i;
912 struct lt_sendlap cbuf; 904 struct lt_sendlap cbuf;
913 unsigned char *hdr; 905 unsigned char *hdr;
@@ -936,20 +928,13 @@ static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev)
936 printk("\n"); 928 printk("\n");
937 } 929 }
938 930
939 stats->tx_packets++; 931 dev->stats.tx_packets++;
940 stats->tx_bytes+=skb->len; 932 dev->stats.tx_bytes += skb->len;
941 933
942 dev_kfree_skb(skb); 934 dev_kfree_skb(skb);
943 return 0; 935 return 0;
944} 936}
945 937
946static struct net_device_stats *ltpc_get_stats(struct net_device *dev)
947{
948 struct ltpc_private *ltpc_priv = netdev_priv(dev);
949 struct net_device_stats *stats = &ltpc_priv->stats;
950 return stats;
951}
952
953/* initialization stuff */ 938/* initialization stuff */
954 939
955static int __init ltpc_probe_dma(int base, int dma) 940static int __init ltpc_probe_dma(int base, int dma)
@@ -1027,6 +1012,12 @@ static int __init ltpc_probe_dma(int base, int dma)
1027 return (want & 2) ? 3 : 1; 1012 return (want & 2) ? 3 : 1;
1028} 1013}
1029 1014
1015static const struct net_device_ops ltpc_netdev = {
1016 .ndo_start_xmit = ltpc_xmit,
1017 .ndo_do_ioctl = ltpc_ioctl,
1018 .ndo_set_multicast_list = set_multicast_list,
1019};
1020
1030struct net_device * __init ltpc_probe(void) 1021struct net_device * __init ltpc_probe(void)
1031{ 1022{
1032 struct net_device *dev; 1023 struct net_device *dev;
@@ -1133,14 +1124,7 @@ struct net_device * __init ltpc_probe(void)
1133 else 1124 else
1134 printk(KERN_INFO "Apple/Farallon LocalTalk-PC card at %03x, DMA%d. Using polled mode.\n",io,dma); 1125 printk(KERN_INFO "Apple/Farallon LocalTalk-PC card at %03x, DMA%d. Using polled mode.\n",io,dma);
1135 1126
1136 /* Fill in the fields of the device structure with ethernet-generic values. */ 1127 dev->netdev_ops = &ltpc_netdev;
1137 dev->hard_start_xmit = ltpc_xmit;
1138 dev->get_stats = ltpc_get_stats;
1139
1140 /* add the ltpc-specific things */
1141 dev->do_ioctl = &ltpc_ioctl;
1142
1143 dev->set_multicast_list = &set_multicast_list;
1144 dev->mc_list = NULL; 1128 dev->mc_list = NULL;
1145 dev->base_addr = io; 1129 dev->base_addr = io;
1146 dev->irq = irq; 1130 dev->irq = irq;