Commit 9b8ee8e7 authored by Vitaly Bordug's avatar Vitaly Bordug Committed by David S. Miller

FS_ENET: Add polling support

Signed-off-by: default avatarVitaly Bordug <vitb@kernel.crashing.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent aa90f503
/* /*
* Combined Ethernet driver for Motorola MPC8xx and MPC82xx. * Combined Ethernet driver for Motorola MPC8xx and MPC82xx.
* *
* Copyright (c) 2003 Intracom S.A. * Copyright (c) 2003 Intracom S.A.
* by Pantelis Antoniou <panto@intracom.gr> * by Pantelis Antoniou <panto@intracom.gr>
* *
* 2005 (c) MontaVista Software, Inc. * 2005 (c) MontaVista Software, Inc.
* Vitaly Bordug <vbordug@ru.mvista.com> * Vitaly Bordug <vbordug@ru.mvista.com>
* *
* Heavily based on original FEC driver by Dan Malek <dan@embeddededge.com> * Heavily based on original FEC driver by Dan Malek <dan@embeddededge.com>
* and modifications by Joakim Tjernlund <joakim.tjernlund@lumentis.se> * and modifications by Joakim Tjernlund <joakim.tjernlund@lumentis.se>
* *
* This file is licensed under the terms of the GNU General Public License * This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any * version 2. This program is licensed "as is" without any warranty of any
* kind, whether express or implied. * kind, whether express or implied.
*/ */
...@@ -59,6 +59,9 @@ module_param(fs_enet_debug, int, 0); ...@@ -59,6 +59,9 @@ module_param(fs_enet_debug, int, 0);
MODULE_PARM_DESC(fs_enet_debug, MODULE_PARM_DESC(fs_enet_debug,
"Freescale bitmapped debugging message enable value"); "Freescale bitmapped debugging message enable value");
#ifdef CONFIG_NET_POLL_CONTROLLER
static void fs_enet_netpoll(struct net_device *dev);
#endif
static void fs_set_multicast_list(struct net_device *dev) static void fs_set_multicast_list(struct net_device *dev)
{ {
...@@ -104,7 +107,7 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget) ...@@ -104,7 +107,7 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget)
dev->name); dev->name);
/* /*
* Check for errors. * Check for errors.
*/ */
if (sc & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_CL | if (sc & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_CL |
BD_ENET_RX_NO | BD_ENET_RX_CR | BD_ENET_RX_OV)) { 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,7 +184,7 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget)
CBDW_SC(bdp, (sc & ~BD_ENET_RX_STATS) | BD_ENET_RX_EMPTY); CBDW_SC(bdp, (sc & ~BD_ENET_RX_STATS) | BD_ENET_RX_EMPTY);
/* /*
* Update BD pointer to next entry. * Update BD pointer to next entry.
*/ */
if ((sc & BD_ENET_RX_WRAP) == 0) if ((sc & BD_ENET_RX_WRAP) == 0)
bdp++; bdp++;
...@@ -234,7 +237,7 @@ static int fs_enet_rx_non_napi(struct net_device *dev) ...@@ -234,7 +237,7 @@ static int fs_enet_rx_non_napi(struct net_device *dev)
dev->name); dev->name);
/* /*
* Check for errors. * Check for errors.
*/ */
if (sc & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_CL | if (sc & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_CL |
BD_ENET_RX_NO | BD_ENET_RX_CR | BD_ENET_RX_OV)) { 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,7 +315,7 @@ static int fs_enet_rx_non_napi(struct net_device *dev)
CBDW_SC(bdp, (sc & ~BD_ENET_RX_STATS) | BD_ENET_RX_EMPTY); CBDW_SC(bdp, (sc & ~BD_ENET_RX_STATS) | BD_ENET_RX_EMPTY);
/* /*
* Update BD pointer to next entry. * Update BD pointer to next entry.
*/ */
if ((sc & BD_ENET_RX_WRAP) == 0) if ((sc & BD_ENET_RX_WRAP) == 0)
bdp++; bdp++;
...@@ -349,7 +352,7 @@ static void fs_enet_tx(struct net_device *dev) ...@@ -349,7 +352,7 @@ static void fs_enet_tx(struct net_device *dev)
skb = fep->tx_skbuff[dirtyidx]; skb = fep->tx_skbuff[dirtyidx];
/* /*
* Check for errors. * Check for errors.
*/ */
if (sc & (BD_ENET_TX_HB | BD_ENET_TX_LC | if (sc & (BD_ENET_TX_HB | BD_ENET_TX_LC |
BD_ENET_TX_RL | BD_ENET_TX_UN | BD_ENET_TX_CSL)) { 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,13 +392,13 @@ static void fs_enet_tx(struct net_device *dev)
skb->len, DMA_TO_DEVICE); skb->len, DMA_TO_DEVICE);
/* /*
* Free the sk buffer associated with this last transmit. * Free the sk buffer associated with this last transmit.
*/ */
dev_kfree_skb_irq(skb); dev_kfree_skb_irq(skb);
fep->tx_skbuff[dirtyidx] = NULL; fep->tx_skbuff[dirtyidx] = NULL;
/* /*
* Update pointer to next buffer descriptor to be transmitted. * Update pointer to next buffer descriptor to be transmitted.
*/ */
if ((sc & BD_ENET_TX_WRAP) == 0) if ((sc & BD_ENET_TX_WRAP) == 0)
bdp++; bdp++;
...@@ -491,7 +494,7 @@ void fs_init_bds(struct net_device *dev) ...@@ -491,7 +494,7 @@ void fs_init_bds(struct net_device *dev)
fep->cur_rx = fep->rx_bd_base; fep->cur_rx = fep->rx_bd_base;
/* /*
* Initialize the receive buffer descriptors. * Initialize the receive buffer descriptors.
*/ */
for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) { for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) {
skb = dev_alloc_skb(ENET_RX_FRSIZE); skb = dev_alloc_skb(ENET_RX_FRSIZE);
...@@ -511,7 +514,7 @@ void fs_init_bds(struct net_device *dev) ...@@ -511,7 +514,7 @@ void fs_init_bds(struct net_device *dev)
((i < fep->rx_ring - 1) ? 0 : BD_SC_WRAP)); ((i < fep->rx_ring - 1) ? 0 : BD_SC_WRAP));
} }
/* /*
* if we failed, fillup remainder * if we failed, fillup remainder
*/ */
for (; i < fep->rx_ring; i++, bdp++) { for (; i < fep->rx_ring; i++, bdp++) {
fep->rx_skbuff[i] = NULL; fep->rx_skbuff[i] = NULL;
...@@ -519,7 +522,7 @@ void fs_init_bds(struct net_device *dev) ...@@ -519,7 +522,7 @@ void fs_init_bds(struct net_device *dev)
} }
/* /*
* ...and the same for transmit. * ...and the same for transmit.
*/ */
for (i = 0, bdp = fep->tx_bd_base; i < fep->tx_ring; i++, bdp++) { for (i = 0, bdp = fep->tx_bd_base; i < fep->tx_ring; i++, bdp++) {
fep->tx_skbuff[i] = NULL; fep->tx_skbuff[i] = NULL;
...@@ -537,7 +540,7 @@ void fs_cleanup_bds(struct net_device *dev) ...@@ -537,7 +540,7 @@ void fs_cleanup_bds(struct net_device *dev)
int i; int i;
/* /*
* Reset SKB transmit buffers. * Reset SKB transmit buffers.
*/ */
for (i = 0, bdp = fep->tx_bd_base; i < fep->tx_ring; i++, bdp++) { for (i = 0, bdp = fep->tx_bd_base; i < fep->tx_ring; i++, bdp++) {
if ((skb = fep->tx_skbuff[i]) == NULL) if ((skb = fep->tx_skbuff[i]) == NULL)
...@@ -552,7 +555,7 @@ void fs_cleanup_bds(struct net_device *dev) ...@@ -552,7 +555,7 @@ void fs_cleanup_bds(struct net_device *dev)
} }
/* /*
* Reset SKB receive buffers * Reset SKB receive buffers
*/ */
for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) { for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) {
if ((skb = fep->rx_skbuff[i]) == NULL) 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,7 +585,7 @@ static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
spin_lock_irqsave(&fep->tx_lock, flags); spin_lock_irqsave(&fep->tx_lock, flags);
/* /*
* Fill in a Tx ring entry * Fill in a Tx ring entry
*/ */
bdp = fep->cur_tx; bdp = fep->cur_tx;
...@@ -601,19 +604,19 @@ static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -601,19 +604,19 @@ static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
curidx = bdp - fep->tx_bd_base; curidx = bdp - fep->tx_bd_base;
/* /*
* Clear all of the status flags. * Clear all of the status flags.
*/ */
CBDC_SC(bdp, BD_ENET_TX_STATS); CBDC_SC(bdp, BD_ENET_TX_STATS);
/* /*
* Save skb pointer. * Save skb pointer.
*/ */
fep->tx_skbuff[curidx] = skb; fep->tx_skbuff[curidx] = skb;
fep->stats.tx_bytes += skb->len; fep->stats.tx_bytes += skb->len;
/* /*
* Push the data cache so the CPM does not get stale memory data. * Push the data cache so the CPM does not get stale memory data.
*/ */
CBDW_BUFADDR(bdp, dma_map_single(fep->dev, CBDW_BUFADDR(bdp, dma_map_single(fep->dev,
skb->data, skb->len, DMA_TO_DEVICE)); 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,7 +625,7 @@ static int fs_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
dev->trans_start = jiffies; dev->trans_start = jiffies;
/* /*
* If this was the last BD in the ring, start at the beginning again. * If this was the last BD in the ring, start at the beginning again.
*/ */
if ((CBDR_SC(bdp) & BD_ENET_TX_WRAP) == 0) if ((CBDR_SC(bdp) & BD_ENET_TX_WRAP) == 0)
fep->cur_tx++; fep->cur_tx++;
...@@ -1003,13 +1006,13 @@ static struct net_device *fs_init_instance(struct device *dev, ...@@ -1003,13 +1006,13 @@ static struct net_device *fs_init_instance(struct device *dev,
spin_lock_init(&fep->tx_lock); spin_lock_init(&fep->tx_lock);
/* /*
* Set the Ethernet address. * Set the Ethernet address.
*/ */
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
ndev->dev_addr[i] = fpi->macaddr[i]; ndev->dev_addr[i] = fpi->macaddr[i];
r = (*fep->ops->allocate_bd)(ndev); r = (*fep->ops->allocate_bd)(ndev);
if (fep->ring_base == NULL) { if (fep->ring_base == NULL) {
printk(KERN_ERR DRV_MODULE_NAME printk(KERN_ERR DRV_MODULE_NAME
": %s buffer descriptor alloc failed (%d).\n", ndev->name, r); ": %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,7 +1031,7 @@ static struct net_device *fs_init_instance(struct device *dev,
fep->rx_ring = fpi->rx_ring; fep->rx_ring = fpi->rx_ring;
/* /*
* The FEC Ethernet specific entries in the device structure. * The FEC Ethernet specific entries in the device structure.
*/ */
ndev->open = fs_enet_open; ndev->open = fs_enet_open;
ndev->hard_start_xmit = fs_enet_start_xmit; ndev->hard_start_xmit = fs_enet_start_xmit;
...@@ -1037,6 +1040,11 @@ static struct net_device *fs_init_instance(struct device *dev, ...@@ -1037,6 +1040,11 @@ static struct net_device *fs_init_instance(struct device *dev,
ndev->stop = fs_enet_close; ndev->stop = fs_enet_close;
ndev->get_stats = fs_enet_get_stats; ndev->get_stats = fs_enet_get_stats;
ndev->set_multicast_list = fs_set_multicast_list; ndev->set_multicast_list = fs_set_multicast_list;
#ifdef CONFIG_NET_POLL_CONTROLLER
ndev->poll_controller = fs_enet_netpoll;
#endif
netif_napi_add(ndev, &fep->napi, netif_napi_add(ndev, &fep->napi,
fs_enet_rx_napi, fpi->napi_weight); fs_enet_rx_napi, fpi->napi_weight);
...@@ -1251,7 +1259,7 @@ static int __init fs_init(void) ...@@ -1251,7 +1259,7 @@ static int __init fs_init(void)
err: err:
cleanup_immap(); cleanup_immap();
return r; return r;
} }
static void __exit fs_cleanup(void) static void __exit fs_cleanup(void)
...@@ -1262,6 +1270,15 @@ static void __exit fs_cleanup(void) ...@@ -1262,6 +1270,15 @@ static void __exit fs_cleanup(void)
cleanup_immap(); cleanup_immap();
} }
#ifdef CONFIG_NET_POLL_CONTROLLER
static void fs_enet_netpoll(struct net_device *dev)
{
disable_irq(dev->irq);
fs_enet_interrupt(dev->irq, dev, NULL);
enable_irq(dev->irq);
}
#endif
/**************************************************************************************/ /**************************************************************************************/
module_init(fs_init); module_init(fs_init);
......
/* /*
* FCC driver for Motorola MPC82xx (PQ2). * FCC driver for Motorola MPC82xx (PQ2).
* *
* Copyright (c) 2003 Intracom S.A. * Copyright (c) 2003 Intracom S.A.
* by Pantelis Antoniou <panto@intracom.gr> * by Pantelis Antoniou <panto@intracom.gr>
* *
* 2005 (c) MontaVista Software, Inc. * 2005 (c) MontaVista Software, Inc.
* Vitaly Bordug <vbordug@ru.mvista.com> * Vitaly Bordug <vbordug@ru.mvista.com>
* *
* This file is licensed under the terms of the GNU General Public License * This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any * version 2. This program is licensed "as is" without any warranty of any
* kind, whether express or implied. * kind, whether express or implied.
*/ */
...@@ -92,7 +92,7 @@ static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 mcn, u32 op) ...@@ -92,7 +92,7 @@ static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 mcn, u32 op)
u32 v; u32 v;
int i; int i;
/* Currently I don't know what feature call will look like. But /* Currently I don't know what feature call will look like. But
I guess there'd be something like do_cpm_cmd() which will require page & sblock */ I guess there'd be something like do_cpm_cmd() which will require page & sblock */
v = mk_cr_cmd(fpi->cp_page, fpi->cp_block, mcn, op); v = mk_cr_cmd(fpi->cp_page, fpi->cp_block, mcn, op);
W32(cpmp, cp_cpcr, v | CPM_CR_FLG); W32(cpmp, cp_cpcr, v | CPM_CR_FLG);
...@@ -548,7 +548,7 @@ int get_regs_len(struct net_device *dev) ...@@ -548,7 +548,7 @@ int get_regs_len(struct net_device *dev)
* down. We now issue a restart transmit. Since the * down. We now issue a restart transmit. Since the
* errors close the BD and update the pointers, the restart * errors close the BD and update the pointers, the restart
* _should_ pick up without having to reset any of our * _should_ pick up without having to reset any of our
* pointers either. Also, To workaround 8260 device erratum * pointers either. Also, To workaround 8260 device erratum
* CPM37, we must disable and then re-enable the transmitter * CPM37, we must disable and then re-enable the transmitter
* following a Late Collision, Underrun, or Retry Limit error. * following a Late Collision, Underrun, or Retry Limit error.
*/ */
......
/* /*
* Freescale Ethernet controllers * Freescale Ethernet controllers
* *
* Copyright (c) 2005 Intracom S.A. * Copyright (c) 2005 Intracom S.A.
* by Pantelis Antoniou <panto@intracom.gr> * by Pantelis Antoniou <panto@intracom.gr>
* *
* 2005 (c) MontaVista Software, Inc. * 2005 (c) MontaVista Software, Inc.
* Vitaly Bordug <vbordug@ru.mvista.com> * Vitaly Bordug <vbordug@ru.mvista.com>
* *
* This file is licensed under the terms of the GNU General Public License * This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any * version 2. This program is licensed "as is" without any warranty of any
* kind, whether express or implied. * kind, whether express or implied.
*/ */
...@@ -95,9 +95,9 @@ static int whack_reset(fec_t * fecp) ...@@ -95,9 +95,9 @@ static int whack_reset(fec_t * fecp)
static int do_pd_setup(struct fs_enet_private *fep) static int do_pd_setup(struct fs_enet_private *fep)
{ {
struct platform_device *pdev = to_platform_device(fep->dev); struct platform_device *pdev = to_platform_device(fep->dev);
struct resource *r; struct resource *r;
/* Fill out IRQ field */ /* Fill out IRQ field */
fep->interrupt = platform_get_irq_byname(pdev,"interrupt"); fep->interrupt = platform_get_irq_byname(pdev,"interrupt");
if (fep->interrupt < 0) if (fep->interrupt < 0)
...@@ -110,7 +110,7 @@ static int do_pd_setup(struct fs_enet_private *fep) ...@@ -110,7 +110,7 @@ static int do_pd_setup(struct fs_enet_private *fep)
return -EINVAL; return -EINVAL;
return 0; return 0;
} }
#define FEC_NAPI_RX_EVENT_MSK (FEC_ENET_RXF | FEC_ENET_RXB) #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,7 +141,7 @@ static int allocate_bd(struct net_device *dev)
{ {
struct fs_enet_private *fep = netdev_priv(dev); struct fs_enet_private *fep = netdev_priv(dev);
const struct fs_platform_info *fpi = fep->fpi; const struct fs_platform_info *fpi = fep->fpi;
fep->ring_base = dma_alloc_coherent(fep->dev, fep->ring_base = dma_alloc_coherent(fep->dev,
(fpi->tx_ring + fpi->rx_ring) * (fpi->tx_ring + fpi->rx_ring) *
sizeof(cbd_t), &fep->ring_mem_addr, sizeof(cbd_t), &fep->ring_mem_addr,
...@@ -280,13 +280,13 @@ static void restart(struct net_device *dev) ...@@ -280,13 +280,13 @@ static void restart(struct net_device *dev)
FW(fecp, addr_high, addrlo); FW(fecp, addr_high, addrlo);
/* /*
* Reset all multicast. * Reset all multicast.
*/ */
FW(fecp, hash_table_high, fep->fec.hthi); FW(fecp, hash_table_high, fep->fec.hthi);
FW(fecp, hash_table_low, fep->fec.htlo); FW(fecp, hash_table_low, fep->fec.htlo);
/* /*
* Set maximum receive buffer size. * Set maximum receive buffer size.
*/ */
FW(fecp, r_buff_size, PKT_MAXBLR_SIZE); FW(fecp, r_buff_size, PKT_MAXBLR_SIZE);
FW(fecp, r_hash, PKT_MAXBUF_SIZE); FW(fecp, r_hash, PKT_MAXBUF_SIZE);
...@@ -296,7 +296,7 @@ static void restart(struct net_device *dev) ...@@ -296,7 +296,7 @@ static void restart(struct net_device *dev)
tx_bd_base_phys = rx_bd_base_phys + sizeof(cbd_t) * fpi->rx_ring; tx_bd_base_phys = rx_bd_base_phys + sizeof(cbd_t) * fpi->rx_ring;
/* /*
* Set receive and transmit descriptor base. * Set receive and transmit descriptor base.
*/ */
FW(fecp, r_des_start, rx_bd_base_phys); FW(fecp, r_des_start, rx_bd_base_phys);
FW(fecp, x_des_start, tx_bd_base_phys); FW(fecp, x_des_start, tx_bd_base_phys);
...@@ -304,7 +304,7 @@ static void restart(struct net_device *dev) ...@@ -304,7 +304,7 @@ static void restart(struct net_device *dev)
fs_init_bds(dev); fs_init_bds(dev);
/* /*
* Enable big endian and don't care about SDMA FC. * Enable big endian and don't care about SDMA FC.
*/ */
FW(fecp, fun_code, 0x78000000); FW(fecp, fun_code, 0x78000000);
...@@ -366,13 +366,13 @@ static void restart(struct net_device *dev) ...@@ -366,13 +366,13 @@ static void restart(struct net_device *dev)
} }
/* /*
* Enable interrupts we wish to service. * Enable interrupts we wish to service.
*/ */
FW(fecp, imask, FEC_ENET_TXF | FEC_ENET_TXB | FW(fecp, imask, FEC_ENET_TXF | FEC_ENET_TXB |
FEC_ENET_RXF | FEC_ENET_RXB); FEC_ENET_RXF | FEC_ENET_RXB);
/* /*
* And last, enable the transmit and receive processing. * And last, enable the transmit and receive processing.
*/ */
FW(fecp, ecntrl, FEC_ECNTRL_PINMUX | FEC_ECNTRL_ETHER_EN); FW(fecp, ecntrl, FEC_ECNTRL_PINMUX | FEC_ECNTRL_ETHER_EN);
FW(fecp, r_des_active, 0x01000000); FW(fecp, r_des_active, 0x01000000);
...@@ -401,7 +401,7 @@ static void stop(struct net_device *dev) ...@@ -401,7 +401,7 @@ static void stop(struct net_device *dev)
": %s FEC timeout on graceful transmit stop\n", ": %s FEC timeout on graceful transmit stop\n",
dev->name); dev->name);
/* /*
* Disable FEC. Let only MII interrupts. * Disable FEC. Let only MII interrupts.
*/ */
FW(fecp, imask, 0); FW(fecp, imask, 0);
FC(fecp, ecntrl, FEC_ECNTRL_ETHER_EN); FC(fecp, ecntrl, FEC_ECNTRL_ETHER_EN);
......
/* /*
* Ethernet on Serial Communications Controller (SCC) driver for Motorola MPC8xx and MPC82xx. * Ethernet on Serial Communications Controller (SCC) driver for Motorola MPC8xx and MPC82xx.
* *
* Copyright (c) 2003 Intracom S.A. * Copyright (c) 2003 Intracom S.A.
* by Pantelis Antoniou <panto@intracom.gr> * by Pantelis Antoniou <panto@intracom.gr>
* *
* 2005 (c) MontaVista Software, Inc. * 2005 (c) MontaVista Software, Inc.
* Vitaly Bordug <vbordug@ru.mvista.com> * Vitaly Bordug <vbordug@ru.mvista.com>
* *
* This file is licensed under the terms of the GNU General Public License * This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any * version 2. This program is licensed "as is" without any warranty of any
* kind, whether express or implied. * kind, whether express or implied.
*/ */
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
#define SCC_MAX_MULTICAST_ADDRS 64 #define SCC_MAX_MULTICAST_ADDRS 64
/* /*
* Delay to wait for SCC reset command to complete (in us) * Delay to wait for SCC reset command to complete (in us)
*/ */
#define SCC_RESET_DELAY 50 #define SCC_RESET_DELAY 50
#define MAX_CR_CMD_LOOPS 10000 #define MAX_CR_CMD_LOOPS 10000
...@@ -189,7 +189,7 @@ static void cleanup_data(struct net_device *dev) ...@@ -189,7 +189,7 @@ static void cleanup_data(struct net_device *dev)
} }
static void set_promiscuous_mode(struct net_device *dev) static void set_promiscuous_mode(struct net_device *dev)
{ {
struct fs_enet_private *fep = netdev_priv(dev); struct fs_enet_private *fep = netdev_priv(dev);
scc_t *sccp = fep->scc.sccp; scc_t *sccp = fep->scc.sccp;
...@@ -323,7 +323,7 @@ static void restart(struct net_device *dev) ...@@ -323,7 +323,7 @@ static void restart(struct net_device *dev)
W16(ep, sen_iaddr3, 0); W16(ep, sen_iaddr3, 0);
W16(ep, sen_iaddr4, 0); W16(ep, sen_iaddr4, 0);
/* set address /* set address
*/ */
mac = dev->dev_addr; mac = dev->dev_addr;
paddrh = ((u16) mac[5] << 8) | mac[4]; paddrh = ((u16) mac[5] << 8) | mac[4];
...@@ -345,7 +345,7 @@ static void restart(struct net_device *dev) ...@@ -345,7 +345,7 @@ static void restart(struct net_device *dev)
W16(sccp, scc_scce, 0xffff); W16(sccp, scc_scce, 0xffff);
/* Enable interrupts we wish to service. /* Enable interrupts we wish to service.
*/ */
W16(sccp, scc_sccm, SCCE_ENET_TXE | SCCE_ENET_RXF | SCCE_ENET_TXB); W16(sccp, scc_sccm, SCCE_ENET_TXE | SCCE_ENET_RXF | SCCE_ENET_TXB);
...@@ -373,7 +373,7 @@ static void restart(struct net_device *dev) ...@@ -373,7 +373,7 @@ static void restart(struct net_device *dev)
S32(sccp, scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); S32(sccp, scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
} }
static void stop(struct net_device *dev) static void stop(struct net_device *dev)
{ {
struct fs_enet_private *fep = netdev_priv(dev); struct fs_enet_private *fep = netdev_priv(dev);
scc_t *sccp = fep->scc.sccp; scc_t *sccp = fep->scc.sccp;
......
/* /*
* Combined Ethernet driver for Motorola MPC8xx and MPC82xx. * Combined Ethernet driver for Motorola MPC8xx and MPC82xx.
* *
* Copyright (c) 2003 Intracom S.A. * Copyright (c) 2003 Intracom S.A.
* by Pantelis Antoniou <panto@intracom.gr> * by Pantelis Antoniou <panto@intracom.gr>
* *
* 2005 (c) MontaVista Software, Inc. * 2005 (c) MontaVista Software, Inc.
* Vitaly Bordug <vbordug@ru.mvista.com> * Vitaly Bordug <vbordug@ru.mvista.com>
* *
* This file is licensed under the terms of the GNU General Public License * This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any * version 2. This program is licensed "as is" without any warranty of any
* kind, whether express or implied. * kind, whether express or implied.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment