aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-04-14 21:32:16 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-16 05:34:48 -0400
commit2e28532f7e63c3011f7b3c1516cfebd5321bdd15 (patch)
treeb164c335b57ea5e5e4cd92f68fb64b600ac308f5 /drivers/net
parentf44d6305280378cb34319e0118e18d84cc7ac773 (diff)
fec: do not typedef struct types
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/fec.c37
-rw-r--r--drivers/net/fec.h8
2 files changed, 24 insertions, 21 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 37b333265629..f8396fb30326 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -180,10 +180,14 @@ struct fec_enet_private {
180 /* CPM dual port RAM relative addresses. 180 /* CPM dual port RAM relative addresses.
181 */ 181 */
182 dma_addr_t bd_dma; 182 dma_addr_t bd_dma;
183 cbd_t *rx_bd_base; /* Address of Rx and Tx buffers. */ 183 /* Address of Rx and Tx buffers. */
184 cbd_t *tx_bd_base; 184 struct bufdesc *rx_bd_base;
185 cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ 185 struct bufdesc *tx_bd_base;
186 cbd_t *dirty_tx; /* The ring entries to be free()ed. */ 186 /* The next free ring entry */
187 struct bufdesc *cur_rx, *cur_tx;
188 /* The ring entries to be free()ed. */
189 struct bufdesc *dirty_tx;
190
187 uint tx_full; 191 uint tx_full;
188 /* hold while accessing the HW like ringbuffer for tx/rx but not MAC */ 192 /* hold while accessing the HW like ringbuffer for tx/rx but not MAC */
189 spinlock_t hw_lock; 193 spinlock_t hw_lock;
@@ -289,7 +293,7 @@ static int
289fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) 293fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
290{ 294{
291 struct fec_enet_private *fep = netdev_priv(dev); 295 struct fec_enet_private *fep = netdev_priv(dev);
292 volatile cbd_t *bdp; 296 struct bufdesc *bdp;
293 unsigned short status; 297 unsigned short status;
294 unsigned long flags; 298 unsigned long flags;
295 299
@@ -374,7 +378,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
374 netif_stop_queue(dev); 378 netif_stop_queue(dev);
375 } 379 }
376 380
377 fep->cur_tx = (cbd_t *)bdp; 381 fep->cur_tx = bdp;
378 382
379 spin_unlock_irqrestore(&fep->hw_lock, flags); 383 spin_unlock_irqrestore(&fep->hw_lock, flags);
380 384
@@ -391,7 +395,7 @@ fec_timeout(struct net_device *dev)
391#ifndef final_version 395#ifndef final_version
392 { 396 {
393 int i; 397 int i;
394 cbd_t *bdp; 398 struct bufdesc *bdp;
395 399
396 printk("Ring data dump: cur_tx %lx%s, dirty_tx %lx cur_rx: %lx\n", 400 printk("Ring data dump: cur_tx %lx%s, dirty_tx %lx cur_rx: %lx\n",
397 (unsigned long)fep->cur_tx, fep->tx_full ? " (full)" : "", 401 (unsigned long)fep->cur_tx, fep->tx_full ? " (full)" : "",
@@ -471,7 +475,7 @@ static void
471fec_enet_tx(struct net_device *dev) 475fec_enet_tx(struct net_device *dev)
472{ 476{
473 struct fec_enet_private *fep; 477 struct fec_enet_private *fep;
474 volatile cbd_t *bdp; 478 struct bufdesc *bdp;
475 unsigned short status; 479 unsigned short status;
476 struct sk_buff *skb; 480 struct sk_buff *skb;
477 481
@@ -534,7 +538,7 @@ fec_enet_tx(struct net_device *dev)
534 netif_wake_queue(dev); 538 netif_wake_queue(dev);
535 } 539 }
536 } 540 }
537 fep->dirty_tx = (cbd_t *)bdp; 541 fep->dirty_tx = bdp;
538 spin_unlock_irq(&fep->hw_lock); 542 spin_unlock_irq(&fep->hw_lock);
539} 543}
540 544
@@ -548,7 +552,7 @@ static void
548fec_enet_rx(struct net_device *dev) 552fec_enet_rx(struct net_device *dev)
549{ 553{
550 struct fec_enet_private *fep = netdev_priv(dev); 554 struct fec_enet_private *fep = netdev_priv(dev);
551 volatile cbd_t *bdp; 555 struct bufdesc *bdp;
552 unsigned short status; 556 unsigned short status;
553 struct sk_buff *skb; 557 struct sk_buff *skb;
554 ushort pkt_len; 558 ushort pkt_len;
@@ -656,7 +660,7 @@ while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) {
656 writel(0, fep->hwp + FEC_R_DES_ACTIVE); 660 writel(0, fep->hwp + FEC_R_DES_ACTIVE);
657#endif 661#endif
658 } /* while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) */ 662 } /* while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) */
659 fep->cur_rx = (cbd_t *)bdp; 663 fep->cur_rx = bdp;
660 664
661#if 0 665#if 0
662 /* Doing this here will allow us to process all frames in the 666 /* Doing this here will allow us to process all frames in the
@@ -1653,8 +1657,7 @@ int __init fec_enet_init(struct net_device *dev, int index)
1653{ 1657{
1654 struct fec_enet_private *fep = netdev_priv(dev); 1658 struct fec_enet_private *fep = netdev_priv(dev);
1655 unsigned long mem_addr; 1659 unsigned long mem_addr;
1656 volatile cbd_t *bdp; 1660 struct bufdesc *bdp, *cbd_base;
1657 cbd_t *cbd_base;
1658 int i, j; 1661 int i, j;
1659 1662
1660 /* Allocate memory for buffer descriptors. 1663 /* Allocate memory for buffer descriptors.
@@ -1695,7 +1698,7 @@ int __init fec_enet_init(struct net_device *dev, int index)
1695 } 1698 }
1696#endif 1699#endif
1697 1700
1698 cbd_base = (cbd_t *)mem_addr; 1701 cbd_base = (struct bufdesc *)mem_addr;
1699 1702
1700 /* Set receive and transmit descriptor base. 1703 /* Set receive and transmit descriptor base.
1701 */ 1704 */
@@ -1760,7 +1763,7 @@ int __init fec_enet_init(struct net_device *dev, int index)
1760 /* Set receive and transmit descriptor base. 1763 /* Set receive and transmit descriptor base.
1761 */ 1764 */
1762 writel(fep->bd_dma, fep->hwp + FEC_R_DES_START); 1765 writel(fep->bd_dma, fep->hwp + FEC_R_DES_START);
1763 writel((unsigned long)fep->bd_dma + sizeof(cbd_t) * RX_RING_SIZE, 1766 writel((unsigned long)fep->bd_dma + sizeof(struct bufdesc) * RX_RING_SIZE,
1764 fep->hwp + FEC_X_DES_START); 1767 fep->hwp + FEC_X_DES_START);
1765 1768
1766#ifdef HAVE_mii_link_interrupt 1769#ifdef HAVE_mii_link_interrupt
@@ -1824,7 +1827,7 @@ static void
1824fec_restart(struct net_device *dev, int duplex) 1827fec_restart(struct net_device *dev, int duplex)
1825{ 1828{
1826 struct fec_enet_private *fep = netdev_priv(dev); 1829 struct fec_enet_private *fep = netdev_priv(dev);
1827 volatile cbd_t *bdp; 1830 struct bufdesc *bdp;
1828 int i; 1831 int i;
1829 1832
1830 /* Whack a reset. We should wait for this. */ 1833 /* Whack a reset. We should wait for this. */
@@ -1846,7 +1849,7 @@ fec_restart(struct net_device *dev, int duplex)
1846 1849
1847 /* Set receive and transmit descriptor base. */ 1850 /* Set receive and transmit descriptor base. */
1848 writel(fep->bd_dma, fep->hwp + FEC_R_DES_START); 1851 writel(fep->bd_dma, fep->hwp + FEC_R_DES_START);
1849 writel((unsigned long)fep->bd_dma + sizeof(cbd_t) * RX_RING_SIZE, 1852 writel((unsigned long)fep->bd_dma + sizeof(struct bufdesc) * RX_RING_SIZE,
1850 fep->hwp + FEC_X_DES_START); 1853 fep->hwp + FEC_X_DES_START);
1851 1854
1852 fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; 1855 fep->dirty_tx = fep->cur_tx = fep->tx_bd_base;
diff --git a/drivers/net/fec.h b/drivers/net/fec.h
index 5474ba39d46c..30b7dd671336 100644
--- a/drivers/net/fec.h
+++ b/drivers/net/fec.h
@@ -77,17 +77,17 @@
77 * Define the buffer descriptor structure. 77 * Define the buffer descriptor structure.
78 */ 78 */
79#ifdef CONFIG_ARCH_MXC 79#ifdef CONFIG_ARCH_MXC
80typedef struct bufdesc { 80struct bufdesc {
81 unsigned short cbd_datlen; /* Data length */ 81 unsigned short cbd_datlen; /* Data length */
82 unsigned short cbd_sc; /* Control and status info */ 82 unsigned short cbd_sc; /* Control and status info */
83 unsigned long cbd_bufaddr; /* Buffer address */ 83 unsigned long cbd_bufaddr; /* Buffer address */
84} cbd_t; 84};
85#else 85#else
86typedef struct bufdesc { 86struct bufdesc {
87 unsigned short cbd_sc; /* Control and status info */ 87 unsigned short cbd_sc; /* Control and status info */
88 unsigned short cbd_datlen; /* Data length */ 88 unsigned short cbd_datlen; /* Data length */
89 unsigned long cbd_bufaddr; /* Buffer address */ 89 unsigned long cbd_bufaddr; /* Buffer address */
90} cbd_t; 90};
91#endif 91#endif
92 92
93/* 93/*