aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ax88796.c
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2011-02-20 11:46:18 -0500
committerMarc Kleine-Budde <mkl@pengutronix.de>2011-02-21 07:17:36 -0500
commit85ac6162c94638c7f27afa4bf63f165a6ca5e931 (patch)
tree22197015050948eb1afafbecff6f02e582fd1b1f /drivers/net/ax88796.c
parent1cbece33ff657cfc9782963d502f3c3be07c0317 (diff)
ax88796: use netdev_<LEVEL> instead of dev_<LEVEL> and pr_<LEVEL>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/ax88796.c')
-rw-r--r--drivers/net/ax88796.c46
1 files changed, 20 insertions, 26 deletions
diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c
index eac5b101beb7..1370cac6d6c0 100644
--- a/drivers/net/ax88796.c
+++ b/drivers/net/ax88796.c
@@ -143,12 +143,11 @@ static int ax_initial_check(struct net_device *dev)
143static void ax_reset_8390(struct net_device *dev) 143static void ax_reset_8390(struct net_device *dev)
144{ 144{
145 struct ei_device *ei_local = netdev_priv(dev); 145 struct ei_device *ei_local = netdev_priv(dev);
146 struct ax_device *ax = to_ax_dev(dev);
147 unsigned long reset_start_time = jiffies; 146 unsigned long reset_start_time = jiffies;
148 void __iomem *addr = (void __iomem *)dev->base_addr; 147 void __iomem *addr = (void __iomem *)dev->base_addr;
149 148
150 if (ei_debug > 1) 149 if (ei_debug > 1)
151 dev_dbg(&ax->dev->dev, "resetting the 8390 t=%ld\n", jiffies); 150 netdev_dbg(dev, "resetting the 8390 t=%ld\n", jiffies);
152 151
153 ei_outb(ei_inb(addr + NE_RESET), addr + NE_RESET); 152 ei_outb(ei_inb(addr + NE_RESET), addr + NE_RESET);
154 153
@@ -158,8 +157,7 @@ static void ax_reset_8390(struct net_device *dev)
158 /* This check _should_not_ be necessary, omit eventually. */ 157 /* This check _should_not_ be necessary, omit eventually. */
159 while ((ei_inb(addr + EN0_ISR) & ENISR_RESET) == 0) { 158 while ((ei_inb(addr + EN0_ISR) & ENISR_RESET) == 0) {
160 if (jiffies - reset_start_time > 2 * HZ / 100) { 159 if (jiffies - reset_start_time > 2 * HZ / 100) {
161 dev_warn(&ax->dev->dev, "%s: %s did not complete.\n", 160 netdev_warn(dev, "%s: did not complete.\n", __func__);
162 __func__, dev->name);
163 break; 161 break;
164 } 162 }
165 } 163 }
@@ -172,14 +170,13 @@ static void ax_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
172 int ring_page) 170 int ring_page)
173{ 171{
174 struct ei_device *ei_local = netdev_priv(dev); 172 struct ei_device *ei_local = netdev_priv(dev);
175 struct ax_device *ax = to_ax_dev(dev);
176 void __iomem *nic_base = ei_local->mem; 173 void __iomem *nic_base = ei_local->mem;
177 174
178 /* This *shouldn't* happen. If it does, it's the last thing you'll see */ 175 /* This *shouldn't* happen. If it does, it's the last thing you'll see */
179 if (ei_local->dmaing) { 176 if (ei_local->dmaing) {
180 dev_err(&ax->dev->dev, "%s: DMAing conflict in %s " 177 netdev_err(dev, "DMAing conflict in %s "
181 "[DMAstat:%d][irqlock:%d].\n", 178 "[DMAstat:%d][irqlock:%d].\n",
182 dev->name, __func__, 179 __func__,
183 ei_local->dmaing, ei_local->irqlock); 180 ei_local->dmaing, ei_local->irqlock);
184 return; 181 return;
185 } 182 }
@@ -217,15 +214,14 @@ static void ax_block_input(struct net_device *dev, int count,
217 struct sk_buff *skb, int ring_offset) 214 struct sk_buff *skb, int ring_offset)
218{ 215{
219 struct ei_device *ei_local = netdev_priv(dev); 216 struct ei_device *ei_local = netdev_priv(dev);
220 struct ax_device *ax = to_ax_dev(dev);
221 void __iomem *nic_base = ei_local->mem; 217 void __iomem *nic_base = ei_local->mem;
222 char *buf = skb->data; 218 char *buf = skb->data;
223 219
224 if (ei_local->dmaing) { 220 if (ei_local->dmaing) {
225 dev_err(&ax->dev->dev, 221 netdev_err(dev,
226 "%s: DMAing conflict in %s " 222 "DMAing conflict in %s "
227 "[DMAstat:%d][irqlock:%d].\n", 223 "[DMAstat:%d][irqlock:%d].\n",
228 dev->name, __func__, 224 __func__,
229 ei_local->dmaing, ei_local->irqlock); 225 ei_local->dmaing, ei_local->irqlock);
230 return; 226 return;
231 } 227 }
@@ -255,7 +251,6 @@ static void ax_block_output(struct net_device *dev, int count,
255 const unsigned char *buf, const int start_page) 251 const unsigned char *buf, const int start_page)
256{ 252{
257 struct ei_device *ei_local = netdev_priv(dev); 253 struct ei_device *ei_local = netdev_priv(dev);
258 struct ax_device *ax = to_ax_dev(dev);
259 void __iomem *nic_base = ei_local->mem; 254 void __iomem *nic_base = ei_local->mem;
260 unsigned long dma_start; 255 unsigned long dma_start;
261 256
@@ -269,9 +264,9 @@ static void ax_block_output(struct net_device *dev, int count,
269 264
270 /* This *shouldn't* happen. If it does, it's the last thing you'll see */ 265 /* This *shouldn't* happen. If it does, it's the last thing you'll see */
271 if (ei_local->dmaing) { 266 if (ei_local->dmaing) {
272 dev_err(&ax->dev->dev, "%s: DMAing conflict in %s." 267 netdev_err(dev, "DMAing conflict in %s."
273 "[DMAstat:%d][irqlock:%d]\n", 268 "[DMAstat:%d][irqlock:%d]\n",
274 dev->name, __func__, 269 __func__,
275 ei_local->dmaing, ei_local->irqlock); 270 ei_local->dmaing, ei_local->irqlock);
276 return; 271 return;
277 } 272 }
@@ -298,8 +293,7 @@ static void ax_block_output(struct net_device *dev, int count,
298 293
299 while ((ei_inb(nic_base + EN0_ISR) & ENISR_RDC) == 0) { 294 while ((ei_inb(nic_base + EN0_ISR) & ENISR_RDC) == 0) {
300 if (jiffies - dma_start > 2 * HZ / 100) { /* 20ms */ 295 if (jiffies - dma_start > 2 * HZ / 100) { /* 20ms */
301 dev_warn(&ax->dev->dev, 296 netdev_warn(dev, "timeout waiting for Tx RDC.\n");
302 "%s: timeout waiting for Tx RDC.\n", dev->name);
303 ax_reset_8390(dev); 297 ax_reset_8390(dev);
304 ax_NS8390_init(dev, 1); 298 ax_NS8390_init(dev, 1);
305 break; 299 break;
@@ -404,7 +398,7 @@ static void
404ax_phy_issueaddr(struct net_device *dev, int phy_addr, int reg, int opc) 398ax_phy_issueaddr(struct net_device *dev, int phy_addr, int reg, int opc)
405{ 399{
406 if (phy_debug) 400 if (phy_debug)
407 pr_debug("%s: dev %p, %04x, %04x, %d\n", 401 netdev_dbg(dev, "%s: dev %p, %04x, %04x, %d\n",
408 __func__, dev, phy_addr, reg, opc); 402 __func__, dev, phy_addr, reg, opc);
409 403
410 ax_mii_ei_outbits(dev, 0x3f, 6); /* pre-amble */ 404 ax_mii_ei_outbits(dev, 0x3f, 6); /* pre-amble */
@@ -431,7 +425,7 @@ ax_phy_read(struct net_device *dev, int phy_addr, int reg)
431 spin_unlock_irqrestore(&ei_local->page_lock, flags); 425 spin_unlock_irqrestore(&ei_local->page_lock, flags);
432 426
433 if (phy_debug) 427 if (phy_debug)
434 pr_debug("%s: %04x.%04x => read %04x\n", __func__, 428 netdev_dbg(dev, "%s: %04x.%04x => read %04x\n", __func__,
435 phy_addr, reg, result); 429 phy_addr, reg, result);
436 430
437 return result; 431 return result;
@@ -441,10 +435,9 @@ static void
441ax_phy_write(struct net_device *dev, int phy_addr, int reg, int value) 435ax_phy_write(struct net_device *dev, int phy_addr, int reg, int value)
442{ 436{
443 struct ei_device *ei = netdev_priv(dev); 437 struct ei_device *ei = netdev_priv(dev);
444 struct ax_device *ax = to_ax_dev(dev);
445 unsigned long flags; 438 unsigned long flags;
446 439
447 dev_dbg(&ax->dev->dev, "%s: %p, %04x, %04x %04x\n", 440 netdev_dbg(dev, "%s: %p, %04x, %04x %04x\n",
448 __func__, dev, phy_addr, reg, value); 441 __func__, dev, phy_addr, reg, value);
449 442
450 spin_lock_irqsave(&ei->page_lock, flags); 443 spin_lock_irqsave(&ei->page_lock, flags);
@@ -478,7 +471,7 @@ static int ax_open(struct net_device *dev)
478 struct ei_device *ei_local = netdev_priv(dev); 471 struct ei_device *ei_local = netdev_priv(dev);
479 int ret; 472 int ret;
480 473
481 dev_dbg(&ax->dev->dev, "%s: open\n", dev->name); 474 netdev_dbg(dev, "open\n");
482 475
483 ret = request_irq(dev->irq, ax_ei_interrupt, ax->irqflags, 476 ret = request_irq(dev->irq, ax_ei_interrupt, ax->irqflags,
484 dev->name, dev); 477 dev->name, dev);
@@ -514,7 +507,7 @@ static int ax_close(struct net_device *dev)
514 struct ax_device *ax = to_ax_dev(dev); 507 struct ax_device *ax = to_ax_dev(dev);
515 struct ei_device *ei_local = netdev_priv(dev); 508 struct ei_device *ei_local = netdev_priv(dev);
516 509
517 dev_dbg(&ax->dev->dev, "%s: close\n", dev->name); 510 netdev_dbg(dev, "close\n");
518 511
519 /* turn the phy off */ 512 /* turn the phy off */
520 513
@@ -785,14 +778,14 @@ static int ax_init_dev(struct net_device *dev)
785 778
786 ax_NS8390_init(dev, 0); 779 ax_NS8390_init(dev, 0);
787 780
788 dev_info(&ax->dev->dev, "%dbit, irq %d, %lx, MAC: %pM\n",
789 ei_local->word16 ? 16 : 8, dev->irq, dev->base_addr,
790 dev->dev_addr);
791
792 ret = register_netdev(dev); 781 ret = register_netdev(dev);
793 if (ret) 782 if (ret)
794 goto out_irq; 783 goto out_irq;
795 784
785 netdev_info(dev, "%dbit, irq %d, %lx, MAC: %pM\n",
786 ei_local->word16 ? 16 : 8, dev->irq, dev->base_addr,
787 dev->dev_addr);
788
796 return 0; 789 return 0;
797 790
798 out_irq: 791 out_irq:
@@ -849,6 +842,7 @@ static int ax_probe(struct platform_device *pdev)
849 return -ENOMEM; 842 return -ENOMEM;
850 843
851 /* ok, let's setup our device */ 844 /* ok, let's setup our device */
845 SET_NETDEV_DEV(dev, &pdev->dev);
852 ei_local = netdev_priv(dev); 846 ei_local = netdev_priv(dev);
853 ax = to_ax_dev(dev); 847 ax = to_ax_dev(dev);
854 848