Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-sunhme-cleanups-and-logging-improvements'

Sean Anderson says:

====================
net: sunhme: Cleanups and logging improvements

This series is a continuation of [1] with a focus on logging improvements (in
the style of commit b11e5f6a3a5c ("net: sunhme: output link status with a single
print.")). I have included several of Rolf's patches in the series where
appropriate (with slight modifications). After this series is applied, many more
messages from this driver will come with driver/device information.
Additionally, most messages (especially debug messages) have been condensed onto
one line (as KERN_CONT messages get split).

[1] https://lore.kernel.org/netdev/4686583.GXAFRqVoOG@eto.sf-tec.de/
====================

Link: https://lore.kernel.org/r/20220924015339.1816744-1-seanga2@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+266 -404
+5
MAINTAINERS
··· 19511 19511 S: Maintained 19512 19512 F: drivers/net/ethernet/dlink/sundance.c 19513 19513 19514 + SUN HAPPY MEAL ETHERNET DRIVER 19515 + M: Sean Anderson <seanga2@gmail.com> 19516 + S: Maintained 19517 + F: drivers/net/ethernet/sun/sunhme.* 19518 + 19514 19519 SUNPLUS ETHERNET DRIVER 19515 19520 M: Wells Lu <wellslutw@gmail.com> 19516 19521 L: netdev@vger.kernel.org
+261 -404
drivers/net/ethernet/sun/sunhme.c
··· 61 61 #include "sunhme.h" 62 62 63 63 #define DRV_NAME "sunhme" 64 - #define DRV_VERSION "3.10" 65 - #define DRV_RELDATE "August 26, 2008" 66 - #define DRV_AUTHOR "David S. Miller (davem@davemloft.net)" 67 64 68 - static char version[] = 69 - DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " " DRV_AUTHOR "\n"; 70 - 71 - MODULE_VERSION(DRV_VERSION); 72 - MODULE_AUTHOR(DRV_AUTHOR); 65 + MODULE_AUTHOR("David S. Miller (davem@davemloft.net)"); 73 66 MODULE_DESCRIPTION("Sun HappyMealEthernet(HME) 10/100baseT ethernet driver"); 74 67 MODULE_LICENSE("GPL"); 75 68 ··· 80 87 static struct quattro *qfe_pci_list; 81 88 #endif 82 89 83 - #undef HMEDEBUG 84 - #undef SXDEBUG 85 - #undef RXDEBUG 86 - #undef TXDEBUG 87 - #undef TXLOGGING 90 + #define hme_debug(fmt, ...) pr_debug("%s: " fmt, __func__, ##__VA_ARGS__) 91 + #define HMD hme_debug 88 92 89 - #ifdef TXLOGGING 93 + /* "Auto Switch Debug" aka phy debug */ 94 + #if 1 95 + #define ASD hme_debug 96 + #else 97 + #define ASD(...) 98 + #endif 99 + 100 + #if 0 90 101 struct hme_tx_logent { 91 102 unsigned int tstamp; 92 103 int tx_new, tx_old; ··· 125 128 126 129 this = txlog_cur_entry; 127 130 for (i = 0; i < TX_LOG_LEN; i++) { 128 - printk("TXLOG[%d]: j[%08x] tx[N(%d)O(%d)] action[%08x] stat[%08x]\n", i, 131 + pr_err("TXLOG[%d]: j[%08x] tx[N(%d)O(%d)] action[%08x] stat[%08x]\n", i, 129 132 tx_log[this].tstamp, 130 133 tx_log[this].tx_new, tx_log[this].tx_old, 131 134 tx_log[this].action, tx_log[this].status); 132 135 this = (this + 1) & (TX_LOG_LEN - 1); 133 136 } 134 137 } 135 - static __inline__ void tx_dump_ring(struct happy_meal *hp) 136 - { 137 - struct hmeal_init_block *hb = hp->happy_block; 138 - struct happy_meal_txd *tp = &hb->happy_meal_txd[0]; 139 - int i; 140 - 141 - for (i = 0; i < TX_RING_SIZE; i+=4) { 142 - printk("TXD[%d..%d]: [%08x:%08x] [%08x:%08x] [%08x:%08x] [%08x:%08x]\n", 143 - i, i + 4, 144 - le32_to_cpu(tp[i].tx_flags), le32_to_cpu(tp[i].tx_addr), 145 - le32_to_cpu(tp[i + 1].tx_flags), le32_to_cpu(tp[i + 1].tx_addr), 146 - le32_to_cpu(tp[i + 2].tx_flags), le32_to_cpu(tp[i + 2].tx_addr), 147 - le32_to_cpu(tp[i + 3].tx_flags), le32_to_cpu(tp[i + 3].tx_addr)); 148 - } 149 - } 150 138 #else 151 - #define tx_add_log(hp, a, s) do { } while(0) 152 - #define tx_dump_log() do { } while(0) 153 - #define tx_dump_ring(hp) do { } while(0) 154 - #endif 155 - 156 - #ifdef HMEDEBUG 157 - #define HMD(x) printk x 158 - #else 159 - #define HMD(x) 160 - #endif 161 - 162 - /* #define AUTO_SWITCH_DEBUG */ 163 - 164 - #ifdef AUTO_SWITCH_DEBUG 165 - #define ASD(x) printk x 166 - #else 167 - #define ASD(x) 139 + #define tx_add_log(hp, a, s) 140 + #define tx_dump_log() 168 141 #endif 169 142 170 143 #define DEFAULT_IPG0 16 /* For lance-mode only */ ··· 310 343 int retval = 0; 311 344 int i; 312 345 313 - ASD(("happy_meal_bb_read: reg=%d ", reg)); 314 - 315 346 /* Enable the MIF BitBang outputs. */ 316 347 hme_write32(hp, tregs + TCVR_BBOENAB, 1); 317 348 ··· 343 378 (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); 344 379 (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); 345 380 (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); 346 - ASD(("value=%x\n", retval)); 381 + ASD("reg=%d value=%x\n", reg, retval); 347 382 return retval; 348 383 } 349 384 ··· 354 389 u32 tmp; 355 390 int i; 356 391 357 - ASD(("happy_meal_bb_write: reg=%d value=%x\n", reg, value)); 392 + ASD("reg=%d value=%x\n", reg, value); 358 393 359 394 /* Enable the MIF BitBang outputs. */ 360 395 hme_write32(hp, tregs + TCVR_BBOENAB, 1); ··· 398 433 int tries = TCVR_READ_TRIES; 399 434 int retval; 400 435 401 - ASD(("happy_meal_tcvr_read: reg=0x%02x ", reg)); 402 436 if (hp->tcvr_type == none) { 403 - ASD(("no transceiver, value=TCVR_FAILURE\n")); 437 + ASD("no transceiver, value=TCVR_FAILURE\n"); 404 438 return TCVR_FAILURE; 405 439 } 406 440 407 441 if (!(hp->happy_flags & HFLAG_FENABLE)) { 408 - ASD(("doing bit bang\n")); 442 + ASD("doing bit bang\n"); 409 443 return happy_meal_bb_read(hp, tregs, reg); 410 444 } 411 445 ··· 413 449 while (!(hme_read32(hp, tregs + TCVR_FRAME) & 0x10000) && --tries) 414 450 udelay(20); 415 451 if (!tries) { 416 - printk(KERN_ERR "happy meal: Aieee, transceiver MIF read bolixed\n"); 452 + netdev_err(hp->dev, "Aieee, transceiver MIF read bolixed\n"); 417 453 return TCVR_FAILURE; 418 454 } 419 455 retval = hme_read32(hp, tregs + TCVR_FRAME) & 0xffff; 420 - ASD(("value=%04x\n", retval)); 456 + ASD("reg=0x%02x value=%04x\n", reg, retval); 421 457 return retval; 422 458 } 423 459 ··· 429 465 { 430 466 int tries = TCVR_WRITE_TRIES; 431 467 432 - ASD(("happy_meal_tcvr_write: reg=0x%02x value=%04x\n", reg, value)); 468 + ASD("reg=0x%02x value=%04x\n", reg, value); 433 469 434 470 /* Welcome to Sun Microsystems, can I take your order please? */ 435 471 if (!(hp->happy_flags & HFLAG_FENABLE)) { ··· 446 482 447 483 /* Anything else? */ 448 484 if (!tries) 449 - printk(KERN_ERR "happy meal: Aieee, transceiver MIF write bolixed\n"); 485 + netdev_err(hp->dev, "Aieee, transceiver MIF write bolixed\n"); 450 486 451 487 /* Fifty-two cents is your change, have a nice day. */ 452 488 } ··· 624 660 /* Enter force mode. */ 625 661 do_force_mode: 626 662 hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); 627 - printk(KERN_NOTICE "%s: Auto-Negotiation unsuccessful, trying force link mode\n", 628 - hp->dev->name); 663 + netdev_notice(hp->dev, 664 + "Auto-Negotiation unsuccessful, trying force link mode\n"); 629 665 hp->sw_bmcr = BMCR_SPEED100; 630 666 happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); 631 667 ··· 684 720 restart_timer = 0; 685 721 } else { 686 722 if (hp->timer_ticks >= 10) { 687 - printk(KERN_NOTICE "%s: Auto negotiation successful, link still " 688 - "not completely up.\n", hp->dev->name); 723 + netdev_notice(hp->dev, 724 + "Auto negotiation successful, link still not completely up.\n"); 689 725 hp->timer_ticks = 0; 690 726 restart_timer = 1; 691 727 } else { ··· 740 776 */ 741 777 742 778 /* Let the user know... */ 743 - printk(KERN_NOTICE "%s: Link down, cable problem?\n", 744 - hp->dev->name); 779 + netdev_notice(hp->dev, 780 + "Link down, cable problem?\n"); 745 781 746 782 ret = happy_meal_init(hp); 747 783 if (ret) { 748 784 /* ho hum... */ 749 - printk(KERN_ERR "%s: Error, cannot re-init the " 750 - "Happy Meal.\n", hp->dev->name); 785 + netdev_err(hp->dev, 786 + "Error, cannot re-init the Happy Meal.\n"); 751 787 } 752 788 goto out; 753 789 } ··· 769 805 case asleep: 770 806 default: 771 807 /* Can't happens.... */ 772 - printk(KERN_ERR "%s: Aieee, link timer is asleep but we got one anyways!\n", 773 - hp->dev->name); 808 + netdev_err(hp->dev, 809 + "Aieee, link timer is asleep but we got one anyways!\n"); 774 810 restart_timer = 0; 775 811 hp->timer_ticks = 0; 776 812 hp->timer_state = asleep; /* foo on you */ ··· 794 830 { 795 831 int tries = TX_RESET_TRIES; 796 832 797 - HMD(("happy_meal_tx_reset: reset, ")); 833 + HMD("reset...\n"); 798 834 799 835 /* Would you like to try our SMCC Delux? */ 800 836 hme_write32(hp, bregs + BMAC_TXSWRESET, 0); ··· 803 839 804 840 /* Lettuce, tomato, buggy hardware (no extra charge)? */ 805 841 if (!tries) 806 - printk(KERN_ERR "happy meal: Transceiver BigMac ATTACK!"); 842 + netdev_err(hp->dev, "Transceiver BigMac ATTACK!"); 807 843 808 844 /* Take care. */ 809 - HMD(("done\n")); 845 + HMD("done\n"); 810 846 } 811 847 812 848 /* hp->happy_lock must be held */ ··· 814 850 { 815 851 int tries = RX_RESET_TRIES; 816 852 817 - HMD(("happy_meal_rx_reset: reset, ")); 853 + HMD("reset...\n"); 818 854 819 855 /* We have a special on GNU/Viking hardware bugs today. */ 820 856 hme_write32(hp, bregs + BMAC_RXSWRESET, 0); ··· 823 859 824 860 /* Will that be all? */ 825 861 if (!tries) 826 - printk(KERN_ERR "happy meal: Receiver BigMac ATTACK!"); 862 + netdev_err(hp->dev, "Receiver BigMac ATTACK!\n"); 827 863 828 864 /* Don't forget your vik_1137125_wa. Have a nice day. */ 829 - HMD(("done\n")); 865 + HMD("done\n"); 830 866 } 831 867 832 868 #define STOP_TRIES 16 ··· 836 872 { 837 873 int tries = STOP_TRIES; 838 874 839 - HMD(("happy_meal_stop: reset, ")); 875 + HMD("reset...\n"); 840 876 841 877 /* We're consolidating our STB products, it's your lucky day. */ 842 878 hme_write32(hp, gregs + GREG_SWRESET, GREG_RESET_ALL); ··· 845 881 846 882 /* Come back next week when we are "Sun Microelectronics". */ 847 883 if (!tries) 848 - printk(KERN_ERR "happy meal: Fry guys."); 884 + netdev_err(hp->dev, "Fry guys.\n"); 849 885 850 886 /* Remember: "Different name, same old buggy as shit hardware." */ 851 - HMD(("done\n")); 887 + HMD("done\n"); 852 888 } 853 889 854 890 /* hp->happy_lock must be held */ ··· 877 913 /* hp->happy_lock must be held */ 878 914 static void happy_meal_poll_stop(struct happy_meal *hp, void __iomem *tregs) 879 915 { 880 - ASD(("happy_meal_poll_stop: ")); 881 - 882 916 /* If polling disabled or not polling already, nothing to do. */ 883 917 if ((hp->happy_flags & (HFLAG_POLLENABLE | HFLAG_POLL)) != 884 918 (HFLAG_POLLENABLE | HFLAG_POLL)) { 885 - HMD(("not polling, return\n")); 919 + ASD("not polling, return\n"); 886 920 return; 887 921 } 888 922 889 923 /* Shut up the MIF. */ 890 - ASD(("were polling, mif ints off, ")); 924 + ASD("were polling, mif ints off, polling off\n"); 891 925 hme_write32(hp, tregs + TCVR_IMASK, 0xffff); 892 926 893 927 /* Turn off polling. */ 894 - ASD(("polling off, ")); 895 928 hme_write32(hp, tregs + TCVR_CFG, 896 929 hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_PENABLE)); 897 930 ··· 897 936 898 937 /* Let the bits set. */ 899 938 udelay(200); 900 - ASD(("done\n")); 939 + ASD("done\n"); 901 940 } 902 941 903 942 /* Only Sun can take such nice parts and fuck up the programming interface ··· 913 952 int result, tries = TCVR_RESET_TRIES; 914 953 915 954 tconfig = hme_read32(hp, tregs + TCVR_CFG); 916 - ASD(("happy_meal_tcvr_reset: tcfg<%08lx> ", tconfig)); 955 + ASD("tcfg=%08x\n", tconfig); 917 956 if (hp->tcvr_type == external) { 918 - ASD(("external<")); 919 957 hme_write32(hp, tregs + TCVR_CFG, tconfig & ~(TCV_CFG_PSELECT)); 920 958 hp->tcvr_type = internal; 921 959 hp->paddr = TCV_PADDR_ITX; 922 - ASD(("ISOLATE,")); 923 960 happy_meal_tcvr_write(hp, tregs, MII_BMCR, 924 961 (BMCR_LOOPBACK|BMCR_PDOWN|BMCR_ISOLATE)); 925 962 result = happy_meal_tcvr_read(hp, tregs, MII_BMCR); 926 963 if (result == TCVR_FAILURE) { 927 - ASD(("phyread_fail>\n")); 964 + ASD("phyread_fail\n"); 928 965 return -1; 929 966 } 930 - ASD(("phyread_ok,PSELECT>")); 967 + ASD("external: ISOLATE, phyread_ok, PSELECT\n"); 931 968 hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT); 932 969 hp->tcvr_type = external; 933 970 hp->paddr = TCV_PADDR_ETX; 934 971 } else { 935 972 if (tconfig & TCV_CFG_MDIO1) { 936 - ASD(("internal<PSELECT,")); 937 973 hme_write32(hp, tregs + TCVR_CFG, (tconfig | TCV_CFG_PSELECT)); 938 - ASD(("ISOLATE,")); 939 974 happy_meal_tcvr_write(hp, tregs, MII_BMCR, 940 975 (BMCR_LOOPBACK|BMCR_PDOWN|BMCR_ISOLATE)); 941 976 result = happy_meal_tcvr_read(hp, tregs, MII_BMCR); 942 977 if (result == TCVR_FAILURE) { 943 - ASD(("phyread_fail>\n")); 978 + ASD("phyread_fail>\n"); 944 979 return -1; 945 980 } 946 - ASD(("phyread_ok,~PSELECT>")); 981 + ASD("internal: PSELECT, ISOLATE, phyread_ok, ~PSELECT\n"); 947 982 hme_write32(hp, tregs + TCVR_CFG, (tconfig & ~(TCV_CFG_PSELECT))); 948 983 hp->tcvr_type = internal; 949 984 hp->paddr = TCV_PADDR_ITX; 950 985 } 951 986 } 952 987 953 - ASD(("BMCR_RESET ")); 988 + ASD("BMCR_RESET...\n"); 954 989 happy_meal_tcvr_write(hp, tregs, MII_BMCR, BMCR_RESET); 955 990 956 991 while (--tries) { ··· 959 1002 udelay(20); 960 1003 } 961 1004 if (!tries) { 962 - ASD(("BMCR RESET FAILED!\n")); 1005 + ASD("BMCR RESET FAILED!\n"); 963 1006 return -1; 964 1007 } 965 - ASD(("RESET_OK\n")); 1008 + ASD("RESET_OK\n"); 966 1009 967 1010 /* Get fresh copies of the PHY registers. */ 968 1011 hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR); ··· 970 1013 hp->sw_physid2 = happy_meal_tcvr_read(hp, tregs, MII_PHYSID2); 971 1014 hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE); 972 1015 973 - ASD(("UNISOLATE")); 1016 + ASD("UNISOLATE...\n"); 974 1017 hp->sw_bmcr &= ~(BMCR_ISOLATE); 975 1018 happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); 976 1019 ··· 984 1027 udelay(20); 985 1028 } 986 1029 if (!tries) { 987 - ASD((" FAILED!\n")); 1030 + ASD("UNISOLATE FAILED!\n"); 988 1031 return -1; 989 1032 } 990 - ASD((" SUCCESS and CSCONFIG_DFBYPASS\n")); 1033 + ASD("SUCCESS and CSCONFIG_DFBYPASS\n"); 991 1034 if (!is_lucent_phy(hp)) { 992 1035 result = happy_meal_tcvr_read(hp, tregs, 993 1036 DP83840_CSCONFIG); ··· 1005 1048 { 1006 1049 unsigned long tconfig = hme_read32(hp, tregs + TCVR_CFG); 1007 1050 1008 - ASD(("happy_meal_transceiver_check: tcfg=%08lx ", tconfig)); 1051 + ASD("tcfg=%08lx\n", tconfig); 1009 1052 if (hp->happy_flags & HFLAG_POLL) { 1010 1053 /* If we are polling, we must stop to get the transceiver type. */ 1011 - ASD(("<polling> ")); 1012 1054 if (hp->tcvr_type == internal) { 1013 1055 if (tconfig & TCV_CFG_MDIO1) { 1014 - ASD(("<internal> <poll stop> ")); 1015 1056 happy_meal_poll_stop(hp, tregs); 1016 1057 hp->paddr = TCV_PADDR_ETX; 1017 1058 hp->tcvr_type = external; 1018 - ASD(("<external>\n")); 1019 1059 tconfig &= ~(TCV_CFG_PENABLE); 1020 1060 tconfig |= TCV_CFG_PSELECT; 1021 1061 hme_write32(hp, tregs + TCVR_CFG, tconfig); 1062 + ASD("poll stop, internal->external\n"); 1022 1063 } 1023 1064 } else { 1024 1065 if (hp->tcvr_type == external) { 1025 - ASD(("<external> ")); 1026 1066 if (!(hme_read32(hp, tregs + TCVR_STATUS) >> 16)) { 1027 - ASD(("<poll stop> ")); 1028 1067 happy_meal_poll_stop(hp, tregs); 1029 1068 hp->paddr = TCV_PADDR_ITX; 1030 1069 hp->tcvr_type = internal; 1031 - ASD(("<internal>\n")); 1032 1070 hme_write32(hp, tregs + TCVR_CFG, 1033 1071 hme_read32(hp, tregs + TCVR_CFG) & 1034 1072 ~(TCV_CFG_PSELECT)); 1073 + ASD("poll stop, external->internal\n"); 1035 1074 } 1036 - ASD(("\n")); 1037 1075 } else { 1038 - ASD(("<none>\n")); 1076 + ASD("polling, none\n"); 1039 1077 } 1040 1078 } 1041 1079 } else { 1042 1080 u32 reread = hme_read32(hp, tregs + TCVR_CFG); 1043 1081 1044 1082 /* Else we can just work off of the MDIO bits. */ 1045 - ASD(("<not polling> ")); 1046 1083 if (reread & TCV_CFG_MDIO1) { 1047 1084 hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT); 1048 1085 hp->paddr = TCV_PADDR_ETX; 1049 1086 hp->tcvr_type = external; 1050 - ASD(("<external>\n")); 1087 + ASD("not polling, external\n"); 1051 1088 } else { 1052 1089 if (reread & TCV_CFG_MDIO0) { 1053 1090 hme_write32(hp, tregs + TCVR_CFG, 1054 1091 tconfig & ~(TCV_CFG_PSELECT)); 1055 1092 hp->paddr = TCV_PADDR_ITX; 1056 1093 hp->tcvr_type = internal; 1057 - ASD(("<internal>\n")); 1094 + ASD("not polling, internal\n"); 1058 1095 } else { 1059 - printk(KERN_ERR "happy meal: Transceiver and a coke please."); 1096 + netdev_err(hp->dev, 1097 + "Transceiver and a coke please."); 1060 1098 hp->tcvr_type = none; /* Grrr... */ 1061 - ASD(("<none>\n")); 1099 + ASD("not polling, none\n"); 1062 1100 } 1063 1101 } 1064 1102 } ··· 1160 1208 struct hmeal_init_block *hb = hp->happy_block; 1161 1209 int i; 1162 1210 1163 - HMD(("happy_meal_init_rings: counters to zero, ")); 1211 + HMD("counters to zero\n"); 1164 1212 hp->rx_new = hp->rx_old = hp->tx_new = hp->tx_old = 0; 1165 1213 1166 1214 /* Free any skippy bufs left around in the rings. */ 1167 - HMD(("clean, ")); 1168 1215 happy_meal_clean_rings(hp); 1169 1216 1170 1217 /* Now get new skippy bufs for the receive ring. */ 1171 - HMD(("init rxring, ")); 1218 + HMD("init rxring\n"); 1172 1219 for (i = 0; i < RX_RING_SIZE; i++) { 1173 1220 struct sk_buff *skb; 1174 1221 u32 mapping; ··· 1194 1243 skb_reserve(skb, RX_OFFSET); 1195 1244 } 1196 1245 1197 - HMD(("init txring, ")); 1246 + HMD("init txring\n"); 1198 1247 for (i = 0; i < TX_RING_SIZE; i++) 1199 1248 hme_write_txd(hp, &hb->happy_meal_txd[i], 0, 0); 1200 1249 1201 - HMD(("done\n")); 1250 + HMD("done\n"); 1202 1251 } 1203 1252 1204 1253 /* hp->happy_lock must be held */ ··· 1245 1294 * XXX so I completely skip checking for it in the BMSR for now. 1246 1295 */ 1247 1296 1248 - #ifdef AUTO_SWITCH_DEBUG 1249 - ASD(("%s: Advertising [ ", hp->dev->name)); 1250 - if (hp->sw_advertise & ADVERTISE_10HALF) 1251 - ASD(("10H ")); 1252 - if (hp->sw_advertise & ADVERTISE_10FULL) 1253 - ASD(("10F ")); 1254 - if (hp->sw_advertise & ADVERTISE_100HALF) 1255 - ASD(("100H ")); 1256 - if (hp->sw_advertise & ADVERTISE_100FULL) 1257 - ASD(("100F ")); 1258 - #endif 1297 + ASD("Advertising [ %s%s%s%s]\n", 1298 + hp->sw_advertise & ADVERTISE_10HALF ? "10H " : "", 1299 + hp->sw_advertise & ADVERTISE_10FULL ? "10F " : "", 1300 + hp->sw_advertise & ADVERTISE_100HALF ? "100H " : "", 1301 + hp->sw_advertise & ADVERTISE_100FULL ? "100F " : ""); 1259 1302 1260 1303 /* Enable Auto-Negotiation, this is usually on already... */ 1261 1304 hp->sw_bmcr |= BMCR_ANENABLE; ··· 1269 1324 udelay(10); 1270 1325 } 1271 1326 if (!timeout) { 1272 - printk(KERN_ERR "%s: Happy Meal would not start auto negotiation " 1273 - "BMCR=0x%04x\n", hp->dev->name, hp->sw_bmcr); 1274 - printk(KERN_NOTICE "%s: Performing force link detection.\n", 1275 - hp->dev->name); 1327 + netdev_err(hp->dev, 1328 + "Happy Meal would not start auto negotiation BMCR=0x%04x\n", 1329 + hp->sw_bmcr); 1330 + netdev_notice(hp->dev, 1331 + "Performing force link detection.\n"); 1276 1332 goto force_link; 1277 1333 } else { 1278 1334 hp->timer_state = arbwait; ··· 1328 1382 void __iomem *erxregs = hp->erxregs; 1329 1383 void __iomem *bregs = hp->bigmacregs; 1330 1384 void __iomem *tregs = hp->tcvregs; 1385 + const char *bursts; 1331 1386 u32 regtmp, rxcfg; 1332 1387 1333 1388 /* If auto-negotiation timer is running, kill it. */ 1334 1389 del_timer(&hp->happy_timer); 1335 1390 1336 - HMD(("happy_meal_init: happy_flags[%08x] ", 1337 - hp->happy_flags)); 1391 + HMD("happy_flags[%08x]\n", hp->happy_flags); 1338 1392 if (!(hp->happy_flags & HFLAG_INIT)) { 1339 - HMD(("set HFLAG_INIT, ")); 1393 + HMD("set HFLAG_INIT\n"); 1340 1394 hp->happy_flags |= HFLAG_INIT; 1341 1395 happy_meal_get_counters(hp, bregs); 1342 1396 } 1343 1397 1344 1398 /* Stop polling. */ 1345 - HMD(("to happy_meal_poll_stop\n")); 1399 + HMD("to happy_meal_poll_stop\n"); 1346 1400 happy_meal_poll_stop(hp, tregs); 1347 1401 1348 1402 /* Stop transmitter and receiver. */ 1349 - HMD(("happy_meal_init: to happy_meal_stop\n")); 1403 + HMD("to happy_meal_stop\n"); 1350 1404 happy_meal_stop(hp, gregs); 1351 1405 1352 1406 /* Alloc and reset the tx/rx descriptor chains. */ 1353 - HMD(("happy_meal_init: to happy_meal_init_rings\n")); 1407 + HMD("to happy_meal_init_rings\n"); 1354 1408 happy_meal_init_rings(hp); 1355 1409 1356 1410 /* Shut up the MIF. */ 1357 - HMD(("happy_meal_init: Disable all MIF irqs (old[%08x]), ", 1358 - hme_read32(hp, tregs + TCVR_IMASK))); 1411 + HMD("Disable all MIF irqs (old[%08x])\n", 1412 + hme_read32(hp, tregs + TCVR_IMASK)); 1359 1413 hme_write32(hp, tregs + TCVR_IMASK, 0xffff); 1360 1414 1361 1415 /* See if we can enable the MIF frame on this card to speak to the DP83840. */ 1362 1416 if (hp->happy_flags & HFLAG_FENABLE) { 1363 - HMD(("use frame old[%08x], ", 1364 - hme_read32(hp, tregs + TCVR_CFG))); 1417 + HMD("use frame old[%08x]\n", 1418 + hme_read32(hp, tregs + TCVR_CFG)); 1365 1419 hme_write32(hp, tregs + TCVR_CFG, 1366 1420 hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_BENABLE)); 1367 1421 } else { 1368 - HMD(("use bitbang old[%08x], ", 1369 - hme_read32(hp, tregs + TCVR_CFG))); 1422 + HMD("use bitbang old[%08x]\n", 1423 + hme_read32(hp, tregs + TCVR_CFG)); 1370 1424 hme_write32(hp, tregs + TCVR_CFG, 1371 1425 hme_read32(hp, tregs + TCVR_CFG) | TCV_CFG_BENABLE); 1372 1426 } 1373 1427 1374 1428 /* Check the state of the transceiver. */ 1375 - HMD(("to happy_meal_transceiver_check\n")); 1429 + HMD("to happy_meal_transceiver_check\n"); 1376 1430 happy_meal_transceiver_check(hp, tregs); 1377 1431 1378 1432 /* Put the Big Mac into a sane state. */ 1379 - HMD(("happy_meal_init: ")); 1380 1433 switch(hp->tcvr_type) { 1381 1434 case none: 1382 1435 /* Cannot operate if we don't know the transceiver type! */ 1383 - HMD(("AAIEEE no transceiver type, EAGAIN")); 1436 + HMD("AAIEEE no transceiver type, EAGAIN\n"); 1384 1437 return -EAGAIN; 1385 1438 1386 1439 case internal: 1387 1440 /* Using the MII buffers. */ 1388 - HMD(("internal, using MII, ")); 1441 + HMD("internal, using MII\n"); 1389 1442 hme_write32(hp, bregs + BMAC_XIFCFG, 0); 1390 1443 break; 1391 1444 1392 1445 case external: 1393 1446 /* Not using the MII, disable it. */ 1394 - HMD(("external, disable MII, ")); 1447 + HMD("external, disable MII\n"); 1395 1448 hme_write32(hp, bregs + BMAC_XIFCFG, BIGMAC_XCFG_MIIDISAB); 1396 1449 break; 1397 1450 } ··· 1399 1454 return -EAGAIN; 1400 1455 1401 1456 /* Reset the Happy Meal Big Mac transceiver and the receiver. */ 1402 - HMD(("tx/rx reset, ")); 1457 + HMD("tx/rx reset\n"); 1403 1458 happy_meal_tx_reset(hp, bregs); 1404 1459 happy_meal_rx_reset(hp, bregs); 1405 1460 1406 1461 /* Set jam size and inter-packet gaps to reasonable defaults. */ 1407 - HMD(("jsize/ipg1/ipg2, ")); 1408 1462 hme_write32(hp, bregs + BMAC_JSIZE, DEFAULT_JAMSIZE); 1409 1463 hme_write32(hp, bregs + BMAC_IGAP1, DEFAULT_IPG1); 1410 1464 hme_write32(hp, bregs + BMAC_IGAP2, DEFAULT_IPG2); 1411 1465 1412 1466 /* Load up the MAC address and random seed. */ 1413 - HMD(("rseed/macaddr, ")); 1414 1467 1415 1468 /* The docs recommend to use the 10LSB of our MAC here. */ 1416 1469 hme_write32(hp, bregs + BMAC_RSEED, ((e[5] | e[4]<<8)&0x3ff)); ··· 1417 1474 hme_write32(hp, bregs + BMAC_MACADDR1, ((e[2] << 8) | e[3])); 1418 1475 hme_write32(hp, bregs + BMAC_MACADDR0, ((e[0] << 8) | e[1])); 1419 1476 1420 - HMD(("htable, ")); 1421 1477 if ((hp->dev->flags & IFF_ALLMULTI) || 1422 1478 (netdev_mc_count(hp->dev) > 64)) { 1423 1479 hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff); ··· 1446 1504 } 1447 1505 1448 1506 /* Set the RX and TX ring ptrs. */ 1449 - HMD(("ring ptrs rxr[%08x] txr[%08x]\n", 1450 - ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0)), 1451 - ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_txd, 0)))); 1507 + HMD("ring ptrs rxr[%08x] txr[%08x]\n", 1508 + ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0)), 1509 + ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_txd, 0))); 1452 1510 hme_write32(hp, erxregs + ERX_RING, 1453 1511 ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0))); 1454 1512 hme_write32(hp, etxregs + ETX_RING, ··· 1466 1524 | 0x4); 1467 1525 1468 1526 /* Set the supported burst sizes. */ 1469 - HMD(("happy_meal_init: old[%08x] bursts<", 1470 - hme_read32(hp, gregs + GREG_CFG))); 1471 - 1472 1527 #ifndef CONFIG_SPARC 1473 1528 /* It is always PCI and can handle 64byte bursts. */ 1474 1529 hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST64); ··· 1493 1554 } 1494 1555 #endif 1495 1556 1496 - HMD(("64>")); 1557 + bursts = "64"; 1497 1558 hme_write32(hp, gregs + GREG_CFG, gcfg); 1498 1559 } else if (hp->happy_bursts & DMA_BURST32) { 1499 - HMD(("32>")); 1560 + bursts = "32"; 1500 1561 hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST32); 1501 1562 } else if (hp->happy_bursts & DMA_BURST16) { 1502 - HMD(("16>")); 1563 + bursts = "16"; 1503 1564 hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST16); 1504 1565 } else { 1505 - HMD(("XXX>")); 1566 + bursts = "XXX"; 1506 1567 hme_write32(hp, gregs + GREG_CFG, 0); 1507 1568 } 1508 1569 #endif /* CONFIG_SPARC */ 1509 1570 1571 + HMD("old[%08x] bursts<%s>\n", 1572 + hme_read32(hp, gregs + GREG_CFG), bursts); 1573 + 1510 1574 /* Turn off interrupts we do not want to hear. */ 1511 - HMD((", enable global interrupts, ")); 1512 1575 hme_write32(hp, gregs + GREG_IMASK, 1513 1576 (GREG_IMASK_GOTFRAME | GREG_IMASK_RCNTEXP | 1514 1577 GREG_IMASK_SENTFRAME | GREG_IMASK_TXPERR)); 1515 1578 1516 1579 /* Set the transmit ring buffer size. */ 1517 - HMD(("tx rsize=%d oreg[%08x], ", (int)TX_RING_SIZE, 1518 - hme_read32(hp, etxregs + ETX_RSIZE))); 1580 + HMD("tx rsize=%d oreg[%08x]\n", (int)TX_RING_SIZE, 1581 + hme_read32(hp, etxregs + ETX_RSIZE)); 1519 1582 hme_write32(hp, etxregs + ETX_RSIZE, (TX_RING_SIZE >> ETX_RSIZE_SHIFT) - 1); 1520 1583 1521 1584 /* Enable transmitter DVMA. */ 1522 - HMD(("tx dma enable old[%08x], ", 1523 - hme_read32(hp, etxregs + ETX_CFG))); 1585 + HMD("tx dma enable old[%08x]\n", hme_read32(hp, etxregs + ETX_CFG)); 1524 1586 hme_write32(hp, etxregs + ETX_CFG, 1525 1587 hme_read32(hp, etxregs + ETX_CFG) | ETX_CFG_DMAENABLE); 1526 1588 ··· 1530 1590 * properly. I cannot think of a sane way to provide complete 1531 1591 * coverage for this hardware bug yet. 1532 1592 */ 1533 - HMD(("erx regs bug old[%08x]\n", 1534 - hme_read32(hp, erxregs + ERX_CFG))); 1593 + HMD("erx regs bug old[%08x]\n", 1594 + hme_read32(hp, erxregs + ERX_CFG)); 1535 1595 hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET)); 1536 1596 regtmp = hme_read32(hp, erxregs + ERX_CFG); 1537 1597 hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET)); 1538 1598 if (hme_read32(hp, erxregs + ERX_CFG) != ERX_CFG_DEFAULT(RX_OFFSET)) { 1539 - printk(KERN_ERR "happy meal: Eieee, rx config register gets greasy fries.\n"); 1540 - printk(KERN_ERR "happy meal: Trying to set %08x, reread gives %08x\n", 1541 - ERX_CFG_DEFAULT(RX_OFFSET), regtmp); 1599 + netdev_err(hp->dev, 1600 + "Eieee, rx config register gets greasy fries.\n"); 1601 + netdev_err(hp->dev, 1602 + "Trying to set %08x, reread gives %08x\n", 1603 + ERX_CFG_DEFAULT(RX_OFFSET), regtmp); 1542 1604 /* XXX Should return failure here... */ 1543 1605 } 1544 1606 1545 1607 /* Enable Big Mac hash table filter. */ 1546 - HMD(("happy_meal_init: enable hash rx_cfg_old[%08x], ", 1547 - hme_read32(hp, bregs + BMAC_RXCFG))); 1608 + HMD("enable hash rx_cfg_old[%08x]\n", 1609 + hme_read32(hp, bregs + BMAC_RXCFG)); 1548 1610 rxcfg = BIGMAC_RXCFG_HENABLE | BIGMAC_RXCFG_REJME; 1549 1611 if (hp->dev->flags & IFF_PROMISC) 1550 1612 rxcfg |= BIGMAC_RXCFG_PMISC; ··· 1556 1614 udelay(10); 1557 1615 1558 1616 /* Ok, configure the Big Mac transmitter. */ 1559 - HMD(("BIGMAC init, ")); 1617 + HMD("BIGMAC init\n"); 1560 1618 regtmp = 0; 1561 1619 if (hp->happy_flags & HFLAG_FULL) 1562 1620 regtmp |= BIGMAC_TXCFG_FULLDPLX; ··· 1580 1638 if (hp->tcvr_type == external) 1581 1639 regtmp |= BIGMAC_XCFG_MIIDISAB; 1582 1640 1583 - HMD(("XIF config old[%08x], ", 1584 - hme_read32(hp, bregs + BMAC_XIFCFG))); 1641 + HMD("XIF config old[%08x]\n", hme_read32(hp, bregs + BMAC_XIFCFG)); 1585 1642 hme_write32(hp, bregs + BMAC_XIFCFG, regtmp); 1586 1643 1587 1644 /* Start things up. */ 1588 - HMD(("tx old[%08x] and rx [%08x] ON!\n", 1589 - hme_read32(hp, bregs + BMAC_TXCFG), 1590 - hme_read32(hp, bregs + BMAC_RXCFG))); 1645 + HMD("tx old[%08x] and rx [%08x] ON!\n", 1646 + hme_read32(hp, bregs + BMAC_TXCFG), 1647 + hme_read32(hp, bregs + BMAC_RXCFG)); 1591 1648 1592 1649 /* Set larger TX/RX size to allow for 802.1q */ 1593 1650 hme_write32(hp, bregs + BMAC_TXMAX, ETH_FRAME_LEN + 8); ··· 1676 1735 GREG_STAT_MIFIRQ | GREG_STAT_TXEACK | GREG_STAT_TXLERR | 1677 1736 GREG_STAT_TXPERR | GREG_STAT_TXTERR | GREG_STAT_SLVERR | 1678 1737 GREG_STAT_SLVPERR)) 1679 - printk(KERN_ERR "%s: Error interrupt for happy meal, status = %08x\n", 1680 - hp->dev->name, status); 1738 + netdev_err(hp->dev, 1739 + "Error interrupt for happy meal, status = %08x\n", 1740 + status); 1681 1741 1682 1742 if (status & GREG_STAT_RFIFOVF) { 1683 1743 /* Receive FIFO overflow is harmless and the hardware will take 1684 1744 care of it, just some packets are lost. Who cares. */ 1685 - printk(KERN_DEBUG "%s: Happy Meal receive FIFO overflow.\n", hp->dev->name); 1745 + netdev_dbg(hp->dev, "Happy Meal receive FIFO overflow.\n"); 1686 1746 } 1687 1747 1688 1748 if (status & GREG_STAT_STSTERR) { 1689 1749 /* BigMAC SQE link test failed. */ 1690 - printk(KERN_ERR "%s: Happy Meal BigMAC SQE test failed.\n", hp->dev->name); 1750 + netdev_err(hp->dev, "Happy Meal BigMAC SQE test failed.\n"); 1691 1751 reset = 1; 1692 1752 } 1693 1753 1694 1754 if (status & GREG_STAT_TFIFO_UND) { 1695 1755 /* Transmit FIFO underrun, again DMA error likely. */ 1696 - printk(KERN_ERR "%s: Happy Meal transmitter FIFO underrun, DMA error.\n", 1697 - hp->dev->name); 1756 + netdev_err(hp->dev, 1757 + "Happy Meal transmitter FIFO underrun, DMA error.\n"); 1698 1758 reset = 1; 1699 1759 } 1700 1760 ··· 1703 1761 /* Driver error, tried to transmit something larger 1704 1762 * than ethernet max mtu. 1705 1763 */ 1706 - printk(KERN_ERR "%s: Happy Meal MAX Packet size error.\n", hp->dev->name); 1764 + netdev_err(hp->dev, "Happy Meal MAX Packet size error.\n"); 1707 1765 reset = 1; 1708 1766 } 1709 1767 ··· 1713 1771 * faster than the interrupt handler could keep up 1714 1772 * with. 1715 1773 */ 1716 - printk(KERN_INFO "%s: Happy Meal out of receive " 1717 - "descriptors, packet dropped.\n", 1718 - hp->dev->name); 1774 + netdev_info(hp->dev, 1775 + "Happy Meal out of receive descriptors, packet dropped.\n"); 1719 1776 } 1720 1777 1721 1778 if (status & (GREG_STAT_RXERR|GREG_STAT_RXPERR|GREG_STAT_RXTERR)) { 1722 1779 /* All sorts of DMA receive errors. */ 1723 - printk(KERN_ERR "%s: Happy Meal rx DMA errors [ ", hp->dev->name); 1724 - if (status & GREG_STAT_RXERR) 1725 - printk("GenericError "); 1726 - if (status & GREG_STAT_RXPERR) 1727 - printk("ParityError "); 1728 - if (status & GREG_STAT_RXTERR) 1729 - printk("RxTagBotch "); 1730 - printk("]\n"); 1780 + netdev_err(hp->dev, "Happy Meal rx DMA errors [ %s%s%s]\n", 1781 + status & GREG_STAT_RXERR ? "GenericError " : "", 1782 + status & GREG_STAT_RXPERR ? "ParityError " : "", 1783 + status & GREG_STAT_RXTERR ? "RxTagBotch " : ""); 1731 1784 reset = 1; 1732 1785 } 1733 1786 ··· 1730 1793 /* Driver bug, didn't set EOP bit in tx descriptor given 1731 1794 * to the happy meal. 1732 1795 */ 1733 - printk(KERN_ERR "%s: EOP not set in happy meal transmit descriptor!\n", 1734 - hp->dev->name); 1796 + netdev_err(hp->dev, 1797 + "EOP not set in happy meal transmit descriptor!\n"); 1735 1798 reset = 1; 1736 1799 } 1737 1800 1738 1801 if (status & GREG_STAT_MIFIRQ) { 1739 1802 /* MIF signalled an interrupt, were we polling it? */ 1740 - printk(KERN_ERR "%s: Happy Meal MIF interrupt.\n", hp->dev->name); 1803 + netdev_err(hp->dev, "Happy Meal MIF interrupt.\n"); 1741 1804 } 1742 1805 1743 1806 if (status & 1744 1807 (GREG_STAT_TXEACK|GREG_STAT_TXLERR|GREG_STAT_TXPERR|GREG_STAT_TXTERR)) { 1745 1808 /* All sorts of transmit DMA errors. */ 1746 - printk(KERN_ERR "%s: Happy Meal tx DMA errors [ ", hp->dev->name); 1747 - if (status & GREG_STAT_TXEACK) 1748 - printk("GenericError "); 1749 - if (status & GREG_STAT_TXLERR) 1750 - printk("LateError "); 1751 - if (status & GREG_STAT_TXPERR) 1752 - printk("ParityError "); 1753 - if (status & GREG_STAT_TXTERR) 1754 - printk("TagBotch "); 1755 - printk("]\n"); 1809 + netdev_err(hp->dev, "Happy Meal tx DMA errors [ %s%s%s%s]\n", 1810 + status & GREG_STAT_TXEACK ? "GenericError " : "", 1811 + status & GREG_STAT_TXLERR ? "LateError " : "", 1812 + status & GREG_STAT_TXPERR ? "ParityError " : "", 1813 + status & GREG_STAT_TXTERR ? "TagBotch " : ""); 1756 1814 reset = 1; 1757 1815 } 1758 1816 ··· 1755 1823 /* Bus or parity error when cpu accessed happy meal registers 1756 1824 * or it's internal FIFO's. Should never see this. 1757 1825 */ 1758 - printk(KERN_ERR "%s: Happy Meal register access SBUS slave (%s) error.\n", 1759 - hp->dev->name, 1760 - (status & GREG_STAT_SLVPERR) ? "parity" : "generic"); 1826 + netdev_err(hp->dev, 1827 + "Happy Meal register access SBUS slave (%s) error.\n", 1828 + (status & GREG_STAT_SLVPERR) ? "parity" : "generic"); 1761 1829 reset = 1; 1762 1830 } 1763 1831 1764 1832 if (reset) { 1765 - printk(KERN_NOTICE "%s: Resetting...\n", hp->dev->name); 1833 + netdev_notice(hp->dev, "Resetting...\n"); 1766 1834 happy_meal_init(hp); 1767 1835 return 1; 1768 1836 } ··· 1774 1842 { 1775 1843 void __iomem *tregs = hp->tcvregs; 1776 1844 1777 - printk(KERN_INFO "%s: Link status change.\n", hp->dev->name); 1845 + netdev_info(hp->dev, "Link status change.\n"); 1778 1846 hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); 1779 1847 hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA); 1780 1848 1781 1849 /* Use the fastest transmission protocol possible. */ 1782 1850 if (hp->sw_lpa & LPA_100FULL) { 1783 - printk(KERN_INFO "%s: Switching to 100Mbps at full duplex.", hp->dev->name); 1851 + netdev_info(hp->dev, "Switching to 100Mbps at full duplex.\n"); 1784 1852 hp->sw_bmcr |= (BMCR_FULLDPLX | BMCR_SPEED100); 1785 1853 } else if (hp->sw_lpa & LPA_100HALF) { 1786 - printk(KERN_INFO "%s: Switching to 100MBps at half duplex.", hp->dev->name); 1854 + netdev_info(hp->dev, "Switching to 100MBps at half duplex.\n"); 1787 1855 hp->sw_bmcr |= BMCR_SPEED100; 1788 1856 } else if (hp->sw_lpa & LPA_10FULL) { 1789 - printk(KERN_INFO "%s: Switching to 10MBps at full duplex.", hp->dev->name); 1857 + netdev_info(hp->dev, "Switching to 10MBps at full duplex.\n"); 1790 1858 hp->sw_bmcr |= BMCR_FULLDPLX; 1791 1859 } else { 1792 - printk(KERN_INFO "%s: Using 10Mbps at half duplex.", hp->dev->name); 1860 + netdev_info(hp->dev, "Using 10Mbps at half duplex.\n"); 1793 1861 } 1794 1862 happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); 1795 1863 1796 1864 /* Finally stop polling and shut up the MIF. */ 1797 1865 happy_meal_poll_stop(hp, tregs); 1798 1866 } 1799 - 1800 - #ifdef TXDEBUG 1801 - #define TXD(x) printk x 1802 - #else 1803 - #define TXD(x) 1804 - #endif 1805 1867 1806 1868 /* hp->happy_lock must be held */ 1807 1869 static void happy_meal_tx(struct happy_meal *hp) ··· 1806 1880 int elem; 1807 1881 1808 1882 elem = hp->tx_old; 1809 - TXD(("TX<")); 1810 1883 while (elem != hp->tx_new) { 1811 1884 struct sk_buff *skb; 1812 1885 u32 flags, dma_addr, dma_len; 1813 1886 int frag; 1814 1887 1815 - TXD(("[%d]", elem)); 1888 + netdev_vdbg(hp->dev, "TX[%d]\n", elem); 1816 1889 this = &txbase[elem]; 1817 1890 flags = hme_read_desc32(hp, &this->tx_flags); 1818 1891 if (flags & TXFLAG_OWN) ··· 1847 1922 dev->stats.tx_packets++; 1848 1923 } 1849 1924 hp->tx_old = elem; 1850 - TXD((">")); 1851 1925 1852 1926 if (netif_queue_stopped(dev) && 1853 1927 TX_BUFFS_AVAIL(hp) > (MAX_SKB_FRAGS + 1)) 1854 1928 netif_wake_queue(dev); 1855 1929 } 1856 - 1857 - #ifdef RXDEBUG 1858 - #define RXD(x) printk x 1859 - #else 1860 - #define RXD(x) 1861 - #endif 1862 1930 1863 1931 /* Originally I used to handle the allocation failure by just giving back just 1864 1932 * that one ring buffer to the happy meal. Problem is that usually when that ··· 1869 1951 int elem = hp->rx_new, drops = 0; 1870 1952 u32 flags; 1871 1953 1872 - RXD(("RX<")); 1873 1954 this = &rxbase[elem]; 1874 1955 while (!((flags = hme_read_desc32(hp, &this->rx_flags)) & RXFLAG_OWN)) { 1875 1956 struct sk_buff *skb; ··· 1876 1959 u16 csum = flags & RXFLAG_CSUM; 1877 1960 u32 dma_addr = hme_read_desc32(hp, &this->rx_addr); 1878 1961 1879 - RXD(("[%d ", elem)); 1880 - 1881 1962 /* Check for errors. */ 1882 1963 if ((len < ETH_ZLEN) || (flags & RXFLAG_OVERFLOW)) { 1883 - RXD(("ERR(%08x)]", flags)); 1964 + netdev_vdbg(dev, "RX[%d ERR(%08x)]", elem, flags); 1884 1965 dev->stats.rx_errors++; 1885 1966 if (len < ETH_ZLEN) 1886 1967 dev->stats.rx_length_errors++; ··· 1950 2035 skb->csum = csum_unfold(~(__force __sum16)htons(csum)); 1951 2036 skb->ip_summed = CHECKSUM_COMPLETE; 1952 2037 1953 - RXD(("len=%d csum=%4x]", len, csum)); 2038 + netdev_vdbg(dev, "RX[%d len=%d csum=%4x]", elem, len, csum); 1954 2039 skb->protocol = eth_type_trans(skb, dev); 1955 2040 netif_rx(skb); 1956 2041 ··· 1962 2047 } 1963 2048 hp->rx_new = elem; 1964 2049 if (drops) 1965 - printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n", hp->dev->name); 1966 - RXD((">")); 2050 + netdev_info(hp->dev, "Memory squeeze, deferring packet.\n"); 1967 2051 } 1968 2052 1969 2053 static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) ··· 1971 2057 struct happy_meal *hp = netdev_priv(dev); 1972 2058 u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); 1973 2059 1974 - HMD(("happy_meal_interrupt: status=%08x ", happy_status)); 2060 + HMD("status=%08x\n", happy_status); 1975 2061 1976 2062 spin_lock(&hp->happy_lock); 1977 2063 1978 2064 if (happy_status & GREG_STAT_ERRORS) { 1979 - HMD(("ERRORS ")); 1980 2065 if (happy_meal_is_not_so_happy(hp, /* un- */ happy_status)) 1981 2066 goto out; 1982 2067 } 1983 2068 1984 - if (happy_status & GREG_STAT_MIFIRQ) { 1985 - HMD(("MIFIRQ ")); 2069 + if (happy_status & GREG_STAT_MIFIRQ) 1986 2070 happy_meal_mif_interrupt(hp); 1987 - } 1988 2071 1989 - if (happy_status & GREG_STAT_TXALL) { 1990 - HMD(("TXALL ")); 2072 + if (happy_status & GREG_STAT_TXALL) 1991 2073 happy_meal_tx(hp); 1992 - } 1993 2074 1994 - if (happy_status & GREG_STAT_RXTOHOST) { 1995 - HMD(("RXTOHOST ")); 2075 + if (happy_status & GREG_STAT_RXTOHOST) 1996 2076 happy_meal_rx(hp, dev); 1997 - } 1998 2077 1999 - HMD(("done\n")); 2078 + HMD("done\n"); 2000 2079 out: 2001 2080 spin_unlock(&hp->happy_lock); 2002 2081 ··· 2007 2100 struct happy_meal *hp = netdev_priv(dev); 2008 2101 u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); 2009 2102 2010 - HMD(("quattro_interrupt: status=%08x ", happy_status)); 2103 + HMD("status=%08x\n", happy_status); 2011 2104 2012 2105 if (!(happy_status & (GREG_STAT_ERRORS | 2013 2106 GREG_STAT_MIFIRQ | ··· 2017 2110 2018 2111 spin_lock(&hp->happy_lock); 2019 2112 2020 - if (happy_status & GREG_STAT_ERRORS) { 2021 - HMD(("ERRORS ")); 2113 + if (happy_status & GREG_STAT_ERRORS) 2022 2114 if (happy_meal_is_not_so_happy(hp, happy_status)) 2023 2115 goto next; 2024 - } 2025 2116 2026 - if (happy_status & GREG_STAT_MIFIRQ) { 2027 - HMD(("MIFIRQ ")); 2117 + if (happy_status & GREG_STAT_MIFIRQ) 2028 2118 happy_meal_mif_interrupt(hp); 2029 - } 2030 2119 2031 - if (happy_status & GREG_STAT_TXALL) { 2032 - HMD(("TXALL ")); 2120 + if (happy_status & GREG_STAT_TXALL) 2033 2121 happy_meal_tx(hp); 2034 - } 2035 2122 2036 - if (happy_status & GREG_STAT_RXTOHOST) { 2037 - HMD(("RXTOHOST ")); 2123 + if (happy_status & GREG_STAT_RXTOHOST) 2038 2124 happy_meal_rx(hp, dev); 2039 - } 2040 2125 2041 2126 next: 2042 2127 spin_unlock(&hp->happy_lock); 2043 2128 } 2044 - HMD(("done\n")); 2129 + HMD("done\n"); 2045 2130 2046 2131 return IRQ_HANDLED; 2047 2132 } ··· 2044 2145 struct happy_meal *hp = netdev_priv(dev); 2045 2146 int res; 2046 2147 2047 - HMD(("happy_meal_open: ")); 2048 - 2049 2148 /* On SBUS Quattro QFE cards, all hme interrupts are concentrated 2050 2149 * into a single source which we register handling at probe time. 2051 2150 */ ··· 2051 2154 res = request_irq(hp->irq, happy_meal_interrupt, IRQF_SHARED, 2052 2155 dev->name, dev); 2053 2156 if (res) { 2054 - HMD(("EAGAIN\n")); 2055 - printk(KERN_ERR "happy_meal(SBUS): Can't order irq %d to go.\n", 2056 - hp->irq); 2157 + HMD("EAGAIN\n"); 2158 + netdev_err(dev, "Can't order irq %d to go.\n", hp->irq); 2057 2159 2058 2160 return -EAGAIN; 2059 2161 } 2060 2162 } 2061 2163 2062 - HMD(("to happy_meal_init\n")); 2164 + HMD("to happy_meal_init\n"); 2063 2165 2064 2166 spin_lock_irq(&hp->happy_lock); 2065 2167 res = happy_meal_init(hp); ··· 2092 2196 return 0; 2093 2197 } 2094 2198 2095 - #ifdef SXDEBUG 2096 - #define SXD(x) printk x 2097 - #else 2098 - #define SXD(x) 2099 - #endif 2100 - 2101 2199 static void happy_meal_tx_timeout(struct net_device *dev, unsigned int txqueue) 2102 2200 { 2103 2201 struct happy_meal *hp = netdev_priv(dev); 2104 2202 2105 - printk (KERN_ERR "%s: transmit timed out, resetting\n", dev->name); 2203 + netdev_err(dev, "transmit timed out, resetting\n"); 2106 2204 tx_dump_log(); 2107 - printk (KERN_ERR "%s: Happy Status %08x TX[%08x:%08x]\n", dev->name, 2108 - hme_read32(hp, hp->gregs + GREG_STAT), 2109 - hme_read32(hp, hp->etxregs + ETX_CFG), 2110 - hme_read32(hp, hp->bigmacregs + BMAC_TXCFG)); 2205 + netdev_err(dev, "Happy Status %08x TX[%08x:%08x]\n", 2206 + hme_read32(hp, hp->gregs + GREG_STAT), 2207 + hme_read32(hp, hp->etxregs + ETX_CFG), 2208 + hme_read32(hp, hp->bigmacregs + BMAC_TXCFG)); 2111 2209 2112 2210 spin_lock_irq(&hp->happy_lock); 2113 2211 happy_meal_init(hp); ··· 2151 2261 if (TX_BUFFS_AVAIL(hp) <= (skb_shinfo(skb)->nr_frags + 1)) { 2152 2262 netif_stop_queue(dev); 2153 2263 spin_unlock_irq(&hp->happy_lock); 2154 - printk(KERN_ERR "%s: BUG! Tx Ring full when queue awake!\n", 2155 - dev->name); 2264 + netdev_err(dev, "BUG! Tx Ring full when queue awake!\n"); 2156 2265 return NETDEV_TX_BUSY; 2157 2266 } 2158 2267 2159 2268 entry = hp->tx_new; 2160 - SXD(("SX<l[%d]e[%d]>", len, entry)); 2269 + netdev_vdbg(dev, "SX<l[%d]e[%d]>\n", skb->len, entry); 2161 2270 hp->tx_skbs[entry] = skb; 2162 2271 2163 2272 if (skb_shinfo(skb)->nr_frags == 0) { ··· 2356 2467 { 2357 2468 struct happy_meal *hp = netdev_priv(dev); 2358 2469 2359 - strscpy(info->driver, "sunhme", sizeof(info->driver)); 2360 - strscpy(info->version, "2.02", sizeof(info->version)); 2470 + strscpy(info->driver, DRV_NAME, sizeof(info->driver)); 2361 2471 if (hp->happy_flags & HFLAG_PCI) { 2362 2472 struct pci_dev *pdev = hp->happy_dev; 2363 2473 strscpy(info->bus_info, pci_name(pdev), sizeof(info->bus_info)); ··· 2392 2504 .set_link_ksettings = hme_set_link_ksettings, 2393 2505 }; 2394 2506 2395 - static int hme_version_printed; 2396 - 2397 2507 #ifdef CONFIG_SBUS 2398 2508 /* Given a happy meal sbus device, find it's quattro parent. 2399 2509 * If none exist, allocate and return a new one. ··· 2410 2524 return qp; 2411 2525 2412 2526 qp = kmalloc(sizeof(struct quattro), GFP_KERNEL); 2413 - if (qp != NULL) { 2414 - int i; 2527 + if (!qp) 2528 + return NULL; 2415 2529 2416 - for (i = 0; i < 4; i++) 2417 - qp->happy_meals[i] = NULL; 2530 + memset(qp->happy_meals, 0, sizeof(*qp->happy_meals)); 2418 2531 2419 - qp->quattro_dev = child; 2420 - qp->next = qfe_sbus_list; 2421 - qfe_sbus_list = qp; 2532 + qp->quattro_dev = child; 2533 + qp->next = qfe_sbus_list; 2534 + qfe_sbus_list = qp; 2422 2535 2423 - platform_set_drvdata(op, qp); 2424 - } 2536 + platform_set_drvdata(op, qp); 2425 2537 return qp; 2426 2538 } 2427 2539 ··· 2447 2563 IRQF_SHARED, "Quattro", 2448 2564 qp); 2449 2565 if (err != 0) { 2450 - printk(KERN_ERR "Quattro HME: IRQ registration " 2451 - "error %d.\n", err); 2566 + dev_err(&op->dev, 2567 + "Quattro HME: IRQ registration error %d.\n", 2568 + err); 2452 2569 return err; 2453 2570 } 2454 2571 } ··· 2480 2595 #ifdef CONFIG_PCI 2481 2596 static struct quattro *quattro_pci_find(struct pci_dev *pdev) 2482 2597 { 2598 + int i; 2483 2599 struct pci_dev *bdev = pdev->bus->self; 2484 2600 struct quattro *qp; 2485 2601 2486 - if (!bdev) return NULL; 2602 + if (!bdev) 2603 + return ERR_PTR(-ENODEV); 2604 + 2487 2605 for (qp = qfe_pci_list; qp != NULL; qp = qp->next) { 2488 2606 struct pci_dev *qpdev = qp->quattro_dev; 2489 2607 2490 2608 if (qpdev == bdev) 2491 2609 return qp; 2492 2610 } 2611 + 2493 2612 qp = kmalloc(sizeof(struct quattro), GFP_KERNEL); 2494 - if (qp != NULL) { 2495 - int i; 2613 + if (!qp) 2614 + return ERR_PTR(-ENOMEM); 2496 2615 2497 - for (i = 0; i < 4; i++) 2498 - qp->happy_meals[i] = NULL; 2616 + for (i = 0; i < 4; i++) 2617 + qp->happy_meals[i] = NULL; 2499 2618 2500 - qp->quattro_dev = bdev; 2501 - qp->next = qfe_pci_list; 2502 - qfe_pci_list = qp; 2619 + qp->quattro_dev = bdev; 2620 + qp->next = qfe_pci_list; 2621 + qfe_pci_list = qp; 2503 2622 2504 - /* No range tricks necessary on PCI. */ 2505 - qp->nranges = 0; 2506 - } 2623 + /* No range tricks necessary on PCI. */ 2624 + qp->nranges = 0; 2507 2625 return qp; 2508 2626 } 2509 2627 #endif /* CONFIG_PCI */ ··· 2556 2668 goto err_out; 2557 2669 SET_NETDEV_DEV(dev, &op->dev); 2558 2670 2559 - if (hme_version_printed++ == 0) 2560 - printk(KERN_INFO "%s", version); 2561 - 2562 2671 /* If user did not specify a MAC address specifically, use 2563 2672 * the Quattro local-mac-address property... 2564 2673 */ ··· 2597 2712 hp->gregs = of_ioremap(&op->resource[0], 0, 2598 2713 GREG_REG_SIZE, "HME Global Regs"); 2599 2714 if (!hp->gregs) { 2600 - printk(KERN_ERR "happymeal: Cannot map global registers.\n"); 2715 + dev_err(&op->dev, "Cannot map global registers.\n"); 2601 2716 goto err_out_free_netdev; 2602 2717 } 2603 2718 2604 2719 hp->etxregs = of_ioremap(&op->resource[1], 0, 2605 2720 ETX_REG_SIZE, "HME TX Regs"); 2606 2721 if (!hp->etxregs) { 2607 - printk(KERN_ERR "happymeal: Cannot map MAC TX registers.\n"); 2722 + dev_err(&op->dev, "Cannot map MAC TX registers.\n"); 2608 2723 goto err_out_iounmap; 2609 2724 } 2610 2725 2611 2726 hp->erxregs = of_ioremap(&op->resource[2], 0, 2612 2727 ERX_REG_SIZE, "HME RX Regs"); 2613 2728 if (!hp->erxregs) { 2614 - printk(KERN_ERR "happymeal: Cannot map MAC RX registers.\n"); 2729 + dev_err(&op->dev, "Cannot map MAC RX registers.\n"); 2615 2730 goto err_out_iounmap; 2616 2731 } 2617 2732 2618 2733 hp->bigmacregs = of_ioremap(&op->resource[3], 0, 2619 2734 BMAC_REG_SIZE, "HME BIGMAC Regs"); 2620 2735 if (!hp->bigmacregs) { 2621 - printk(KERN_ERR "happymeal: Cannot map BIGMAC registers.\n"); 2736 + dev_err(&op->dev, "Cannot map BIGMAC registers.\n"); 2622 2737 goto err_out_iounmap; 2623 2738 } 2624 2739 2625 2740 hp->tcvregs = of_ioremap(&op->resource[4], 0, 2626 2741 TCVR_REG_SIZE, "HME Tranceiver Regs"); 2627 2742 if (!hp->tcvregs) { 2628 - printk(KERN_ERR "happymeal: Cannot map TCVR registers.\n"); 2743 + dev_err(&op->dev, "Cannot map TCVR registers.\n"); 2629 2744 goto err_out_iounmap; 2630 2745 } 2631 2746 ··· 2692 2807 2693 2808 err = register_netdev(hp->dev); 2694 2809 if (err) { 2695 - printk(KERN_ERR "happymeal: Cannot register net device, " 2696 - "aborting.\n"); 2810 + dev_err(&op->dev, "Cannot register net device, aborting.\n"); 2697 2811 goto err_out_free_coherent; 2698 2812 } 2699 2813 2700 2814 platform_set_drvdata(op, hp); 2701 2815 2702 2816 if (qfe_slot != -1) 2703 - printk(KERN_INFO "%s: Quattro HME slot %d (SBUS) 10/100baseT Ethernet ", 2704 - dev->name, qfe_slot); 2817 + netdev_info(dev, 2818 + "Quattro HME slot %d (SBUS) 10/100baseT Ethernet %pM\n", 2819 + qfe_slot, dev->dev_addr); 2705 2820 else 2706 - printk(KERN_INFO "%s: HAPPY MEAL (SBUS) 10/100baseT Ethernet ", 2707 - dev->name); 2708 - 2709 - printk("%pM\n", dev->dev_addr); 2821 + netdev_info(dev, "HAPPY MEAL (SBUS) 10/100baseT Ethernet %pM\n", 2822 + dev->dev_addr); 2710 2823 2711 2824 return 0; 2712 2825 ··· 2832 2949 struct happy_meal *hp; 2833 2950 struct net_device *dev; 2834 2951 void __iomem *hpreg_base; 2835 - unsigned long hpreg_res; 2952 + struct resource *hpreg_res; 2836 2953 int i, qfe_slot = -1; 2837 2954 char prom_name[64]; 2838 2955 u8 addr[ETH_ALEN]; ··· 2849 2966 strcpy(prom_name, "SUNW,hme"); 2850 2967 #endif 2851 2968 2852 - err = -ENODEV; 2853 - 2854 - if (pci_enable_device(pdev)) 2969 + err = pcim_enable_device(pdev); 2970 + if (err) 2855 2971 goto err_out; 2856 2972 pci_set_master(pdev); 2857 2973 2858 2974 if (!strcmp(prom_name, "SUNW,qfe") || !strcmp(prom_name, "qfe")) { 2859 2975 qp = quattro_pci_find(pdev); 2860 - if (qp == NULL) 2976 + if (IS_ERR(qp)) { 2977 + err = PTR_ERR(qp); 2861 2978 goto err_out; 2979 + } 2980 + 2862 2981 for (qfe_slot = 0; qfe_slot < 4; qfe_slot++) 2863 - if (qp->happy_meals[qfe_slot] == NULL) 2982 + if (!qp->happy_meals[qfe_slot]) 2864 2983 break; 2984 + 2865 2985 if (qfe_slot == 4) 2866 2986 goto err_out; 2867 2987 } 2868 2988 2869 - dev = alloc_etherdev(sizeof(struct happy_meal)); 2870 - err = -ENOMEM; 2871 - if (!dev) 2989 + dev = devm_alloc_etherdev(&pdev->dev, sizeof(struct happy_meal)); 2990 + if (!dev) { 2991 + err = -ENOMEM; 2872 2992 goto err_out; 2993 + } 2873 2994 SET_NETDEV_DEV(dev, &pdev->dev); 2874 - 2875 - if (hme_version_printed++ == 0) 2876 - printk(KERN_INFO "%s", version); 2877 2995 2878 2996 hp = netdev_priv(dev); 2879 2997 ··· 2889 3005 qp->happy_meals[qfe_slot] = dev; 2890 3006 } 2891 3007 2892 - hpreg_res = pci_resource_start(pdev, 0); 2893 - err = -ENODEV; 3008 + err = -EINVAL; 2894 3009 if ((pci_resource_flags(pdev, 0) & IORESOURCE_IO) != 0) { 2895 - printk(KERN_ERR "happymeal(PCI): Cannot find proper PCI device base address.\n"); 2896 - goto err_out_clear_quattro; 2897 - } 2898 - if (pci_request_regions(pdev, DRV_NAME)) { 2899 - printk(KERN_ERR "happymeal(PCI): Cannot obtain PCI resources, " 2900 - "aborting.\n"); 3010 + dev_err(&pdev->dev, 3011 + "Cannot find proper PCI device base address.\n"); 2901 3012 goto err_out_clear_quattro; 2902 3013 } 2903 3014 2904 - if ((hpreg_base = ioremap(hpreg_res, 0x8000)) == NULL) { 2905 - printk(KERN_ERR "happymeal(PCI): Unable to remap card memory.\n"); 2906 - goto err_out_free_res; 3015 + hpreg_res = devm_request_region(&pdev->dev, pci_resource_start(pdev, 0), 3016 + pci_resource_len(pdev, 0), DRV_NAME); 3017 + if (IS_ERR(hpreg_res)) { 3018 + err = PTR_ERR(hpreg_res); 3019 + dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting.\n"); 3020 + goto err_out_clear_quattro; 3021 + } 3022 + 3023 + hpreg_base = pcim_iomap(pdev, 0, 0x8000); 3024 + if (!hpreg_base) { 3025 + err = -ENOMEM; 3026 + dev_err(&pdev->dev, "Unable to remap card memory.\n"); 3027 + goto err_out_clear_quattro; 2907 3028 } 2908 3029 2909 3030 for (i = 0; i < 6; i++) { ··· 2974 3085 hp->happy_bursts = DMA_BURSTBITS; 2975 3086 #endif 2976 3087 2977 - hp->happy_block = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, 2978 - &hp->hblock_dvma, GFP_KERNEL); 2979 - err = -ENODEV; 2980 - if (!hp->happy_block) 2981 - goto err_out_iounmap; 3088 + hp->happy_block = dmam_alloc_coherent(&pdev->dev, PAGE_SIZE, 3089 + &hp->hblock_dvma, GFP_KERNEL); 3090 + if (!hp->happy_block) { 3091 + err = -ENOMEM; 3092 + goto err_out_clear_quattro; 3093 + } 2982 3094 2983 3095 hp->linkcheck = 0; 2984 3096 hp->timer_state = asleep; ··· 3013 3123 happy_meal_set_initial_advertisement(hp); 3014 3124 spin_unlock_irq(&hp->happy_lock); 3015 3125 3016 - err = register_netdev(hp->dev); 3126 + err = devm_register_netdev(&pdev->dev, dev); 3017 3127 if (err) { 3018 - printk(KERN_ERR "happymeal(PCI): Cannot register net device, " 3019 - "aborting.\n"); 3020 - goto err_out_free_coherent; 3128 + dev_err(&pdev->dev, "Cannot register net device, aborting.\n"); 3129 + goto err_out_clear_quattro; 3021 3130 } 3022 3131 3023 3132 pci_set_drvdata(pdev, hp); ··· 3029 3140 int i = simple_strtoul(dev->name + 3, NULL, 10); 3030 3141 sprintf(prom_name, "-%d", i + 3); 3031 3142 } 3032 - printk(KERN_INFO "%s%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet ", dev->name, prom_name); 3033 - if (qpdev->vendor == PCI_VENDOR_ID_DEC && 3034 - qpdev->device == PCI_DEVICE_ID_DEC_21153) 3035 - printk("DEC 21153 PCI Bridge\n"); 3036 - else 3037 - printk("unknown bridge %04x.%04x\n", 3038 - qpdev->vendor, qpdev->device); 3143 + netdev_info(dev, 3144 + "%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet bridge %04x.%04x\n", 3145 + prom_name, qpdev->vendor, qpdev->device); 3039 3146 } 3040 3147 3041 3148 if (qfe_slot != -1) 3042 - printk(KERN_INFO "%s: Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet ", 3043 - dev->name, qfe_slot); 3149 + netdev_info(dev, 3150 + "Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet %pM\n", 3151 + qfe_slot, dev->dev_addr); 3044 3152 else 3045 - printk(KERN_INFO "%s: HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet ", 3046 - dev->name); 3047 - 3048 - printk("%pM\n", dev->dev_addr); 3153 + netdev_info(dev, 3154 + "HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet %pM\n", 3155 + dev->dev_addr); 3049 3156 3050 3157 return 0; 3051 - 3052 - err_out_free_coherent: 3053 - dma_free_coherent(hp->dma_dev, PAGE_SIZE, 3054 - hp->happy_block, hp->hblock_dvma); 3055 - 3056 - err_out_iounmap: 3057 - iounmap(hp->gregs); 3058 - 3059 - err_out_free_res: 3060 - pci_release_regions(pdev); 3061 3158 3062 3159 err_out_clear_quattro: 3063 3160 if (qp != NULL) 3064 3161 qp->happy_meals[qfe_slot] = NULL; 3065 3162 3066 - free_netdev(dev); 3067 - 3068 3163 err_out: 3069 3164 return err; 3070 - } 3071 - 3072 - static void happy_meal_pci_remove(struct pci_dev *pdev) 3073 - { 3074 - struct happy_meal *hp = pci_get_drvdata(pdev); 3075 - struct net_device *net_dev = hp->dev; 3076 - 3077 - unregister_netdev(net_dev); 3078 - 3079 - dma_free_coherent(hp->dma_dev, PAGE_SIZE, 3080 - hp->happy_block, hp->hblock_dvma); 3081 - iounmap(hp->gregs); 3082 - pci_release_regions(hp->happy_dev); 3083 - 3084 - free_netdev(net_dev); 3085 3165 } 3086 3166 3087 3167 static const struct pci_device_id happymeal_pci_ids[] = { ··· 3064 3206 .name = "hme", 3065 3207 .id_table = happymeal_pci_ids, 3066 3208 .probe = happy_meal_pci_probe, 3067 - .remove = happy_meal_pci_remove, 3068 3209 }; 3069 3210 3070 3211 static int __init happy_meal_pci_init(void)