aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/au1000_eth.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-09-13 13:24:59 -0400
committerJeff Garzik <jeff@garzik.org>2006-09-13 13:24:59 -0400
commit6aa20a2235535605db6d6d2bd850298b2fe7f31e (patch)
treedf0b855043407b831d57f2f2c271f8aab48444f4 /drivers/net/au1000_eth.c
parent7a291083225af6e22ffaa46b3d91cfc1a1ccaab4 (diff)
drivers/net: Trim trailing whitespace
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/au1000_eth.c')
-rw-r--r--drivers/net/au1000_eth.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 85be0e6aa1f3..ec493368d784 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -6,8 +6,8 @@
6 * Copyright 2002 TimeSys Corp. 6 * Copyright 2002 TimeSys Corp.
7 * Added ethtool/mii-tool support, 7 * Added ethtool/mii-tool support,
8 * Copyright 2004 Matt Porter <mporter@kernel.crashing.org> 8 * Copyright 2004 Matt Porter <mporter@kernel.crashing.org>
9 * Update: 2004 Bjoern Riemer, riemer@fokus.fraunhofer.de 9 * Update: 2004 Bjoern Riemer, riemer@fokus.fraunhofer.de
10 * or riemer@riemer-nt.de: fixed the link beat detection with 10 * or riemer@riemer-nt.de: fixed the link beat detection with
11 * ioctls (SIOCGMIIPHY) 11 * ioctls (SIOCGMIIPHY)
12 * Copyright 2006 Herbert Valerio Riedel <hvr@gnu.org> 12 * Copyright 2006 Herbert Valerio Riedel <hvr@gnu.org>
13 * converted to use linux-2.6.x's PHY framework 13 * converted to use linux-2.6.x's PHY framework
@@ -32,7 +32,7 @@
32 * 32 *
33 * ######################################################################## 33 * ########################################################################
34 * 34 *
35 * 35 *
36 */ 36 */
37 37
38#include <linux/module.h> 38#include <linux/module.h>
@@ -107,13 +107,13 @@ extern char * __init prom_getcmdline(void);
107/* 107/*
108 * Theory of operation 108 * Theory of operation
109 * 109 *
110 * The Au1000 MACs use a simple rx and tx descriptor ring scheme. 110 * The Au1000 MACs use a simple rx and tx descriptor ring scheme.
111 * There are four receive and four transmit descriptors. These 111 * There are four receive and four transmit descriptors. These
112 * descriptors are not in memory; rather, they are just a set of 112 * descriptors are not in memory; rather, they are just a set of
113 * hardware registers. 113 * hardware registers.
114 * 114 *
115 * Since the Au1000 has a coherent data cache, the receive and 115 * Since the Au1000 has a coherent data cache, the receive and
116 * transmit buffers are allocated from the KSEG0 segment. The 116 * transmit buffers are allocated from the KSEG0 segment. The
117 * hardware registers, however, are still mapped at KSEG1 to 117 * hardware registers, however, are still mapped at KSEG1 to
118 * make sure there's no out-of-order writes, and that all writes 118 * make sure there's no out-of-order writes, and that all writes
119 * complete immediately. 119 * complete immediately.
@@ -123,7 +123,7 @@ extern char * __init prom_getcmdline(void);
123 * the mac address is, and the mac address is not passed on the 123 * the mac address is, and the mac address is not passed on the
124 * command line. 124 * command line.
125 */ 125 */
126static unsigned char au1000_mac_addr[6] __devinitdata = { 126static unsigned char au1000_mac_addr[6] __devinitdata = {
127 0x00, 0x50, 0xc2, 0x0c, 0x30, 0x00 127 0x00, 0x50, 0xc2, 0x0c, 0x30, 0x00
128}; 128};
129 129
@@ -207,13 +207,13 @@ static int mdio_read(struct net_device *dev, int phy_addr, int reg)
207 while (*mii_control_reg & MAC_MII_BUSY) { 207 while (*mii_control_reg & MAC_MII_BUSY) {
208 mdelay(1); 208 mdelay(1);
209 if (--timedout == 0) { 209 if (--timedout == 0) {
210 printk(KERN_ERR "%s: read_MII busy timeout!!\n", 210 printk(KERN_ERR "%s: read_MII busy timeout!!\n",
211 dev->name); 211 dev->name);
212 return -1; 212 return -1;
213 } 213 }
214 } 214 }
215 215
216 mii_control = MAC_SET_MII_SELECT_REG(reg) | 216 mii_control = MAC_SET_MII_SELECT_REG(reg) |
217 MAC_SET_MII_SELECT_PHY(phy_addr) | MAC_MII_READ; 217 MAC_SET_MII_SELECT_PHY(phy_addr) | MAC_MII_READ;
218 218
219 *mii_control_reg = mii_control; 219 *mii_control_reg = mii_control;
@@ -222,7 +222,7 @@ static int mdio_read(struct net_device *dev, int phy_addr, int reg)
222 while (*mii_control_reg & MAC_MII_BUSY) { 222 while (*mii_control_reg & MAC_MII_BUSY) {
223 mdelay(1); 223 mdelay(1);
224 if (--timedout == 0) { 224 if (--timedout == 0) {
225 printk(KERN_ERR "%s: mdio_read busy timeout!!\n", 225 printk(KERN_ERR "%s: mdio_read busy timeout!!\n",
226 dev->name); 226 dev->name);
227 return -1; 227 return -1;
228 } 228 }
@@ -241,13 +241,13 @@ static void mdio_write(struct net_device *dev, int phy_addr, int reg, u16 value)
241 while (*mii_control_reg & MAC_MII_BUSY) { 241 while (*mii_control_reg & MAC_MII_BUSY) {
242 mdelay(1); 242 mdelay(1);
243 if (--timedout == 0) { 243 if (--timedout == 0) {
244 printk(KERN_ERR "%s: mdio_write busy timeout!!\n", 244 printk(KERN_ERR "%s: mdio_write busy timeout!!\n",
245 dev->name); 245 dev->name);
246 return; 246 return;
247 } 247 }
248 } 248 }
249 249
250 mii_control = MAC_SET_MII_SELECT_REG(reg) | 250 mii_control = MAC_SET_MII_SELECT_REG(reg) |
251 MAC_SET_MII_SELECT_PHY(phy_addr) | MAC_MII_WRITE; 251 MAC_SET_MII_SELECT_PHY(phy_addr) | MAC_MII_WRITE;
252 252
253 *mii_data_reg = value; 253 *mii_data_reg = value;
@@ -394,7 +394,7 @@ static int mii_probe (struct net_device *dev)
394 394
395/* 395/*
396 * Buffer allocation/deallocation routines. The buffer descriptor returned 396 * Buffer allocation/deallocation routines. The buffer descriptor returned
397 * has the virtual and dma address of a buffer suitable for 397 * has the virtual and dma address of a buffer suitable for
398 * both, receive and transmit operations. 398 * both, receive and transmit operations.
399 */ 399 */
400static db_dest_t *GetFreeDB(struct au1000_private *aup) 400static db_dest_t *GetFreeDB(struct au1000_private *aup)
@@ -500,22 +500,22 @@ static void reset_mac(struct net_device *dev)
500 spin_unlock_irqrestore(&aup->lock, flags); 500 spin_unlock_irqrestore(&aup->lock, flags);
501} 501}
502 502
503/* 503/*
504 * Setup the receive and transmit "rings". These pointers are the addresses 504 * Setup the receive and transmit "rings". These pointers are the addresses
505 * of the rx and tx MAC DMA registers so they are fixed by the hardware -- 505 * of the rx and tx MAC DMA registers so they are fixed by the hardware --
506 * these are not descriptors sitting in memory. 506 * these are not descriptors sitting in memory.
507 */ 507 */
508static void 508static void
509setup_hw_rings(struct au1000_private *aup, u32 rx_base, u32 tx_base) 509setup_hw_rings(struct au1000_private *aup, u32 rx_base, u32 tx_base)
510{ 510{
511 int i; 511 int i;
512 512
513 for (i = 0; i < NUM_RX_DMA; i++) { 513 for (i = 0; i < NUM_RX_DMA; i++) {
514 aup->rx_dma_ring[i] = 514 aup->rx_dma_ring[i] =
515 (volatile rx_dma_t *) (rx_base + sizeof(rx_dma_t)*i); 515 (volatile rx_dma_t *) (rx_base + sizeof(rx_dma_t)*i);
516 } 516 }
517 for (i = 0; i < NUM_TX_DMA; i++) { 517 for (i = 0; i < NUM_TX_DMA; i++) {
518 aup->tx_dma_ring[i] = 518 aup->tx_dma_ring[i] =
519 (volatile tx_dma_t *) (tx_base + sizeof(tx_dma_t)*i); 519 (volatile tx_dma_t *) (tx_base + sizeof(tx_dma_t)*i);
520 } 520 }
521} 521}
@@ -691,7 +691,7 @@ static struct net_device * au1000_probe(int port_num)
691 /* Use the hard coded MAC addresses */ 691 /* Use the hard coded MAC addresses */
692 else { 692 else {
693 str2eaddr(ethaddr, pmac + strlen("ethaddr=")); 693 str2eaddr(ethaddr, pmac + strlen("ethaddr="));
694 memcpy(au1000_mac_addr, ethaddr, 694 memcpy(au1000_mac_addr, ethaddr,
695 sizeof(au1000_mac_addr)); 695 sizeof(au1000_mac_addr));
696 } 696 }
697 } 697 }
@@ -780,8 +780,8 @@ static struct net_device * au1000_probe(int port_num)
780 dev->tx_timeout = au1000_tx_timeout; 780 dev->tx_timeout = au1000_tx_timeout;
781 dev->watchdog_timeo = ETH_TX_TIMEOUT; 781 dev->watchdog_timeo = ETH_TX_TIMEOUT;
782 782
783 /* 783 /*
784 * The boot code uses the ethernet controller, so reset it to start 784 * The boot code uses the ethernet controller, so reset it to start
785 * fresh. au1000_init() expects that the device is in reset state. 785 * fresh. au1000_init() expects that the device is in reset state.
786 */ 786 */
787 reset_mac(dev); 787 reset_mac(dev);
@@ -810,7 +810,7 @@ err_out:
810 return NULL; 810 return NULL;
811} 811}
812 812
813/* 813/*
814 * Initialize the interface. 814 * Initialize the interface.
815 * 815 *
816 * When the device powers up, the clocks are disabled and the 816 * When the device powers up, the clocks are disabled and the
@@ -826,7 +826,7 @@ static int au1000_init(struct net_device *dev)
826 int i; 826 int i;
827 u32 control; 827 u32 control;
828 828
829 if (au1000_debug > 4) 829 if (au1000_debug > 4)
830 printk("%s: au1000_init\n", dev->name); 830 printk("%s: au1000_init\n", dev->name);
831 831
832 /* bring the device out of reset */ 832 /* bring the device out of reset */
@@ -1102,8 +1102,8 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
1102 int i; 1102 int i;
1103 1103
1104 if (au1000_debug > 5) 1104 if (au1000_debug > 5)
1105 printk("%s: tx: aup %x len=%d, data=%p, head %d\n", 1105 printk("%s: tx: aup %x len=%d, data=%p, head %d\n",
1106 dev->name, (unsigned)aup, skb->len, 1106 dev->name, (unsigned)aup, skb->len,
1107 skb->data, aup->tx_head); 1107 skb->data, aup->tx_head);
1108 1108
1109 ptxd = aup->tx_dma_ring[aup->tx_head]; 1109 ptxd = aup->tx_dma_ring[aup->tx_head];
@@ -1127,7 +1127,7 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
1127 pDB = aup->tx_db_inuse[aup->tx_head]; 1127 pDB = aup->tx_db_inuse[aup->tx_head];
1128 memcpy((void *)pDB->vaddr, skb->data, skb->len); 1128 memcpy((void *)pDB->vaddr, skb->data, skb->len);
1129 if (skb->len < ETH_ZLEN) { 1129 if (skb->len < ETH_ZLEN) {
1130 for (i=skb->len; i<ETH_ZLEN; i++) { 1130 for (i=skb->len; i<ETH_ZLEN; i++) {
1131 ((char *)pDB->vaddr)[i] = 0; 1131 ((char *)pDB->vaddr)[i] = 0;
1132 } 1132 }
1133 ptxd->len = ETH_ZLEN; 1133 ptxd->len = ETH_ZLEN;
@@ -1166,7 +1166,7 @@ static inline void update_rx_stats(struct net_device *dev, u32 status)
1166 if (status & RX_COLL) 1166 if (status & RX_COLL)
1167 ps->collisions++; 1167 ps->collisions++;
1168 } 1168 }
1169 else 1169 else
1170 ps->rx_bytes += status & RX_FRAME_LEN_MASK; 1170 ps->rx_bytes += status & RX_FRAME_LEN_MASK;
1171 1171
1172} 1172}
@@ -1215,13 +1215,13 @@ static int au1000_rx(struct net_device *dev)
1215 } 1215 }
1216 else { 1216 else {
1217 if (au1000_debug > 4) { 1217 if (au1000_debug > 4) {
1218 if (status & RX_MISSED_FRAME) 1218 if (status & RX_MISSED_FRAME)
1219 printk("rx miss\n"); 1219 printk("rx miss\n");
1220 if (status & RX_WDOG_TIMER) 1220 if (status & RX_WDOG_TIMER)
1221 printk("rx wdog\n"); 1221 printk("rx wdog\n");
1222 if (status & RX_RUNT) 1222 if (status & RX_RUNT)
1223 printk("rx runt\n"); 1223 printk("rx runt\n");
1224 if (status & RX_OVERLEN) 1224 if (status & RX_OVERLEN)
1225 printk("rx overlen\n"); 1225 printk("rx overlen\n");
1226 if (status & RX_COLL) 1226 if (status & RX_COLL)
1227 printk("rx coll\n"); 1227 printk("rx coll\n");
@@ -1287,7 +1287,7 @@ static void set_rx_mode(struct net_device *dev)
1287{ 1287{
1288 struct au1000_private *aup = (struct au1000_private *) dev->priv; 1288 struct au1000_private *aup = (struct au1000_private *) dev->priv;
1289 1289
1290 if (au1000_debug > 4) 1290 if (au1000_debug > 4)
1291 printk("%s: set_rx_mode: flags=%x\n", dev->name, dev->flags); 1291 printk("%s: set_rx_mode: flags=%x\n", dev->name, dev->flags);
1292 1292
1293 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ 1293 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
@@ -1305,7 +1305,7 @@ static void set_rx_mode(struct net_device *dev)
1305 mc_filter[1] = mc_filter[0] = 0; 1305 mc_filter[1] = mc_filter[0] = 0;
1306 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1306 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
1307 i++, mclist = mclist->next) { 1307 i++, mclist = mclist->next) {
1308 set_bit(ether_crc(ETH_ALEN, mclist->dmi_addr)>>26, 1308 set_bit(ether_crc(ETH_ALEN, mclist->dmi_addr)>>26,
1309 (long *)mc_filter); 1309 (long *)mc_filter);
1310 } 1310 }
1311 aup->mac->multi_hash_high = mc_filter[1]; 1311 aup->mac->multi_hash_high = mc_filter[1];