diff options
author | Vitaly Bordug <vitb@kernel.crashing.org> | 2007-09-18 12:05:35 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:51:55 -0400 |
commit | 9b8ee8e7d6b7f2270b19b3425a393d918fe497d3 (patch) | |
tree | 84c6f1bba3bb927385ab1b55b2f0caaf076bad4c /drivers/net/fs_enet | |
parent | aa90f5032129b43569896c1c6c15a706c02c6abf (diff) |
FS_ENET: Add polling support
Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/fs_enet')
-rw-r--r-- | drivers/net/fs_enet/fs_enet-main.c | 71 | ||||
-rw-r--r-- | drivers/net/fs_enet/mac-fcc.c | 12 | ||||
-rw-r--r-- | drivers/net/fs_enet/mac-fec.c | 30 | ||||
-rw-r--r-- | drivers/net/fs_enet/mac-scc.c | 20 | ||||
-rw-r--r-- | drivers/net/fs_enet/mii-bitbang.c | 10 |
5 files changed, 80 insertions, 63 deletions
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index 83c9bf27ecfd..dcbe83c773ee 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * Combined Ethernet driver for Motorola MPC8xx and MPC82xx. | 2 | * Combined Ethernet driver for Motorola MPC8xx and MPC82xx. |
3 | * | 3 | * |
4 | * Copyright (c) 2003 Intracom S.A. | 4 | * Copyright (c) 2003 Intracom S.A. |
5 | * by Pantelis Antoniou <panto@intracom.gr> | 5 | * by Pantelis Antoniou <panto@intracom.gr> |
6 | * | 6 | * |
7 | * 2005 (c) MontaVista Software, Inc. | 7 | * 2005 (c) MontaVista Software, Inc. |
8 | * Vitaly Bordug <vbordug@ru.mvista.com> | 8 | * Vitaly Bordug <vbordug@ru.mvista.com> |
9 | * | 9 | * |
10 | * Heavily based on original FEC driver by Dan Malek <dan@embeddededge.com> | 10 | * Heavily based on original FEC driver by Dan Malek <dan@embeddededge.com> |
11 | * and modifications by Joakim Tjernlund <joakim.tjernlund@lumentis.se> | 11 | * and modifications by Joakim Tjernlund <joakim.tjernlund@lumentis.se> |
12 | * | 12 | * |
13 | * This file is licensed under the terms of the GNU General Public License | 13 | * This file is licensed under the terms of the GNU General Public License |
14 | * version 2. This program is licensed "as is" without any warranty of any | 14 | * version 2. This program is licensed "as is" without any warranty of any |
15 | * kind, whether express or implied. | 15 | * kind, whether express or implied. |
16 | */ | 16 | */ |
17 | 17 | ||
@@ -59,6 +59,9 @@ module_param(fs_enet_debug, int, 0); | |||
59 | MODULE_PARM_DESC(fs_enet_debug, | 59 | MODULE_PARM_DESC(fs_enet_debug, |
60 | "Freescale bitmapped debugging message enable value"); | 60 | "Freescale bitmapped debugging message enable value"); |
61 | 61 | ||
62 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
63 | static void fs_enet_netpoll(struct net_device *dev); | ||
64 | #endif | ||
62 | 65 | ||
63 | static void fs_set_multicast_list(struct net_device *dev) | 66 | static void fs_set_multicast_list(struct net_device *dev) |
64 | { | 67 | { |
@@ -104,7 +107,7 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget) | |||
104 | dev->name); | 107 | dev->name); |
105 | 108 | ||
106 | /* | 109 | /* |
107 | * Check for errors. | 110 | * Check for errors. |
108 | */ | 111 | */ |
109 | if (sc & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_CL | | 112 | if (sc & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_CL | |
110 | BD_ENET_RX_NO | BD_ENET_RX_CR | BD_ENET_RX_OV)) { | 113 | BD_ENET_RX_NO | BD_ENET_RX_CR | BD_ENET_RX_OV)) { |
@@ -181,7 +184,7 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget) | |||
181 | CBDW_SC(bdp, (sc & ~BD_ENET_RX_STATS) | BD_ENET_RX_EMPTY); | 184 | CBDW_SC(bdp, (sc & ~BD_ENET_RX_STATS) | BD_ENET_RX_EMPTY); |
182 | 185 | ||
183 | /* | 186 | /* |
184 | * Update BD pointer to next entry. | 187 | * Update BD pointer to next entry. |
185 | */ | 188 | */ |
186 | if ((sc & BD_ENET_RX_WRAP) == 0) | 189 | if ((sc & BD_ENET_RX_WRAP) == 0) |
187 | bdp++; | 190 | bdp++; |
@@ -234,7 +237,7 @@ static int fs_enet_rx_non_napi(struct net_device *dev) | |||
234 | dev->name); | 237 | dev->name); |
235 | 238 | ||
236 | /* | 239 | /* |
237 | * Check for errors. | 240 | * Check for errors. |
238 | */ | 241 | */ |
239 | if (sc & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_CL | | 242 | if (sc & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_CL | |
240 | BD_ENET_RX_NO | BD_ENET_RX_CR | BD_ENET_RX_OV)) { | 243 | BD_ENET_RX_NO | BD_ENET_RX_CR | BD_ENET_RX_OV)) { |
@@ -312,7 +315,7 @@ static int fs_enet_rx_non_napi(struct net_device *dev) | |||
312 | CBDW_SC(bdp, (sc & ~BD_ENET_RX_STATS) | BD_ENET_RX_EMPTY); | 315 | CBDW_SC(bdp, (sc & ~BD_ENET_RX_STATS) | BD_ENET_RX_EMPTY); |
313 | 316 | ||
314 | /* | 317 | /* |
315 | * Update BD pointer to next entry. | 318 | * Update BD pointer to next entry. |
316 | */ | 319 | */ |
317 | if ((sc & BD_ENET_RX_WRAP) == 0) | 320 | if ((sc & BD_ENET_RX_WRAP) == 0) |
318 | bdp++; | 321 | bdp++; |
@@ -349,7 +352,7 @@ static void fs_enet_tx(struct net_device *dev) | |||
349 | skb = fep->tx_skbuff[dirtyidx]; | 352 | skb = fep->tx_skbuff[dirtyidx]; |
350 | 353 | ||
351 | /* | 354 | /* |
352 | * Check for errors. | 355 | * Check for errors. |
353 | */ | 356 | */ |
354 | if (sc & (BD_ENET_TX_HB | BD_ENET_TX_LC | | 357 | if (sc & (BD_ENET_TX_HB | BD_ENET_TX_LC | |
355 | BD_ENET_TX_RL | BD_ENET_TX_UN | BD_ENET_TX_CSL)) { | 358 | BD_ENET_TX_RL | BD_ENET_TX_UN | BD_ENET_TX_CSL)) { |
@@ -389,13 +392,13 @@ static void fs_enet_tx(struct net_device *dev) | |||
389 | skb->len, DMA_TO_DEVICE); | 392 | skb->len, DMA_TO_DEVICE); |
390 | 393 | ||
391 | /* | 394 | /* |
392 | * Free the sk buffer associated with this last transmit. | 395 | * Free the sk buffer associated with this last transmit. |
393 | */ | 396 | */ |
394 | dev_kfree_skb_irq(skb); | 397 | dev_kfree_skb_irq(skb); |
395 | fep->tx_skbuff[dirtyidx] = NULL; | 398 | fep->tx_skbuff[dirtyidx] = NULL; |
396 | 399 | ||
397 | /* | 400 | /* |
398 | * Update pointer to next buffer descriptor to be transmitted. | 401 | * Update pointer to next buffer descriptor to be transmitted. |
399 | */ | 402 | */ |
400 | if ((sc & BD_ENET_TX_WRAP) == 0) | 403 | if ((sc & BD_ENET_TX_WRAP) == 0) |
401 | bdp++; | 404 | bdp++; |
@@ -491,7 +494,7 @@ void fs_init_bds(struct net_device *dev) | |||
491 | fep->cur_rx = fep->rx_bd_base; | 494 | fep->cur_rx = fep->rx_bd_base; |
492 | 495 | ||
493 | /* | 496 | /* |
494 | * Initialize the receive buffer descriptors. | 497 | * Initialize the receive buffer descriptors. |
495 | */ | 498 | */ |
496 | for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) { | 499 | for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) { |
497 | skb = dev_alloc_skb(ENET_RX_FRSIZE); | 500 | skb = dev_alloc_skb(ENET_RX_FRSIZE); |
@@ -511,7 +514,7 @@ void fs_init_bds(struct net_device *dev) | |||
511 | ((i < fep->rx_ring - 1) ? 0 : BD_SC_WRAP)); | 514 | ((i < fep->rx_ring - 1) ? 0 : BD_SC_WRAP)); |
512 | } | 515 | } |
513 | /* | 516 | /* |
514 | * if we failed, fillup remainder | 517 | * if we failed, fillup remainder |
515 | */ | 518 | */ |
516 | for (; i < fep->rx_ring; i++, bdp++) { | 519 | for (; i < fep->rx_ring; i++, bdp++) { |
517 | fep->rx_skbuff[i] = NULL; | 520 | fep->rx_skbuff[i] = NULL; |
@@ -519,7 +522,7 @@ void fs_init_bds(struct net_device *dev) | |||
519 | } | 522 | } |
520 | 523 | ||
521 | /* | 524 | /* |
522 | * ...and the same for transmit. | 525 | * ...and the same for transmit. |
523 | */ | 526 | */ |
524 | for (i = 0, bdp = fep->tx_bd_base; i < fep->tx_ring; i++, bdp++) { | 527 | for (i = 0, bdp = fep->tx_bd_base; i < fep->tx_ring; i++, bdp++) { |
525 | fep->tx_skbuff[i] = NULL; | 528 | fep->tx_skbuff[i] = NULL; |
@@ -537,7 +540,7 @@ void fs_cleanup_bds(struct net_device *dev) | |||
537 | int i; | 540 | int i; |
538 | 541 | ||
539 | /* | 542 | /* |
540 | * Reset SKB transmit buffers. | 543 | * Reset SKB transmit buffers. |
541 | */ | 544 | */ |
542 | for (i = 0, bdp = fep->tx_bd_base; i < fep->tx_ring; i++, bdp++) { | 545 | for (i = 0, bdp = fep->tx_bd_base; i < fep->tx_ring; i++, bdp++) { |
543 | if ((skb = fep->tx_skbuff[i]) == NULL) | 546 | if ((skb = fep->tx_skbuff[i]) == NULL) |
@@ -552,7 +555,7 @@ void fs_cleanup_bds(struct net_device *dev) | |||
552 | } | 555 | } |
553 | 556 | ||
554 | /* | 557 | /* |
555 | * Reset SKB receive buffers | 558 | * Reset SKB receive buffers |
556 | */ | 559 | */ |
557 | for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) { | 560 | for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) { |
558 | if ((skb = fep->rx_skbuff[i]) == NULL) | 561 | if ((skb = fep->rx_skbuff[i]) == NULL) |
@@ -582,7 +585,7 @@ static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
582 | spin_lock_irqsave(&fep->tx_lock, flags); | 585 | spin_lock_irqsave(&fep->tx_lock, flags); |
583 | 586 | ||
584 | /* | 587 | /* |
585 | * Fill in a Tx ring entry | 588 | * Fill in a Tx ring entry |
586 | */ | 589 | */ |
587 | bdp = fep->cur_tx; | 590 | bdp = fep->cur_tx; |
588 | 591 | ||
@@ -601,19 +604,19 @@ static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
601 | 604 | ||
602 | curidx = bdp - fep->tx_bd_base; | 605 | curidx = bdp - fep->tx_bd_base; |
603 | /* | 606 | /* |
604 | * Clear all of the status flags. | 607 | * Clear all of the status flags. |
605 | */ | 608 | */ |
606 | CBDC_SC(bdp, BD_ENET_TX_STATS); | 609 | CBDC_SC(bdp, BD_ENET_TX_STATS); |
607 | 610 | ||
608 | /* | 611 | /* |
609 | * Save skb pointer. | 612 | * Save skb pointer. |
610 | */ | 613 | */ |
611 | fep->tx_skbuff[curidx] = skb; | 614 | fep->tx_skbuff[curidx] = skb; |
612 | 615 | ||
613 | fep->stats.tx_bytes += skb->len; | 616 | fep->stats.tx_bytes += skb->len; |
614 | 617 | ||
615 | /* | 618 | /* |
616 | * Push the data cache so the CPM does not get stale memory data. | 619 | * Push the data cache so the CPM does not get stale memory data. |
617 | */ | 620 | */ |
618 | CBDW_BUFADDR(bdp, dma_map_single(fep->dev, | 621 | CBDW_BUFADDR(bdp, dma_map_single(fep->dev, |
619 | skb->data, skb->len, DMA_TO_DEVICE)); | 622 | skb->data, skb->len, DMA_TO_DEVICE)); |
@@ -622,7 +625,7 @@ static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
622 | dev->trans_start = jiffies; | 625 | dev->trans_start = jiffies; |
623 | 626 | ||
624 | /* | 627 | /* |
625 | * If this was the last BD in the ring, start at the beginning again. | 628 | * If this was the last BD in the ring, start at the beginning again. |
626 | */ | 629 | */ |
627 | if ((CBDR_SC(bdp) & BD_ENET_TX_WRAP) == 0) | 630 | if ((CBDR_SC(bdp) & BD_ENET_TX_WRAP) == 0) |
628 | fep->cur_tx++; | 631 | fep->cur_tx++; |
@@ -1003,13 +1006,13 @@ static struct net_device *fs_init_instance(struct device *dev, | |||
1003 | spin_lock_init(&fep->tx_lock); | 1006 | spin_lock_init(&fep->tx_lock); |
1004 | 1007 | ||
1005 | /* | 1008 | /* |
1006 | * Set the Ethernet address. | 1009 | * Set the Ethernet address. |
1007 | */ | 1010 | */ |
1008 | for (i = 0; i < 6; i++) | 1011 | for (i = 0; i < 6; i++) |
1009 | ndev->dev_addr[i] = fpi->macaddr[i]; | 1012 | ndev->dev_addr[i] = fpi->macaddr[i]; |
1010 | 1013 | ||
1011 | r = (*fep->ops->allocate_bd)(ndev); | 1014 | r = (*fep->ops->allocate_bd)(ndev); |
1012 | 1015 | ||
1013 | if (fep->ring_base == NULL) { | 1016 | if (fep->ring_base == NULL) { |
1014 | printk(KERN_ERR DRV_MODULE_NAME | 1017 | printk(KERN_ERR DRV_MODULE_NAME |
1015 | ": %s buffer descriptor alloc failed (%d).\n", ndev->name, r); | 1018 | ": %s buffer descriptor alloc failed (%d).\n", ndev->name, r); |
@@ -1028,7 +1031,7 @@ static struct net_device *fs_init_instance(struct device *dev, | |||
1028 | fep->rx_ring = fpi->rx_ring; | 1031 | fep->rx_ring = fpi->rx_ring; |
1029 | 1032 | ||
1030 | /* | 1033 | /* |
1031 | * The FEC Ethernet specific entries in the device structure. | 1034 | * The FEC Ethernet specific entries in the device structure. |
1032 | */ | 1035 | */ |
1033 | ndev->open = fs_enet_open; | 1036 | ndev->open = fs_enet_open; |
1034 | ndev->hard_start_xmit = fs_enet_start_xmit; | 1037 | ndev->hard_start_xmit = fs_enet_start_xmit; |
@@ -1037,6 +1040,11 @@ static struct net_device *fs_init_instance(struct device *dev, | |||
1037 | ndev->stop = fs_enet_close; | 1040 | ndev->stop = fs_enet_close; |
1038 | ndev->get_stats = fs_enet_get_stats; | 1041 | ndev->get_stats = fs_enet_get_stats; |
1039 | ndev->set_multicast_list = fs_set_multicast_list; | 1042 | ndev->set_multicast_list = fs_set_multicast_list; |
1043 | |||
1044 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1045 | ndev->poll_controller = fs_enet_netpoll; | ||
1046 | #endif | ||
1047 | |||
1040 | netif_napi_add(ndev, &fep->napi, | 1048 | netif_napi_add(ndev, &fep->napi, |
1041 | fs_enet_rx_napi, fpi->napi_weight); | 1049 | fs_enet_rx_napi, fpi->napi_weight); |
1042 | 1050 | ||
@@ -1251,7 +1259,7 @@ static int __init fs_init(void) | |||
1251 | err: | 1259 | err: |
1252 | cleanup_immap(); | 1260 | cleanup_immap(); |
1253 | return r; | 1261 | return r; |
1254 | 1262 | ||
1255 | } | 1263 | } |
1256 | 1264 | ||
1257 | static void __exit fs_cleanup(void) | 1265 | static void __exit fs_cleanup(void) |
@@ -1262,6 +1270,15 @@ static void __exit fs_cleanup(void) | |||
1262 | cleanup_immap(); | 1270 | cleanup_immap(); |
1263 | } | 1271 | } |
1264 | 1272 | ||
1273 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1274 | static void fs_enet_netpoll(struct net_device *dev) | ||
1275 | { | ||
1276 | disable_irq(dev->irq); | ||
1277 | fs_enet_interrupt(dev->irq, dev, NULL); | ||
1278 | enable_irq(dev->irq); | ||
1279 | } | ||
1280 | #endif | ||
1281 | |||
1265 | /**************************************************************************************/ | 1282 | /**************************************************************************************/ |
1266 | 1283 | ||
1267 | module_init(fs_init); | 1284 | module_init(fs_init); |
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c index 5603121132cd..64071514d7d5 100644 --- a/drivers/net/fs_enet/mac-fcc.c +++ b/drivers/net/fs_enet/mac-fcc.c | |||
@@ -1,14 +1,14 @@ | |||
1 | /* | 1 | /* |
2 | * FCC driver for Motorola MPC82xx (PQ2). | 2 | * FCC driver for Motorola MPC82xx (PQ2). |
3 | * | 3 | * |
4 | * Copyright (c) 2003 Intracom S.A. | 4 | * Copyright (c) 2003 Intracom S.A. |
5 | * by Pantelis Antoniou <panto@intracom.gr> | 5 | * by Pantelis Antoniou <panto@intracom.gr> |
6 | * | 6 | * |
7 | * 2005 (c) MontaVista Software, Inc. | 7 | * 2005 (c) MontaVista Software, Inc. |
8 | * Vitaly Bordug <vbordug@ru.mvista.com> | 8 | * Vitaly Bordug <vbordug@ru.mvista.com> |
9 | * | 9 | * |
10 | * This file is licensed under the terms of the GNU General Public License | 10 | * This file is licensed under the terms of the GNU General Public License |
11 | * version 2. This program is licensed "as is" without any warranty of any | 11 | * version 2. This program is licensed "as is" without any warranty of any |
12 | * kind, whether express or implied. | 12 | * kind, whether express or implied. |
13 | */ | 13 | */ |
14 | 14 | ||
@@ -92,7 +92,7 @@ static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 mcn, u32 op) | |||
92 | u32 v; | 92 | u32 v; |
93 | int i; | 93 | int i; |
94 | 94 | ||
95 | /* Currently I don't know what feature call will look like. But | 95 | /* Currently I don't know what feature call will look like. But |
96 | I guess there'd be something like do_cpm_cmd() which will require page & sblock */ | 96 | I guess there'd be something like do_cpm_cmd() which will require page & sblock */ |
97 | v = mk_cr_cmd(fpi->cp_page, fpi->cp_block, mcn, op); | 97 | v = mk_cr_cmd(fpi->cp_page, fpi->cp_block, mcn, op); |
98 | W32(cpmp, cp_cpcr, v | CPM_CR_FLG); | 98 | W32(cpmp, cp_cpcr, v | CPM_CR_FLG); |
@@ -548,7 +548,7 @@ int get_regs_len(struct net_device *dev) | |||
548 | * down. We now issue a restart transmit. Since the | 548 | * down. We now issue a restart transmit. Since the |
549 | * errors close the BD and update the pointers, the restart | 549 | * errors close the BD and update the pointers, the restart |
550 | * _should_ pick up without having to reset any of our | 550 | * _should_ pick up without having to reset any of our |
551 | * pointers either. Also, To workaround 8260 device erratum | 551 | * pointers either. Also, To workaround 8260 device erratum |
552 | * CPM37, we must disable and then re-enable the transmitter | 552 | * CPM37, we must disable and then re-enable the transmitter |
553 | * following a Late Collision, Underrun, or Retry Limit error. | 553 | * following a Late Collision, Underrun, or Retry Limit error. |
554 | */ | 554 | */ |
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c index 04b4f80a1cde..cbdc17b743db 100644 --- a/drivers/net/fs_enet/mac-fec.c +++ b/drivers/net/fs_enet/mac-fec.c | |||
@@ -1,14 +1,14 @@ | |||
1 | /* | 1 | /* |
2 | * Freescale Ethernet controllers | 2 | * Freescale Ethernet controllers |
3 | * | 3 | * |
4 | * Copyright (c) 2005 Intracom S.A. | 4 | * Copyright (c) 2005 Intracom S.A. |
5 | * by Pantelis Antoniou <panto@intracom.gr> | 5 | * by Pantelis Antoniou <panto@intracom.gr> |
6 | * | 6 | * |
7 | * 2005 (c) MontaVista Software, Inc. | 7 | * 2005 (c) MontaVista Software, Inc. |
8 | * Vitaly Bordug <vbordug@ru.mvista.com> | 8 | * Vitaly Bordug <vbordug@ru.mvista.com> |
9 | * | 9 | * |
10 | * This file is licensed under the terms of the GNU General Public License | 10 | * This file is licensed under the terms of the GNU General Public License |
11 | * version 2. This program is licensed "as is" without any warranty of any | 11 | * version 2. This program is licensed "as is" without any warranty of any |
12 | * kind, whether express or implied. | 12 | * kind, whether express or implied. |
13 | */ | 13 | */ |
14 | 14 | ||
@@ -95,9 +95,9 @@ static int whack_reset(fec_t * fecp) | |||
95 | 95 | ||
96 | static int do_pd_setup(struct fs_enet_private *fep) | 96 | static int do_pd_setup(struct fs_enet_private *fep) |
97 | { | 97 | { |
98 | struct platform_device *pdev = to_platform_device(fep->dev); | 98 | struct platform_device *pdev = to_platform_device(fep->dev); |
99 | struct resource *r; | 99 | struct resource *r; |
100 | 100 | ||
101 | /* Fill out IRQ field */ | 101 | /* Fill out IRQ field */ |
102 | fep->interrupt = platform_get_irq_byname(pdev,"interrupt"); | 102 | fep->interrupt = platform_get_irq_byname(pdev,"interrupt"); |
103 | if (fep->interrupt < 0) | 103 | if (fep->interrupt < 0) |
@@ -110,7 +110,7 @@ static int do_pd_setup(struct fs_enet_private *fep) | |||
110 | return -EINVAL; | 110 | return -EINVAL; |
111 | 111 | ||
112 | return 0; | 112 | return 0; |
113 | 113 | ||
114 | } | 114 | } |
115 | 115 | ||
116 | #define FEC_NAPI_RX_EVENT_MSK (FEC_ENET_RXF | FEC_ENET_RXB) | 116 | #define FEC_NAPI_RX_EVENT_MSK (FEC_ENET_RXF | FEC_ENET_RXB) |
@@ -141,7 +141,7 @@ static int allocate_bd(struct net_device *dev) | |||
141 | { | 141 | { |
142 | struct fs_enet_private *fep = netdev_priv(dev); | 142 | struct fs_enet_private *fep = netdev_priv(dev); |
143 | const struct fs_platform_info *fpi = fep->fpi; | 143 | const struct fs_platform_info *fpi = fep->fpi; |
144 | 144 | ||
145 | fep->ring_base = dma_alloc_coherent(fep->dev, | 145 | fep->ring_base = dma_alloc_coherent(fep->dev, |
146 | (fpi->tx_ring + fpi->rx_ring) * | 146 | (fpi->tx_ring + fpi->rx_ring) * |
147 | sizeof(cbd_t), &fep->ring_mem_addr, | 147 | sizeof(cbd_t), &fep->ring_mem_addr, |
@@ -280,13 +280,13 @@ static void restart(struct net_device *dev) | |||
280 | FW(fecp, addr_high, addrlo); | 280 | FW(fecp, addr_high, addrlo); |
281 | 281 | ||
282 | /* | 282 | /* |
283 | * Reset all multicast. | 283 | * Reset all multicast. |
284 | */ | 284 | */ |
285 | FW(fecp, hash_table_high, fep->fec.hthi); | 285 | FW(fecp, hash_table_high, fep->fec.hthi); |
286 | FW(fecp, hash_table_low, fep->fec.htlo); | 286 | FW(fecp, hash_table_low, fep->fec.htlo); |
287 | 287 | ||
288 | /* | 288 | /* |
289 | * Set maximum receive buffer size. | 289 | * Set maximum receive buffer size. |
290 | */ | 290 | */ |
291 | FW(fecp, r_buff_size, PKT_MAXBLR_SIZE); | 291 | FW(fecp, r_buff_size, PKT_MAXBLR_SIZE); |
292 | FW(fecp, r_hash, PKT_MAXBUF_SIZE); | 292 | FW(fecp, r_hash, PKT_MAXBUF_SIZE); |
@@ -296,7 +296,7 @@ static void restart(struct net_device *dev) | |||
296 | tx_bd_base_phys = rx_bd_base_phys + sizeof(cbd_t) * fpi->rx_ring; | 296 | tx_bd_base_phys = rx_bd_base_phys + sizeof(cbd_t) * fpi->rx_ring; |
297 | 297 | ||
298 | /* | 298 | /* |
299 | * Set receive and transmit descriptor base. | 299 | * Set receive and transmit descriptor base. |
300 | */ | 300 | */ |
301 | FW(fecp, r_des_start, rx_bd_base_phys); | 301 | FW(fecp, r_des_start, rx_bd_base_phys); |
302 | FW(fecp, x_des_start, tx_bd_base_phys); | 302 | FW(fecp, x_des_start, tx_bd_base_phys); |
@@ -304,7 +304,7 @@ static void restart(struct net_device *dev) | |||
304 | fs_init_bds(dev); | 304 | fs_init_bds(dev); |
305 | 305 | ||
306 | /* | 306 | /* |
307 | * Enable big endian and don't care about SDMA FC. | 307 | * Enable big endian and don't care about SDMA FC. |
308 | */ | 308 | */ |
309 | FW(fecp, fun_code, 0x78000000); | 309 | FW(fecp, fun_code, 0x78000000); |
310 | 310 | ||
@@ -366,13 +366,13 @@ static void restart(struct net_device *dev) | |||
366 | } | 366 | } |
367 | 367 | ||
368 | /* | 368 | /* |
369 | * Enable interrupts we wish to service. | 369 | * Enable interrupts we wish to service. |
370 | */ | 370 | */ |
371 | FW(fecp, imask, FEC_ENET_TXF | FEC_ENET_TXB | | 371 | FW(fecp, imask, FEC_ENET_TXF | FEC_ENET_TXB | |
372 | FEC_ENET_RXF | FEC_ENET_RXB); | 372 | FEC_ENET_RXF | FEC_ENET_RXB); |
373 | 373 | ||
374 | /* | 374 | /* |
375 | * And last, enable the transmit and receive processing. | 375 | * And last, enable the transmit and receive processing. |
376 | */ | 376 | */ |
377 | FW(fecp, ecntrl, FEC_ECNTRL_PINMUX | FEC_ECNTRL_ETHER_EN); | 377 | FW(fecp, ecntrl, FEC_ECNTRL_PINMUX | FEC_ECNTRL_ETHER_EN); |
378 | FW(fecp, r_des_active, 0x01000000); | 378 | FW(fecp, r_des_active, 0x01000000); |
@@ -401,7 +401,7 @@ static void stop(struct net_device *dev) | |||
401 | ": %s FEC timeout on graceful transmit stop\n", | 401 | ": %s FEC timeout on graceful transmit stop\n", |
402 | dev->name); | 402 | dev->name); |
403 | /* | 403 | /* |
404 | * Disable FEC. Let only MII interrupts. | 404 | * Disable FEC. Let only MII interrupts. |
405 | */ | 405 | */ |
406 | FW(fecp, imask, 0); | 406 | FW(fecp, imask, 0); |
407 | FC(fecp, ecntrl, FEC_ECNTRL_ETHER_EN); | 407 | FC(fecp, ecntrl, FEC_ECNTRL_ETHER_EN); |
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c index 7540966687ec..6f32674a78e9 100644 --- a/drivers/net/fs_enet/mac-scc.c +++ b/drivers/net/fs_enet/mac-scc.c | |||
@@ -1,14 +1,14 @@ | |||
1 | /* | 1 | /* |
2 | * Ethernet on Serial Communications Controller (SCC) driver for Motorola MPC8xx and MPC82xx. | 2 | * Ethernet on Serial Communications Controller (SCC) driver for Motorola MPC8xx and MPC82xx. |
3 | * | 3 | * |
4 | * Copyright (c) 2003 Intracom S.A. | 4 | * Copyright (c) 2003 Intracom S.A. |
5 | * by Pantelis Antoniou <panto@intracom.gr> | 5 | * by Pantelis Antoniou <panto@intracom.gr> |
6 | * | 6 | * |
7 | * 2005 (c) MontaVista Software, Inc. | 7 | * 2005 (c) MontaVista Software, Inc. |
8 | * Vitaly Bordug <vbordug@ru.mvista.com> | 8 | * Vitaly Bordug <vbordug@ru.mvista.com> |
9 | * | 9 | * |
10 | * This file is licensed under the terms of the GNU General Public License | 10 | * This file is licensed under the terms of the GNU General Public License |
11 | * version 2. This program is licensed "as is" without any warranty of any | 11 | * version 2. This program is licensed "as is" without any warranty of any |
12 | * kind, whether express or implied. | 12 | * kind, whether express or implied. |
13 | */ | 13 | */ |
14 | 14 | ||
@@ -82,7 +82,7 @@ | |||
82 | #define SCC_MAX_MULTICAST_ADDRS 64 | 82 | #define SCC_MAX_MULTICAST_ADDRS 64 |
83 | 83 | ||
84 | /* | 84 | /* |
85 | * Delay to wait for SCC reset command to complete (in us) | 85 | * Delay to wait for SCC reset command to complete (in us) |
86 | */ | 86 | */ |
87 | #define SCC_RESET_DELAY 50 | 87 | #define SCC_RESET_DELAY 50 |
88 | #define MAX_CR_CMD_LOOPS 10000 | 88 | #define MAX_CR_CMD_LOOPS 10000 |
@@ -189,7 +189,7 @@ static void cleanup_data(struct net_device *dev) | |||
189 | } | 189 | } |
190 | 190 | ||
191 | static void set_promiscuous_mode(struct net_device *dev) | 191 | static void set_promiscuous_mode(struct net_device *dev) |
192 | { | 192 | { |
193 | struct fs_enet_private *fep = netdev_priv(dev); | 193 | struct fs_enet_private *fep = netdev_priv(dev); |
194 | scc_t *sccp = fep->scc.sccp; | 194 | scc_t *sccp = fep->scc.sccp; |
195 | 195 | ||
@@ -323,7 +323,7 @@ static void restart(struct net_device *dev) | |||
323 | W16(ep, sen_iaddr3, 0); | 323 | W16(ep, sen_iaddr3, 0); |
324 | W16(ep, sen_iaddr4, 0); | 324 | W16(ep, sen_iaddr4, 0); |
325 | 325 | ||
326 | /* set address | 326 | /* set address |
327 | */ | 327 | */ |
328 | mac = dev->dev_addr; | 328 | mac = dev->dev_addr; |
329 | paddrh = ((u16) mac[5] << 8) | mac[4]; | 329 | paddrh = ((u16) mac[5] << 8) | mac[4]; |
@@ -345,7 +345,7 @@ static void restart(struct net_device *dev) | |||
345 | 345 | ||
346 | W16(sccp, scc_scce, 0xffff); | 346 | W16(sccp, scc_scce, 0xffff); |
347 | 347 | ||
348 | /* Enable interrupts we wish to service. | 348 | /* Enable interrupts we wish to service. |
349 | */ | 349 | */ |
350 | W16(sccp, scc_sccm, SCCE_ENET_TXE | SCCE_ENET_RXF | SCCE_ENET_TXB); | 350 | W16(sccp, scc_sccm, SCCE_ENET_TXE | SCCE_ENET_RXF | SCCE_ENET_TXB); |
351 | 351 | ||
@@ -373,7 +373,7 @@ static void restart(struct net_device *dev) | |||
373 | S32(sccp, scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); | 373 | S32(sccp, scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); |
374 | } | 374 | } |
375 | 375 | ||
376 | static void stop(struct net_device *dev) | 376 | static void stop(struct net_device *dev) |
377 | { | 377 | { |
378 | struct fs_enet_private *fep = netdev_priv(dev); | 378 | struct fs_enet_private *fep = netdev_priv(dev); |
379 | scc_t *sccp = fep->scc.sccp; | 379 | scc_t *sccp = fep->scc.sccp; |
diff --git a/drivers/net/fs_enet/mii-bitbang.c b/drivers/net/fs_enet/mii-bitbang.c index d3840108ffbd..1a41ea60f982 100644 --- a/drivers/net/fs_enet/mii-bitbang.c +++ b/drivers/net/fs_enet/mii-bitbang.c | |||
@@ -1,14 +1,14 @@ | |||
1 | /* | 1 | /* |
2 | * Combined Ethernet driver for Motorola MPC8xx and MPC82xx. | 2 | * Combined Ethernet driver for Motorola MPC8xx and MPC82xx. |
3 | * | 3 | * |
4 | * Copyright (c) 2003 Intracom S.A. | 4 | * Copyright (c) 2003 Intracom S.A. |
5 | * by Pantelis Antoniou <panto@intracom.gr> | 5 | * by Pantelis Antoniou <panto@intracom.gr> |
6 | * | 6 | * |
7 | * 2005 (c) MontaVista Software, Inc. | 7 | * 2005 (c) MontaVista Software, Inc. |
8 | * Vitaly Bordug <vbordug@ru.mvista.com> | 8 | * Vitaly Bordug <vbordug@ru.mvista.com> |
9 | * | 9 | * |
10 | * This file is licensed under the terms of the GNU General Public License | 10 | * This file is licensed under the terms of the GNU General Public License |
11 | * version 2. This program is licensed "as is" without any warranty of any | 11 | * version 2. This program is licensed "as is" without any warranty of any |
12 | * kind, whether express or implied. | 12 | * kind, whether express or implied. |
13 | */ | 13 | */ |
14 | 14 | ||