aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e100.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-03-17 00:24:32 -0400
committerDavid S. Miller <davem@davemloft.net>2010-03-17 00:24:32 -0400
commitfa05e1ad1b61b37fb64a66794c11ab478e975c56 (patch)
treea263b733667b15857e823c10aed7afb721060406 /drivers/net/e100.c
parentabf35df21513c51d7761c41fa6d3b819cdf4103e (diff)
drivers/net/e100.c: Use pr_<level> and netif_<level>
Convert DPRINTK, commonly used for debugging, to netif_<level> Remove #define PFX Use #define pr_fmt Consistently use no periods for non-sentence logging messages Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e100.c')
-rw-r--r--drivers/net/e100.c183
1 files changed, 98 insertions, 85 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index b997e578e58f..c0cd57656681 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -147,6 +147,8 @@
147 * - add clean lowlevel I/O emulation for cards with MII-lacking PHYs 147 * - add clean lowlevel I/O emulation for cards with MII-lacking PHYs
148 */ 148 */
149 149
150#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
151
150#include <linux/module.h> 152#include <linux/module.h>
151#include <linux/moduleparam.h> 153#include <linux/moduleparam.h>
152#include <linux/kernel.h> 154#include <linux/kernel.h>
@@ -174,7 +176,6 @@
174#define DRV_VERSION "3.5.24-k2"DRV_EXT 176#define DRV_VERSION "3.5.24-k2"DRV_EXT
175#define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver" 177#define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver"
176#define DRV_COPYRIGHT "Copyright(c) 1999-2006 Intel Corporation" 178#define DRV_COPYRIGHT "Copyright(c) 1999-2006 Intel Corporation"
177#define PFX DRV_NAME ": "
178 179
179#define E100_WATCHDOG_PERIOD (2 * HZ) 180#define E100_WATCHDOG_PERIOD (2 * HZ)
180#define E100_NAPI_WEIGHT 16 181#define E100_NAPI_WEIGHT 16
@@ -200,10 +201,6 @@ module_param(use_io, int, 0);
200MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); 201MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
201MODULE_PARM_DESC(eeprom_bad_csum_allow, "Allow bad eeprom checksums"); 202MODULE_PARM_DESC(eeprom_bad_csum_allow, "Allow bad eeprom checksums");
202MODULE_PARM_DESC(use_io, "Force use of i/o access mode"); 203MODULE_PARM_DESC(use_io, "Force use of i/o access mode");
203#define DPRINTK(nlevel, klevel, fmt, args...) \
204 (void)((NETIF_MSG_##nlevel & nic->msg_enable) && \
205 printk(KERN_##klevel PFX "%s: %s: " fmt, nic->netdev->name, \
206 __func__ , ## args))
207 204
208#define INTEL_8255X_ETHERNET_DEVICE(device_id, ich) {\ 205#define INTEL_8255X_ETHERNET_DEVICE(device_id, ich) {\
209 PCI_VENDOR_ID_INTEL, device_id, PCI_ANY_ID, PCI_ANY_ID, \ 206 PCI_VENDOR_ID_INTEL, device_id, PCI_ANY_ID, PCI_ANY_ID, \
@@ -689,12 +686,13 @@ static int e100_self_test(struct nic *nic)
689 686
690 /* Check results of self-test */ 687 /* Check results of self-test */
691 if (nic->mem->selftest.result != 0) { 688 if (nic->mem->selftest.result != 0) {
692 DPRINTK(HW, ERR, "Self-test failed: result=0x%08X\n", 689 netif_err(nic, hw, nic->netdev,
693 nic->mem->selftest.result); 690 "Self-test failed: result=0x%08X\n",
691 nic->mem->selftest.result);
694 return -ETIMEDOUT; 692 return -ETIMEDOUT;
695 } 693 }
696 if (nic->mem->selftest.signature == 0) { 694 if (nic->mem->selftest.signature == 0) {
697 DPRINTK(HW, ERR, "Self-test failed: timed out\n"); 695 netif_err(nic, hw, nic->netdev, "Self-test failed: timed out\n");
698 return -ETIMEDOUT; 696 return -ETIMEDOUT;
699 } 697 }
700 698
@@ -797,7 +795,7 @@ static int e100_eeprom_load(struct nic *nic)
797 /* The checksum, stored in the last word, is calculated such that 795 /* The checksum, stored in the last word, is calculated such that
798 * the sum of words should be 0xBABA */ 796 * the sum of words should be 0xBABA */
799 if (cpu_to_le16(0xBABA - checksum) != nic->eeprom[nic->eeprom_wc - 1]) { 797 if (cpu_to_le16(0xBABA - checksum) != nic->eeprom[nic->eeprom_wc - 1]) {
800 DPRINTK(PROBE, ERR, "EEPROM corrupted\n"); 798 netif_err(nic, probe, nic->netdev, "EEPROM corrupted\n");
801 if (!eeprom_bad_csum_allow) 799 if (!eeprom_bad_csum_allow)
802 return -EAGAIN; 800 return -EAGAIN;
803 } 801 }
@@ -953,8 +951,7 @@ static u16 mdio_ctrl_hw(struct nic *nic, u32 addr, u32 dir, u32 reg, u16 data)
953 udelay(20); 951 udelay(20);
954 } 952 }
955 if (unlikely(!i)) { 953 if (unlikely(!i)) {
956 printk("e100.mdio_ctrl(%s) won't go Ready\n", 954 netdev_err(nic->netdev, "e100.mdio_ctrl won't go Ready\n");
957 nic->netdev->name );
958 spin_unlock_irqrestore(&nic->mdio_lock, flags); 955 spin_unlock_irqrestore(&nic->mdio_lock, flags);
959 return 0; /* No way to indicate timeout error */ 956 return 0; /* No way to indicate timeout error */
960 } 957 }
@@ -966,9 +963,10 @@ static u16 mdio_ctrl_hw(struct nic *nic, u32 addr, u32 dir, u32 reg, u16 data)
966 break; 963 break;
967 } 964 }
968 spin_unlock_irqrestore(&nic->mdio_lock, flags); 965 spin_unlock_irqrestore(&nic->mdio_lock, flags);
969 DPRINTK(HW, DEBUG, 966 netif_printk(nic, hw, KERN_DEBUG, nic->netdev,
970 "%s:addr=%d, reg=%d, data_in=0x%04X, data_out=0x%04X\n", 967 "%s:addr=%d, reg=%d, data_in=0x%04X, data_out=0x%04X\n",
971 dir == mdi_read ? "READ" : "WRITE", addr, reg, data, data_out); 968 dir == mdi_read ? "READ" : "WRITE",
969 addr, reg, data, data_out);
972 return (u16)data_out; 970 return (u16)data_out;
973} 971}
974 972
@@ -1028,17 +1026,19 @@ static u16 mdio_ctrl_phy_mii_emulated(struct nic *nic,
1028 return ADVERTISE_10HALF | 1026 return ADVERTISE_10HALF |
1029 ADVERTISE_10FULL; 1027 ADVERTISE_10FULL;
1030 default: 1028 default:
1031 DPRINTK(HW, DEBUG, 1029 netif_printk(nic, hw, KERN_DEBUG, nic->netdev,
1032 "%s:addr=%d, reg=%d, data=0x%04X: unimplemented emulation!\n", 1030 "%s:addr=%d, reg=%d, data=0x%04X: unimplemented emulation!\n",
1033 dir == mdi_read ? "READ" : "WRITE", addr, reg, data); 1031 dir == mdi_read ? "READ" : "WRITE",
1032 addr, reg, data);
1034 return 0xFFFF; 1033 return 0xFFFF;
1035 } 1034 }
1036 } else { 1035 } else {
1037 switch (reg) { 1036 switch (reg) {
1038 default: 1037 default:
1039 DPRINTK(HW, DEBUG, 1038 netif_printk(nic, hw, KERN_DEBUG, nic->netdev,
1040 "%s:addr=%d, reg=%d, data=0x%04X: unimplemented emulation!\n", 1039 "%s:addr=%d, reg=%d, data=0x%04X: unimplemented emulation!\n",
1041 dir == mdi_read ? "READ" : "WRITE", addr, reg, data); 1040 dir == mdi_read ? "READ" : "WRITE",
1041 addr, reg, data);
1042 return 0xFFFF; 1042 return 0xFFFF;
1043 } 1043 }
1044 } 1044 }
@@ -1155,12 +1155,15 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
1155 } 1155 }
1156 } 1156 }
1157 1157
1158 DPRINTK(HW, DEBUG, "[00-07]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", 1158 netif_printk(nic, hw, KERN_DEBUG, nic->netdev,
1159 c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7]); 1159 "[00-07]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n",
1160 DPRINTK(HW, DEBUG, "[08-15]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", 1160 c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7]);
1161 c[8], c[9], c[10], c[11], c[12], c[13], c[14], c[15]); 1161 netif_printk(nic, hw, KERN_DEBUG, nic->netdev,
1162 DPRINTK(HW, DEBUG, "[16-23]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", 1162 "[08-15]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n",
1163 c[16], c[17], c[18], c[19], c[20], c[21], c[22], c[23]); 1163 c[8], c[9], c[10], c[11], c[12], c[13], c[14], c[15]);
1164 netif_printk(nic, hw, KERN_DEBUG, nic->netdev,
1165 "[16-23]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n",
1166 c[16], c[17], c[18], c[19], c[20], c[21], c[22], c[23]);
1164} 1167}
1165 1168
1166/************************************************************************* 1169/*************************************************************************
@@ -1253,16 +1256,18 @@ static const struct firmware *e100_request_firmware(struct nic *nic)
1253 err = request_firmware(&fw, fw_name, &nic->pdev->dev); 1256 err = request_firmware(&fw, fw_name, &nic->pdev->dev);
1254 1257
1255 if (err) { 1258 if (err) {
1256 DPRINTK(PROBE, ERR, "Failed to load firmware \"%s\": %d\n", 1259 netif_err(nic, probe, nic->netdev,
1257 fw_name, err); 1260 "Failed to load firmware \"%s\": %d\n",
1261 fw_name, err);
1258 return ERR_PTR(err); 1262 return ERR_PTR(err);
1259 } 1263 }
1260 1264
1261 /* Firmware should be precisely UCODE_SIZE (words) plus three bytes 1265 /* Firmware should be precisely UCODE_SIZE (words) plus three bytes
1262 indicating the offsets for BUNDLESMALL, BUNDLEMAX, INTDELAY */ 1266 indicating the offsets for BUNDLESMALL, BUNDLEMAX, INTDELAY */
1263 if (fw->size != UCODE_SIZE * 4 + 3) { 1267 if (fw->size != UCODE_SIZE * 4 + 3) {
1264 DPRINTK(PROBE, ERR, "Firmware \"%s\" has wrong size %zu\n", 1268 netif_err(nic, probe, nic->netdev,
1265 fw_name, fw->size); 1269 "Firmware \"%s\" has wrong size %zu\n",
1270 fw_name, fw->size);
1266 release_firmware(fw); 1271 release_firmware(fw);
1267 return ERR_PTR(-EINVAL); 1272 return ERR_PTR(-EINVAL);
1268 } 1273 }
@@ -1274,9 +1279,9 @@ static const struct firmware *e100_request_firmware(struct nic *nic)
1274 1279
1275 if (timer >= UCODE_SIZE || bundle >= UCODE_SIZE || 1280 if (timer >= UCODE_SIZE || bundle >= UCODE_SIZE ||
1276 min_size >= UCODE_SIZE) { 1281 min_size >= UCODE_SIZE) {
1277 DPRINTK(PROBE, ERR, 1282 netif_err(nic, probe, nic->netdev,
1278 "\"%s\" has bogus offset values (0x%x,0x%x,0x%x)\n", 1283 "\"%s\" has bogus offset values (0x%x,0x%x,0x%x)\n",
1279 fw_name, timer, bundle, min_size); 1284 fw_name, timer, bundle, min_size);
1280 release_firmware(fw); 1285 release_firmware(fw);
1281 return ERR_PTR(-EINVAL); 1286 return ERR_PTR(-EINVAL);
1282 } 1287 }
@@ -1328,7 +1333,8 @@ static inline int e100_load_ucode_wait(struct nic *nic)
1328 return PTR_ERR(fw); 1333 return PTR_ERR(fw);
1329 1334
1330 if ((err = e100_exec_cb(nic, (void *)fw, e100_setup_ucode))) 1335 if ((err = e100_exec_cb(nic, (void *)fw, e100_setup_ucode)))
1331 DPRINTK(PROBE,ERR, "ucode cmd failed with error %d\n", err); 1336 netif_err(nic, probe, nic->netdev,
1337 "ucode cmd failed with error %d\n", err);
1332 1338
1333 /* must restart cuc */ 1339 /* must restart cuc */
1334 nic->cuc_cmd = cuc_start; 1340 nic->cuc_cmd = cuc_start;
@@ -1348,7 +1354,7 @@ static inline int e100_load_ucode_wait(struct nic *nic)
1348 1354
1349 /* if the command failed, or is not OK, notify and return */ 1355 /* if the command failed, or is not OK, notify and return */
1350 if (!counter || !(cb->status & cpu_to_le16(cb_ok))) { 1356 if (!counter || !(cb->status & cpu_to_le16(cb_ok))) {
1351 DPRINTK(PROBE,ERR, "ucode load failed\n"); 1357 netif_err(nic, probe, nic->netdev, "ucode load failed\n");
1352 err = -EPERM; 1358 err = -EPERM;
1353 } 1359 }
1354 1360
@@ -1386,8 +1392,8 @@ static int e100_phy_check_without_mii(struct nic *nic)
1386 * media is sensed automatically based on how the link partner 1392 * media is sensed automatically based on how the link partner
1387 * is configured. This is, in essence, manual configuration. 1393 * is configured. This is, in essence, manual configuration.
1388 */ 1394 */
1389 DPRINTK(PROBE, INFO, 1395 netif_info(nic, probe, nic->netdev,
1390 "found MII-less i82503 or 80c24 or other PHY\n"); 1396 "found MII-less i82503 or 80c24 or other PHY\n");
1391 1397
1392 nic->mdio_ctrl = mdio_ctrl_phy_mii_emulated; 1398 nic->mdio_ctrl = mdio_ctrl_phy_mii_emulated;
1393 nic->mii.phy_id = 0; /* is this ok for an MII-less PHY? */ 1399 nic->mii.phy_id = 0; /* is this ok for an MII-less PHY? */
@@ -1434,18 +1440,20 @@ static int e100_phy_init(struct nic *nic)
1434 return 0; /* simply return and hope for the best */ 1440 return 0; /* simply return and hope for the best */
1435 else { 1441 else {
1436 /* for unknown cases log a fatal error */ 1442 /* for unknown cases log a fatal error */
1437 DPRINTK(HW, ERR, 1443 netif_err(nic, hw, nic->netdev,
1438 "Failed to locate any known PHY, aborting.\n"); 1444 "Failed to locate any known PHY, aborting\n");
1439 return -EAGAIN; 1445 return -EAGAIN;
1440 } 1446 }
1441 } else 1447 } else
1442 DPRINTK(HW, DEBUG, "phy_addr = %d\n", nic->mii.phy_id); 1448 netif_printk(nic, hw, KERN_DEBUG, nic->netdev,
1449 "phy_addr = %d\n", nic->mii.phy_id);
1443 1450
1444 /* Get phy ID */ 1451 /* Get phy ID */
1445 id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1); 1452 id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1);
1446 id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2); 1453 id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2);
1447 nic->phy = (u32)id_hi << 16 | (u32)id_lo; 1454 nic->phy = (u32)id_hi << 16 | (u32)id_lo;
1448 DPRINTK(HW, DEBUG, "phy ID = 0x%08X\n", nic->phy); 1455 netif_printk(nic, hw, KERN_DEBUG, nic->netdev,
1456 "phy ID = 0x%08X\n", nic->phy);
1449 1457
1450 /* Select the phy and isolate the rest */ 1458 /* Select the phy and isolate the rest */
1451 for (addr = 0; addr < 32; addr++) { 1459 for (addr = 0; addr < 32; addr++) {
@@ -1507,7 +1515,7 @@ static int e100_hw_init(struct nic *nic)
1507 1515
1508 e100_hw_reset(nic); 1516 e100_hw_reset(nic);
1509 1517
1510 DPRINTK(HW, ERR, "e100_hw_init\n"); 1518 netif_err(nic, hw, nic->netdev, "e100_hw_init\n");
1511 if (!in_interrupt() && (err = e100_self_test(nic))) 1519 if (!in_interrupt() && (err = e100_self_test(nic)))
1512 return err; 1520 return err;
1513 1521
@@ -1555,8 +1563,9 @@ static void e100_set_multicast_list(struct net_device *netdev)
1555{ 1563{
1556 struct nic *nic = netdev_priv(netdev); 1564 struct nic *nic = netdev_priv(netdev);
1557 1565
1558 DPRINTK(HW, DEBUG, "mc_count=%d, flags=0x%04X\n", 1566 netif_printk(nic, hw, KERN_DEBUG, nic->netdev,
1559 netdev_mc_count(netdev), netdev->flags); 1567 "mc_count=%d, flags=0x%04X\n",
1568 netdev_mc_count(netdev), netdev->flags);
1560 1569
1561 if (netdev->flags & IFF_PROMISC) 1570 if (netdev->flags & IFF_PROMISC)
1562 nic->flags |= promiscuous; 1571 nic->flags |= promiscuous;
@@ -1629,7 +1638,8 @@ static void e100_update_stats(struct nic *nic)
1629 1638
1630 1639
1631 if (e100_exec_cmd(nic, cuc_dump_reset, 0)) 1640 if (e100_exec_cmd(nic, cuc_dump_reset, 0))
1632 DPRINTK(TX_ERR, DEBUG, "exec cuc_dump_reset failed\n"); 1641 netif_printk(nic, tx_err, KERN_DEBUG, nic->netdev,
1642 "exec cuc_dump_reset failed\n");
1633} 1643}
1634 1644
1635static void e100_adjust_adaptive_ifs(struct nic *nic, int speed, int duplex) 1645static void e100_adjust_adaptive_ifs(struct nic *nic, int speed, int duplex)
@@ -1659,20 +1669,19 @@ static void e100_watchdog(unsigned long data)
1659 struct nic *nic = (struct nic *)data; 1669 struct nic *nic = (struct nic *)data;
1660 struct ethtool_cmd cmd; 1670 struct ethtool_cmd cmd;
1661 1671
1662 DPRINTK(TIMER, DEBUG, "right now = %ld\n", jiffies); 1672 netif_printk(nic, timer, KERN_DEBUG, nic->netdev,
1673 "right now = %ld\n", jiffies);
1663 1674
1664 /* mii library handles link maintenance tasks */ 1675 /* mii library handles link maintenance tasks */
1665 1676
1666 mii_ethtool_gset(&nic->mii, &cmd); 1677 mii_ethtool_gset(&nic->mii, &cmd);
1667 1678
1668 if (mii_link_ok(&nic->mii) && !netif_carrier_ok(nic->netdev)) { 1679 if (mii_link_ok(&nic->mii) && !netif_carrier_ok(nic->netdev)) {
1669 printk(KERN_INFO "e100: %s NIC Link is Up %s Mbps %s Duplex\n", 1680 netdev_info(nic->netdev, "NIC Link is Up %u Mbps %s Duplex\n",
1670 nic->netdev->name, 1681 cmd.speed == SPEED_100 ? 100 : 10,
1671 cmd.speed == SPEED_100 ? "100" : "10", 1682 cmd.duplex == DUPLEX_FULL ? "Full" : "Half");
1672 cmd.duplex == DUPLEX_FULL ? "Full" : "Half");
1673 } else if (!mii_link_ok(&nic->mii) && netif_carrier_ok(nic->netdev)) { 1683 } else if (!mii_link_ok(&nic->mii) && netif_carrier_ok(nic->netdev)) {
1674 printk(KERN_INFO "e100: %s NIC Link is Down\n", 1684 netdev_info(nic->netdev, "NIC Link is Down\n");
1675 nic->netdev->name);
1676 } 1685 }
1677 1686
1678 mii_check_link(&nic->mii); 1687 mii_check_link(&nic->mii);
@@ -1732,7 +1741,8 @@ static netdev_tx_t e100_xmit_frame(struct sk_buff *skb,
1732 Issue a NOP command followed by a 1us delay before 1741 Issue a NOP command followed by a 1us delay before
1733 issuing the Tx command. */ 1742 issuing the Tx command. */
1734 if (e100_exec_cmd(nic, cuc_nop, 0)) 1743 if (e100_exec_cmd(nic, cuc_nop, 0))
1735 DPRINTK(TX_ERR, DEBUG, "exec cuc_nop failed\n"); 1744 netif_printk(nic, tx_err, KERN_DEBUG, nic->netdev,
1745 "exec cuc_nop failed\n");
1736 udelay(1); 1746 udelay(1);
1737 } 1747 }
1738 1748
@@ -1741,12 +1751,14 @@ static netdev_tx_t e100_xmit_frame(struct sk_buff *skb,
1741 switch (err) { 1751 switch (err) {
1742 case -ENOSPC: 1752 case -ENOSPC:
1743 /* We queued the skb, but now we're out of space. */ 1753 /* We queued the skb, but now we're out of space. */
1744 DPRINTK(TX_ERR, DEBUG, "No space for CB\n"); 1754 netif_printk(nic, tx_err, KERN_DEBUG, nic->netdev,
1755 "No space for CB\n");
1745 netif_stop_queue(netdev); 1756 netif_stop_queue(netdev);
1746 break; 1757 break;
1747 case -ENOMEM: 1758 case -ENOMEM:
1748 /* This is a hard error - log it. */ 1759 /* This is a hard error - log it. */
1749 DPRINTK(TX_ERR, DEBUG, "Out of Tx resources, returning skb\n"); 1760 netif_printk(nic, tx_err, KERN_DEBUG, nic->netdev,
1761 "Out of Tx resources, returning skb\n");
1750 netif_stop_queue(netdev); 1762 netif_stop_queue(netdev);
1751 return NETDEV_TX_BUSY; 1763 return NETDEV_TX_BUSY;
1752 } 1764 }
@@ -1767,9 +1779,10 @@ static int e100_tx_clean(struct nic *nic)
1767 for (cb = nic->cb_to_clean; 1779 for (cb = nic->cb_to_clean;
1768 cb->status & cpu_to_le16(cb_complete); 1780 cb->status & cpu_to_le16(cb_complete);
1769 cb = nic->cb_to_clean = cb->next) { 1781 cb = nic->cb_to_clean = cb->next) {
1770 DPRINTK(TX_DONE, DEBUG, "cb[%d]->status = 0x%04X\n", 1782 netif_printk(nic, tx_done, KERN_DEBUG, nic->netdev,
1771 (int)(((void*)cb - (void*)nic->cbs)/sizeof(struct cb)), 1783 "cb[%d]->status = 0x%04X\n",
1772 cb->status); 1784 (int)(((void*)cb - (void*)nic->cbs)/sizeof(struct cb)),
1785 cb->status);
1773 1786
1774 if (likely(cb->skb != NULL)) { 1787 if (likely(cb->skb != NULL)) {
1775 dev->stats.tx_packets++; 1788 dev->stats.tx_packets++;
@@ -1912,7 +1925,8 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
1912 sizeof(struct rfd), PCI_DMA_BIDIRECTIONAL); 1925 sizeof(struct rfd), PCI_DMA_BIDIRECTIONAL);
1913 rfd_status = le16_to_cpu(rfd->status); 1926 rfd_status = le16_to_cpu(rfd->status);
1914 1927
1915 DPRINTK(RX_STATUS, DEBUG, "status=0x%04X\n", rfd_status); 1928 netif_printk(nic, rx_status, KERN_DEBUG, nic->netdev,
1929 "status=0x%04X\n", rfd_status);
1916 1930
1917 /* If data isn't ready, nothing to indicate */ 1931 /* If data isn't ready, nothing to indicate */
1918 if (unlikely(!(rfd_status & cb_complete))) { 1932 if (unlikely(!(rfd_status & cb_complete))) {
@@ -2123,7 +2137,8 @@ static irqreturn_t e100_intr(int irq, void *dev_id)
2123 struct nic *nic = netdev_priv(netdev); 2137 struct nic *nic = netdev_priv(netdev);
2124 u8 stat_ack = ioread8(&nic->csr->scb.stat_ack); 2138 u8 stat_ack = ioread8(&nic->csr->scb.stat_ack);
2125 2139
2126 DPRINTK(INTR, DEBUG, "stat_ack = 0x%02X\n", stat_ack); 2140 netif_printk(nic, intr, KERN_DEBUG, nic->netdev,
2141 "stat_ack = 0x%02X\n", stat_ack);
2127 2142
2128 if (stat_ack == stat_ack_not_ours || /* Not our interrupt */ 2143 if (stat_ack == stat_ack_not_ours || /* Not our interrupt */
2129 stat_ack == stat_ack_not_present) /* Hardware is ejected */ 2144 stat_ack == stat_ack_not_present) /* Hardware is ejected */
@@ -2263,8 +2278,8 @@ static void e100_tx_timeout_task(struct work_struct *work)
2263 struct nic *nic = container_of(work, struct nic, tx_timeout_task); 2278 struct nic *nic = container_of(work, struct nic, tx_timeout_task);
2264 struct net_device *netdev = nic->netdev; 2279 struct net_device *netdev = nic->netdev;
2265 2280
2266 DPRINTK(TX_ERR, DEBUG, "scb.status=0x%02X\n", 2281 netif_printk(nic, tx_err, KERN_DEBUG, nic->netdev,
2267 ioread8(&nic->csr->scb.status)); 2282 "scb.status=0x%02X\n", ioread8(&nic->csr->scb.status));
2268 e100_down(netdev_priv(netdev)); 2283 e100_down(netdev_priv(netdev));
2269 e100_up(netdev_priv(netdev)); 2284 e100_up(netdev_priv(netdev));
2270} 2285}
@@ -2526,8 +2541,8 @@ static int e100_set_ringparam(struct net_device *netdev,
2526 rfds->count = min(rfds->count, rfds->max); 2541 rfds->count = min(rfds->count, rfds->max);
2527 cbs->count = max(ring->tx_pending, cbs->min); 2542 cbs->count = max(ring->tx_pending, cbs->min);
2528 cbs->count = min(cbs->count, cbs->max); 2543 cbs->count = min(cbs->count, cbs->max);
2529 DPRINTK(DRV, INFO, "Ring Param settings: rx: %d, tx %d\n", 2544 netif_info(nic, drv, nic->netdev, "Ring Param settings: rx: %d, tx %d\n",
2530 rfds->count, cbs->count); 2545 rfds->count, cbs->count);
2531 if (netif_running(netdev)) 2546 if (netif_running(netdev))
2532 e100_up(nic); 2547 e100_up(nic);
2533 2548
@@ -2704,7 +2719,7 @@ static int e100_open(struct net_device *netdev)
2704 2719
2705 netif_carrier_off(netdev); 2720 netif_carrier_off(netdev);
2706 if ((err = e100_up(nic))) 2721 if ((err = e100_up(nic)))
2707 DPRINTK(IFUP, ERR, "Cannot open interface, aborting.\n"); 2722 netif_err(nic, ifup, nic->netdev, "Cannot open interface, aborting\n");
2708 return err; 2723 return err;
2709} 2724}
2710 2725
@@ -2738,7 +2753,7 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2738 2753
2739 if (!(netdev = alloc_etherdev(sizeof(struct nic)))) { 2754 if (!(netdev = alloc_etherdev(sizeof(struct nic)))) {
2740 if (((1 << debug) - 1) & NETIF_MSG_PROBE) 2755 if (((1 << debug) - 1) & NETIF_MSG_PROBE)
2741 printk(KERN_ERR PFX "Etherdev alloc failed, abort.\n"); 2756 pr_err("Etherdev alloc failed, aborting\n");
2742 return -ENOMEM; 2757 return -ENOMEM;
2743 } 2758 }
2744 2759
@@ -2756,35 +2771,34 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2756 pci_set_drvdata(pdev, netdev); 2771 pci_set_drvdata(pdev, netdev);
2757 2772
2758 if ((err = pci_enable_device(pdev))) { 2773 if ((err = pci_enable_device(pdev))) {
2759 DPRINTK(PROBE, ERR, "Cannot enable PCI device, aborting.\n"); 2774 netif_err(nic, probe, nic->netdev, "Cannot enable PCI device, aborting\n");
2760 goto err_out_free_dev; 2775 goto err_out_free_dev;
2761 } 2776 }
2762 2777
2763 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { 2778 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
2764 DPRINTK(PROBE, ERR, "Cannot find proper PCI device " 2779 netif_err(nic, probe, nic->netdev, "Cannot find proper PCI device base address, aborting\n");
2765 "base address, aborting.\n");
2766 err = -ENODEV; 2780 err = -ENODEV;
2767 goto err_out_disable_pdev; 2781 goto err_out_disable_pdev;
2768 } 2782 }
2769 2783
2770 if ((err = pci_request_regions(pdev, DRV_NAME))) { 2784 if ((err = pci_request_regions(pdev, DRV_NAME))) {
2771 DPRINTK(PROBE, ERR, "Cannot obtain PCI resources, aborting.\n"); 2785 netif_err(nic, probe, nic->netdev, "Cannot obtain PCI resources, aborting\n");
2772 goto err_out_disable_pdev; 2786 goto err_out_disable_pdev;
2773 } 2787 }
2774 2788
2775 if ((err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) { 2789 if ((err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) {
2776 DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting.\n"); 2790 netif_err(nic, probe, nic->netdev, "No usable DMA configuration, aborting\n");
2777 goto err_out_free_res; 2791 goto err_out_free_res;
2778 } 2792 }
2779 2793
2780 SET_NETDEV_DEV(netdev, &pdev->dev); 2794 SET_NETDEV_DEV(netdev, &pdev->dev);
2781 2795
2782 if (use_io) 2796 if (use_io)
2783 DPRINTK(PROBE, INFO, "using i/o access mode\n"); 2797 netif_info(nic, probe, nic->netdev, "using i/o access mode\n");
2784 2798
2785 nic->csr = pci_iomap(pdev, (use_io ? 1 : 0), sizeof(struct csr)); 2799 nic->csr = pci_iomap(pdev, (use_io ? 1 : 0), sizeof(struct csr));
2786 if (!nic->csr) { 2800 if (!nic->csr) {
2787 DPRINTK(PROBE, ERR, "Cannot map device registers, aborting.\n"); 2801 netif_err(nic, probe, nic->netdev, "Cannot map device registers, aborting\n");
2788 err = -ENOMEM; 2802 err = -ENOMEM;
2789 goto err_out_free_res; 2803 goto err_out_free_res;
2790 } 2804 }
@@ -2818,7 +2832,7 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2818 INIT_WORK(&nic->tx_timeout_task, e100_tx_timeout_task); 2832 INIT_WORK(&nic->tx_timeout_task, e100_tx_timeout_task);
2819 2833
2820 if ((err = e100_alloc(nic))) { 2834 if ((err = e100_alloc(nic))) {
2821 DPRINTK(PROBE, ERR, "Cannot alloc driver memory, aborting.\n"); 2835 netif_err(nic, probe, nic->netdev, "Cannot alloc driver memory, aborting\n");
2822 goto err_out_iounmap; 2836 goto err_out_iounmap;
2823 } 2837 }
2824 2838
@@ -2831,13 +2845,11 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2831 memcpy(netdev->perm_addr, nic->eeprom, ETH_ALEN); 2845 memcpy(netdev->perm_addr, nic->eeprom, ETH_ALEN);
2832 if (!is_valid_ether_addr(netdev->perm_addr)) { 2846 if (!is_valid_ether_addr(netdev->perm_addr)) {
2833 if (!eeprom_bad_csum_allow) { 2847 if (!eeprom_bad_csum_allow) {
2834 DPRINTK(PROBE, ERR, "Invalid MAC address from " 2848 netif_err(nic, probe, nic->netdev, "Invalid MAC address from EEPROM, aborting\n");
2835 "EEPROM, aborting.\n");
2836 err = -EAGAIN; 2849 err = -EAGAIN;
2837 goto err_out_free; 2850 goto err_out_free;
2838 } else { 2851 } else {
2839 DPRINTK(PROBE, ERR, "Invalid MAC address from EEPROM, " 2852 netif_err(nic, probe, nic->netdev, "Invalid MAC address from EEPROM, you MUST configure one.\n");
2840 "you MUST configure one.\n");
2841 } 2853 }
2842 } 2854 }
2843 2855
@@ -2853,7 +2865,7 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2853 2865
2854 strcpy(netdev->name, "eth%d"); 2866 strcpy(netdev->name, "eth%d");
2855 if ((err = register_netdev(netdev))) { 2867 if ((err = register_netdev(netdev))) {
2856 DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n"); 2868 netif_err(nic, probe, nic->netdev, "Cannot register net device, aborting\n");
2857 goto err_out_free; 2869 goto err_out_free;
2858 } 2870 }
2859 nic->cbs_pool = pci_pool_create(netdev->name, 2871 nic->cbs_pool = pci_pool_create(netdev->name,
@@ -2861,9 +2873,10 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2861 nic->params.cbs.max * sizeof(struct cb), 2873 nic->params.cbs.max * sizeof(struct cb),
2862 sizeof(u32), 2874 sizeof(u32),
2863 0); 2875 0);
2864 DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %pM\n", 2876 netif_info(nic, probe, nic->netdev,
2865 (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0), 2877 "addr 0x%llx, irq %d, MAC addr %pM\n",
2866 pdev->irq, netdev->dev_addr); 2878 (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0),
2879 pdev->irq, netdev->dev_addr);
2867 2880
2868 return 0; 2881 return 0;
2869 2882
@@ -3021,7 +3034,7 @@ static pci_ers_result_t e100_io_slot_reset(struct pci_dev *pdev)
3021 struct nic *nic = netdev_priv(netdev); 3034 struct nic *nic = netdev_priv(netdev);
3022 3035
3023 if (pci_enable_device(pdev)) { 3036 if (pci_enable_device(pdev)) {
3024 printk(KERN_ERR "e100: Cannot re-enable PCI device after reset.\n"); 3037 pr_err("Cannot re-enable PCI device after reset\n");
3025 return PCI_ERS_RESULT_DISCONNECT; 3038 return PCI_ERS_RESULT_DISCONNECT;
3026 } 3039 }
3027 pci_set_master(pdev); 3040 pci_set_master(pdev);
@@ -3080,8 +3093,8 @@ static struct pci_driver e100_driver = {
3080static int __init e100_init_module(void) 3093static int __init e100_init_module(void)
3081{ 3094{
3082 if (((1 << debug) - 1) & NETIF_MSG_DRV) { 3095 if (((1 << debug) - 1) & NETIF_MSG_DRV) {
3083 printk(KERN_INFO PFX "%s, %s\n", DRV_DESCRIPTION, DRV_VERSION); 3096 pr_info("%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
3084 printk(KERN_INFO PFX "%s\n", DRV_COPYRIGHT); 3097 pr_info("%s\n", DRV_COPYRIGHT);
3085 } 3098 }
3086 return pci_register_driver(&e100_driver); 3099 return pci_register_driver(&e100_driver);
3087} 3100}