aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/hdlc_fr.c
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/wan/hdlc_fr.c
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/wan/hdlc_fr.c')
-rw-r--r--drivers/net/wan/hdlc_fr.c96
1 files changed, 43 insertions, 53 deletions
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 }