aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ipg.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-07-29 12:38:14 -0400
committerDavid S. Miller <davem@davemloft.net>2011-08-01 03:12:01 -0400
commitc9ea53d0e720ce4af774d7e5046819761eb54e0a (patch)
treed2364b02034b97318a12d144341838934b23cba9 /drivers/net/ipg.c
parentc76ecb7ae9a12dc1ea4d23075a8cd963156d5a32 (diff)
ipg: Use current logging styles
Add and use pr_fmt, pr_<level> and netdev_<level>. Convert printks with %[n].[n]x to %nx to be shorter and clearer. Consolidate printks to use a single printk rather than continued printks without KERN_CONT. Removed unnecessary trailing periods. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipg.c')
-rw-r--r--drivers/net/ipg.c191
1 files changed, 95 insertions, 96 deletions
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index d4aa40adf1e9..3aefaadd1513 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -20,6 +20,9 @@
20 * http://www.icplus.com.tw 20 * http://www.icplus.com.tw
21 * jesse@icplus.com.tw 21 * jesse@icplus.com.tw
22 */ 22 */
23
24#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
25
23#include <linux/crc32.h> 26#include <linux/crc32.h>
24#include <linux/ethtool.h> 27#include <linux/ethtool.h>
25#include <linux/interrupt.h> 28#include <linux/interrupt.h>
@@ -118,23 +121,23 @@ static void ipg_dump_rfdlist(struct net_device *dev)
118 121
119 IPG_DEBUG_MSG("_dump_rfdlist\n"); 122 IPG_DEBUG_MSG("_dump_rfdlist\n");
120 123
121 printk(KERN_INFO "rx_current = %2.2x\n", sp->rx_current); 124 netdev_info(dev, "rx_current = %02x\n", sp->rx_current);
122 printk(KERN_INFO "rx_dirty = %2.2x\n", sp->rx_dirty); 125 netdev_info(dev, "rx_dirty = %02x\n", sp->rx_dirty);
123 printk(KERN_INFO "RFDList start address = %16.16lx\n", 126 netdev_info(dev, "RFDList start address = %016lx\n",
124 (unsigned long) sp->rxd_map); 127 (unsigned long)sp->rxd_map);
125 printk(KERN_INFO "RFDListPtr register = %8.8x%8.8x\n", 128 netdev_info(dev, "RFDListPtr register = %08x%08x\n",
126 ipg_r32(IPG_RFDLISTPTR1), ipg_r32(IPG_RFDLISTPTR0)); 129 ipg_r32(IPG_RFDLISTPTR1), ipg_r32(IPG_RFDLISTPTR0));
127 130
128 for (i = 0; i < IPG_RFDLIST_LENGTH; i++) { 131 for (i = 0; i < IPG_RFDLIST_LENGTH; i++) {
129 offset = (u32) &sp->rxd[i].next_desc - (u32) sp->rxd; 132 offset = (u32) &sp->rxd[i].next_desc - (u32) sp->rxd;
130 printk(KERN_INFO "%2.2x %4.4x RFDNextPtr = %16.16lx\n", i, 133 netdev_info(dev, "%02x %04x RFDNextPtr = %016lx\n",
131 offset, (unsigned long) sp->rxd[i].next_desc); 134 i, offset, (unsigned long)sp->rxd[i].next_desc);
132 offset = (u32) &sp->rxd[i].rfs - (u32) sp->rxd; 135 offset = (u32) &sp->rxd[i].rfs - (u32) sp->rxd;
133 printk(KERN_INFO "%2.2x %4.4x RFS = %16.16lx\n", i, 136 netdev_info(dev, "%02x %04x RFS = %016lx\n",
134 offset, (unsigned long) sp->rxd[i].rfs); 137 i, offset, (unsigned long)sp->rxd[i].rfs);
135 offset = (u32) &sp->rxd[i].frag_info - (u32) sp->rxd; 138 offset = (u32) &sp->rxd[i].frag_info - (u32) sp->rxd;
136 printk(KERN_INFO "%2.2x %4.4x frag_info = %16.16lx\n", i, 139 netdev_info(dev, "%02x %04x frag_info = %016lx\n",
137 offset, (unsigned long) sp->rxd[i].frag_info); 140 i, offset, (unsigned long)sp->rxd[i].frag_info);
138 } 141 }
139} 142}
140 143
@@ -147,24 +150,24 @@ static void ipg_dump_tfdlist(struct net_device *dev)
147 150
148 IPG_DEBUG_MSG("_dump_tfdlist\n"); 151 IPG_DEBUG_MSG("_dump_tfdlist\n");
149 152
150 printk(KERN_INFO "tx_current = %2.2x\n", sp->tx_current); 153 netdev_info(dev, "tx_current = %02x\n", sp->tx_current);
151 printk(KERN_INFO "tx_dirty = %2.2x\n", sp->tx_dirty); 154 netdev_info(dev, "tx_dirty = %02x\n", sp->tx_dirty);
152 printk(KERN_INFO "TFDList start address = %16.16lx\n", 155 netdev_info(dev, "TFDList start address = %016lx\n",
153 (unsigned long) sp->txd_map); 156 (unsigned long) sp->txd_map);
154 printk(KERN_INFO "TFDListPtr register = %8.8x%8.8x\n", 157 netdev_info(dev, "TFDListPtr register = %08x%08x\n",
155 ipg_r32(IPG_TFDLISTPTR1), ipg_r32(IPG_TFDLISTPTR0)); 158 ipg_r32(IPG_TFDLISTPTR1), ipg_r32(IPG_TFDLISTPTR0));
156 159
157 for (i = 0; i < IPG_TFDLIST_LENGTH; i++) { 160 for (i = 0; i < IPG_TFDLIST_LENGTH; i++) {
158 offset = (u32) &sp->txd[i].next_desc - (u32) sp->txd; 161 offset = (u32) &sp->txd[i].next_desc - (u32) sp->txd;
159 printk(KERN_INFO "%2.2x %4.4x TFDNextPtr = %16.16lx\n", i, 162 netdev_info(dev, "%02x %04x TFDNextPtr = %016lx\n",
160 offset, (unsigned long) sp->txd[i].next_desc); 163 i, offset, (unsigned long)sp->txd[i].next_desc);
161 164
162 offset = (u32) &sp->txd[i].tfc - (u32) sp->txd; 165 offset = (u32) &sp->txd[i].tfc - (u32) sp->txd;
163 printk(KERN_INFO "%2.2x %4.4x TFC = %16.16lx\n", i, 166 netdev_info(dev, "%02x %04x TFC = %016lx\n",
164 offset, (unsigned long) sp->txd[i].tfc); 167 i, offset, (unsigned long) sp->txd[i].tfc);
165 offset = (u32) &sp->txd[i].frag_info - (u32) sp->txd; 168 offset = (u32) &sp->txd[i].frag_info - (u32) sp->txd;
166 printk(KERN_INFO "%2.2x %4.4x frag_info = %16.16lx\n", i, 169 netdev_info(dev, "%02x %04x frag_info = %016lx\n",
167 offset, (unsigned long) sp->txd[i].frag_info); 170 i, offset, (unsigned long) sp->txd[i].frag_info);
168 } 171 }
169} 172}
170#endif 173#endif
@@ -480,6 +483,10 @@ static int ipg_config_autoneg(struct net_device *dev)
480 u32 mac_ctrl_val; 483 u32 mac_ctrl_val;
481 u32 asicctrl; 484 u32 asicctrl;
482 u8 phyctrl; 485 u8 phyctrl;
486 const char *speed;
487 const char *duplex;
488 const char *tx_desc;
489 const char *rx_desc;
483 490
484 IPG_DEBUG_MSG("_config_autoneg\n"); 491 IPG_DEBUG_MSG("_config_autoneg\n");
485 492
@@ -499,27 +506,27 @@ static int ipg_config_autoneg(struct net_device *dev)
499 */ 506 */
500 sp->tenmbpsmode = 0; 507 sp->tenmbpsmode = 0;
501 508
502 printk(KERN_INFO "%s: Link speed = ", dev->name);
503
504 /* Determine actual speed of operation. */ 509 /* Determine actual speed of operation. */
505 switch (phyctrl & IPG_PC_LINK_SPEED) { 510 switch (phyctrl & IPG_PC_LINK_SPEED) {
506 case IPG_PC_LINK_SPEED_10MBPS: 511 case IPG_PC_LINK_SPEED_10MBPS:
507 printk("10Mbps.\n"); 512 speed = "10Mbps";
508 printk(KERN_INFO "%s: 10Mbps operational mode enabled.\n",
509 dev->name);
510 sp->tenmbpsmode = 1; 513 sp->tenmbpsmode = 1;
511 break; 514 break;
512 case IPG_PC_LINK_SPEED_100MBPS: 515 case IPG_PC_LINK_SPEED_100MBPS:
513 printk("100Mbps.\n"); 516 speed = "100Mbps";
514 break; 517 break;
515 case IPG_PC_LINK_SPEED_1000MBPS: 518 case IPG_PC_LINK_SPEED_1000MBPS:
516 printk("1000Mbps.\n"); 519 speed = "1000Mbps";
517 break; 520 break;
518 default: 521 default:
519 printk("undefined!\n"); 522 speed = "undefined!";
520 return 0; 523 return 0;
521 } 524 }
522 525
526 netdev_info(dev, "Link speed = %s\n", speed);
527 if (sp->tenmbpsmode == 1)
528 netdev_info(dev, "10Mbps operational mode enabled\n");
529
523 if (phyctrl & IPG_PC_DUPLEX_STATUS) { 530 if (phyctrl & IPG_PC_DUPLEX_STATUS) {
524 fullduplex = 1; 531 fullduplex = 1;
525 txflowcontrol = 1; 532 txflowcontrol = 1;
@@ -528,38 +535,41 @@ static int ipg_config_autoneg(struct net_device *dev)
528 535
529 /* Configure full duplex, and flow control. */ 536 /* Configure full duplex, and flow control. */
530 if (fullduplex == 1) { 537 if (fullduplex == 1) {
538
531 /* Configure IPG for full duplex operation. */ 539 /* Configure IPG for full duplex operation. */
532 printk(KERN_INFO "%s: setting full duplex, ", dev->name); 540
541 duplex = "full";
533 542
534 mac_ctrl_val |= IPG_MC_DUPLEX_SELECT_FD; 543 mac_ctrl_val |= IPG_MC_DUPLEX_SELECT_FD;
535 544
536 if (txflowcontrol == 1) { 545 if (txflowcontrol == 1) {
537 printk("TX flow control"); 546 tx_desc = "";
538 mac_ctrl_val |= IPG_MC_TX_FLOW_CONTROL_ENABLE; 547 mac_ctrl_val |= IPG_MC_TX_FLOW_CONTROL_ENABLE;
539 } else { 548 } else {
540 printk("no TX flow control"); 549 tx_desc = "no ";
541 mac_ctrl_val &= ~IPG_MC_TX_FLOW_CONTROL_ENABLE; 550 mac_ctrl_val &= ~IPG_MC_TX_FLOW_CONTROL_ENABLE;
542 } 551 }
543 552
544 if (rxflowcontrol == 1) { 553 if (rxflowcontrol == 1) {
545 printk(", RX flow control."); 554 rx_desc = "";
546 mac_ctrl_val |= IPG_MC_RX_FLOW_CONTROL_ENABLE; 555 mac_ctrl_val |= IPG_MC_RX_FLOW_CONTROL_ENABLE;
547 } else { 556 } else {
548 printk(", no RX flow control."); 557 rx_desc = "no ";
549 mac_ctrl_val &= ~IPG_MC_RX_FLOW_CONTROL_ENABLE; 558 mac_ctrl_val &= ~IPG_MC_RX_FLOW_CONTROL_ENABLE;
550 } 559 }
551
552 printk("\n");
553 } else { 560 } else {
554 /* Configure IPG for half duplex operation. */ 561 duplex = "half";
555 printk(KERN_INFO "%s: setting half duplex, " 562 tx_desc = "no ";
556 "no TX flow control, no RX flow control.\n", dev->name); 563 rx_desc = "no ";
557 564 mac_ctrl_val &= (~IPG_MC_DUPLEX_SELECT_FD &
558 mac_ctrl_val &= ~IPG_MC_DUPLEX_SELECT_FD & 565 ~IPG_MC_TX_FLOW_CONTROL_ENABLE &
559 ~IPG_MC_TX_FLOW_CONTROL_ENABLE & 566 ~IPG_MC_RX_FLOW_CONTROL_ENABLE);
560 ~IPG_MC_RX_FLOW_CONTROL_ENABLE;
561 } 567 }
568
569 netdev_info(dev, "setting %s duplex, %sTX, %sRX flow control\n",
570 duplex, tx_desc, rx_desc);
562 ipg_w32(mac_ctrl_val, MAC_CTRL); 571 ipg_w32(mac_ctrl_val, MAC_CTRL);
572
563 return 0; 573 return 0;
564} 574}
565 575
@@ -784,14 +794,13 @@ static int init_rfdlist(struct net_device *dev)
784 * A receive buffer was not ready, break the 794 * A receive buffer was not ready, break the
785 * RFD list here. 795 * RFD list here.
786 */ 796 */
787 IPG_DEBUG_MSG("Cannot allocate Rx buffer.\n"); 797 IPG_DEBUG_MSG("Cannot allocate Rx buffer\n");
788 798
789 /* Just in case we cannot allocate a single RFD. 799 /* Just in case we cannot allocate a single RFD.
790 * Should not occur. 800 * Should not occur.
791 */ 801 */
792 if (i == 0) { 802 if (i == 0) {
793 printk(KERN_ERR "%s: No memory available" 803 netdev_err(dev, "No memory available for RFD list\n");
794 " for RFD list.\n", dev->name);
795 return -ENOMEM; 804 return -ENOMEM;
796 } 805 }
797 } 806 }
@@ -838,7 +847,7 @@ static void init_tfdlist(struct net_device *dev)
838 sp->tx_dirty = 0; 847 sp->tx_dirty = 0;
839 848
840 /* Write the location of the TFDList to the IPG. */ 849 /* Write the location of the TFDList to the IPG. */
841 IPG_DDEBUG_MSG("Starting TFDListPtr = %8.8x\n", 850 IPG_DDEBUG_MSG("Starting TFDListPtr = %08x\n",
842 (u32) sp->txd_map); 851 (u32) sp->txd_map);
843 ipg_w32((u32) sp->txd_map, TFD_LIST_PTR_0); 852 ipg_w32((u32) sp->txd_map, TFD_LIST_PTR_0);
844 ipg_w32(0x00000000, TFD_LIST_PTR_1); 853 ipg_w32(0x00000000, TFD_LIST_PTR_1);
@@ -864,7 +873,7 @@ static void ipg_nic_txfree(struct net_device *dev)
864 struct sk_buff *skb = sp->tx_buff[dirty]; 873 struct sk_buff *skb = sp->tx_buff[dirty];
865 struct ipg_tx *txfd = sp->txd + dirty; 874 struct ipg_tx *txfd = sp->txd + dirty;
866 875
867 IPG_DEBUG_MSG("TFC = %16.16lx\n", (unsigned long) txfd->tfc); 876 IPG_DEBUG_MSG("TFC = %016lx\n", (unsigned long) txfd->tfc);
868 877
869 /* Look at each TFD's TFC field beginning 878 /* Look at each TFD's TFC field beginning
870 * at the last freed TFD up to the current TFD. 879 * at the last freed TFD up to the current TFD.
@@ -906,10 +915,8 @@ static void ipg_tx_timeout(struct net_device *dev)
906 spin_lock_irq(&sp->lock); 915 spin_lock_irq(&sp->lock);
907 916
908 /* Re-configure after DMA reset. */ 917 /* Re-configure after DMA reset. */
909 if (ipg_io_config(dev) < 0) { 918 if (ipg_io_config(dev) < 0)
910 printk(KERN_INFO "%s: Error during re-configuration.\n", 919 netdev_info(dev, "Error during re-configuration\n");
911 dev->name);
912 }
913 920
914 init_tfdlist(dev); 921 init_tfdlist(dev);
915 922
@@ -938,7 +945,7 @@ static void ipg_nic_txcleanup(struct net_device *dev)
938 */ 945 */
939 u32 txstatusdword = ipg_r32(TX_STATUS); 946 u32 txstatusdword = ipg_r32(TX_STATUS);
940 947
941 IPG_DEBUG_MSG("TxStatus = %8.8x\n", txstatusdword); 948 IPG_DEBUG_MSG("TxStatus = %08x\n", txstatusdword);
942 949
943 /* Check for Transmit errors. Error bits only valid if 950 /* Check for Transmit errors. Error bits only valid if
944 * TX_COMPLETE bit in the TXSTATUS register is a 1. 951 * TX_COMPLETE bit in the TXSTATUS register is a 1.
@@ -953,20 +960,20 @@ static void ipg_nic_txcleanup(struct net_device *dev)
953 960
954 /* Transmit error, increment stat counters. */ 961 /* Transmit error, increment stat counters. */
955 if (txstatusdword & IPG_TS_TX_ERROR) { 962 if (txstatusdword & IPG_TS_TX_ERROR) {
956 IPG_DEBUG_MSG("Transmit error.\n"); 963 IPG_DEBUG_MSG("Transmit error\n");
957 sp->stats.tx_errors++; 964 sp->stats.tx_errors++;
958 } 965 }
959 966
960 /* Late collision, re-enable transmitter. */ 967 /* Late collision, re-enable transmitter. */
961 if (txstatusdword & IPG_TS_LATE_COLLISION) { 968 if (txstatusdword & IPG_TS_LATE_COLLISION) {
962 IPG_DEBUG_MSG("Late collision on transmit.\n"); 969 IPG_DEBUG_MSG("Late collision on transmit\n");
963 ipg_w32((ipg_r32(MAC_CTRL) | IPG_MC_TX_ENABLE) & 970 ipg_w32((ipg_r32(MAC_CTRL) | IPG_MC_TX_ENABLE) &
964 IPG_MC_RSVD_MASK, MAC_CTRL); 971 IPG_MC_RSVD_MASK, MAC_CTRL);
965 } 972 }
966 973
967 /* Maximum collisions, re-enable transmitter. */ 974 /* Maximum collisions, re-enable transmitter. */
968 if (txstatusdword & IPG_TS_TX_MAX_COLL) { 975 if (txstatusdword & IPG_TS_TX_MAX_COLL) {
969 IPG_DEBUG_MSG("Maximum collisions on transmit.\n"); 976 IPG_DEBUG_MSG("Maximum collisions on transmit\n");
970 ipg_w32((ipg_r32(MAC_CTRL) | IPG_MC_TX_ENABLE) & 977 ipg_w32((ipg_r32(MAC_CTRL) | IPG_MC_TX_ENABLE) &
971 IPG_MC_RSVD_MASK, MAC_CTRL); 978 IPG_MC_RSVD_MASK, MAC_CTRL);
972 } 979 }
@@ -975,16 +982,14 @@ static void ipg_nic_txcleanup(struct net_device *dev)
975 * transmitter. 982 * transmitter.
976 */ 983 */
977 if (txstatusdword & IPG_TS_TX_UNDERRUN) { 984 if (txstatusdword & IPG_TS_TX_UNDERRUN) {
978 IPG_DEBUG_MSG("Transmitter underrun.\n"); 985 IPG_DEBUG_MSG("Transmitter underrun\n");
979 sp->stats.tx_fifo_errors++; 986 sp->stats.tx_fifo_errors++;
980 ipg_reset(dev, IPG_AC_TX_RESET | IPG_AC_DMA | 987 ipg_reset(dev, IPG_AC_TX_RESET | IPG_AC_DMA |
981 IPG_AC_NETWORK | IPG_AC_FIFO); 988 IPG_AC_NETWORK | IPG_AC_FIFO);
982 989
983 /* Re-configure after DMA reset. */ 990 /* Re-configure after DMA reset. */
984 if (ipg_io_config(dev) < 0) { 991 if (ipg_io_config(dev) < 0) {
985 printk(KERN_INFO 992 netdev_info(dev, "Error during re-configuration\n");
986 "%s: Error during re-configuration.\n",
987 dev->name);
988 } 993 }
989 init_tfdlist(dev); 994 init_tfdlist(dev);
990 995
@@ -1063,7 +1068,7 @@ static int ipg_nic_rxrestore(struct net_device *dev)
1063 * Linux system). 1068 * Linux system).
1064 */ 1069 */
1065 if (ipg_get_rxbuff(dev, entry) < 0) { 1070 if (ipg_get_rxbuff(dev, entry) < 0) {
1066 IPG_DEBUG_MSG("Cannot allocate new Rx buffer.\n"); 1071 IPG_DEBUG_MSG("Cannot allocate new Rx buffer\n");
1067 1072
1068 break; 1073 break;
1069 } 1074 }
@@ -1134,7 +1139,7 @@ static int ipg_nic_rx_check_error(struct net_device *dev)
1134 (IPG_RFS_RXFIFOOVERRUN | IPG_RFS_RXRUNTFRAME | 1139 (IPG_RFS_RXFIFOOVERRUN | IPG_RFS_RXRUNTFRAME |
1135 IPG_RFS_RXALIGNMENTERROR | IPG_RFS_RXFCSERROR | 1140 IPG_RFS_RXALIGNMENTERROR | IPG_RFS_RXFCSERROR |
1136 IPG_RFS_RXOVERSIZEDFRAME | IPG_RFS_RXLENGTHERROR))) { 1141 IPG_RFS_RXOVERSIZEDFRAME | IPG_RFS_RXLENGTHERROR))) {
1137 IPG_DEBUG_MSG("Rx error, RFS = %16.16lx\n", 1142 IPG_DEBUG_MSG("Rx error, RFS = %016lx\n",
1138 (unsigned long) rxfd->rfs); 1143 (unsigned long) rxfd->rfs);
1139 1144
1140 /* Increment general receive error statistic. */ 1145 /* Increment general receive error statistic. */
@@ -1142,13 +1147,13 @@ static int ipg_nic_rx_check_error(struct net_device *dev)
1142 1147
1143 /* Increment detailed receive error statistics. */ 1148 /* Increment detailed receive error statistics. */
1144 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFIFOOVERRUN) { 1149 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFIFOOVERRUN) {
1145 IPG_DEBUG_MSG("RX FIFO overrun occurred.\n"); 1150 IPG_DEBUG_MSG("RX FIFO overrun occurred\n");
1146 1151
1147 sp->stats.rx_fifo_errors++; 1152 sp->stats.rx_fifo_errors++;
1148 } 1153 }
1149 1154
1150 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXRUNTFRAME) { 1155 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXRUNTFRAME) {
1151 IPG_DEBUG_MSG("RX runt occurred.\n"); 1156 IPG_DEBUG_MSG("RX runt occurred\n");
1152 sp->stats.rx_length_errors++; 1157 sp->stats.rx_length_errors++;
1153 } 1158 }
1154 1159
@@ -1157,7 +1162,7 @@ static int ipg_nic_rx_check_error(struct net_device *dev)
1157 */ 1162 */
1158 1163
1159 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXALIGNMENTERROR) { 1164 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXALIGNMENTERROR) {
1160 IPG_DEBUG_MSG("RX alignment error occurred.\n"); 1165 IPG_DEBUG_MSG("RX alignment error occurred\n");
1161 sp->stats.rx_frame_errors++; 1166 sp->stats.rx_frame_errors++;
1162 } 1167 }
1163 1168
@@ -1404,7 +1409,7 @@ static int ipg_nic_rx(struct net_device *dev)
1404 */ 1409 */
1405 if (framelen > sp->rxfrag_size) { 1410 if (framelen > sp->rxfrag_size) {
1406 IPG_DEBUG_MSG 1411 IPG_DEBUG_MSG
1407 ("RFS FrameLen > allocated fragment size.\n"); 1412 ("RFS FrameLen > allocated fragment size\n");
1408 1413
1409 framelen = sp->rxfrag_size; 1414 framelen = sp->rxfrag_size;
1410 } 1415 }
@@ -1414,7 +1419,7 @@ static int ipg_nic_rx(struct net_device *dev)
1414 IPG_RFS_RXALIGNMENTERROR | IPG_RFS_RXFCSERROR | 1419 IPG_RFS_RXALIGNMENTERROR | IPG_RFS_RXFCSERROR |
1415 IPG_RFS_RXOVERSIZEDFRAME | IPG_RFS_RXLENGTHERROR)))) { 1420 IPG_RFS_RXOVERSIZEDFRAME | IPG_RFS_RXLENGTHERROR)))) {
1416 1421
1417 IPG_DEBUG_MSG("Rx error, RFS = %16.16lx\n", 1422 IPG_DEBUG_MSG("Rx error, RFS = %016lx\n",
1418 (unsigned long int) rxfd->rfs); 1423 (unsigned long int) rxfd->rfs);
1419 1424
1420 /* Increment general receive error statistic. */ 1425 /* Increment general receive error statistic. */
@@ -1422,12 +1427,12 @@ static int ipg_nic_rx(struct net_device *dev)
1422 1427
1423 /* Increment detailed receive error statistics. */ 1428 /* Increment detailed receive error statistics. */
1424 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFIFOOVERRUN) { 1429 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFIFOOVERRUN) {
1425 IPG_DEBUG_MSG("RX FIFO overrun occurred.\n"); 1430 IPG_DEBUG_MSG("RX FIFO overrun occurred\n");
1426 sp->stats.rx_fifo_errors++; 1431 sp->stats.rx_fifo_errors++;
1427 } 1432 }
1428 1433
1429 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXRUNTFRAME) { 1434 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXRUNTFRAME) {
1430 IPG_DEBUG_MSG("RX runt occurred.\n"); 1435 IPG_DEBUG_MSG("RX runt occurred\n");
1431 sp->stats.rx_length_errors++; 1436 sp->stats.rx_length_errors++;
1432 } 1437 }
1433 1438
@@ -1437,7 +1442,7 @@ static int ipg_nic_rx(struct net_device *dev)
1437 */ 1442 */
1438 1443
1439 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXALIGNMENTERROR) { 1444 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXALIGNMENTERROR) {
1440 IPG_DEBUG_MSG("RX alignment error occurred.\n"); 1445 IPG_DEBUG_MSG("RX alignment error occurred\n");
1441 sp->stats.rx_frame_errors++; 1446 sp->stats.rx_frame_errors++;
1442 } 1447 }
1443 1448
@@ -1508,7 +1513,7 @@ static int ipg_nic_rx(struct net_device *dev)
1508 1513
1509 rxfd = sp->rxd + entry; 1514 rxfd = sp->rxd + entry;
1510 1515
1511 IPG_DEBUG_MSG("Frame requires multiple RFDs.\n"); 1516 IPG_DEBUG_MSG("Frame requires multiple RFDs\n");
1512 1517
1513 /* An unexpected event, additional code needed to handle 1518 /* An unexpected event, additional code needed to handle
1514 * properly. So for the time being, just disregard the 1519 * properly. So for the time being, just disregard the
@@ -1557,8 +1562,7 @@ static void ipg_reset_after_host_error(struct work_struct *work)
1557 init_tfdlist(dev); 1562 init_tfdlist(dev);
1558 1563
1559 if (ipg_io_config(dev) < 0) { 1564 if (ipg_io_config(dev) < 0) {
1560 printk(KERN_INFO "%s: Cannot recover from PCI error.\n", 1565 netdev_info(dev, "Cannot recover from PCI error\n");
1561 dev->name);
1562 schedule_delayed_work(&sp->task, HZ); 1566 schedule_delayed_work(&sp->task, HZ);
1563 } 1567 }
1564} 1568}
@@ -1586,7 +1590,7 @@ static irqreturn_t ipg_interrupt_handler(int irq, void *dev_inst)
1586 */ 1590 */
1587 status = ipg_r16(INT_STATUS_ACK); 1591 status = ipg_r16(INT_STATUS_ACK);
1588 1592
1589 IPG_DEBUG_MSG("IntStatusAck = %4.4x\n", status); 1593 IPG_DEBUG_MSG("IntStatusAck = %04x\n", status);
1590 1594
1591 /* Shared IRQ of remove event. */ 1595 /* Shared IRQ of remove event. */
1592 if (!(status & IPG_IS_RSVD_MASK)) 1596 if (!(status & IPG_IS_RSVD_MASK))
@@ -1599,7 +1603,7 @@ static irqreturn_t ipg_interrupt_handler(int irq, void *dev_inst)
1599 1603
1600 /* If RFDListEnd interrupt, restore all used RFDs. */ 1604 /* If RFDListEnd interrupt, restore all used RFDs. */
1601 if (status & IPG_IS_RFD_LIST_END) { 1605 if (status & IPG_IS_RFD_LIST_END) {
1602 IPG_DEBUG_MSG("RFDListEnd Interrupt.\n"); 1606 IPG_DEBUG_MSG("RFDListEnd Interrupt\n");
1603 1607
1604 /* The RFD list end indicates an RFD was encountered 1608 /* The RFD list end indicates an RFD was encountered
1605 * with a 0 NextPtr, or with an RFDDone bit set to 1 1609 * with a 0 NextPtr, or with an RFDDone bit set to 1
@@ -1661,21 +1665,20 @@ static irqreturn_t ipg_interrupt_handler(int irq, void *dev_inst)
1661 /* If LinkEvent interrupt, resolve autonegotiation. */ 1665 /* If LinkEvent interrupt, resolve autonegotiation. */
1662 if (status & IPG_IS_LINK_EVENT) { 1666 if (status & IPG_IS_LINK_EVENT) {
1663 if (ipg_config_autoneg(dev) < 0) 1667 if (ipg_config_autoneg(dev) < 0)
1664 printk(KERN_INFO "%s: Auto-negotiation error.\n", 1668 netdev_info(dev, "Auto-negotiation error\n");
1665 dev->name);
1666 } 1669 }
1667 1670
1668 /* If MACCtrlFrame interrupt, do nothing. */ 1671 /* If MACCtrlFrame interrupt, do nothing. */
1669 if (status & IPG_IS_MAC_CTRL_FRAME) 1672 if (status & IPG_IS_MAC_CTRL_FRAME)
1670 IPG_DEBUG_MSG("MACCtrlFrame interrupt.\n"); 1673 IPG_DEBUG_MSG("MACCtrlFrame interrupt\n");
1671 1674
1672 /* If RxComplete interrupt, do nothing. */ 1675 /* If RxComplete interrupt, do nothing. */
1673 if (status & IPG_IS_RX_COMPLETE) 1676 if (status & IPG_IS_RX_COMPLETE)
1674 IPG_DEBUG_MSG("RxComplete interrupt.\n"); 1677 IPG_DEBUG_MSG("RxComplete interrupt\n");
1675 1678
1676 /* If RxEarly interrupt, do nothing. */ 1679 /* If RxEarly interrupt, do nothing. */
1677 if (status & IPG_IS_RX_EARLY) 1680 if (status & IPG_IS_RX_EARLY)
1678 IPG_DEBUG_MSG("RxEarly interrupt.\n"); 1681 IPG_DEBUG_MSG("RxEarly interrupt\n");
1679 1682
1680out_enable: 1683out_enable:
1681 /* Re-enable IPG interrupts. */ 1684 /* Re-enable IPG interrupts. */
@@ -1749,8 +1752,7 @@ static int ipg_nic_open(struct net_device *dev)
1749 rc = request_irq(pdev->irq, ipg_interrupt_handler, IRQF_SHARED, 1752 rc = request_irq(pdev->irq, ipg_interrupt_handler, IRQF_SHARED,
1750 dev->name, dev); 1753 dev->name, dev);
1751 if (rc < 0) { 1754 if (rc < 0) {
1752 printk(KERN_INFO "%s: Error when requesting interrupt.\n", 1755 netdev_info(dev, "Error when requesting interrupt\n");
1753 dev->name);
1754 goto out; 1756 goto out;
1755 } 1757 }
1756 1758
@@ -1770,8 +1772,7 @@ static int ipg_nic_open(struct net_device *dev)
1770 1772
1771 rc = init_rfdlist(dev); 1773 rc = init_rfdlist(dev);
1772 if (rc < 0) { 1774 if (rc < 0) {
1773 printk(KERN_INFO "%s: Error during configuration.\n", 1775 netdev_info(dev, "Error during configuration\n");
1774 dev->name);
1775 goto err_free_tx_2; 1776 goto err_free_tx_2;
1776 } 1777 }
1777 1778
@@ -1779,14 +1780,13 @@ static int ipg_nic_open(struct net_device *dev)
1779 1780
1780 rc = ipg_io_config(dev); 1781 rc = ipg_io_config(dev);
1781 if (rc < 0) { 1782 if (rc < 0) {
1782 printk(KERN_INFO "%s: Error during configuration.\n", 1783 netdev_info(dev, "Error during configuration\n");
1783 dev->name);
1784 goto err_release_tfdlist_3; 1784 goto err_release_tfdlist_3;
1785 } 1785 }
1786 1786
1787 /* Resolve autonegotiation. */ 1787 /* Resolve autonegotiation. */
1788 if (ipg_config_autoneg(dev) < 0) 1788 if (ipg_config_autoneg(dev) < 0)
1789 printk(KERN_INFO "%s: Auto-negotiation error.\n", dev->name); 1789 netdev_info(dev, "Auto-negotiation error\n");
1790 1790
1791 /* initialize JUMBO Frame control variable */ 1791 /* initialize JUMBO Frame control variable */
1792 sp->jumbo.found_start = 0; 1792 sp->jumbo.found_start = 0;
@@ -2222,7 +2222,7 @@ static int __devinit ipg_probe(struct pci_dev *pdev,
2222 if (rc < 0) 2222 if (rc < 0)
2223 goto out; 2223 goto out;
2224 2224
2225 printk(KERN_INFO "%s: %s\n", pci_name(pdev), ipg_brand_name[i]); 2225 pr_info("%s: %s\n", pci_name(pdev), ipg_brand_name[i]);
2226 2226
2227 pci_set_master(pdev); 2227 pci_set_master(pdev);
2228 2228
@@ -2230,8 +2230,7 @@ static int __devinit ipg_probe(struct pci_dev *pdev,
2230 if (rc < 0) { 2230 if (rc < 0) {
2231 rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); 2231 rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
2232 if (rc < 0) { 2232 if (rc < 0) {
2233 printk(KERN_ERR "%s: DMA config failed.\n", 2233 pr_err("%s: DMA config failed\n", pci_name(pdev));
2234 pci_name(pdev));
2235 goto err_disable_0; 2234 goto err_disable_0;
2236 } 2235 }
2237 } 2236 }
@@ -2241,7 +2240,7 @@ static int __devinit ipg_probe(struct pci_dev *pdev,
2241 */ 2240 */
2242 dev = alloc_etherdev(sizeof(struct ipg_nic_private)); 2241 dev = alloc_etherdev(sizeof(struct ipg_nic_private));
2243 if (!dev) { 2242 if (!dev) {
2244 printk(KERN_ERR "%s: alloc_etherdev failed\n", pci_name(pdev)); 2243 pr_err("%s: alloc_etherdev failed\n", pci_name(pdev));
2245 rc = -ENOMEM; 2244 rc = -ENOMEM;
2246 goto err_disable_0; 2245 goto err_disable_0;
2247 } 2246 }
@@ -2267,7 +2266,7 @@ static int __devinit ipg_probe(struct pci_dev *pdev,
2267 2266
2268 ioaddr = pci_iomap(pdev, 1, pci_resource_len(pdev, 1)); 2267 ioaddr = pci_iomap(pdev, 1, pci_resource_len(pdev, 1));
2269 if (!ioaddr) { 2268 if (!ioaddr) {
2270 printk(KERN_ERR "%s cannot map MMIO\n", pci_name(pdev)); 2269 pr_err("%s: cannot map MMIO\n", pci_name(pdev));
2271 rc = -EIO; 2270 rc = -EIO;
2272 goto err_release_regions_2; 2271 goto err_release_regions_2;
2273 } 2272 }
@@ -2289,7 +2288,7 @@ static int __devinit ipg_probe(struct pci_dev *pdev,
2289 if (rc < 0) 2288 if (rc < 0)
2290 goto err_unmap_3; 2289 goto err_unmap_3;
2291 2290
2292 printk(KERN_INFO "Ethernet device registered as: %s\n", dev->name); 2291 netdev_info(dev, "Ethernet device registered\n");
2293out: 2292out:
2294 return rc; 2293 return rc;
2295 2294