aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mipsnet.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2007-10-22 19:35:26 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-23 20:18:13 -0400
commitf5e42fbab6c6ca39a33410a0ed0037589908c264 (patch)
treefa4e3d669036b880a7c5064ad4e6d649dae2ece1 /drivers/net/mipsnet.c
parent6cd043d99dcf5d252fcc682958541f449113f7b3 (diff)
MIPSnet: Delete all the useless debugging printks.
Plus minor formatting fixes. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/mipsnet.c')
-rw-r--r--drivers/net/mipsnet.c44
1 files changed, 4 insertions, 40 deletions
diff --git a/drivers/net/mipsnet.c b/drivers/net/mipsnet.c
index 37707a0c0498..aafc3ce59cbb 100644
--- a/drivers/net/mipsnet.c
+++ b/drivers/net/mipsnet.c
@@ -30,6 +30,7 @@ static int ioiocpy_frommipsnet(struct net_device *dev, unsigned char *kdata,
30 int len) 30 int len)
31{ 31{
32 uint32_t available_len = inl(mipsnet_reg_address(dev, rxDataCount)); 32 uint32_t available_len = inl(mipsnet_reg_address(dev, rxDataCount));
33
33 if (available_len < len) 34 if (available_len < len)
34 return -EFAULT; 35 return -EFAULT;
35 36
@@ -45,14 +46,8 @@ static inline ssize_t mipsnet_put_todevice(struct net_device *dev,
45 int count_to_go = skb->len; 46 int count_to_go = skb->len;
46 char *buf_ptr = skb->data; 47 char *buf_ptr = skb->data;
47 48
48 pr_debug("%s: %s(): telling MIPSNET txDataCount(%d)\n",
49 dev->name, __FUNCTION__, skb->len);
50
51 outl(skb->len, mipsnet_reg_address(dev, txDataCount)); 49 outl(skb->len, mipsnet_reg_address(dev, txDataCount));
52 50
53 pr_debug("%s: %s(): sending data to MIPSNET txDataBuffer(%d)\n",
54 dev->name, __FUNCTION__, skb->len);
55
56 for (; count_to_go; buf_ptr++, count_to_go--) 51 for (; count_to_go; buf_ptr++, count_to_go--)
57 outb(*buf_ptr, mipsnet_reg_address(dev, txDataBuffer)); 52 outb(*buf_ptr, mipsnet_reg_address(dev, txDataBuffer));
58 53
@@ -64,10 +59,8 @@ static inline ssize_t mipsnet_put_todevice(struct net_device *dev,
64 59
65static int mipsnet_xmit(struct sk_buff *skb, struct net_device *dev) 60static int mipsnet_xmit(struct sk_buff *skb, struct net_device *dev)
66{ 61{
67 pr_debug("%s:%s(): transmitting %d bytes\n", 62 /*
68 dev->name, __FUNCTION__, skb->len); 63 * Only one packet at a time. Once TXDONE interrupt is serviced, the
69
70 /* Only one packet at a time. Once TXDONE interrupt is serviced, the
71 * queue will be restarted. 64 * queue will be restarted.
72 */ 65 */
73 netif_stop_queue(dev); 66 netif_stop_queue(dev);
@@ -94,8 +87,6 @@ static inline ssize_t mipsnet_get_fromdev(struct net_device *dev, size_t count)
94 skb->protocol = eth_type_trans(skb, dev); 87 skb->protocol = eth_type_trans(skb, dev);
95 skb->ip_summed = CHECKSUM_UNNECESSARY; 88 skb->ip_summed = CHECKSUM_UNNECESSARY;
96 89
97 pr_debug("%s:%s(): pushing RXed data to kernel\n",
98 dev->name, __FUNCTION__);
99 netif_rx(skb); 90 netif_rx(skb);
100 91
101 dev->stats.rx_packets++; 92 dev->stats.rx_packets++;
@@ -112,44 +103,29 @@ static irqreturn_t mipsnet_interrupt(int irq, void *dev_id)
112 uint64_t interruptFlags; 103 uint64_t interruptFlags;
113 104
114 if (irq == dev->irq) { 105 if (irq == dev->irq) {
115 pr_debug("%s:%s(): irq %d for device\n",
116 dev->name, __FUNCTION__, irq);
117
118 retval = IRQ_HANDLED; 106 retval = IRQ_HANDLED;
119 107
120 interruptFlags = 108 interruptFlags =
121 inl(mipsnet_reg_address(dev, interruptControl)); 109 inl(mipsnet_reg_address(dev, interruptControl));
122 pr_debug("%s:%s(): intCtl=0x%016llx\n", dev->name,
123 __FUNCTION__, interruptFlags);
124 110
125 if (interruptFlags & MIPSNET_INTCTL_TXDONE) { 111 if (interruptFlags & MIPSNET_INTCTL_TXDONE) {
126 pr_debug("%s:%s(): got TXDone\n",
127 dev->name, __FUNCTION__);
128 outl(MIPSNET_INTCTL_TXDONE, 112 outl(MIPSNET_INTCTL_TXDONE,
129 mipsnet_reg_address(dev, interruptControl)); 113 mipsnet_reg_address(dev, interruptControl));
130 /* only one packet at a time, we are done. */ 114 /* only one packet at a time, we are done. */
131 netif_wake_queue(dev); 115 netif_wake_queue(dev);
132 } else if (interruptFlags & MIPSNET_INTCTL_RXDONE) { 116 } else if (interruptFlags & MIPSNET_INTCTL_RXDONE) {
133 pr_debug("%s:%s(): got RX data\n",
134 dev->name, __FUNCTION__);
135 mipsnet_get_fromdev(dev, 117 mipsnet_get_fromdev(dev,
136 inl(mipsnet_reg_address(dev, rxDataCount))); 118 inl(mipsnet_reg_address(dev, rxDataCount)));
137 pr_debug("%s:%s(): clearing RX int\n",
138 dev->name, __FUNCTION__);
139 outl(MIPSNET_INTCTL_RXDONE, 119 outl(MIPSNET_INTCTL_RXDONE,
140 mipsnet_reg_address(dev, interruptControl)); 120 mipsnet_reg_address(dev, interruptControl));
141 121
142 } else if (interruptFlags & MIPSNET_INTCTL_TESTBIT) { 122 } else if (interruptFlags & MIPSNET_INTCTL_TESTBIT) {
143 pr_debug("%s:%s(): got test interrupt\n",
144 dev->name, __FUNCTION__);
145 /* 123 /*
146 * TESTBIT is cleared on read. 124 * TESTBIT is cleared on read.
147 * And takes effect after a write with 0 125 * And takes effect after a write with 0
148 */ 126 */
149 outl(0, mipsnet_reg_address(dev, interruptControl)); 127 outl(0, mipsnet_reg_address(dev, interruptControl));
150 } else { 128 } else {
151 pr_debug("%s:%s(): no valid fags 0x%016llx\n",
152 dev->name, __FUNCTION__, interruptFlags);
153 /* Maybe shared IRQ, just ignore, no clearing. */ 129 /* Maybe shared IRQ, just ignore, no clearing. */
154 retval = IRQ_NONE; 130 retval = IRQ_NONE;
155 } 131 }
@@ -165,22 +141,15 @@ static irqreturn_t mipsnet_interrupt(int irq, void *dev_id)
165static int mipsnet_open(struct net_device *dev) 141static int mipsnet_open(struct net_device *dev)
166{ 142{
167 int err; 143 int err;
168 pr_debug("%s: mipsnet_open\n", dev->name);
169 144
170 err = request_irq(dev->irq, &mipsnet_interrupt, 145 err = request_irq(dev->irq, &mipsnet_interrupt,
171 IRQF_SHARED, dev->name, (void *) dev); 146 IRQF_SHARED, dev->name, (void *) dev);
172 147
173 if (err) { 148 if (err) {
174 pr_debug("%s: %s(): can't get irq %d\n",
175 dev->name, __FUNCTION__, dev->irq);
176 release_region(dev->base_addr, MIPSNET_IO_EXTENT); 149 release_region(dev->base_addr, MIPSNET_IO_EXTENT);
177 return err; 150 return err;
178 } 151 }
179 152
180 pr_debug("%s: %s(): got IO region at 0x%04lx and irq %d for dev.\n",
181 dev->name, __FUNCTION__, dev->base_addr, dev->irq);
182
183
184 netif_start_queue(dev); 153 netif_start_queue(dev);
185 154
186 /* test interrupt handler */ 155 /* test interrupt handler */
@@ -193,8 +162,8 @@ static int mipsnet_open(struct net_device *dev)
193 162
194static int mipsnet_close(struct net_device *dev) 163static int mipsnet_close(struct net_device *dev)
195{ 164{
196 pr_debug("%s: %s()\n", dev->name, __FUNCTION__);
197 netif_stop_queue(dev); 165 netif_stop_queue(dev);
166
198 return 0; 167 return 0;
199} 168}
200 169
@@ -229,9 +198,6 @@ static int __init mipsnet_probe(struct device *dev)
229 198
230 /* Get the io region now, get irq on open() */ 199 /* Get the io region now, get irq on open() */
231 if (!request_region(netdev->base_addr, MIPSNET_IO_EXTENT, "mipsnet")) { 200 if (!request_region(netdev->base_addr, MIPSNET_IO_EXTENT, "mipsnet")) {
232 pr_debug("%s: %s(): IO region {start: 0x%04lux, len: %d} "
233 "for dev is not availble.\n", netdev->name,
234 __FUNCTION__, netdev->base_addr, MIPSNET_IO_EXTENT);
235 err = -EBUSY; 201 err = -EBUSY;
236 goto out_free_netdev; 202 goto out_free_netdev;
237 } 203 }
@@ -295,8 +261,6 @@ static int __init mipsnet_init_module(void)
295 261
296static void __exit mipsnet_exit_module(void) 262static void __exit mipsnet_exit_module(void)
297{ 263{
298 pr_debug("MIPSNet Ethernet driver exiting\n");
299
300 driver_unregister(&mipsnet_driver); 264 driver_unregister(&mipsnet_driver);
301} 265}
302 266