summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2015-05-05 13:06:02 -0400
committerMichael Grzeschik <m.grzeschik@pengutronix.de>2015-09-23 02:44:25 -0400
commitd6d7d3ed56e3bfe7fd34108dbe23f0610e3d8621 (patch)
tree2b10614b0ffb6a65523d9b35bf37e3412c446174
parent83df99b50f901cb7c72cf132a83f43bbaeb01362 (diff)
arcnet: Wrap some long lines
Just neatening. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
-rw-r--r--drivers/net/arcnet/arc-rawmode.c3
-rw-r--r--drivers/net/arcnet/arc-rimi.c11
-rw-r--r--drivers/net/arcnet/arcnet.c10
-rw-r--r--drivers/net/arcnet/capmode.c3
-rw-r--r--drivers/net/arcnet/com20020-pci.c3
-rw-r--r--drivers/net/arcnet/com20020.c14
-rw-r--r--drivers/net/arcnet/com90io.c31
-rw-r--r--drivers/net/arcnet/com90xx.c28
-rw-r--r--drivers/net/arcnet/rfc1051.c3
-rw-r--r--drivers/net/arcnet/rfc1201.c15
-rw-r--r--include/linux/arcdevice.h12
11 files changed, 81 insertions, 52 deletions
diff --git a/drivers/net/arcnet/arc-rawmode.c b/drivers/net/arcnet/arc-rawmode.c
index 40035ee8cb40..59b3083c19f9 100644
--- a/drivers/net/arcnet/arc-rawmode.c
+++ b/drivers/net/arcnet/arc-rawmode.c
@@ -165,7 +165,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
165 arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n", 165 arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n",
166 lp->next_tx, lp->cur_tx, bufnum); 166 lp->next_tx, lp->cur_tx, bufnum);
167 167
168 length -= ARC_HDR_SIZE; /* hard header is not included in packet length */ 168 /* hard header is not included in packet length */
169 length -= ARC_HDR_SIZE;
169 170
170 if (length > XMTU) { 171 if (length > XMTU) {
171 /* should never happen! other people already check for this. */ 172 /* should never happen! other people already check for this. */
diff --git a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c
index 7360214e3d3f..8fa5eb43f308 100644
--- a/drivers/net/arcnet/arc-rimi.c
+++ b/drivers/net/arcnet/arc-rimi.c
@@ -49,8 +49,8 @@ static void arcrimi_setmask(struct net_device *dev, int mask);
49static int arcrimi_reset(struct net_device *dev, int really_reset); 49static int arcrimi_reset(struct net_device *dev, int really_reset);
50static void arcrimi_copy_to_card(struct net_device *dev, int bufnum, int offset, 50static void arcrimi_copy_to_card(struct net_device *dev, int bufnum, int offset,
51 void *buf, int count); 51 void *buf, int count);
52static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offset, 52static void arcrimi_copy_from_card(struct net_device *dev, int bufnum,
53 void *buf, int count); 53 int offset, void *buf, int count);
54 54
55/* Handy defines for ARCnet specific stuff */ 55/* Handy defines for ARCnet specific stuff */
56 56
@@ -215,7 +215,8 @@ static int __init arcrimi_found(struct net_device *dev)
215 goto err_free_irq; 215 goto err_free_irq;
216 } 216 }
217 217
218 lp->mem_start = ioremap(dev->mem_start, dev->mem_end - dev->mem_start + 1); 218 lp->mem_start = ioremap(dev->mem_start,
219 dev->mem_end - dev->mem_start + 1);
219 if (!lp->mem_start) { 220 if (!lp->mem_start) {
220 arc_printk(D_NORMAL, dev, "Can't remap device memory!\n"); 221 arc_printk(D_NORMAL, dev, "Can't remap device memory!\n");
221 goto err_release_mem; 222 goto err_release_mem;
@@ -307,8 +308,8 @@ static void arcrimi_copy_to_card(struct net_device *dev, int bufnum, int offset,
307 TIME(dev, "memcpy_toio", count, memcpy_toio(memaddr, buf, count)); 308 TIME(dev, "memcpy_toio", count, memcpy_toio(memaddr, buf, count));
308} 309}
309 310
310static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offset, 311static void arcrimi_copy_from_card(struct net_device *dev, int bufnum,
311 void *buf, int count) 312 int offset, void *buf, int count)
312{ 313{
313 struct arcnet_local *lp = netdev_priv(dev); 314 struct arcnet_local *lp = netdev_priv(dev);
314 void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; 315 void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset;
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
index a9535ec9c236..00074e781353 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -759,7 +759,8 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
759 if ((status & lp->intmask & TXFREEflag) || lp->timed_out) { 759 if ((status & lp->intmask & TXFREEflag) || lp->timed_out) {
760 lp->intmask &= ~(TXFREEflag | EXCNAKflag); 760 lp->intmask &= ~(TXFREEflag | EXCNAKflag);
761 761
762 arc_printk(D_DURING, dev, "TX IRQ (stat=%Xh)\n", status); 762 arc_printk(D_DURING, dev, "TX IRQ (stat=%Xh)\n",
763 status);
763 764
764 if (lp->cur_tx != -1 && !lp->timed_out) { 765 if (lp->cur_tx != -1 && !lp->timed_out) {
765 if (!(status & TXACKflag)) { 766 if (!(status & TXACKflag)) {
@@ -804,7 +805,8 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
804 go_tx(dev); 805 go_tx(dev);
805 806
806 /* continue a split packet, if any */ 807 /* continue a split packet, if any */
807 if (lp->outgoing.proto && lp->outgoing.proto->continue_tx) { 808 if (lp->outgoing.proto &&
809 lp->outgoing.proto->continue_tx) {
808 int txbuf = get_arcbuf(dev); 810 int txbuf = get_arcbuf(dev);
809 811
810 if (txbuf != -1) { 812 if (txbuf != -1) {
@@ -874,7 +876,9 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
874 arc_printk(D_NORMAL, dev, "many reconfigurations detected: cabling problem?\n"); 876 arc_printk(D_NORMAL, dev, "many reconfigurations detected: cabling problem?\n");
875 } else if (!lp->network_down && 877 } else if (!lp->network_down &&
876 lp->last_recon - lp->first_recon > HZ * 60) { 878 lp->last_recon - lp->first_recon > HZ * 60) {
877 /* reset counters if we've gone for over a minute. */ 879 /* reset counters if we've gone for
880 * over a minute.
881 */
878 lp->first_recon = lp->last_recon; 882 lp->first_recon = lp->last_recon;
879 lp->num_recons = 1; 883 lp->num_recons = 1;
880 } 884 }
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c
index a898647ab05d..46a76dcc21aa 100644
--- a/drivers/net/arcnet/capmode.c
+++ b/drivers/net/arcnet/capmode.c
@@ -222,7 +222,8 @@ static int ack_tx(struct net_device *dev, int acked)
222 222
223free_outskb: 223free_outskb:
224 dev_kfree_skb_irq(lp->outgoing.skb); 224 dev_kfree_skb_irq(lp->outgoing.skb);
225 lp->outgoing.proto = NULL; /* We are always finished when in this protocol */ 225 lp->outgoing.proto = NULL;
226 /* We are always finished when in this protocol */
226 227
227 return 0; 228 return 0;
228} 229}
diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index fc6809b43f8f..a28887dfcc9e 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -64,7 +64,8 @@ MODULE_LICENSE("GPL");
64 64
65static void com20020pci_remove(struct pci_dev *pdev); 65static void com20020pci_remove(struct pci_dev *pdev);
66 66
67static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) 67static int com20020pci_probe(struct pci_dev *pdev,
68 const struct pci_device_id *id)
68{ 69{
69 struct com20020_pci_card_info *ci; 70 struct com20020_pci_card_info *ci;
70 struct net_device *dev; 71 struct net_device *dev;
diff --git a/drivers/net/arcnet/com20020.c b/drivers/net/arcnet/com20020.c
index bea386222149..00f910cf7b81 100644
--- a/drivers/net/arcnet/com20020.c
+++ b/drivers/net/arcnet/com20020.c
@@ -192,8 +192,9 @@ int com20020_found(struct net_device *dev, int shared)
192 lp->hw.copy_from_card = com20020_copy_from_card; 192 lp->hw.copy_from_card = com20020_copy_from_card;
193 lp->hw.close = com20020_close; 193 lp->hw.close = com20020_close;
194 194
195 /* FIXME: do this some other way! */
195 if (!dev->dev_addr[0]) 196 if (!dev->dev_addr[0])
196 dev->dev_addr[0] = inb(ioaddr + BUS_ALIGN * 8); /* FIXME: do this some other way! */ 197 dev->dev_addr[0] = inb(ioaddr + BUS_ALIGN * 8);
197 198
198 SET_SUBADR(SUB_SETUP1); 199 SET_SUBADR(SUB_SETUP1);
199 outb(lp->setup, _XREG); 200 outb(lp->setup, _XREG);
@@ -269,7 +270,8 @@ static int com20020_reset(struct net_device *dev, int really_reset)
269 if (really_reset) { 270 if (really_reset) {
270 /* reset the card */ 271 /* reset the card */
271 ARCRESET; 272 ARCRESET;
272 mdelay(RESETtime * 2); /* COM20020 seems to be slower sometimes */ 273 mdelay(RESETtime * 2);
274 /* COM20020 seems to be slower sometimes */
273 } 275 }
274 /* clear flags & end reset */ 276 /* clear flags & end reset */
275 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 277 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
@@ -338,15 +340,15 @@ static void com20020_set_mc_list(struct net_device *dev)
338 struct arcnet_local *lp = netdev_priv(dev); 340 struct arcnet_local *lp = netdev_priv(dev);
339 int ioaddr = dev->base_addr; 341 int ioaddr = dev->base_addr;
340 342
341 if ((dev->flags & IFF_PROMISC) && (dev->flags & IFF_UP)) { /* Enable promiscuous mode */ 343 if ((dev->flags & IFF_PROMISC) && (dev->flags & IFF_UP)) {
344 /* Enable promiscuous mode */
342 if (!(lp->setup & PROMISCset)) 345 if (!(lp->setup & PROMISCset))
343 arc_printk(D_NORMAL, dev, "Setting promiscuous flag...\n"); 346 arc_printk(D_NORMAL, dev, "Setting promiscuous flag...\n");
344 SET_SUBADR(SUB_SETUP1); 347 SET_SUBADR(SUB_SETUP1);
345 lp->setup |= PROMISCset; 348 lp->setup |= PROMISCset;
346 outb(lp->setup, _XREG); 349 outb(lp->setup, _XREG);
347 } else 350 } else {
348 /* Disable promiscuous mode, use normal mode */ 351 /* Disable promiscuous mode, use normal mode */
349 {
350 if ((lp->setup & PROMISCset)) 352 if ((lp->setup & PROMISCset))
351 arc_printk(D_NORMAL, dev, "Resetting promiscuous flag...\n"); 353 arc_printk(D_NORMAL, dev, "Resetting promiscuous flag...\n");
352 SET_SUBADR(SUB_SETUP1); 354 SET_SUBADR(SUB_SETUP1);
@@ -370,7 +372,7 @@ MODULE_LICENSE("GPL");
370static int __init com20020_module_init(void) 372static int __init com20020_module_init(void)
371{ 373{
372 if (BUGLVL(D_NORMAL)) 374 if (BUGLVL(D_NORMAL))
373 pr_info("%s\n", "COM20020 chipset support (by David Woodhouse et al.)\n"); 375 pr_info("%s\n", "COM20020 chipset support (by David Woodhouse et al.)");
374 return 0; 376 return 0;
375} 377}
376 378
diff --git a/drivers/net/arcnet/com90io.c b/drivers/net/arcnet/com90io.c
index 11bc589aa8d1..9e779a53035d 100644
--- a/drivers/net/arcnet/com90io.c
+++ b/drivers/net/arcnet/com90io.c
@@ -49,8 +49,8 @@ static void com90io_setmask(struct net_device *dev, int mask);
49static int com90io_reset(struct net_device *dev, int really_reset); 49static int com90io_reset(struct net_device *dev, int really_reset);
50static void com90io_copy_to_card(struct net_device *dev, int bufnum, int offset, 50static void com90io_copy_to_card(struct net_device *dev, int bufnum, int offset,
51 void *buf, int count); 51 void *buf, int count);
52static void com90io_copy_from_card(struct net_device *dev, int bufnum, int offset, 52static void com90io_copy_from_card(struct net_device *dev, int bufnum,
53 void *buf, int count); 53 int offset, void *buf, int count);
54 54
55/* Handy defines for ARCnet specific stuff */ 55/* Handy defines for ARCnet specific stuff */
56 56
@@ -96,7 +96,8 @@ static u_char get_buffer_byte(struct net_device *dev, unsigned offset)
96} 96}
97 97
98#ifdef ONE_AT_A_TIME_TX 98#ifdef ONE_AT_A_TIME_TX
99static void put_buffer_byte(struct net_device *dev, unsigned offset, u_char datum) 99static void put_buffer_byte(struct net_device *dev, unsigned offset,
100 u_char datum)
100{ 101{
101 int ioaddr = dev->base_addr; 102 int ioaddr = dev->base_addr;
102 103
@@ -108,7 +109,8 @@ static void put_buffer_byte(struct net_device *dev, unsigned offset, u_char datu
108 109
109#endif 110#endif
110 111
111static void get_whole_buffer(struct net_device *dev, unsigned offset, unsigned length, char *dest) 112static void get_whole_buffer(struct net_device *dev, unsigned offset,
113 unsigned length, char *dest)
112{ 114{
113 int ioaddr = dev->base_addr; 115 int ioaddr = dev->base_addr;
114 116
@@ -123,7 +125,8 @@ static void get_whole_buffer(struct net_device *dev, unsigned offset, unsigned l
123#endif 125#endif
124} 126}
125 127
126static void put_whole_buffer(struct net_device *dev, unsigned offset, unsigned length, char *dest) 128static void put_whole_buffer(struct net_device *dev, unsigned offset,
129 unsigned length, char *dest)
127{ 130{
128 int ioaddr = dev->base_addr; 131 int ioaddr = dev->base_addr;
129 132
@@ -237,12 +240,14 @@ static int __init com90io_found(struct net_device *dev)
237 int err; 240 int err;
238 241
239 /* Reserve the irq */ 242 /* Reserve the irq */
240 if (request_irq(dev->irq, arcnet_interrupt, 0, "arcnet (COM90xx-IO)", dev)) { 243 if (request_irq(dev->irq, arcnet_interrupt, 0,
244 "arcnet (COM90xx-IO)", dev)) {
241 arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", dev->irq); 245 arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", dev->irq);
242 return -ENODEV; 246 return -ENODEV;
243 } 247 }
244 /* Reserve the I/O region */ 248 /* Reserve the I/O region */
245 if (!request_region(dev->base_addr, ARCNET_TOTAL_SIZE, "arcnet (COM90xx-IO)")) { 249 if (!request_region(dev->base_addr, ARCNET_TOTAL_SIZE,
250 "arcnet (COM90xx-IO)")) {
246 free_irq(dev->irq, dev); 251 free_irq(dev->irq, dev);
247 return -EBUSY; 252 return -EBUSY;
248 } 253 }
@@ -338,15 +343,15 @@ static void com90io_setmask(struct net_device *dev, int mask)
338 AINTMASK(mask); 343 AINTMASK(mask);
339} 344}
340 345
341static void com90io_copy_to_card(struct net_device *dev, int bufnum, int offset, 346static void com90io_copy_to_card(struct net_device *dev, int bufnum,
342 void *buf, int count) 347 int offset, void *buf, int count)
343{ 348{
344 TIME(dev, "put_whole_buffer", count, 349 TIME(dev, "put_whole_buffer", count,
345 put_whole_buffer(dev, bufnum * 512 + offset, count, buf)); 350 put_whole_buffer(dev, bufnum * 512 + offset, count, buf));
346} 351}
347 352
348static void com90io_copy_from_card(struct net_device *dev, int bufnum, int offset, 353static void com90io_copy_from_card(struct net_device *dev, int bufnum,
349 void *buf, int count) 354 int offset, void *buf, int count)
350{ 355{
351 TIME(dev, "get_whole_buffer", count, 356 TIME(dev, "get_whole_buffer", count,
352 get_whole_buffer(dev, bufnum * 512 + offset, count, buf)); 357 get_whole_buffer(dev, bufnum * 512 + offset, count, buf));
@@ -418,7 +423,9 @@ static void __exit com90io_exit(void)
418 423
419 unregister_netdev(dev); 424 unregister_netdev(dev);
420 425
421 /* Set the thing back to MMAP mode, in case the old driver is loaded later */ 426 /* In case the old driver is loaded later,
427 * set the thing back to MMAP mode
428 */
422 outb((inb(_CONFIG) & ~IOMAPflag), _CONFIG); 429 outb((inb(_CONFIG) & ~IOMAPflag), _CONFIG);
423 430
424 free_irq(dev->irq, dev); 431 free_irq(dev->irq, dev);
diff --git a/drivers/net/arcnet/com90xx.c b/drivers/net/arcnet/com90xx.c
index 50c346b5d907..62100acfb6a7 100644
--- a/drivers/net/arcnet/com90xx.c
+++ b/drivers/net/arcnet/com90xx.c
@@ -60,8 +60,8 @@ static void com90xx_setmask(struct net_device *dev, int mask);
60static int com90xx_reset(struct net_device *dev, int really_reset); 60static int com90xx_reset(struct net_device *dev, int really_reset);
61static void com90xx_copy_to_card(struct net_device *dev, int bufnum, int offset, 61static void com90xx_copy_to_card(struct net_device *dev, int bufnum, int offset,
62 void *buf, int count); 62 void *buf, int count);
63static void com90xx_copy_from_card(struct net_device *dev, int bufnum, int offset, 63static void com90xx_copy_from_card(struct net_device *dev, int bufnum,
64 void *buf, int count); 64 int offset, void *buf, int count);
65 65
66/* Known ARCnet cards */ 66/* Known ARCnet cards */
67 67
@@ -165,7 +165,8 @@ static void __init com90xx_probe(void)
165 165
166 ioaddr = *port; 166 ioaddr = *port;
167 167
168 if (!request_region(*port, ARCNET_TOTAL_SIZE, "arcnet (90xx)")) { 168 if (!request_region(*port, ARCNET_TOTAL_SIZE,
169 "arcnet (90xx)")) {
169 arc_cont(D_INIT_REASONS, "(request_region)\n"); 170 arc_cont(D_INIT_REASONS, "(request_region)\n");
170 arc_cont(D_INIT_REASONS, "S1: "); 171 arc_cont(D_INIT_REASONS, "S1: ");
171 if (BUGLVL(D_INIT_REASONS)) 172 if (BUGLVL(D_INIT_REASONS))
@@ -467,7 +468,8 @@ static int check_mirror(unsigned long addr, size_t size)
467/* Set up the struct net_device associated with this card. Called after 468/* Set up the struct net_device associated with this card. Called after
468 * probing succeeds. 469 * probing succeeds.
469 */ 470 */
470static int __init com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem *p) 471static int __init com90xx_found(int ioaddr, int airq, u_long shmem,
472 void __iomem *p)
471{ 473{
472 struct net_device *dev = NULL; 474 struct net_device *dev = NULL;
473 struct arcnet_local *lp; 475 struct arcnet_local *lp;
@@ -511,7 +513,9 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem
511 iounmap(p); 513 iounmap(p);
512 release_mem_region(shmem, MIRROR_SIZE); 514 release_mem_region(shmem, MIRROR_SIZE);
513 515
514 if (!request_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1, "arcnet (90xx)")) 516 if (!request_mem_region(dev->mem_start,
517 dev->mem_end - dev->mem_start + 1,
518 "arcnet (90xx)"))
515 goto err_free_dev; 519 goto err_free_dev;
516 520
517 /* reserve the irq */ 521 /* reserve the irq */
@@ -530,7 +534,8 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem
530 lp->hw.owner = THIS_MODULE; 534 lp->hw.owner = THIS_MODULE;
531 lp->hw.copy_to_card = com90xx_copy_to_card; 535 lp->hw.copy_to_card = com90xx_copy_to_card;
532 lp->hw.copy_from_card = com90xx_copy_from_card; 536 lp->hw.copy_from_card = com90xx_copy_from_card;
533 lp->mem_start = ioremap(dev->mem_start, dev->mem_end - dev->mem_start + 1); 537 lp->mem_start = ioremap(dev->mem_start,
538 dev->mem_end - dev->mem_start + 1);
534 if (!lp->mem_start) { 539 if (!lp->mem_start) {
535 arc_printk(D_NORMAL, dev, "Can't remap device memory!\n"); 540 arc_printk(D_NORMAL, dev, "Can't remap device memory!\n");
536 goto err_free_irq; 541 goto err_free_irq;
@@ -627,8 +632,8 @@ static int com90xx_reset(struct net_device *dev, int really_reset)
627 return 0; 632 return 0;
628} 633}
629 634
630static void com90xx_copy_to_card(struct net_device *dev, int bufnum, int offset, 635static void com90xx_copy_to_card(struct net_device *dev, int bufnum,
631 void *buf, int count) 636 int offset, void *buf, int count)
632{ 637{
633 struct arcnet_local *lp = netdev_priv(dev); 638 struct arcnet_local *lp = netdev_priv(dev);
634 void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset; 639 void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset;
@@ -636,8 +641,8 @@ static void com90xx_copy_to_card(struct net_device *dev, int bufnum, int offset,
636 TIME(dev, "memcpy_toio", count, memcpy_toio(memaddr, buf, count)); 641 TIME(dev, "memcpy_toio", count, memcpy_toio(memaddr, buf, count));
637} 642}
638 643
639static void com90xx_copy_from_card(struct net_device *dev, int bufnum, int offset, 644static void com90xx_copy_from_card(struct net_device *dev, int bufnum,
640 void *buf, int count) 645 int offset, void *buf, int count)
641{ 646{
642 struct arcnet_local *lp = netdev_priv(dev); 647 struct arcnet_local *lp = netdev_priv(dev);
643 void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset; 648 void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset;
@@ -671,7 +676,8 @@ static void __exit com90xx_exit(void)
671 free_irq(dev->irq, dev); 676 free_irq(dev->irq, dev);
672 iounmap(lp->mem_start); 677 iounmap(lp->mem_start);
673 release_region(dev->base_addr, ARCNET_TOTAL_SIZE); 678 release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
674 release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1); 679 release_mem_region(dev->mem_start,
680 dev->mem_end - dev->mem_start + 1);
675 free_netdev(dev); 681 free_netdev(dev);
676 } 682 }
677} 683}
diff --git a/drivers/net/arcnet/rfc1051.c b/drivers/net/arcnet/rfc1051.c
index b76e458b19e0..691bee5bcd42 100644
--- a/drivers/net/arcnet/rfc1051.c
+++ b/drivers/net/arcnet/rfc1051.c
@@ -213,7 +213,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
213 arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n", 213 arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n",
214 lp->next_tx, lp->cur_tx, bufnum); 214 lp->next_tx, lp->cur_tx, bufnum);
215 215
216 length -= ARC_HDR_SIZE; /* hard header is not included in packet length */ 216 /* hard header is not included in packet length */
217 length -= ARC_HDR_SIZE;
217 218
218 if (length > XMTU) { 219 if (length > XMTU) {
219 /* should never happen! other people already check for this. */ 220 /* should never happen! other people already check for this. */
diff --git a/drivers/net/arcnet/rfc1201.c b/drivers/net/arcnet/rfc1201.c
index 1d777c1e8383..aaa1966593aa 100644
--- a/drivers/net/arcnet/rfc1201.c
+++ b/drivers/net/arcnet/rfc1201.c
@@ -188,11 +188,14 @@ static void rx(struct net_device *dev, int bufnum,
188 pkt = (struct archdr *)skb->data; 188 pkt = (struct archdr *)skb->data;
189 soft = &pkt->soft.rfc1201; 189 soft = &pkt->soft.rfc1201;
190 190
191 /* up to sizeof(pkt->soft) has already been copied from the card */ 191 /* up to sizeof(pkt->soft) has already
192 * been copied from the card
193 */
192 memcpy(pkt, pkthdr, sizeof(struct archdr)); 194 memcpy(pkt, pkthdr, sizeof(struct archdr));
193 if (length > sizeof(pkt->soft)) 195 if (length > sizeof(pkt->soft))
194 lp->hw.copy_from_card(dev, bufnum, ofs + sizeof(pkt->soft), 196 lp->hw.copy_from_card(dev, bufnum,
195 pkt->soft.raw + sizeof(pkt->soft), 197 ofs + sizeof(pkt->soft),
198 pkt->soft.raw + sizeof(pkt->soft),
196 length - sizeof(pkt->soft)); 199 length - sizeof(pkt->soft));
197 200
198 /* ARP packets have problems when sent from some DOS systems: 201 /* ARP packets have problems when sent from some DOS systems:
@@ -318,7 +321,8 @@ static void rx(struct net_device *dev, int bufnum,
318 return; 321 return;
319 } 322 }
320 in->lastpacket++; 323 in->lastpacket++;
321 if (packetnum != in->lastpacket) { /* not the right flag! */ 324 /* if not the right flag */
325 if (packetnum != in->lastpacket) {
322 /* harmless duplicate? ignore. */ 326 /* harmless duplicate? ignore. */
323 if (packetnum <= in->lastpacket - 1) { 327 if (packetnum <= in->lastpacket - 1) {
324 arc_printk(D_EXTRA, dev, "duplicate splitpacket ignored! (splitflag=%d)\n", 328 arc_printk(D_EXTRA, dev, "duplicate splitpacket ignored! (splitflag=%d)\n",
@@ -477,7 +481,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
477 arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n", 481 arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n",
478 lp->next_tx, lp->cur_tx, bufnum); 482 lp->next_tx, lp->cur_tx, bufnum);
479 483
480 length -= ARC_HDR_SIZE; /* hard header is not included in packet length */ 484 /* hard header is not included in packet length */
485 length -= ARC_HDR_SIZE;
481 pkt->soft.rfc1201.split_flag = 0; 486 pkt->soft.rfc1201.split_flag = 0;
482 487
483 /* need to do a split packet? */ 488 /* need to do a split packet? */
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h
index 1d8e36e13616..9ca135d0f114 100644
--- a/include/linux/arcdevice.h
+++ b/include/linux/arcdevice.h
@@ -203,8 +203,8 @@ struct ArcProto {
203 unsigned short ethproto, uint8_t daddr); 203 unsigned short ethproto, uint8_t daddr);
204 204
205 /* these functions return '1' if the skb can now be freed */ 205 /* these functions return '1' if the skb can now be freed */
206 int (*prepare_tx)(struct net_device *dev, struct archdr *pkt, int length, 206 int (*prepare_tx)(struct net_device *dev, struct archdr *pkt,
207 int bufnum); 207 int length, int bufnum);
208 int (*continue_tx)(struct net_device *dev, int bufnum); 208 int (*continue_tx)(struct net_device *dev, int bufnum);
209 int (*ack_tx)(struct net_device *dev, int acked); 209 int (*ack_tx)(struct net_device *dev, int acked);
210}; 210};
@@ -309,10 +309,10 @@ struct arcnet_local {
309 void (*open)(struct net_device *dev); 309 void (*open)(struct net_device *dev);
310 void (*close)(struct net_device *dev); 310 void (*close)(struct net_device *dev);
311 311
312 void (*copy_to_card)(struct net_device *dev, int bufnum, int offset, 312 void (*copy_to_card)(struct net_device *dev, int bufnum,
313 void *buf, int count); 313 int offset, void *buf, int count);
314 void (*copy_from_card)(struct net_device *dev, int bufnum, int offset, 314 void (*copy_from_card)(struct net_device *dev, int bufnum,
315 void *buf, int count); 315 int offset, void *buf, int count);
316 } hw; 316 } hw;
317 317
318 void __iomem *mem_start; /* pointer to ioremap'ed MMIO */ 318 void __iomem *mem_start; /* pointer to ioremap'ed MMIO */