aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fs_enet/mac-fec.c
diff options
context:
space:
mode:
authorVitaly Bordug <vitb@kernel.crashing.org>2007-09-18 12:05:35 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:51:55 -0400
commit9b8ee8e7d6b7f2270b19b3425a393d918fe497d3 (patch)
tree84c6f1bba3bb927385ab1b55b2f0caaf076bad4c /drivers/net/fs_enet/mac-fec.c
parentaa90f5032129b43569896c1c6c15a706c02c6abf (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/mac-fec.c')
-rw-r--r--drivers/net/fs_enet/mac-fec.c30
1 files changed, 15 insertions, 15 deletions
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
96static int do_pd_setup(struct fs_enet_private *fep) 96static 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);