aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-06-26 15:01:28 -0400
committerDavid S. Miller <davem@davemloft.net>2011-06-27 03:09:46 -0400
commit12a3bfefc8c1e43ddb50950cb74f8a11d680567a (patch)
treeff974d28811618a51ab8dcbef1588a1022cb9c74 /drivers/net
parent2903dd654d8788425a9523959b02933ea6555229 (diff)
generic_hdlc: Update to current logging forms
Use pr_fmt, pr_<level> and netdev_<level> as appropriate. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wan/c101.c30
-rw-r--r--drivers/net/wan/hd64570.c8
-rw-r--r--drivers/net/wan/hd64572.c8
-rw-r--r--drivers/net/wan/hdlc.c16
-rw-r--r--drivers/net/wan/hdlc_cisco.c21
-rw-r--r--drivers/net/wan/hdlc_fr.c96
-rw-r--r--drivers/net/wan/hdlc_ppp.c9
-rw-r--r--drivers/net/wan/hdlc_x25.c12
-rw-r--r--drivers/net/wan/n2.c42
-rw-r--r--drivers/net/wan/pc300too.c36
-rw-r--r--drivers/net/wan/pci200syn.c29
-rw-r--r--drivers/net/wan/wanxl.c90
12 files changed, 186 insertions, 211 deletions
diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c
index 4ac85a09c5a6..54f995f4a5a3 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -14,6 +14,8 @@
14 * Moxa C101 User's Manual 14 * Moxa C101 User's Manual
15 */ 15 */
16 16
17#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
18
17#include <linux/module.h> 19#include <linux/module.h>
18#include <linux/kernel.h> 20#include <linux/kernel.h>
19#include <linux/capability.h> 21#include <linux/capability.h>
@@ -313,44 +315,44 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
313 int result; 315 int result;
314 316
315 if (irq<3 || irq>15 || irq == 6) /* FIXME */ { 317 if (irq<3 || irq>15 || irq == 6) /* FIXME */ {
316 printk(KERN_ERR "c101: invalid IRQ value\n"); 318 pr_err("invalid IRQ value\n");
317 return -ENODEV; 319 return -ENODEV;
318 } 320 }
319 321
320 if (winbase < 0xC0000 || winbase > 0xDFFFF || (winbase & 0x3FFF) !=0) { 322 if (winbase < 0xC0000 || winbase > 0xDFFFF || (winbase & 0x3FFF) !=0) {
321 printk(KERN_ERR "c101: invalid RAM value\n"); 323 pr_err("invalid RAM value\n");
322 return -ENODEV; 324 return -ENODEV;
323 } 325 }
324 326
325 card = kzalloc(sizeof(card_t), GFP_KERNEL); 327 card = kzalloc(sizeof(card_t), GFP_KERNEL);
326 if (card == NULL) { 328 if (card == NULL) {
327 printk(KERN_ERR "c101: unable to allocate memory\n"); 329 pr_err("unable to allocate memory\n");
328 return -ENOBUFS; 330 return -ENOBUFS;
329 } 331 }
330 332
331 card->dev = alloc_hdlcdev(card); 333 card->dev = alloc_hdlcdev(card);
332 if (!card->dev) { 334 if (!card->dev) {
333 printk(KERN_ERR "c101: unable to allocate memory\n"); 335 pr_err("unable to allocate memory\n");
334 kfree(card); 336 kfree(card);
335 return -ENOBUFS; 337 return -ENOBUFS;
336 } 338 }
337 339
338 if (request_irq(irq, sca_intr, 0, devname, card)) { 340 if (request_irq(irq, sca_intr, 0, devname, card)) {
339 printk(KERN_ERR "c101: could not allocate IRQ\n"); 341 pr_err("could not allocate IRQ\n");
340 c101_destroy_card(card); 342 c101_destroy_card(card);
341 return -EBUSY; 343 return -EBUSY;
342 } 344 }
343 card->irq = irq; 345 card->irq = irq;
344 346
345 if (!request_mem_region(winbase, C101_MAPPED_RAM_SIZE, devname)) { 347 if (!request_mem_region(winbase, C101_MAPPED_RAM_SIZE, devname)) {
346 printk(KERN_ERR "c101: could not request RAM window\n"); 348 pr_err("could not request RAM window\n");
347 c101_destroy_card(card); 349 c101_destroy_card(card);
348 return -EBUSY; 350 return -EBUSY;
349 } 351 }
350 card->phy_winbase = winbase; 352 card->phy_winbase = winbase;
351 card->win0base = ioremap(winbase, C101_MAPPED_RAM_SIZE); 353 card->win0base = ioremap(winbase, C101_MAPPED_RAM_SIZE);
352 if (!card->win0base) { 354 if (!card->win0base) {
353 printk(KERN_ERR "c101: could not map I/O address\n"); 355 pr_err("could not map I/O address\n");
354 c101_destroy_card(card); 356 c101_destroy_card(card);
355 return -EFAULT; 357 return -EFAULT;
356 } 358 }
@@ -381,7 +383,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
381 383
382 result = register_hdlc_device(dev); 384 result = register_hdlc_device(dev);
383 if (result) { 385 if (result) {
384 printk(KERN_WARNING "c101: unable to register hdlc device\n"); 386 pr_warn("unable to register hdlc device\n");
385 c101_destroy_card(card); 387 c101_destroy_card(card);
386 return result; 388 return result;
387 } 389 }
@@ -389,10 +391,8 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
389 sca_init_port(card); /* Set up C101 memory */ 391 sca_init_port(card); /* Set up C101 memory */
390 set_carrier(card); 392 set_carrier(card);
391 393
392 printk(KERN_INFO "%s: Moxa C101 on IRQ%u," 394 netdev_info(dev, "Moxa C101 on IRQ%u, using %u TX + %u RX packets rings\n",
393 " using %u TX + %u RX packets rings\n", 395 card->irq, card->tx_ring_buffers, card->rx_ring_buffers);
394 dev->name, card->irq,
395 card->tx_ring_buffers, card->rx_ring_buffers);
396 396
397 *new_card = card; 397 *new_card = card;
398 new_card = &card->next_card; 398 new_card = &card->next_card;
@@ -405,12 +405,12 @@ static int __init c101_init(void)
405{ 405{
406 if (hw == NULL) { 406 if (hw == NULL) {
407#ifdef MODULE 407#ifdef MODULE
408 printk(KERN_INFO "c101: no card initialized\n"); 408 pr_info("no card initialized\n");
409#endif 409#endif
410 return -EINVAL; /* no parameters specified, abort */ 410 return -EINVAL; /* no parameters specified, abort */
411 } 411 }
412 412
413 printk(KERN_INFO "%s\n", version); 413 pr_info("%s\n", version);
414 414
415 do { 415 do {
416 unsigned long irq, ram; 416 unsigned long irq, ram;
@@ -428,7 +428,7 @@ static int __init c101_init(void)
428 return first_card ? 0 : -EINVAL; 428 return first_card ? 0 : -EINVAL;
429 }while(*hw++ == ':'); 429 }while(*hw++ == ':');
430 430
431 printk(KERN_ERR "c101: invalid hardware parameters\n"); 431 pr_err("invalid hardware parameters\n");
432 return first_card ? 0 : -EINVAL; 432 return first_card ? 0 : -EINVAL;
433} 433}
434 434
diff --git a/drivers/net/wan/hd64570.c b/drivers/net/wan/hd64570.c
index a3ea27ce04f2..33b67d88fceb 100644
--- a/drivers/net/wan/hd64570.c
+++ b/drivers/net/wan/hd64570.c
@@ -582,8 +582,8 @@ static void sca_dump_rings(struct net_device *dev)
582 sca_in(DSR_RX(phy_node(port)), card), port->rxin, 582 sca_in(DSR_RX(phy_node(port)), card), port->rxin,
583 sca_in(DSR_RX(phy_node(port)), card) & DSR_DE ? "" : "in"); 583 sca_in(DSR_RX(phy_node(port)), card) & DSR_DE ? "" : "in");
584 for (cnt = 0; cnt < port_to_card(port)->rx_ring_buffers; cnt++) 584 for (cnt = 0; cnt < port_to_card(port)->rx_ring_buffers; cnt++)
585 printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); 585 pr_cont(" %02X", readb(&(desc_address(port, cnt, 0)->stat)));
586 printk(KERN_CONT "\n"); 586 pr_cont("\n");
587 587
588 printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " 588 printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u "
589 "last=%u %sactive", 589 "last=%u %sactive",
@@ -593,8 +593,8 @@ static void sca_dump_rings(struct net_device *dev)
593 sca_in(DSR_TX(phy_node(port)), card) & DSR_DE ? "" : "in"); 593 sca_in(DSR_TX(phy_node(port)), card) & DSR_DE ? "" : "in");
594 594
595 for (cnt = 0; cnt < port_to_card(port)->tx_ring_buffers; cnt++) 595 for (cnt = 0; cnt < port_to_card(port)->tx_ring_buffers; cnt++)
596 printk(" %02X", readb(&(desc_address(port, cnt, 1)->stat))); 596 pr_cont(" %02X", readb(&(desc_address(port, cnt, 1)->stat)));
597 printk("\n"); 597 pr_cont("\n");
598 598
599 printk(KERN_DEBUG "MSCI: MD: %02x %02x %02x, ST: %02x %02x %02x %02x," 599 printk(KERN_DEBUG "MSCI: MD: %02x %02x %02x, ST: %02x %02x %02x %02x,"
600 " FST: %02x CST: %02x %02x\n", 600 " FST: %02x CST: %02x %02x\n",
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c
index e305274f83fb..efc0db101183 100644
--- a/drivers/net/wan/hd64572.c
+++ b/drivers/net/wan/hd64572.c
@@ -530,8 +530,8 @@ static void sca_dump_rings(struct net_device *dev)
530 sca_in(DSR_RX(port->chan), card), port->rxin, 530 sca_in(DSR_RX(port->chan), card), port->rxin,
531 sca_in(DSR_RX(port->chan), card) & DSR_DE ? "" : "in"); 531 sca_in(DSR_RX(port->chan), card) & DSR_DE ? "" : "in");
532 for (cnt = 0; cnt < port->card->rx_ring_buffers; cnt++) 532 for (cnt = 0; cnt < port->card->rx_ring_buffers; cnt++)
533 printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); 533 pr_cont(" %02X", readb(&(desc_address(port, cnt, 0)->stat)));
534 printk(KERN_CONT "\n"); 534 pr_cont("\n");
535 535
536 printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " 536 printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u "
537 "last=%u %sactive", 537 "last=%u %sactive",
@@ -541,8 +541,8 @@ static void sca_dump_rings(struct net_device *dev)
541 sca_in(DSR_TX(port->chan), card) & DSR_DE ? "" : "in"); 541 sca_in(DSR_TX(port->chan), card) & DSR_DE ? "" : "in");
542 542
543 for (cnt = 0; cnt < port->card->tx_ring_buffers; cnt++) 543 for (cnt = 0; cnt < port->card->tx_ring_buffers; cnt++)
544 printk(" %02X", readb(&(desc_address(port, cnt, 1)->stat))); 544 pr_cont(" %02X", readb(&(desc_address(port, cnt, 1)->stat)));
545 printk("\n"); 545 pr_cont("\n");
546 546
547 printk(KERN_DEBUG "MSCI: MD: %02x %02x %02x," 547 printk(KERN_DEBUG "MSCI: MD: %02x %02x %02x,"
548 " ST: %02x %02x %02x %02x %02x, FST: %02x CST: %02x %02x\n", 548 " ST: %02x %02x %02x %02x %02x, FST: %02x CST: %02x %02x\n",
diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c
index 5d4bb615ccce..10cc7df95498 100644
--- a/drivers/net/wan/hdlc.c
+++ b/drivers/net/wan/hdlc.c
@@ -22,6 +22,8 @@
22 * - proto->start() and stop() are called with spin_lock_irq held. 22 * - proto->start() and stop() are called with spin_lock_irq held.
23 */ 23 */
24 24
25#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
26
25#include <linux/errno.h> 27#include <linux/errno.h>
26#include <linux/hdlc.h> 28#include <linux/hdlc.h>
27#include <linux/if_arp.h> 29#include <linux/if_arp.h>
@@ -130,10 +132,10 @@ static int hdlc_device_event(struct notifier_block *this, unsigned long event,
130 goto carrier_exit; 132 goto carrier_exit;
131 133
132 if (hdlc->carrier) { 134 if (hdlc->carrier) {
133 printk(KERN_INFO "%s: Carrier detected\n", dev->name); 135 netdev_info(dev, "Carrier detected\n");
134 hdlc_proto_start(dev); 136 hdlc_proto_start(dev);
135 } else { 137 } else {
136 printk(KERN_INFO "%s: Carrier lost\n", dev->name); 138 netdev_info(dev, "Carrier lost\n");
137 hdlc_proto_stop(dev); 139 hdlc_proto_stop(dev);
138 } 140 }
139 141
@@ -165,10 +167,10 @@ int hdlc_open(struct net_device *dev)
165 spin_lock_irq(&hdlc->state_lock); 167 spin_lock_irq(&hdlc->state_lock);
166 168
167 if (hdlc->carrier) { 169 if (hdlc->carrier) {
168 printk(KERN_INFO "%s: Carrier detected\n", dev->name); 170 netdev_info(dev, "Carrier detected\n");
169 hdlc_proto_start(dev); 171 hdlc_proto_start(dev);
170 } else 172 } else
171 printk(KERN_INFO "%s: No carrier\n", dev->name); 173 netdev_info(dev, "No carrier\n");
172 174
173 hdlc->open = 1; 175 hdlc->open = 1;
174 176
@@ -281,8 +283,8 @@ int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,
281 if (size) 283 if (size)
282 if ((dev_to_hdlc(dev)->state = kmalloc(size, 284 if ((dev_to_hdlc(dev)->state = kmalloc(size,
283 GFP_KERNEL)) == NULL) { 285 GFP_KERNEL)) == NULL) {
284 printk(KERN_WARNING "Memory squeeze on" 286 netdev_warn(dev,
285 " hdlc_proto_attach()\n"); 287 "Memory squeeze on hdlc_proto_attach()\n");
286 module_put(proto->module); 288 module_put(proto->module);
287 return -ENOBUFS; 289 return -ENOBUFS;
288 } 290 }
@@ -363,7 +365,7 @@ static int __init hdlc_module_init(void)
363{ 365{
364 int result; 366 int result;
365 367
366 printk(KERN_INFO "%s\n", version); 368 pr_info("%s\n", version);
367 if ((result = register_netdevice_notifier(&hdlc_notifier)) != 0) 369 if ((result = register_netdevice_notifier(&hdlc_notifier)) != 0)
368 return result; 370 return result;
369 dev_add_pack(&hdlc_packet_type); 371 dev_add_pack(&hdlc_packet_type);
diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c
index b1e5e5b69c2a..3f20808b5ff8 100644
--- a/drivers/net/wan/hdlc_cisco.c
+++ b/drivers/net/wan/hdlc_cisco.c
@@ -103,9 +103,7 @@ static void cisco_keepalive_send(struct net_device *dev, u32 type,
103 skb = dev_alloc_skb(sizeof(struct hdlc_header) + 103 skb = dev_alloc_skb(sizeof(struct hdlc_header) +
104 sizeof(struct cisco_packet)); 104 sizeof(struct cisco_packet));
105 if (!skb) { 105 if (!skb) {
106 printk(KERN_WARNING 106 netdev_warn(dev, "Memory squeeze on cisco_keepalive_send()\n");
107 "%s: Memory squeeze on cisco_keepalive_send()\n",
108 dev->name);
109 return; 107 return;
110 } 108 }
111 skb_reserve(skb, 4); 109 skb_reserve(skb, 4);
@@ -181,8 +179,8 @@ static int cisco_rx(struct sk_buff *skb)
181 CISCO_PACKET_LEN) && 179 CISCO_PACKET_LEN) &&
182 (skb->len != sizeof(struct hdlc_header) + 180 (skb->len != sizeof(struct hdlc_header) +
183 CISCO_BIG_PACKET_LEN)) { 181 CISCO_BIG_PACKET_LEN)) {
184 printk(KERN_INFO "%s: Invalid length of Cisco control" 182 netdev_info(dev, "Invalid length of Cisco control packet (%d bytes)\n",
185 " packet (%d bytes)\n", dev->name, skb->len); 183 skb->len);
186 goto rx_error; 184 goto rx_error;
187 } 185 }
188 186
@@ -217,8 +215,7 @@ static int cisco_rx(struct sk_buff *skb)
217 return NET_RX_SUCCESS; 215 return NET_RX_SUCCESS;
218 216
219 case CISCO_ADDR_REPLY: 217 case CISCO_ADDR_REPLY:
220 printk(KERN_INFO "%s: Unexpected Cisco IP address " 218 netdev_info(dev, "Unexpected Cisco IP address reply\n");
221 "reply\n", dev->name);
222 goto rx_error; 219 goto rx_error;
223 220
224 case CISCO_KEEPALIVE_REQ: 221 case CISCO_KEEPALIVE_REQ:
@@ -235,9 +232,8 @@ static int cisco_rx(struct sk_buff *skb)
235 min = sec / 60; sec -= min * 60; 232 min = sec / 60; sec -= min * 60;
236 hrs = min / 60; min -= hrs * 60; 233 hrs = min / 60; min -= hrs * 60;
237 days = hrs / 24; hrs -= days * 24; 234 days = hrs / 24; hrs -= days * 24;
238 printk(KERN_INFO "%s: Link up (peer " 235 netdev_info(dev, "Link up (peer uptime %ud%uh%um%us)\n",
239 "uptime %ud%uh%um%us)\n", 236 days, hrs, min, sec);
240 dev->name, days, hrs, min, sec);
241 netif_dormant_off(dev); 237 netif_dormant_off(dev);
242 st->up = 1; 238 st->up = 1;
243 } 239 }
@@ -249,8 +245,7 @@ static int cisco_rx(struct sk_buff *skb)
249 } /* switch (keepalive type) */ 245 } /* switch (keepalive type) */
250 } /* switch (protocol) */ 246 } /* switch (protocol) */
251 247
252 printk(KERN_INFO "%s: Unsupported protocol %x\n", dev->name, 248 netdev_info(dev, "Unsupported protocol %x\n", ntohs(data->protocol));
253 ntohs(data->protocol));
254 dev_kfree_skb_any(skb); 249 dev_kfree_skb_any(skb);
255 return NET_RX_DROP; 250 return NET_RX_DROP;
256 251
@@ -272,7 +267,7 @@ static void cisco_timer(unsigned long arg)
272 if (st->up && 267 if (st->up &&
273 time_after(jiffies, st->last_poll + st->settings.timeout * HZ)) { 268 time_after(jiffies, st->last_poll + st->settings.timeout * HZ)) {
274 st->up = 0; 269 st->up = 0;
275 printk(KERN_INFO "%s: Link down\n", dev->name); 270 netdev_info(dev, "Link down\n");
276 netif_dormant_on(dev); 271 netif_dormant_on(dev);
277 } 272 }
278 273
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index fc433f28c047..b25c9229a6a9 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -446,15 +446,14 @@ static netdev_tx_t pvc_xmit(struct sk_buff *skb, struct net_device *dev)
446 446
447static inline void fr_log_dlci_active(pvc_device *pvc) 447static inline void fr_log_dlci_active(pvc_device *pvc)
448{ 448{
449 printk(KERN_INFO "%s: DLCI %d [%s%s%s]%s %s\n", 449 netdev_info(pvc->frad, "DLCI %d [%s%s%s]%s %s\n",
450 pvc->frad->name, 450 pvc->dlci,
451 pvc->dlci, 451 pvc->main ? pvc->main->name : "",
452 pvc->main ? pvc->main->name : "", 452 pvc->main && pvc->ether ? " " : "",
453 pvc->main && pvc->ether ? " " : "", 453 pvc->ether ? pvc->ether->name : "",
454 pvc->ether ? pvc->ether->name : "", 454 pvc->state.new ? " new" : "",
455 pvc->state.new ? " new" : "", 455 !pvc->state.exist ? "deleted" :
456 !pvc->state.exist ? "deleted" : 456 pvc->state.active ? "active" : "inactive");
457 pvc->state.active ? "active" : "inactive");
458} 457}
459 458
460 459
@@ -481,16 +480,14 @@ static void fr_lmi_send(struct net_device *dev, int fullrep)
481 if (dce && fullrep) { 480 if (dce && fullrep) {
482 len += state(hdlc)->dce_pvc_count * (2 + stat_len); 481 len += state(hdlc)->dce_pvc_count * (2 + stat_len);
483 if (len > HDLC_MAX_MRU) { 482 if (len > HDLC_MAX_MRU) {
484 printk(KERN_WARNING "%s: Too many PVCs while sending " 483 netdev_warn(dev, "Too many PVCs while sending LMI full report\n");
485 "LMI full report\n", dev->name);
486 return; 484 return;
487 } 485 }
488 } 486 }
489 487
490 skb = dev_alloc_skb(len); 488 skb = dev_alloc_skb(len);
491 if (!skb) { 489 if (!skb) {
492 printk(KERN_WARNING "%s: Memory squeeze on fr_lmi_send()\n", 490 netdev_warn(dev, "Memory squeeze on fr_lmi_send()\n");
493 dev->name);
494 return; 491 return;
495 } 492 }
496 memset(skb->data, 0, len); 493 memset(skb->data, 0, len);
@@ -615,8 +612,7 @@ static void fr_timer(unsigned long arg)
615 state(hdlc)->last_errors <<= 1; /* Shift the list */ 612 state(hdlc)->last_errors <<= 1; /* Shift the list */
616 if (state(hdlc)->request) { 613 if (state(hdlc)->request) {
617 if (state(hdlc)->reliable) 614 if (state(hdlc)->reliable)
618 printk(KERN_INFO "%s: No LMI status reply " 615 netdev_info(dev, "No LMI status reply received\n");
619 "received\n", dev->name);
620 state(hdlc)->last_errors |= 1; 616 state(hdlc)->last_errors |= 1;
621 } 617 }
622 618
@@ -628,8 +624,7 @@ static void fr_timer(unsigned long arg)
628 } 624 }
629 625
630 if (state(hdlc)->reliable != reliable) { 626 if (state(hdlc)->reliable != reliable) {
631 printk(KERN_INFO "%s: Link %sreliable\n", dev->name, 627 netdev_info(dev, "Link %sreliable\n", reliable ? "" : "un");
632 reliable ? "" : "un");
633 fr_set_link_state(reliable, dev); 628 fr_set_link_state(reliable, dev);
634 } 629 }
635 630
@@ -665,33 +660,32 @@ static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
665 660
666 if (skb->len < (lmi == LMI_ANSI ? LMI_ANSI_LENGTH : 661 if (skb->len < (lmi == LMI_ANSI ? LMI_ANSI_LENGTH :
667 LMI_CCITT_CISCO_LENGTH)) { 662 LMI_CCITT_CISCO_LENGTH)) {
668 printk(KERN_INFO "%s: Short LMI frame\n", dev->name); 663 netdev_info(dev, "Short LMI frame\n");
669 return 1; 664 return 1;
670 } 665 }
671 666
672 if (skb->data[3] != (lmi == LMI_CISCO ? NLPID_CISCO_LMI : 667 if (skb->data[3] != (lmi == LMI_CISCO ? NLPID_CISCO_LMI :
673 NLPID_CCITT_ANSI_LMI)) { 668 NLPID_CCITT_ANSI_LMI)) {
674 printk(KERN_INFO "%s: Received non-LMI frame with LMI DLCI\n", 669 netdev_info(dev, "Received non-LMI frame with LMI DLCI\n");
675 dev->name);
676 return 1; 670 return 1;
677 } 671 }
678 672
679 if (skb->data[4] != LMI_CALLREF) { 673 if (skb->data[4] != LMI_CALLREF) {
680 printk(KERN_INFO "%s: Invalid LMI Call reference (0x%02X)\n", 674 netdev_info(dev, "Invalid LMI Call reference (0x%02X)\n",
681 dev->name, skb->data[4]); 675 skb->data[4]);
682 return 1; 676 return 1;
683 } 677 }
684 678
685 if (skb->data[5] != (dce ? LMI_STATUS_ENQUIRY : LMI_STATUS)) { 679 if (skb->data[5] != (dce ? LMI_STATUS_ENQUIRY : LMI_STATUS)) {
686 printk(KERN_INFO "%s: Invalid LMI Message type (0x%02X)\n", 680 netdev_info(dev, "Invalid LMI Message type (0x%02X)\n",
687 dev->name, skb->data[5]); 681 skb->data[5]);
688 return 1; 682 return 1;
689 } 683 }
690 684
691 if (lmi == LMI_ANSI) { 685 if (lmi == LMI_ANSI) {
692 if (skb->data[6] != LMI_ANSI_LOCKSHIFT) { 686 if (skb->data[6] != LMI_ANSI_LOCKSHIFT) {
693 printk(KERN_INFO "%s: Not ANSI locking shift in LMI" 687 netdev_info(dev, "Not ANSI locking shift in LMI message (0x%02X)\n",
694 " message (0x%02X)\n", dev->name, skb->data[6]); 688 skb->data[6]);
695 return 1; 689 return 1;
696 } 690 }
697 i = 7; 691 i = 7;
@@ -700,34 +694,34 @@ static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
700 694
701 if (skb->data[i] != (lmi == LMI_CCITT ? LMI_CCITT_REPTYPE : 695 if (skb->data[i] != (lmi == LMI_CCITT ? LMI_CCITT_REPTYPE :
702 LMI_ANSI_CISCO_REPTYPE)) { 696 LMI_ANSI_CISCO_REPTYPE)) {
703 printk(KERN_INFO "%s: Not an LMI Report type IE (0x%02X)\n", 697 netdev_info(dev, "Not an LMI Report type IE (0x%02X)\n",
704 dev->name, skb->data[i]); 698 skb->data[i]);
705 return 1; 699 return 1;
706 } 700 }
707 701
708 if (skb->data[++i] != LMI_REPT_LEN) { 702 if (skb->data[++i] != LMI_REPT_LEN) {
709 printk(KERN_INFO "%s: Invalid LMI Report type IE length" 703 netdev_info(dev, "Invalid LMI Report type IE length (%u)\n",
710 " (%u)\n", dev->name, skb->data[i]); 704 skb->data[i]);
711 return 1; 705 return 1;
712 } 706 }
713 707
714 reptype = skb->data[++i]; 708 reptype = skb->data[++i];
715 if (reptype != LMI_INTEGRITY && reptype != LMI_FULLREP) { 709 if (reptype != LMI_INTEGRITY && reptype != LMI_FULLREP) {
716 printk(KERN_INFO "%s: Unsupported LMI Report type (0x%02X)\n", 710 netdev_info(dev, "Unsupported LMI Report type (0x%02X)\n",
717 dev->name, reptype); 711 reptype);
718 return 1; 712 return 1;
719 } 713 }
720 714
721 if (skb->data[++i] != (lmi == LMI_CCITT ? LMI_CCITT_ALIVE : 715 if (skb->data[++i] != (lmi == LMI_CCITT ? LMI_CCITT_ALIVE :
722 LMI_ANSI_CISCO_ALIVE)) { 716 LMI_ANSI_CISCO_ALIVE)) {
723 printk(KERN_INFO "%s: Not an LMI Link integrity verification" 717 netdev_info(dev, "Not an LMI Link integrity verification IE (0x%02X)\n",
724 " IE (0x%02X)\n", dev->name, skb->data[i]); 718 skb->data[i]);
725 return 1; 719 return 1;
726 } 720 }
727 721
728 if (skb->data[++i] != LMI_INTEG_LEN) { 722 if (skb->data[++i] != LMI_INTEG_LEN) {
729 printk(KERN_INFO "%s: Invalid LMI Link integrity verification" 723 netdev_info(dev, "Invalid LMI Link integrity verification IE length (%u)\n",
730 " IE length (%u)\n", dev->name, skb->data[i]); 724 skb->data[i]);
731 return 1; 725 return 1;
732 } 726 }
733 i++; 727 i++;
@@ -801,14 +795,14 @@ static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
801 795
802 if (skb->data[i] != (lmi == LMI_CCITT ? LMI_CCITT_PVCSTAT : 796 if (skb->data[i] != (lmi == LMI_CCITT ? LMI_CCITT_PVCSTAT :
803 LMI_ANSI_CISCO_PVCSTAT)) { 797 LMI_ANSI_CISCO_PVCSTAT)) {
804 printk(KERN_INFO "%s: Not an LMI PVC status IE" 798 netdev_info(dev, "Not an LMI PVC status IE (0x%02X)\n",
805 " (0x%02X)\n", dev->name, skb->data[i]); 799 skb->data[i]);
806 return 1; 800 return 1;
807 } 801 }
808 802
809 if (skb->data[++i] != stat_len) { 803 if (skb->data[++i] != stat_len) {
810 printk(KERN_INFO "%s: Invalid LMI PVC status IE length" 804 netdev_info(dev, "Invalid LMI PVC status IE length (%u)\n",
811 " (%u)\n", dev->name, skb->data[i]); 805 skb->data[i]);
812 return 1; 806 return 1;
813 } 807 }
814 i++; 808 i++;
@@ -829,9 +823,7 @@ static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
829 pvc = add_pvc(dev, dlci); 823 pvc = add_pvc(dev, dlci);
830 824
831 if (!pvc && !no_ram) { 825 if (!pvc && !no_ram) {
832 printk(KERN_WARNING 826 netdev_warn(dev, "Memory squeeze on fr_lmi_recv()\n");
833 "%s: Memory squeeze on fr_lmi_recv()\n",
834 dev->name);
835 no_ram = 1; 827 no_ram = 1;
836 } 828 }
837 829
@@ -902,8 +894,8 @@ static int fr_rx(struct sk_buff *skb)
902 pvc = find_pvc(hdlc, dlci); 894 pvc = find_pvc(hdlc, dlci);
903 if (!pvc) { 895 if (!pvc) {
904#ifdef DEBUG_PKT 896#ifdef DEBUG_PKT
905 printk(KERN_INFO "%s: No PVC for received frame's DLCI %d\n", 897 netdev_info(frad, "No PVC for received frame's DLCI %d\n",
906 frad->name, dlci); 898 dlci);
907#endif 899#endif
908 dev_kfree_skb_any(skb); 900 dev_kfree_skb_any(skb);
909 return NET_RX_DROP; 901 return NET_RX_DROP;
@@ -962,14 +954,14 @@ static int fr_rx(struct sk_buff *skb)
962 break; 954 break;
963 955
964 default: 956 default:
965 printk(KERN_INFO "%s: Unsupported protocol, OUI=%x " 957 netdev_info(frad, "Unsupported protocol, OUI=%x PID=%x\n",
966 "PID=%x\n", frad->name, oui, pid); 958 oui, pid);
967 dev_kfree_skb_any(skb); 959 dev_kfree_skb_any(skb);
968 return NET_RX_DROP; 960 return NET_RX_DROP;
969 } 961 }
970 } else { 962 } else {
971 printk(KERN_INFO "%s: Unsupported protocol, NLPID=%x " 963 netdev_info(frad, "Unsupported protocol, NLPID=%x length=%i\n",
972 "length = %i\n", frad->name, data[3], skb->len); 964 data[3], skb->len);
973 dev_kfree_skb_any(skb); 965 dev_kfree_skb_any(skb);
974 return NET_RX_DROP; 966 return NET_RX_DROP;
975 } 967 }
@@ -1073,8 +1065,7 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
1073 int used; 1065 int used;
1074 1066
1075 if ((pvc = add_pvc(frad, dlci)) == NULL) { 1067 if ((pvc = add_pvc(frad, dlci)) == NULL) {
1076 printk(KERN_WARNING "%s: Memory squeeze on fr_add_pvc()\n", 1068 netdev_warn(frad, "Memory squeeze on fr_add_pvc()\n");
1077 frad->name);
1078 return -ENOBUFS; 1069 return -ENOBUFS;
1079 } 1070 }
1080 1071
@@ -1089,8 +1080,7 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
1089 dev = alloc_netdev(0, "pvc%d", pvc_setup); 1080 dev = alloc_netdev(0, "pvc%d", pvc_setup);
1090 1081
1091 if (!dev) { 1082 if (!dev) {
1092 printk(KERN_WARNING "%s: Memory squeeze on fr_pvc()\n", 1083 netdev_warn(frad, "Memory squeeze on fr_pvc()\n");
1093 frad->name);
1094 delete_unused_pvcs(hdlc); 1084 delete_unused_pvcs(hdlc);
1095 return -ENOBUFS; 1085 return -ENOBUFS;
1096 } 1086 }
diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c
index 941f053e650e..055a918067e6 100644
--- a/drivers/net/wan/hdlc_ppp.c
+++ b/drivers/net/wan/hdlc_ppp.c
@@ -223,8 +223,7 @@ static void ppp_tx_cp(struct net_device *dev, u16 pid, u8 code,
223 skb = dev_alloc_skb(sizeof(struct hdlc_header) + 223 skb = dev_alloc_skb(sizeof(struct hdlc_header) +
224 sizeof(struct cp_header) + magic_len + len); 224 sizeof(struct cp_header) + magic_len + len);
225 if (!skb) { 225 if (!skb) {
226 printk(KERN_WARNING "%s: out of memory in ppp_tx_cp()\n", 226 netdev_warn(dev, "out of memory in ppp_tx_cp()\n");
227 dev->name);
228 return; 227 return;
229 } 228 }
230 skb_reserve(skb, sizeof(struct hdlc_header)); 229 skb_reserve(skb, sizeof(struct hdlc_header));
@@ -345,7 +344,7 @@ static void ppp_cp_event(struct net_device *dev, u16 pid, u16 event, u8 code,
345 ppp_tx_cp(dev, pid, CP_CODE_REJ, ++ppp->seq, len, data); 344 ppp_tx_cp(dev, pid, CP_CODE_REJ, ++ppp->seq, len, data);
346 345
347 if (old_state != OPENED && proto->state == OPENED) { 346 if (old_state != OPENED && proto->state == OPENED) {
348 printk(KERN_INFO "%s: %s up\n", dev->name, proto_name(pid)); 347 netdev_info(dev, "%s up\n", proto_name(pid));
349 if (pid == PID_LCP) { 348 if (pid == PID_LCP) {
350 netif_dormant_off(dev); 349 netif_dormant_off(dev);
351 ppp_cp_event(dev, PID_IPCP, START, 0, 0, 0, NULL); 350 ppp_cp_event(dev, PID_IPCP, START, 0, 0, 0, NULL);
@@ -356,7 +355,7 @@ static void ppp_cp_event(struct net_device *dev, u16 pid, u16 event, u8 code,
356 } 355 }
357 } 356 }
358 if (old_state == OPENED && proto->state != OPENED) { 357 if (old_state == OPENED && proto->state != OPENED) {
359 printk(KERN_INFO "%s: %s down\n", dev->name, proto_name(pid)); 358 netdev_info(dev, "%s down\n", proto_name(pid));
360 if (pid == PID_LCP) { 359 if (pid == PID_LCP) {
361 netif_dormant_on(dev); 360 netif_dormant_on(dev);
362 ppp_cp_event(dev, PID_IPCP, STOP, 0, 0, 0, NULL); 361 ppp_cp_event(dev, PID_IPCP, STOP, 0, 0, 0, NULL);
@@ -585,7 +584,7 @@ static void ppp_timer(unsigned long arg)
585 break; 584 break;
586 if (time_after(jiffies, ppp->last_pong + 585 if (time_after(jiffies, ppp->last_pong +
587 ppp->keepalive_timeout * HZ)) { 586 ppp->keepalive_timeout * HZ)) {
588 printk(KERN_INFO "%s: Link down\n", proto->dev->name); 587 netdev_info(proto->dev, "Link down\n");
589 ppp_cp_event(proto->dev, PID_LCP, STOP, 0, 0, 0, NULL); 588 ppp_cp_event(proto->dev, PID_LCP, STOP, 0, 0, 0, NULL);
590 ppp_cp_event(proto->dev, PID_LCP, START, 0, 0, 0, NULL); 589 ppp_cp_event(proto->dev, PID_LCP, START, 0, 0, 0, NULL);
591 } else { /* send keep-alive packet */ 590 } else { /* send keep-alive packet */
diff --git a/drivers/net/wan/hdlc_x25.c b/drivers/net/wan/hdlc_x25.c
index 70527e5a54a2..56aeb011cb3d 100644
--- a/drivers/net/wan/hdlc_x25.c
+++ b/drivers/net/wan/hdlc_x25.c
@@ -34,7 +34,7 @@ static void x25_connect_disconnect(struct net_device *dev, int reason, int code)
34 unsigned char *ptr; 34 unsigned char *ptr;
35 35
36 if ((skb = dev_alloc_skb(1)) == NULL) { 36 if ((skb = dev_alloc_skb(1)) == NULL) {
37 printk(KERN_ERR "%s: out of memory\n", dev->name); 37 netdev_err(dev, "out of memory\n");
38 return; 38 return;
39 } 39 }
40 40
@@ -106,9 +106,8 @@ static netdev_tx_t x25_xmit(struct sk_buff *skb, struct net_device *dev)
106 /* Send connect confirm. msg to level 3 */ 106 /* Send connect confirm. msg to level 3 */
107 x25_connected(dev, 0); 107 x25_connected(dev, 0);
108 else 108 else
109 printk(KERN_ERR "%s: LAPB connect request " 109 netdev_err(dev, "LAPB connect request failed, error code = %i\n",
110 "failed, error code = %i\n", 110 result);
111 dev->name, result);
112 } 111 }
113 break; 112 break;
114 113
@@ -118,9 +117,8 @@ static netdev_tx_t x25_xmit(struct sk_buff *skb, struct net_device *dev)
118 /* Send disconnect confirm. msg to level 3 */ 117 /* Send disconnect confirm. msg to level 3 */
119 x25_disconnected(dev, 0); 118 x25_disconnected(dev, 0);
120 else 119 else
121 printk(KERN_ERR "%s: LAPB disconnect request " 120 netdev_err(dev, "LAPB disconnect request failed, error code = %i\n",
122 "failed, error code = %i\n", 121 result);
123 dev->name, result);
124 } 122 }
125 break; 123 break;
126 124
diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c
index 17d408fe693f..5129ad514d26 100644
--- a/drivers/net/wan/n2.c
+++ b/drivers/net/wan/n2.c
@@ -16,6 +16,8 @@
16 * SDL Inc. PPP/HDLC/CISCO driver 16 * SDL Inc. PPP/HDLC/CISCO driver
17 */ 17 */
18 18
19#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
20
19#include <linux/module.h> 21#include <linux/module.h>
20#include <linux/kernel.h> 22#include <linux/kernel.h>
21#include <linux/capability.h> 23#include <linux/capability.h>
@@ -341,57 +343,57 @@ static int __init n2_run(unsigned long io, unsigned long irq,
341 int i; 343 int i;
342 344
343 if (io < 0x200 || io > 0x3FF || (io % N2_IOPORTS) != 0) { 345 if (io < 0x200 || io > 0x3FF || (io % N2_IOPORTS) != 0) {
344 printk(KERN_ERR "n2: invalid I/O port value\n"); 346 pr_err("invalid I/O port value\n");
345 return -ENODEV; 347 return -ENODEV;
346 } 348 }
347 349
348 if (irq < 3 || irq > 15 || irq == 6) /* FIXME */ { 350 if (irq < 3 || irq > 15 || irq == 6) /* FIXME */ {
349 printk(KERN_ERR "n2: invalid IRQ value\n"); 351 pr_err("invalid IRQ value\n");
350 return -ENODEV; 352 return -ENODEV;
351 } 353 }
352 354
353 if (winbase < 0xA0000 || winbase > 0xFFFFF || (winbase & 0xFFF) != 0) { 355 if (winbase < 0xA0000 || winbase > 0xFFFFF || (winbase & 0xFFF) != 0) {
354 printk(KERN_ERR "n2: invalid RAM value\n"); 356 pr_err("invalid RAM value\n");
355 return -ENODEV; 357 return -ENODEV;
356 } 358 }
357 359
358 card = kzalloc(sizeof(card_t), GFP_KERNEL); 360 card = kzalloc(sizeof(card_t), GFP_KERNEL);
359 if (card == NULL) { 361 if (card == NULL) {
360 printk(KERN_ERR "n2: unable to allocate memory\n"); 362 pr_err("unable to allocate memory\n");
361 return -ENOBUFS; 363 return -ENOBUFS;
362 } 364 }
363 365
364 card->ports[0].dev = alloc_hdlcdev(&card->ports[0]); 366 card->ports[0].dev = alloc_hdlcdev(&card->ports[0]);
365 card->ports[1].dev = alloc_hdlcdev(&card->ports[1]); 367 card->ports[1].dev = alloc_hdlcdev(&card->ports[1]);
366 if (!card->ports[0].dev || !card->ports[1].dev) { 368 if (!card->ports[0].dev || !card->ports[1].dev) {
367 printk(KERN_ERR "n2: unable to allocate memory\n"); 369 pr_err("unable to allocate memory\n");
368 n2_destroy_card(card); 370 n2_destroy_card(card);
369 return -ENOMEM; 371 return -ENOMEM;
370 } 372 }
371 373
372 if (!request_region(io, N2_IOPORTS, devname)) { 374 if (!request_region(io, N2_IOPORTS, devname)) {
373 printk(KERN_ERR "n2: I/O port region in use\n"); 375 pr_err("I/O port region in use\n");
374 n2_destroy_card(card); 376 n2_destroy_card(card);
375 return -EBUSY; 377 return -EBUSY;
376 } 378 }
377 card->io = io; 379 card->io = io;
378 380
379 if (request_irq(irq, sca_intr, 0, devname, card)) { 381 if (request_irq(irq, sca_intr, 0, devname, card)) {
380 printk(KERN_ERR "n2: could not allocate IRQ\n"); 382 pr_err("could not allocate IRQ\n");
381 n2_destroy_card(card); 383 n2_destroy_card(card);
382 return -EBUSY; 384 return -EBUSY;
383 } 385 }
384 card->irq = irq; 386 card->irq = irq;
385 387
386 if (!request_mem_region(winbase, USE_WINDOWSIZE, devname)) { 388 if (!request_mem_region(winbase, USE_WINDOWSIZE, devname)) {
387 printk(KERN_ERR "n2: could not request RAM window\n"); 389 pr_err("could not request RAM window\n");
388 n2_destroy_card(card); 390 n2_destroy_card(card);
389 return -EBUSY; 391 return -EBUSY;
390 } 392 }
391 card->phy_winbase = winbase; 393 card->phy_winbase = winbase;
392 card->winbase = ioremap(winbase, USE_WINDOWSIZE); 394 card->winbase = ioremap(winbase, USE_WINDOWSIZE);
393 if (!card->winbase) { 395 if (!card->winbase) {
394 printk(KERN_ERR "n2: ioremap() failed\n"); 396 pr_err("ioremap() failed\n");
395 n2_destroy_card(card); 397 n2_destroy_card(card);
396 return -EFAULT; 398 return -EFAULT;
397 } 399 }
@@ -413,7 +415,7 @@ static int __init n2_run(unsigned long io, unsigned long irq,
413 break; 415 break;
414 416
415 default: 417 default:
416 printk(KERN_ERR "n2: invalid window size\n"); 418 pr_err("invalid window size\n");
417 n2_destroy_card(card); 419 n2_destroy_card(card);
418 return -ENODEV; 420 return -ENODEV;
419 } 421 }
@@ -433,12 +435,12 @@ static int __init n2_run(unsigned long io, unsigned long irq,
433 card->buff_offset = (valid0 + valid1) * sizeof(pkt_desc) * 435 card->buff_offset = (valid0 + valid1) * sizeof(pkt_desc) *
434 (card->tx_ring_buffers + card->rx_ring_buffers); 436 (card->tx_ring_buffers + card->rx_ring_buffers);
435 437
436 printk(KERN_INFO "n2: RISCom/N2 %u KB RAM, IRQ%u, " 438 pr_info("RISCom/N2 %u KB RAM, IRQ%u, using %u TX + %u RX packets rings\n",
437 "using %u TX + %u RX packets rings\n", card->ram_size / 1024, 439 card->ram_size / 1024, card->irq,
438 card->irq, card->tx_ring_buffers, card->rx_ring_buffers); 440 card->tx_ring_buffers, card->rx_ring_buffers);
439 441
440 if (card->tx_ring_buffers < 1) { 442 if (card->tx_ring_buffers < 1) {
441 printk(KERN_ERR "n2: RAM test failed\n"); 443 pr_err("RAM test failed\n");
442 n2_destroy_card(card); 444 n2_destroy_card(card);
443 return -EIO; 445 return -EIO;
444 } 446 }
@@ -474,16 +476,14 @@ static int __init n2_run(unsigned long io, unsigned long irq,
474 port->card = card; 476 port->card = card;
475 477
476 if (register_hdlc_device(dev)) { 478 if (register_hdlc_device(dev)) {
477 printk(KERN_WARNING "n2: unable to register hdlc " 479 pr_warn("unable to register hdlc device\n");
478 "device\n");
479 port->card = NULL; 480 port->card = NULL;
480 n2_destroy_card(card); 481 n2_destroy_card(card);
481 return -ENOBUFS; 482 return -ENOBUFS;
482 } 483 }
483 sca_init_port(port); /* Set up SCA memory */ 484 sca_init_port(port); /* Set up SCA memory */
484 485
485 printk(KERN_INFO "%s: RISCom/N2 node %d\n", 486 netdev_info(dev, "RISCom/N2 node %d\n", port->phy_node);
486 dev->name, port->phy_node);
487 } 487 }
488 488
489 *new_card = card; 489 *new_card = card;
@@ -498,12 +498,12 @@ static int __init n2_init(void)
498{ 498{
499 if (hw==NULL) { 499 if (hw==NULL) {
500#ifdef MODULE 500#ifdef MODULE
501 printk(KERN_INFO "n2: no card initialized\n"); 501 pr_info("no card initialized\n");
502#endif 502#endif
503 return -EINVAL; /* no parameters specified, abort */ 503 return -EINVAL; /* no parameters specified, abort */
504 } 504 }
505 505
506 printk(KERN_INFO "%s\n", version); 506 pr_info("%s\n", version);
507 507
508 do { 508 do {
509 unsigned long io, irq, ram; 509 unsigned long io, irq, ram;
@@ -541,7 +541,7 @@ static int __init n2_init(void)
541 return first_card ? 0 : -EINVAL; 541 return first_card ? 0 : -EINVAL;
542 }while(*hw++ == ':'); 542 }while(*hw++ == ':');
543 543
544 printk(KERN_ERR "n2: invalid hardware parameters\n"); 544 pr_err("invalid hardware parameters\n");
545 return first_card ? 0 : -EINVAL; 545 return first_card ? 0 : -EINVAL;
546} 546}
547 547
diff --git a/drivers/net/wan/pc300too.c b/drivers/net/wan/pc300too.c
index c7ab3becd261..c49c1b3c7aad 100644
--- a/drivers/net/wan/pc300too.c
+++ b/drivers/net/wan/pc300too.c
@@ -17,6 +17,8 @@
17 * PC300/X21 cards. 17 * PC300/X21 cards.
18 */ 18 */
19 19
20#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
21
20#include <linux/module.h> 22#include <linux/module.h>
21#include <linux/kernel.h> 23#include <linux/kernel.h>
22#include <linux/slab.h> 24#include <linux/slab.h>
@@ -318,7 +320,7 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev,
318 320
319 card = kzalloc(sizeof(card_t), GFP_KERNEL); 321 card = kzalloc(sizeof(card_t), GFP_KERNEL);
320 if (card == NULL) { 322 if (card == NULL) {
321 printk(KERN_ERR "pc300: unable to allocate memory\n"); 323 pr_err("unable to allocate memory\n");
322 pci_release_regions(pdev); 324 pci_release_regions(pdev);
323 pci_disable_device(pdev); 325 pci_disable_device(pdev);
324 return -ENOBUFS; 326 return -ENOBUFS;
@@ -328,7 +330,7 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev,
328 if (pci_resource_len(pdev, 0) != PC300_PLX_SIZE || 330 if (pci_resource_len(pdev, 0) != PC300_PLX_SIZE ||
329 pci_resource_len(pdev, 2) != PC300_SCA_SIZE || 331 pci_resource_len(pdev, 2) != PC300_SCA_SIZE ||
330 pci_resource_len(pdev, 3) < 16384) { 332 pci_resource_len(pdev, 3) < 16384) {
331 printk(KERN_ERR "pc300: invalid card EEPROM parameters\n"); 333 pr_err("invalid card EEPROM parameters\n");
332 pc300_pci_remove_one(pdev); 334 pc300_pci_remove_one(pdev);
333 return -EFAULT; 335 return -EFAULT;
334 } 336 }
@@ -345,7 +347,7 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev,
345 if (card->plxbase == NULL || 347 if (card->plxbase == NULL ||
346 card->scabase == NULL || 348 card->scabase == NULL ||
347 card->rambase == NULL) { 349 card->rambase == NULL) {
348 printk(KERN_ERR "pc300: ioremap() failed\n"); 350 pr_err("ioremap() failed\n");
349 pc300_pci_remove_one(pdev); 351 pc300_pci_remove_one(pdev);
350 } 352 }
351 353
@@ -370,7 +372,7 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev,
370 372
371 for (i = 0; i < card->n_ports; i++) 373 for (i = 0; i < card->n_ports; i++)
372 if (!(card->ports[i].netdev = alloc_hdlcdev(&card->ports[i]))) { 374 if (!(card->ports[i].netdev = alloc_hdlcdev(&card->ports[i]))) {
373 printk(KERN_ERR "pc300: unable to allocate memory\n"); 375 pr_err("unable to allocate memory\n");
374 pc300_pci_remove_one(pdev); 376 pc300_pci_remove_one(pdev);
375 return -ENOMEM; 377 return -ENOMEM;
376 } 378 }
@@ -411,15 +413,14 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev,
411 card->buff_offset = card->n_ports * sizeof(pkt_desc) * 413 card->buff_offset = card->n_ports * sizeof(pkt_desc) *
412 (card->tx_ring_buffers + card->rx_ring_buffers); 414 (card->tx_ring_buffers + card->rx_ring_buffers);
413 415
414 printk(KERN_INFO "pc300: PC300/%s, %u KB RAM at 0x%x, IRQ%u, " 416 pr_info("PC300/%s, %u KB RAM at 0x%x, IRQ%u, using %u TX + %u RX packets rings\n",
415 "using %u TX + %u RX packets rings\n", 417 card->type == PC300_X21 ? "X21" :
416 card->type == PC300_X21 ? "X21" : 418 card->type == PC300_TE ? "TE" : "RSV",
417 card->type == PC300_TE ? "TE" : "RSV", 419 ramsize / 1024, ramphys, pdev->irq,
418 ramsize / 1024, ramphys, pdev->irq, 420 card->tx_ring_buffers, card->rx_ring_buffers);
419 card->tx_ring_buffers, card->rx_ring_buffers);
420 421
421 if (card->tx_ring_buffers < 1) { 422 if (card->tx_ring_buffers < 1) {
422 printk(KERN_ERR "pc300: RAM test failed\n"); 423 pr_err("RAM test failed\n");
423 pc300_pci_remove_one(pdev); 424 pc300_pci_remove_one(pdev);
424 return -EFAULT; 425 return -EFAULT;
425 } 426 }
@@ -429,8 +430,7 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev,
429 430
430 /* Allocate IRQ */ 431 /* Allocate IRQ */
431 if (request_irq(pdev->irq, sca_intr, IRQF_SHARED, "pc300", card)) { 432 if (request_irq(pdev->irq, sca_intr, IRQF_SHARED, "pc300", card)) {
432 printk(KERN_WARNING "pc300: could not allocate IRQ%d.\n", 433 pr_warn("could not allocate IRQ%d\n", pdev->irq);
433 pdev->irq);
434 pc300_pci_remove_one(pdev); 434 pc300_pci_remove_one(pdev);
435 return -EBUSY; 435 return -EBUSY;
436 } 436 }
@@ -466,15 +466,13 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev,
466 466
467 sca_init_port(port); 467 sca_init_port(port);
468 if (register_hdlc_device(dev)) { 468 if (register_hdlc_device(dev)) {
469 printk(KERN_ERR "pc300: unable to register hdlc " 469 pr_err("unable to register hdlc device\n");
470 "device\n");
471 port->card = NULL; 470 port->card = NULL;
472 pc300_pci_remove_one(pdev); 471 pc300_pci_remove_one(pdev);
473 return -ENOBUFS; 472 return -ENOBUFS;
474 } 473 }
475 474
476 printk(KERN_INFO "%s: PC300 channel %d\n", 475 netdev_info(dev, "PC300 channel %d\n", port->chan);
477 dev->name, port->chan);
478 } 476 }
479 return 0; 477 return 0;
480} 478}
@@ -505,11 +503,11 @@ static struct pci_driver pc300_pci_driver = {
505static int __init pc300_init_module(void) 503static int __init pc300_init_module(void)
506{ 504{
507 if (pci_clock_freq < 1000000 || pci_clock_freq > 80000000) { 505 if (pci_clock_freq < 1000000 || pci_clock_freq > 80000000) {
508 printk(KERN_ERR "pc300: Invalid PCI clock frequency\n"); 506 pr_err("Invalid PCI clock frequency\n");
509 return -EINVAL; 507 return -EINVAL;
510 } 508 }
511 if (use_crystal_clock != 0 && use_crystal_clock != 1) { 509 if (use_crystal_clock != 0 && use_crystal_clock != 1) {
512 printk(KERN_ERR "pc300: Invalid 'use_crystal_clock' value\n"); 510 pr_err("Invalid 'use_crystal_clock' value\n");
513 return -EINVAL; 511 return -EINVAL;
514 } 512 }
515 513
diff --git a/drivers/net/wan/pci200syn.c b/drivers/net/wan/pci200syn.c
index fd7375955e41..1ce21163c776 100644
--- a/drivers/net/wan/pci200syn.c
+++ b/drivers/net/wan/pci200syn.c
@@ -14,6 +14,8 @@
14 * PLX Technology Inc. PCI9052 Data Book 14 * PLX Technology Inc. PCI9052 Data Book
15 */ 15 */
16 16
17#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
18
17#include <linux/module.h> 19#include <linux/module.h>
18#include <linux/kernel.h> 20#include <linux/kernel.h>
19#include <linux/capability.h> 21#include <linux/capability.h>
@@ -297,7 +299,7 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev,
297 299
298 card = kzalloc(sizeof(card_t), GFP_KERNEL); 300 card = kzalloc(sizeof(card_t), GFP_KERNEL);
299 if (card == NULL) { 301 if (card == NULL) {
300 printk(KERN_ERR "pci200syn: unable to allocate memory\n"); 302 pr_err("unable to allocate memory\n");
301 pci_release_regions(pdev); 303 pci_release_regions(pdev);
302 pci_disable_device(pdev); 304 pci_disable_device(pdev);
303 return -ENOBUFS; 305 return -ENOBUFS;
@@ -306,7 +308,7 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev,
306 card->ports[0].netdev = alloc_hdlcdev(&card->ports[0]); 308 card->ports[0].netdev = alloc_hdlcdev(&card->ports[0]);
307 card->ports[1].netdev = alloc_hdlcdev(&card->ports[1]); 309 card->ports[1].netdev = alloc_hdlcdev(&card->ports[1]);
308 if (!card->ports[0].netdev || !card->ports[1].netdev) { 310 if (!card->ports[0].netdev || !card->ports[1].netdev) {
309 printk(KERN_ERR "pci200syn: unable to allocate memory\n"); 311 pr_err("unable to allocate memory\n");
310 pci200_pci_remove_one(pdev); 312 pci200_pci_remove_one(pdev);
311 return -ENOMEM; 313 return -ENOMEM;
312 } 314 }
@@ -314,7 +316,7 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev,
314 if (pci_resource_len(pdev, 0) != PCI200SYN_PLX_SIZE || 316 if (pci_resource_len(pdev, 0) != PCI200SYN_PLX_SIZE ||
315 pci_resource_len(pdev, 2) != PCI200SYN_SCA_SIZE || 317 pci_resource_len(pdev, 2) != PCI200SYN_SCA_SIZE ||
316 pci_resource_len(pdev, 3) < 16384) { 318 pci_resource_len(pdev, 3) < 16384) {
317 printk(KERN_ERR "pci200syn: invalid card EEPROM parameters\n"); 319 pr_err("invalid card EEPROM parameters\n");
318 pci200_pci_remove_one(pdev); 320 pci200_pci_remove_one(pdev);
319 return -EFAULT; 321 return -EFAULT;
320 } 322 }
@@ -331,7 +333,7 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev,
331 if (card->plxbase == NULL || 333 if (card->plxbase == NULL ||
332 card->scabase == NULL || 334 card->scabase == NULL ||
333 card->rambase == NULL) { 335 card->rambase == NULL) {
334 printk(KERN_ERR "pci200syn: ioremap() failed\n"); 336 pr_err("ioremap() failed\n");
335 pci200_pci_remove_one(pdev); 337 pci200_pci_remove_one(pdev);
336 return -EFAULT; 338 return -EFAULT;
337 } 339 }
@@ -357,12 +359,12 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev,
357 card->buff_offset = 2 * sizeof(pkt_desc) * (card->tx_ring_buffers + 359 card->buff_offset = 2 * sizeof(pkt_desc) * (card->tx_ring_buffers +
358 card->rx_ring_buffers); 360 card->rx_ring_buffers);
359 361
360 printk(KERN_INFO "pci200syn: %u KB RAM at 0x%x, IRQ%u, using %u TX +" 362 pr_info("%u KB RAM at 0x%x, IRQ%u, using %u TX + %u RX packets rings\n",
361 " %u RX packets rings\n", ramsize / 1024, ramphys, 363 ramsize / 1024, ramphys,
362 pdev->irq, card->tx_ring_buffers, card->rx_ring_buffers); 364 pdev->irq, card->tx_ring_buffers, card->rx_ring_buffers);
363 365
364 if (card->tx_ring_buffers < 1) { 366 if (card->tx_ring_buffers < 1) {
365 printk(KERN_ERR "pci200syn: RAM test failed\n"); 367 pr_err("RAM test failed\n");
366 pci200_pci_remove_one(pdev); 368 pci200_pci_remove_one(pdev);
367 return -EFAULT; 369 return -EFAULT;
368 } 370 }
@@ -373,8 +375,7 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev,
373 375
374 /* Allocate IRQ */ 376 /* Allocate IRQ */
375 if (request_irq(pdev->irq, sca_intr, IRQF_SHARED, "pci200syn", card)) { 377 if (request_irq(pdev->irq, sca_intr, IRQF_SHARED, "pci200syn", card)) {
376 printk(KERN_WARNING "pci200syn: could not allocate IRQ%d.\n", 378 pr_warn("could not allocate IRQ%d\n", pdev->irq);
377 pdev->irq);
378 pci200_pci_remove_one(pdev); 379 pci200_pci_remove_one(pdev);
379 return -EBUSY; 380 return -EBUSY;
380 } 381 }
@@ -400,15 +401,13 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev,
400 port->card = card; 401 port->card = card;
401 sca_init_port(port); 402 sca_init_port(port);
402 if (register_hdlc_device(dev)) { 403 if (register_hdlc_device(dev)) {
403 printk(KERN_ERR "pci200syn: unable to register hdlc " 404 pr_err("unable to register hdlc device\n");
404 "device\n");
405 port->card = NULL; 405 port->card = NULL;
406 pci200_pci_remove_one(pdev); 406 pci200_pci_remove_one(pdev);
407 return -ENOBUFS; 407 return -ENOBUFS;
408 } 408 }
409 409
410 printk(KERN_INFO "%s: PCI200SYN channel %d\n", 410 netdev_info(dev, "PCI200SYN channel %d\n", port->chan);
411 dev->name, port->chan);
412 } 411 }
413 412
414 sca_flush(card); 413 sca_flush(card);
@@ -435,7 +434,7 @@ static struct pci_driver pci200_pci_driver = {
435static int __init pci200_init_module(void) 434static int __init pci200_init_module(void)
436{ 435{
437 if (pci_clock_freq < 1000000 || pci_clock_freq > 80000000) { 436 if (pci_clock_freq < 1000000 || pci_clock_freq > 80000000) {
438 printk(KERN_ERR "pci200syn: Invalid PCI clock frequency\n"); 437 pr_err("Invalid PCI clock frequency\n");
439 return -EINVAL; 438 return -EINVAL;
440 } 439 }
441 return pci_register_driver(&pci200_pci_driver); 440 return pci_register_driver(&pci200_pci_driver);
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
index 4ea89fe0006f..8d7aa43dfba5 100644
--- a/drivers/net/wan/wanxl.c
+++ b/drivers/net/wan/wanxl.c
@@ -13,6 +13,8 @@
13 * - wanXL100 will require minor driver modifications, no access to hw 13 * - wanXL100 will require minor driver modifications, no access to hw
14 */ 14 */
15 15
16#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
17
16#include <linux/module.h> 18#include <linux/module.h>
17#include <linux/kernel.h> 19#include <linux/kernel.h>
18#include <linux/slab.h> 20#include <linux/slab.h>
@@ -102,9 +104,8 @@ static inline dma_addr_t pci_map_single_debug(struct pci_dev *pdev, void *ptr,
102{ 104{
103 dma_addr_t addr = pci_map_single(pdev, ptr, size, direction); 105 dma_addr_t addr = pci_map_single(pdev, ptr, size, direction);
104 if (addr + size > 0x100000000LL) 106 if (addr + size > 0x100000000LL)
105 printk(KERN_CRIT "wanXL %s: pci_map_single() returned memory" 107 pr_crit("%s: pci_map_single() returned memory at 0x%llx!\n",
106 " at 0x%LX!\n", pci_name(pdev), 108 pci_name(pdev), (unsigned long long)addr);
107 (unsigned long long)addr);
108 return addr; 109 return addr;
109} 110}
110 111
@@ -147,8 +148,8 @@ static inline void wanxl_cable_intr(port_t *port)
147 } 148 }
148 dte = (value & STATUS_CABLE_DCE) ? " DCE" : " DTE"; 149 dte = (value & STATUS_CABLE_DCE) ? " DCE" : " DTE";
149 } 150 }
150 printk(KERN_INFO "%s: %s%s module, %s cable%s%s\n", 151 netdev_info(port->dev, "%s%s module, %s cable%s%s\n",
151 port->dev->name, pm, dte, cable, dsr, dcd); 152 pm, dte, cable, dsr, dcd);
152 153
153 if (value & STATUS_CABLE_DCD) 154 if (value & STATUS_CABLE_DCD)
154 netif_carrier_on(port->dev); 155 netif_carrier_on(port->dev);
@@ -198,8 +199,8 @@ static inline void wanxl_rx_intr(card_t *card)
198 while (desc = &card->status->rx_descs[card->rx_in], 199 while (desc = &card->status->rx_descs[card->rx_in],
199 desc->stat != PACKET_EMPTY) { 200 desc->stat != PACKET_EMPTY) {
200 if ((desc->stat & PACKET_PORT_MASK) > card->n_ports) 201 if ((desc->stat & PACKET_PORT_MASK) > card->n_ports)
201 printk(KERN_CRIT "wanXL %s: received packet for" 202 pr_crit("%s: received packet for nonexistent port\n",
202 " nonexistent port\n", pci_name(card->pdev)); 203 pci_name(card->pdev));
203 else { 204 else {
204 struct sk_buff *skb = card->rx_skbs[card->rx_in]; 205 struct sk_buff *skb = card->rx_skbs[card->rx_in];
205 port_t *port = &card->ports[desc->stat & 206 port_t *port = &card->ports[desc->stat &
@@ -397,7 +398,7 @@ static int wanxl_open(struct net_device *dev)
397 int i; 398 int i;
398 399
399 if (get_status(port)->open) { 400 if (get_status(port)->open) {
400 printk(KERN_ERR "%s: port already open\n", dev->name); 401 netdev_err(dev, "port already open\n");
401 return -EIO; 402 return -EIO;
402 } 403 }
403 if ((i = hdlc_open(dev)) != 0) 404 if ((i = hdlc_open(dev)) != 0)
@@ -417,7 +418,7 @@ static int wanxl_open(struct net_device *dev)
417 } 418 }
418 } while (time_after(timeout, jiffies)); 419 } while (time_after(timeout, jiffies));
419 420
420 printk(KERN_ERR "%s: unable to open port\n", dev->name); 421 netdev_err(dev, "unable to open port\n");
421 /* ask the card to close the port, should it be still alive */ 422 /* ask the card to close the port, should it be still alive */
422 writel(1 << (DOORBELL_TO_CARD_CLOSE_0 + port->node), dbr); 423 writel(1 << (DOORBELL_TO_CARD_CLOSE_0 + port->node), dbr);
423 return -EFAULT; 424 return -EFAULT;
@@ -443,7 +444,7 @@ static int wanxl_close(struct net_device *dev)
443 } while (time_after(timeout, jiffies)); 444 } while (time_after(timeout, jiffies));
444 445
445 if (get_status(port)->open) 446 if (get_status(port)->open)
446 printk(KERN_ERR "%s: unable to close port\n", dev->name); 447 netdev_err(dev, "unable to close port\n");
447 448
448 netif_stop_queue(dev); 449 netif_stop_queue(dev);
449 450
@@ -568,11 +569,7 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
568 int i, ports, alloc_size; 569 int i, ports, alloc_size;
569 570
570#ifndef MODULE 571#ifndef MODULE
571 static int printed_version; 572 pr_info_once("%s\n", version);
572 if (!printed_version) {
573 printed_version++;
574 printk(KERN_INFO "%s\n", version);
575 }
576#endif 573#endif
577 574
578 i = pci_enable_device(pdev); 575 i = pci_enable_device(pdev);
@@ -588,7 +585,7 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
588 work on most platforms */ 585 work on most platforms */
589 if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(28)) || 586 if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(28)) ||
590 pci_set_dma_mask(pdev, DMA_BIT_MASK(28))) { 587 pci_set_dma_mask(pdev, DMA_BIT_MASK(28))) {
591 printk(KERN_ERR "wanXL: No usable DMA configuration\n"); 588 pr_err("No usable DMA configuration\n");
592 return -EIO; 589 return -EIO;
593 } 590 }
594 591
@@ -607,8 +604,7 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
607 alloc_size = sizeof(card_t) + ports * sizeof(port_t); 604 alloc_size = sizeof(card_t) + ports * sizeof(port_t);
608 card = kzalloc(alloc_size, GFP_KERNEL); 605 card = kzalloc(alloc_size, GFP_KERNEL);
609 if (card == NULL) { 606 if (card == NULL) {
610 printk(KERN_ERR "wanXL %s: unable to allocate memory\n", 607 pr_err("%s: unable to allocate memory\n", pci_name(pdev));
611 pci_name(pdev));
612 pci_release_regions(pdev); 608 pci_release_regions(pdev);
613 pci_disable_device(pdev); 609 pci_disable_device(pdev);
614 return -ENOBUFS; 610 return -ENOBUFS;
@@ -635,7 +631,7 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
635 to indicate the card can do 32-bit DMA addressing */ 631 to indicate the card can do 32-bit DMA addressing */
636 if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)) || 632 if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)) ||
637 pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { 633 pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
638 printk(KERN_ERR "wanXL: No usable DMA configuration\n"); 634 pr_err("No usable DMA configuration\n");
639 wanxl_pci_remove_one(pdev); 635 wanxl_pci_remove_one(pdev);
640 return -EIO; 636 return -EIO;
641 } 637 }
@@ -645,7 +641,7 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
645 641
646 card->plx = ioremap_nocache(plx_phy, 0x70); 642 card->plx = ioremap_nocache(plx_phy, 0x70);
647 if (!card->plx) { 643 if (!card->plx) {
648 printk(KERN_ERR "wanxl: ioremap() failed\n"); 644 pr_err("ioremap() failed\n");
649 wanxl_pci_remove_one(pdev); 645 wanxl_pci_remove_one(pdev);
650 return -EFAULT; 646 return -EFAULT;
651 } 647 }
@@ -657,8 +653,8 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
657 timeout = jiffies + 20 * HZ; 653 timeout = jiffies + 20 * HZ;
658 while ((stat = readl(card->plx + PLX_MAILBOX_0)) != 0) { 654 while ((stat = readl(card->plx + PLX_MAILBOX_0)) != 0) {
659 if (time_before(timeout, jiffies)) { 655 if (time_before(timeout, jiffies)) {
660 printk(KERN_WARNING "wanXL %s: timeout waiting for" 656 pr_warn("%s: timeout waiting for PUTS to complete\n",
661 " PUTS to complete\n", pci_name(pdev)); 657 pci_name(pdev));
662 wanxl_pci_remove_one(pdev); 658 wanxl_pci_remove_one(pdev);
663 return -ENODEV; 659 return -ENODEV;
664 } 660 }
@@ -669,8 +665,8 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
669 break; 665 break;
670 666
671 default: 667 default:
672 printk(KERN_WARNING "wanXL %s: PUTS test 0x%X" 668 pr_warn("%s: PUTS test 0x%X failed\n",
673 " failed\n", pci_name(pdev), stat & 0x30); 669 pci_name(pdev), stat & 0x30);
674 wanxl_pci_remove_one(pdev); 670 wanxl_pci_remove_one(pdev);
675 return -ENODEV; 671 return -ENODEV;
676 } 672 }
@@ -688,17 +684,16 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
688 /* sanity check the board's reported memory size */ 684 /* sanity check the board's reported memory size */
689 if (ramsize < BUFFERS_ADDR + 685 if (ramsize < BUFFERS_ADDR +
690 (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH * ports) { 686 (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH * ports) {
691 printk(KERN_WARNING "wanXL %s: no enough on-board RAM" 687 pr_warn("%s: no enough on-board RAM (%u bytes detected, %u bytes required)\n",
692 " (%u bytes detected, %u bytes required)\n", 688 pci_name(pdev), ramsize,
693 pci_name(pdev), ramsize, BUFFERS_ADDR + 689 BUFFERS_ADDR +
694 (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH * ports); 690 (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH * ports);
695 wanxl_pci_remove_one(pdev); 691 wanxl_pci_remove_one(pdev);
696 return -ENODEV; 692 return -ENODEV;
697 } 693 }
698 694
699 if (wanxl_puts_command(card, MBX1_CMD_BSWAP)) { 695 if (wanxl_puts_command(card, MBX1_CMD_BSWAP)) {
700 printk(KERN_WARNING "wanXL %s: unable to Set Byte Swap" 696 pr_warn("%s: unable to Set Byte Swap Mode\n", pci_name(pdev));
701 " Mode\n", pci_name(pdev));
702 wanxl_pci_remove_one(pdev); 697 wanxl_pci_remove_one(pdev);
703 return -ENODEV; 698 return -ENODEV;
704 } 699 }
@@ -715,7 +710,7 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
715 710
716 mem = ioremap_nocache(mem_phy, PDM_OFFSET + sizeof(firmware)); 711 mem = ioremap_nocache(mem_phy, PDM_OFFSET + sizeof(firmware));
717 if (!mem) { 712 if (!mem) {
718 printk(KERN_ERR "wanxl: ioremap() failed\n"); 713 pr_err("ioremap() failed\n");
719 wanxl_pci_remove_one(pdev); 714 wanxl_pci_remove_one(pdev);
720 return -EFAULT; 715 return -EFAULT;
721 } 716 }
@@ -734,8 +729,7 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
734 writel(0, card->plx + PLX_MAILBOX_5); 729 writel(0, card->plx + PLX_MAILBOX_5);
735 730
736 if (wanxl_puts_command(card, MBX1_CMD_ABORTJ)) { 731 if (wanxl_puts_command(card, MBX1_CMD_ABORTJ)) {
737 printk(KERN_WARNING "wanXL %s: unable to Abort and Jump\n", 732 pr_warn("%s: unable to Abort and Jump\n", pci_name(pdev));
738 pci_name(pdev));
739 wanxl_pci_remove_one(pdev); 733 wanxl_pci_remove_one(pdev);
740 return -ENODEV; 734 return -ENODEV;
741 } 735 }
@@ -749,8 +743,8 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
749 }while (time_after(timeout, jiffies)); 743 }while (time_after(timeout, jiffies));
750 744
751 if (!stat) { 745 if (!stat) {
752 printk(KERN_WARNING "wanXL %s: timeout while initializing card " 746 pr_warn("%s: timeout while initializing card firmware\n",
753 "firmware\n", pci_name(pdev)); 747 pci_name(pdev));
754 wanxl_pci_remove_one(pdev); 748 wanxl_pci_remove_one(pdev);
755 return -ENODEV; 749 return -ENODEV;
756 } 750 }
@@ -759,13 +753,13 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
759 ramsize = stat; 753 ramsize = stat;
760#endif 754#endif
761 755
762 printk(KERN_INFO "wanXL %s: at 0x%X, %u KB of RAM at 0x%X, irq %u\n", 756 pr_info("%s: at 0x%X, %u KB of RAM at 0x%X, irq %u\n",
763 pci_name(pdev), plx_phy, ramsize / 1024, mem_phy, pdev->irq); 757 pci_name(pdev), plx_phy, ramsize / 1024, mem_phy, pdev->irq);
764 758
765 /* Allocate IRQ */ 759 /* Allocate IRQ */
766 if (request_irq(pdev->irq, wanxl_intr, IRQF_SHARED, "wanXL", card)) { 760 if (request_irq(pdev->irq, wanxl_intr, IRQF_SHARED, "wanXL", card)) {
767 printk(KERN_WARNING "wanXL %s: could not allocate IRQ%i.\n", 761 pr_warn("%s: could not allocate IRQ%i\n",
768 pci_name(pdev), pdev->irq); 762 pci_name(pdev), pdev->irq);
769 wanxl_pci_remove_one(pdev); 763 wanxl_pci_remove_one(pdev);
770 return -EBUSY; 764 return -EBUSY;
771 } 765 }
@@ -776,8 +770,8 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
776 port_t *port = &card->ports[i]; 770 port_t *port = &card->ports[i];
777 struct net_device *dev = alloc_hdlcdev(port); 771 struct net_device *dev = alloc_hdlcdev(port);
778 if (!dev) { 772 if (!dev) {
779 printk(KERN_ERR "wanXL %s: unable to allocate" 773 pr_err("%s: unable to allocate memory\n",
780 " memory\n", pci_name(pdev)); 774 pci_name(pdev));
781 wanxl_pci_remove_one(pdev); 775 wanxl_pci_remove_one(pdev);
782 return -ENOMEM; 776 return -ENOMEM;
783 } 777 }
@@ -793,8 +787,8 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
793 port->node = i; 787 port->node = i;
794 get_status(port)->clocking = CLOCK_EXT; 788 get_status(port)->clocking = CLOCK_EXT;
795 if (register_hdlc_device(dev)) { 789 if (register_hdlc_device(dev)) {
796 printk(KERN_ERR "wanXL %s: unable to register hdlc" 790 pr_err("%s: unable to register hdlc device\n",
797 " device\n", pci_name(pdev)); 791 pci_name(pdev));
798 free_netdev(dev); 792 free_netdev(dev);
799 wanxl_pci_remove_one(pdev); 793 wanxl_pci_remove_one(pdev);
800 return -ENOBUFS; 794 return -ENOBUFS;
@@ -802,11 +796,11 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
802 card->n_ports++; 796 card->n_ports++;
803 } 797 }
804 798
805 printk(KERN_INFO "wanXL %s: port", pci_name(pdev)); 799 pr_info("%s: port", pci_name(pdev));
806 for (i = 0; i < ports; i++) 800 for (i = 0; i < ports; i++)
807 printk("%s #%i: %s", i ? "," : "", i, 801 pr_cont("%s #%i: %s",
808 card->ports[i].dev->name); 802 i ? "," : "", i, card->ports[i].dev->name);
809 printk("\n"); 803 pr_cont("\n");
810 804
811 for (i = 0; i < ports; i++) 805 for (i = 0; i < ports; i++)
812 wanxl_cable_intr(&card->ports[i]); /* get carrier status etc.*/ 806 wanxl_cable_intr(&card->ports[i]); /* get carrier status etc.*/
@@ -836,7 +830,7 @@ static struct pci_driver wanxl_pci_driver = {
836static int __init wanxl_init_module(void) 830static int __init wanxl_init_module(void)
837{ 831{
838#ifdef MODULE 832#ifdef MODULE
839 printk(KERN_INFO "%s\n", version); 833 pr_info("%s\n", version);
840#endif 834#endif
841 return pci_register_driver(&wanxl_pci_driver); 835 return pci_register_driver(&wanxl_pci_driver);
842} 836}