aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/arcnet
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/arcnet')
-rw-r--r--drivers/net/arcnet/arc-rawmode.c2
-rw-r--r--drivers/net/arcnet/arcnet.c71
-rw-r--r--drivers/net/arcnet/capmode.c2
-rw-r--r--drivers/net/arcnet/com20020-isa.c2
-rw-r--r--drivers/net/arcnet/com20020-pci.c3
-rw-r--r--drivers/net/arcnet/com20020.c11
-rw-r--r--drivers/net/arcnet/rfc1051.c12
-rw-r--r--drivers/net/arcnet/rfc1201.c47
8 files changed, 72 insertions, 78 deletions
diff --git a/drivers/net/arcnet/arc-rawmode.c b/drivers/net/arcnet/arc-rawmode.c
index 3ff9affb1a91..da017cbb5f64 100644
--- a/drivers/net/arcnet/arc-rawmode.c
+++ b/drivers/net/arcnet/arc-rawmode.c
@@ -102,7 +102,7 @@ static void rx(struct net_device *dev, int bufnum,
102 skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); 102 skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
103 if (skb == NULL) { 103 if (skb == NULL) {
104 BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n"); 104 BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n");
105 lp->stats.rx_dropped++; 105 dev->stats.rx_dropped++;
106 return; 106 return;
107 } 107 }
108 skb_put(skb, length + ARC_HDR_SIZE); 108 skb_put(skb, length + ARC_HDR_SIZE);
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
index 6b53e5ed125c..a80d4a30a464 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -95,17 +95,16 @@ EXPORT_SYMBOL(arcnet_unregister_proto);
95EXPORT_SYMBOL(arcnet_debug); 95EXPORT_SYMBOL(arcnet_debug);
96EXPORT_SYMBOL(alloc_arcdev); 96EXPORT_SYMBOL(alloc_arcdev);
97EXPORT_SYMBOL(arcnet_interrupt); 97EXPORT_SYMBOL(arcnet_interrupt);
98EXPORT_SYMBOL(arcnet_open);
99EXPORT_SYMBOL(arcnet_close);
100EXPORT_SYMBOL(arcnet_send_packet);
101EXPORT_SYMBOL(arcnet_timeout);
98 102
99/* Internal function prototypes */ 103/* Internal function prototypes */
100static int arcnet_open(struct net_device *dev);
101static int arcnet_close(struct net_device *dev);
102static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev);
103static void arcnet_timeout(struct net_device *dev);
104static int arcnet_header(struct sk_buff *skb, struct net_device *dev, 104static int arcnet_header(struct sk_buff *skb, struct net_device *dev,
105 unsigned short type, const void *daddr, 105 unsigned short type, const void *daddr,
106 const void *saddr, unsigned len); 106 const void *saddr, unsigned len);
107static int arcnet_rebuild_header(struct sk_buff *skb); 107static int arcnet_rebuild_header(struct sk_buff *skb);
108static struct net_device_stats *arcnet_get_stats(struct net_device *dev);
109static int go_tx(struct net_device *dev); 108static int go_tx(struct net_device *dev);
110 109
111static int debug = ARCNET_DEBUG; 110static int debug = ARCNET_DEBUG;
@@ -322,11 +321,18 @@ static const struct header_ops arcnet_header_ops = {
322 .rebuild = arcnet_rebuild_header, 321 .rebuild = arcnet_rebuild_header,
323}; 322};
324 323
324static const struct net_device_ops arcnet_netdev_ops = {
325 .ndo_open = arcnet_open,
326 .ndo_stop = arcnet_close,
327 .ndo_start_xmit = arcnet_send_packet,
328 .ndo_tx_timeout = arcnet_timeout,
329};
325 330
326/* Setup a struct device for ARCnet. */ 331/* Setup a struct device for ARCnet. */
327static void arcdev_setup(struct net_device *dev) 332static void arcdev_setup(struct net_device *dev)
328{ 333{
329 dev->type = ARPHRD_ARCNET; 334 dev->type = ARPHRD_ARCNET;
335 dev->netdev_ops = &arcnet_netdev_ops;
330 dev->header_ops = &arcnet_header_ops; 336 dev->header_ops = &arcnet_header_ops;
331 dev->hard_header_len = sizeof(struct archdr); 337 dev->hard_header_len = sizeof(struct archdr);
332 dev->mtu = choose_mtu(); 338 dev->mtu = choose_mtu();
@@ -339,18 +345,9 @@ static void arcdev_setup(struct net_device *dev)
339 /* New-style flags. */ 345 /* New-style flags. */
340 dev->flags = IFF_BROADCAST; 346 dev->flags = IFF_BROADCAST;
341 347
342 /*
343 * Put in this stuff here, so we don't have to export the symbols to
344 * the chipset drivers.
345 */
346 dev->open = arcnet_open;
347 dev->stop = arcnet_close;
348 dev->hard_start_xmit = arcnet_send_packet;
349 dev->tx_timeout = arcnet_timeout;
350 dev->get_stats = arcnet_get_stats;
351} 348}
352 349
353struct net_device *alloc_arcdev(char *name) 350struct net_device *alloc_arcdev(const char *name)
354{ 351{
355 struct net_device *dev; 352 struct net_device *dev;
356 353
@@ -372,7 +369,7 @@ struct net_device *alloc_arcdev(char *name)
372 * that "should" only need to be set once at boot, so that there is 369 * that "should" only need to be set once at boot, so that there is
373 * non-reboot way to recover if something goes wrong. 370 * non-reboot way to recover if something goes wrong.
374 */ 371 */
375static int arcnet_open(struct net_device *dev) 372int arcnet_open(struct net_device *dev)
376{ 373{
377 struct arcnet_local *lp = netdev_priv(dev); 374 struct arcnet_local *lp = netdev_priv(dev);
378 int count, newmtu, error; 375 int count, newmtu, error;
@@ -472,7 +469,7 @@ static int arcnet_open(struct net_device *dev)
472 469
473 470
474/* The inverse routine to arcnet_open - shuts down the card. */ 471/* The inverse routine to arcnet_open - shuts down the card. */
475static int arcnet_close(struct net_device *dev) 472int arcnet_close(struct net_device *dev)
476{ 473{
477 struct arcnet_local *lp = netdev_priv(dev); 474 struct arcnet_local *lp = netdev_priv(dev);
478 475
@@ -583,8 +580,8 @@ static int arcnet_rebuild_header(struct sk_buff *skb)
583 } else { 580 } else {
584 BUGMSG(D_NORMAL, 581 BUGMSG(D_NORMAL,
585 "I don't understand ethernet protocol %Xh addresses!\n", type); 582 "I don't understand ethernet protocol %Xh addresses!\n", type);
586 lp->stats.tx_errors++; 583 dev->stats.tx_errors++;
587 lp->stats.tx_aborted_errors++; 584 dev->stats.tx_aborted_errors++;
588 } 585 }
589 586
590 /* if we couldn't resolve the address... give up. */ 587 /* if we couldn't resolve the address... give up. */
@@ -601,7 +598,7 @@ static int arcnet_rebuild_header(struct sk_buff *skb)
601 598
602 599
603/* Called by the kernel in order to transmit a packet. */ 600/* Called by the kernel in order to transmit a packet. */
604static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev) 601int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
605{ 602{
606 struct arcnet_local *lp = netdev_priv(dev); 603 struct arcnet_local *lp = netdev_priv(dev);
607 struct archdr *pkt; 604 struct archdr *pkt;
@@ -645,7 +642,7 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
645 !proto->ack_tx) { 642 !proto->ack_tx) {
646 /* done right away and we don't want to acknowledge 643 /* done right away and we don't want to acknowledge
647 the package later - forget about it now */ 644 the package later - forget about it now */
648 lp->stats.tx_bytes += skb->len; 645 dev->stats.tx_bytes += skb->len;
649 freeskb = 1; 646 freeskb = 1;
650 } else { 647 } else {
651 /* do it the 'split' way */ 648 /* do it the 'split' way */
@@ -709,7 +706,7 @@ static int go_tx(struct net_device *dev)
709 /* start sending */ 706 /* start sending */
710 ACOMMAND(TXcmd | (lp->cur_tx << 3)); 707 ACOMMAND(TXcmd | (lp->cur_tx << 3));
711 708
712 lp->stats.tx_packets++; 709 dev->stats.tx_packets++;
713 lp->lasttrans_dest = lp->lastload_dest; 710 lp->lasttrans_dest = lp->lastload_dest;
714 lp->lastload_dest = 0; 711 lp->lastload_dest = 0;
715 lp->excnak_pending = 0; 712 lp->excnak_pending = 0;
@@ -720,7 +717,7 @@ static int go_tx(struct net_device *dev)
720 717
721 718
722/* Called by the kernel when transmit times out */ 719/* Called by the kernel when transmit times out */
723static void arcnet_timeout(struct net_device *dev) 720void arcnet_timeout(struct net_device *dev)
724{ 721{
725 unsigned long flags; 722 unsigned long flags;
726 struct arcnet_local *lp = netdev_priv(dev); 723 struct arcnet_local *lp = netdev_priv(dev);
@@ -732,11 +729,11 @@ static void arcnet_timeout(struct net_device *dev)
732 msg = " - missed IRQ?"; 729 msg = " - missed IRQ?";
733 } else { 730 } else {
734 msg = ""; 731 msg = "";
735 lp->stats.tx_aborted_errors++; 732 dev->stats.tx_aborted_errors++;
736 lp->timed_out = 1; 733 lp->timed_out = 1;
737 ACOMMAND(NOTXcmd | (lp->cur_tx << 3)); 734 ACOMMAND(NOTXcmd | (lp->cur_tx << 3));
738 } 735 }
739 lp->stats.tx_errors++; 736 dev->stats.tx_errors++;
740 737
741 /* make sure we didn't miss a TX or a EXC NAK IRQ */ 738 /* make sure we didn't miss a TX or a EXC NAK IRQ */
742 AINTMASK(0); 739 AINTMASK(0);
@@ -865,8 +862,8 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
865 "transmit was not acknowledged! " 862 "transmit was not acknowledged! "
866 "(status=%Xh, dest=%02Xh)\n", 863 "(status=%Xh, dest=%02Xh)\n",
867 status, lp->lasttrans_dest); 864 status, lp->lasttrans_dest);
868 lp->stats.tx_errors++; 865 dev->stats.tx_errors++;
869 lp->stats.tx_carrier_errors++; 866 dev->stats.tx_carrier_errors++;
870 } else { 867 } else {
871 BUGMSG(D_DURING, 868 BUGMSG(D_DURING,
872 "broadcast was not acknowledged; that's normal " 869 "broadcast was not acknowledged; that's normal "
@@ -905,7 +902,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
905 if (txbuf != -1) { 902 if (txbuf != -1) {
906 if (lp->outgoing.proto->continue_tx(dev, txbuf)) { 903 if (lp->outgoing.proto->continue_tx(dev, txbuf)) {
907 /* that was the last segment */ 904 /* that was the last segment */
908 lp->stats.tx_bytes += lp->outgoing.skb->len; 905 dev->stats.tx_bytes += lp->outgoing.skb->len;
909 if(!lp->outgoing.proto->ack_tx) 906 if(!lp->outgoing.proto->ack_tx)
910 { 907 {
911 dev_kfree_skb_irq(lp->outgoing.skb); 908 dev_kfree_skb_irq(lp->outgoing.skb);
@@ -930,7 +927,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
930 } 927 }
931 if (status & lp->intmask & RECONflag) { 928 if (status & lp->intmask & RECONflag) {
932 ACOMMAND(CFLAGScmd | CONFIGclear); 929 ACOMMAND(CFLAGScmd | CONFIGclear);
933 lp->stats.tx_carrier_errors++; 930 dev->stats.tx_carrier_errors++;
934 931
935 BUGMSG(D_RECON, "Network reconfiguration detected (status=%Xh)\n", 932 BUGMSG(D_RECON, "Network reconfiguration detected (status=%Xh)\n",
936 status); 933 status);
@@ -1038,8 +1035,8 @@ static void arcnet_rx(struct net_device *dev, int bufnum)
1038 "(%d+4 bytes)\n", 1035 "(%d+4 bytes)\n",
1039 bufnum, pkt.hard.source, pkt.hard.dest, length); 1036 bufnum, pkt.hard.source, pkt.hard.dest, length);
1040 1037
1041 lp->stats.rx_packets++; 1038 dev->stats.rx_packets++;
1042 lp->stats.rx_bytes += length + ARC_HDR_SIZE; 1039 dev->stats.rx_bytes += length + ARC_HDR_SIZE;
1043 1040
1044 /* call the right receiver for the protocol */ 1041 /* call the right receiver for the protocol */
1045 if (arc_proto_map[soft->proto]->is_ip) { 1042 if (arc_proto_map[soft->proto]->is_ip) {
@@ -1067,18 +1064,6 @@ static void arcnet_rx(struct net_device *dev, int bufnum)
1067} 1064}
1068 1065
1069 1066
1070
1071/*
1072 * Get the current statistics. This may be called with the card open or
1073 * closed.
1074 */
1075static struct net_device_stats *arcnet_get_stats(struct net_device *dev)
1076{
1077 struct arcnet_local *lp = netdev_priv(dev);
1078 return &lp->stats;
1079}
1080
1081
1082static void null_rx(struct net_device *dev, int bufnum, 1067static void null_rx(struct net_device *dev, int bufnum,
1083 struct archdr *pkthdr, int length) 1068 struct archdr *pkthdr, int length)
1084{ 1069{
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c
index 30580bbe252d..1613929ff301 100644
--- a/drivers/net/arcnet/capmode.c
+++ b/drivers/net/arcnet/capmode.c
@@ -119,7 +119,7 @@ static void rx(struct net_device *dev, int bufnum,
119 skb = alloc_skb(length + ARC_HDR_SIZE + sizeof(int), GFP_ATOMIC); 119 skb = alloc_skb(length + ARC_HDR_SIZE + sizeof(int), GFP_ATOMIC);
120 if (skb == NULL) { 120 if (skb == NULL) {
121 BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n"); 121 BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n");
122 lp->stats.rx_dropped++; 122 dev->stats.rx_dropped++;
123 return; 123 return;
124 } 124 }
125 skb_put(skb, length + ARC_HDR_SIZE + sizeof(int)); 125 skb_put(skb, length + ARC_HDR_SIZE + sizeof(int));
diff --git a/drivers/net/arcnet/com20020-isa.c b/drivers/net/arcnet/com20020-isa.c
index ea53a940272f..db08fc24047a 100644
--- a/drivers/net/arcnet/com20020-isa.c
+++ b/drivers/net/arcnet/com20020-isa.c
@@ -151,6 +151,8 @@ static int __init com20020_init(void)
151 if (node && node != 0xff) 151 if (node && node != 0xff)
152 dev->dev_addr[0] = node; 152 dev->dev_addr[0] = node;
153 153
154 dev->netdev_ops = &com20020_netdev_ops;
155
154 lp = netdev_priv(dev); 156 lp = netdev_priv(dev);
155 lp->backplane = backplane; 157 lp->backplane = backplane;
156 lp->clockp = clockp & 7; 158 lp->clockp = clockp & 7;
diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index 8b51f632581d..dbf4de39754d 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -72,6 +72,9 @@ static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_de
72 dev = alloc_arcdev(device); 72 dev = alloc_arcdev(device);
73 if (!dev) 73 if (!dev)
74 return -ENOMEM; 74 return -ENOMEM;
75
76 dev->netdev_ops = &com20020_netdev_ops;
77
75 lp = netdev_priv(dev); 78 lp = netdev_priv(dev);
76 79
77 pci_set_drvdata(pdev, dev); 80 pci_set_drvdata(pdev, dev);
diff --git a/drivers/net/arcnet/com20020.c b/drivers/net/arcnet/com20020.c
index 103688358fb8..651275a5f3d2 100644
--- a/drivers/net/arcnet/com20020.c
+++ b/drivers/net/arcnet/com20020.c
@@ -149,6 +149,14 @@ int com20020_check(struct net_device *dev)
149 return 0; 149 return 0;
150} 150}
151 151
152const struct net_device_ops com20020_netdev_ops = {
153 .ndo_open = arcnet_open,
154 .ndo_stop = arcnet_close,
155 .ndo_start_xmit = arcnet_send_packet,
156 .ndo_tx_timeout = arcnet_timeout,
157 .ndo_set_multicast_list = com20020_set_mc_list,
158};
159
152/* Set up the struct net_device associated with this card. Called after 160/* Set up the struct net_device associated with this card. Called after
153 * probing succeeds. 161 * probing succeeds.
154 */ 162 */
@@ -170,8 +178,6 @@ int com20020_found(struct net_device *dev, int shared)
170 lp->hw.copy_from_card = com20020_copy_from_card; 178 lp->hw.copy_from_card = com20020_copy_from_card;
171 lp->hw.close = com20020_close; 179 lp->hw.close = com20020_close;
172 180
173 dev->set_multicast_list = com20020_set_mc_list;
174
175 if (!dev->dev_addr[0]) 181 if (!dev->dev_addr[0])
176 dev->dev_addr[0] = inb(ioaddr + BUS_ALIGN*8); /* FIXME: do this some other way! */ 182 dev->dev_addr[0] = inb(ioaddr + BUS_ALIGN*8); /* FIXME: do this some other way! */
177 183
@@ -342,6 +348,7 @@ static void com20020_set_mc_list(struct net_device *dev)
342 defined(CONFIG_ARCNET_COM20020_CS_MODULE) 348 defined(CONFIG_ARCNET_COM20020_CS_MODULE)
343EXPORT_SYMBOL(com20020_check); 349EXPORT_SYMBOL(com20020_check);
344EXPORT_SYMBOL(com20020_found); 350EXPORT_SYMBOL(com20020_found);
351EXPORT_SYMBOL(com20020_netdev_ops);
345#endif 352#endif
346 353
347MODULE_LICENSE("GPL"); 354MODULE_LICENSE("GPL");
diff --git a/drivers/net/arcnet/rfc1051.c b/drivers/net/arcnet/rfc1051.c
index 49d39a9cb696..06f8fa2f8f2f 100644
--- a/drivers/net/arcnet/rfc1051.c
+++ b/drivers/net/arcnet/rfc1051.c
@@ -88,7 +88,6 @@ MODULE_LICENSE("GPL");
88 */ 88 */
89static __be16 type_trans(struct sk_buff *skb, struct net_device *dev) 89static __be16 type_trans(struct sk_buff *skb, struct net_device *dev)
90{ 90{
91 struct arcnet_local *lp = netdev_priv(dev);
92 struct archdr *pkt = (struct archdr *) skb->data; 91 struct archdr *pkt = (struct archdr *) skb->data;
93 struct arc_rfc1051 *soft = &pkt->soft.rfc1051; 92 struct arc_rfc1051 *soft = &pkt->soft.rfc1051;
94 int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE; 93 int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE;
@@ -112,8 +111,8 @@ static __be16 type_trans(struct sk_buff *skb, struct net_device *dev)
112 return htons(ETH_P_ARP); 111 return htons(ETH_P_ARP);
113 112
114 default: 113 default:
115 lp->stats.rx_errors++; 114 dev->stats.rx_errors++;
116 lp->stats.rx_crc_errors++; 115 dev->stats.rx_crc_errors++;
117 return 0; 116 return 0;
118 } 117 }
119 118
@@ -140,7 +139,7 @@ static void rx(struct net_device *dev, int bufnum,
140 skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); 139 skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
141 if (skb == NULL) { 140 if (skb == NULL) {
142 BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n"); 141 BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n");
143 lp->stats.rx_dropped++; 142 dev->stats.rx_dropped++;
144 return; 143 return;
145 } 144 }
146 skb_put(skb, length + ARC_HDR_SIZE); 145 skb_put(skb, length + ARC_HDR_SIZE);
@@ -168,7 +167,6 @@ static void rx(struct net_device *dev, int bufnum,
168static int build_header(struct sk_buff *skb, struct net_device *dev, 167static int build_header(struct sk_buff *skb, struct net_device *dev,
169 unsigned short type, uint8_t daddr) 168 unsigned short type, uint8_t daddr)
170{ 169{
171 struct arcnet_local *lp = netdev_priv(dev);
172 int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE; 170 int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE;
173 struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size); 171 struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size);
174 struct arc_rfc1051 *soft = &pkt->soft.rfc1051; 172 struct arc_rfc1051 *soft = &pkt->soft.rfc1051;
@@ -184,8 +182,8 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
184 default: 182 default:
185 BUGMSG(D_NORMAL, "RFC1051: I don't understand protocol %d (%Xh)\n", 183 BUGMSG(D_NORMAL, "RFC1051: I don't understand protocol %d (%Xh)\n",
186 type, type); 184 type, type);
187 lp->stats.tx_errors++; 185 dev->stats.tx_errors++;
188 lp->stats.tx_aborted_errors++; 186 dev->stats.tx_aborted_errors++;
189 return 0; 187 return 0;
190 } 188 }
191 189
diff --git a/drivers/net/arcnet/rfc1201.c b/drivers/net/arcnet/rfc1201.c
index 2303d3a1f4b6..745530651c45 100644
--- a/drivers/net/arcnet/rfc1201.c
+++ b/drivers/net/arcnet/rfc1201.c
@@ -92,7 +92,6 @@ static __be16 type_trans(struct sk_buff *skb, struct net_device *dev)
92{ 92{
93 struct archdr *pkt = (struct archdr *) skb->data; 93 struct archdr *pkt = (struct archdr *) skb->data;
94 struct arc_rfc1201 *soft = &pkt->soft.rfc1201; 94 struct arc_rfc1201 *soft = &pkt->soft.rfc1201;
95 struct arcnet_local *lp = netdev_priv(dev);
96 int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE; 95 int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE;
97 96
98 /* Pull off the arcnet header. */ 97 /* Pull off the arcnet header. */
@@ -121,8 +120,8 @@ static __be16 type_trans(struct sk_buff *skb, struct net_device *dev)
121 case ARC_P_NOVELL_EC: 120 case ARC_P_NOVELL_EC:
122 return htons(ETH_P_802_3); 121 return htons(ETH_P_802_3);
123 default: 122 default:
124 lp->stats.rx_errors++; 123 dev->stats.rx_errors++;
125 lp->stats.rx_crc_errors++; 124 dev->stats.rx_crc_errors++;
126 return 0; 125 return 0;
127 } 126 }
128 127
@@ -172,8 +171,8 @@ static void rx(struct net_device *dev, int bufnum,
172 in->sequence, soft->split_flag, soft->sequence); 171 in->sequence, soft->split_flag, soft->sequence);
173 lp->rfc1201.aborted_seq = soft->sequence; 172 lp->rfc1201.aborted_seq = soft->sequence;
174 dev_kfree_skb_irq(in->skb); 173 dev_kfree_skb_irq(in->skb);
175 lp->stats.rx_errors++; 174 dev->stats.rx_errors++;
176 lp->stats.rx_missed_errors++; 175 dev->stats.rx_missed_errors++;
177 in->skb = NULL; 176 in->skb = NULL;
178 } 177 }
179 in->sequence = soft->sequence; 178 in->sequence = soft->sequence;
@@ -181,7 +180,7 @@ static void rx(struct net_device *dev, int bufnum,
181 skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); 180 skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
182 if (skb == NULL) { 181 if (skb == NULL) {
183 BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n"); 182 BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n");
184 lp->stats.rx_dropped++; 183 dev->stats.rx_dropped++;
185 return; 184 return;
186 } 185 }
187 skb_put(skb, length + ARC_HDR_SIZE); 186 skb_put(skb, length + ARC_HDR_SIZE);
@@ -213,7 +212,7 @@ static void rx(struct net_device *dev, int bufnum,
213 BUGMSG(D_EXTRA, 212 BUGMSG(D_EXTRA,
214 "ARP source address was 00h, set to %02Xh.\n", 213 "ARP source address was 00h, set to %02Xh.\n",
215 saddr); 214 saddr);
216 lp->stats.rx_crc_errors++; 215 dev->stats.rx_crc_errors++;
217 *cptr = saddr; 216 *cptr = saddr;
218 } else { 217 } else {
219 BUGMSG(D_DURING, "ARP source address (%Xh) is fine.\n", 218 BUGMSG(D_DURING, "ARP source address (%Xh) is fine.\n",
@@ -222,8 +221,8 @@ static void rx(struct net_device *dev, int bufnum,
222 } else { 221 } else {
223 BUGMSG(D_NORMAL, "funny-shaped ARP packet. (%Xh, %Xh)\n", 222 BUGMSG(D_NORMAL, "funny-shaped ARP packet. (%Xh, %Xh)\n",
224 arp->ar_hln, arp->ar_pln); 223 arp->ar_hln, arp->ar_pln);
225 lp->stats.rx_errors++; 224 dev->stats.rx_errors++;
226 lp->stats.rx_crc_errors++; 225 dev->stats.rx_crc_errors++;
227 } 226 }
228 } 227 }
229 BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx"); 228 BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx");
@@ -257,8 +256,8 @@ static void rx(struct net_device *dev, int bufnum,
257 soft->split_flag); 256 soft->split_flag);
258 dev_kfree_skb_irq(in->skb); 257 dev_kfree_skb_irq(in->skb);
259 in->skb = NULL; 258 in->skb = NULL;
260 lp->stats.rx_errors++; 259 dev->stats.rx_errors++;
261 lp->stats.rx_missed_errors++; 260 dev->stats.rx_missed_errors++;
262 in->lastpacket = in->numpackets = 0; 261 in->lastpacket = in->numpackets = 0;
263 } 262 }
264 if (soft->split_flag & 1) { /* first packet in split */ 263 if (soft->split_flag & 1) { /* first packet in split */
@@ -269,8 +268,8 @@ static void rx(struct net_device *dev, int bufnum,
269 "(splitflag=%d, seq=%d)\n", 268 "(splitflag=%d, seq=%d)\n",
270 in->sequence, soft->split_flag, 269 in->sequence, soft->split_flag,
271 soft->sequence); 270 soft->sequence);
272 lp->stats.rx_errors++; 271 dev->stats.rx_errors++;
273 lp->stats.rx_missed_errors++; 272 dev->stats.rx_missed_errors++;
274 dev_kfree_skb_irq(in->skb); 273 dev_kfree_skb_irq(in->skb);
275 } 274 }
276 in->sequence = soft->sequence; 275 in->sequence = soft->sequence;
@@ -281,8 +280,8 @@ static void rx(struct net_device *dev, int bufnum,
281 BUGMSG(D_EXTRA, "incoming packet more than 16 segments; dropping. (splitflag=%d)\n", 280 BUGMSG(D_EXTRA, "incoming packet more than 16 segments; dropping. (splitflag=%d)\n",
282 soft->split_flag); 281 soft->split_flag);
283 lp->rfc1201.aborted_seq = soft->sequence; 282 lp->rfc1201.aborted_seq = soft->sequence;
284 lp->stats.rx_errors++; 283 dev->stats.rx_errors++;
285 lp->stats.rx_length_errors++; 284 dev->stats.rx_length_errors++;
286 return; 285 return;
287 } 286 }
288 in->skb = skb = alloc_skb(508 * in->numpackets + ARC_HDR_SIZE, 287 in->skb = skb = alloc_skb(508 * in->numpackets + ARC_HDR_SIZE,
@@ -290,7 +289,7 @@ static void rx(struct net_device *dev, int bufnum,
290 if (skb == NULL) { 289 if (skb == NULL) {
291 BUGMSG(D_NORMAL, "(split) memory squeeze, dropping packet.\n"); 290 BUGMSG(D_NORMAL, "(split) memory squeeze, dropping packet.\n");
292 lp->rfc1201.aborted_seq = soft->sequence; 291 lp->rfc1201.aborted_seq = soft->sequence;
293 lp->stats.rx_dropped++; 292 dev->stats.rx_dropped++;
294 return; 293 return;
295 } 294 }
296 skb->dev = dev; 295 skb->dev = dev;
@@ -314,8 +313,8 @@ static void rx(struct net_device *dev, int bufnum,
314 "first! (splitflag=%d, seq=%d, aborted=%d)\n", 313 "first! (splitflag=%d, seq=%d, aborted=%d)\n",
315 soft->split_flag, soft->sequence, 314 soft->split_flag, soft->sequence,
316 lp->rfc1201.aborted_seq); 315 lp->rfc1201.aborted_seq);
317 lp->stats.rx_errors++; 316 dev->stats.rx_errors++;
318 lp->stats.rx_missed_errors++; 317 dev->stats.rx_missed_errors++;
319 } 318 }
320 return; 319 return;
321 } 320 }
@@ -325,8 +324,8 @@ static void rx(struct net_device *dev, int bufnum,
325 if (packetnum <= in->lastpacket - 1) { 324 if (packetnum <= in->lastpacket - 1) {
326 BUGMSG(D_EXTRA, "duplicate splitpacket ignored! (splitflag=%d)\n", 325 BUGMSG(D_EXTRA, "duplicate splitpacket ignored! (splitflag=%d)\n",
327 soft->split_flag); 326 soft->split_flag);
328 lp->stats.rx_errors++; 327 dev->stats.rx_errors++;
329 lp->stats.rx_frame_errors++; 328 dev->stats.rx_frame_errors++;
330 return; 329 return;
331 } 330 }
332 /* "bad" duplicate, kill reassembly */ 331 /* "bad" duplicate, kill reassembly */
@@ -336,8 +335,8 @@ static void rx(struct net_device *dev, int bufnum,
336 lp->rfc1201.aborted_seq = soft->sequence; 335 lp->rfc1201.aborted_seq = soft->sequence;
337 dev_kfree_skb_irq(in->skb); 336 dev_kfree_skb_irq(in->skb);
338 in->skb = NULL; 337 in->skb = NULL;
339 lp->stats.rx_errors++; 338 dev->stats.rx_errors++;
340 lp->stats.rx_missed_errors++; 339 dev->stats.rx_missed_errors++;
341 in->lastpacket = in->numpackets = 0; 340 in->lastpacket = in->numpackets = 0;
342 return; 341 return;
343 } 342 }
@@ -404,8 +403,8 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
404 default: 403 default:
405 BUGMSG(D_NORMAL, "RFC1201: I don't understand protocol %d (%Xh)\n", 404 BUGMSG(D_NORMAL, "RFC1201: I don't understand protocol %d (%Xh)\n",
406 type, type); 405 type, type);
407 lp->stats.tx_errors++; 406 dev->stats.tx_errors++;
408 lp->stats.tx_aborted_errors++; 407 dev->stats.tx_aborted_errors++;
409 return 0; 408 return 0;
410 } 409 }
411 410