aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_main.c
diff options
context:
space:
mode:
authorEmil Tantilov <emil.s.tantilov@intel.com>2010-04-27 10:02:58 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-27 20:05:03 -0400
commit675ad47375c76a7c3be4ace9554d92cd55518ced (patch)
tree54acb7e8aa4db5e93b960d565b1cc2dce45988b9 /drivers/net/e1000/e1000_main.c
parent709b9326ef6fc1b7e379d47d5f39ebc27dad3f4d (diff)
e1000: Use netdev_<level>, pr_<level> and dev_<level>
This patch is an alternative to similar patch provided by Joe Perches. Substitute DPRINTK macro for e_<level> that uses netdev_<level> and dev_<level> similar to e1000e. - Convert printk to pr_<level> where applicable. - Use common #define pr_fmt for the driver. - Use dev_<level> for displaying text in parts of the driver where the interface name is not assigned (like e1000_param.c). - Better align test with the new macros. CC: Joe Perches <joe@perches.com> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000/e1000_main.c')
-rw-r--r--drivers/net/e1000/e1000_main.c239
1 files changed, 114 insertions, 125 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 0a56e7d1f33b..e6ebc222459f 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -214,6 +214,17 @@ module_param(debug, int, 0);
214MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); 214MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
215 215
216/** 216/**
217 * e1000_get_hw_dev - return device
218 * used by hardware layer to print debugging information
219 *
220 **/
221struct net_device *e1000_get_hw_dev(struct e1000_hw *hw)
222{
223 struct e1000_adapter *adapter = hw->back;
224 return adapter->netdev;
225}
226
227/**
217 * e1000_init_module - Driver Registration Routine 228 * e1000_init_module - Driver Registration Routine
218 * 229 *
219 * e1000_init_module is the first routine called when the driver is 230 * e1000_init_module is the first routine called when the driver is
@@ -223,18 +234,17 @@ MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
223static int __init e1000_init_module(void) 234static int __init e1000_init_module(void)
224{ 235{
225 int ret; 236 int ret;
226 printk(KERN_INFO "%s - version %s\n", 237 pr_info("%s - version %s\n", e1000_driver_string, e1000_driver_version);
227 e1000_driver_string, e1000_driver_version);
228 238
229 printk(KERN_INFO "%s\n", e1000_copyright); 239 pr_info("%s\n", e1000_copyright);
230 240
231 ret = pci_register_driver(&e1000_driver); 241 ret = pci_register_driver(&e1000_driver);
232 if (copybreak != COPYBREAK_DEFAULT) { 242 if (copybreak != COPYBREAK_DEFAULT) {
233 if (copybreak == 0) 243 if (copybreak == 0)
234 printk(KERN_INFO "e1000: copybreak disabled\n"); 244 pr_info("copybreak disabled\n");
235 else 245 else
236 printk(KERN_INFO "e1000: copybreak enabled for " 246 pr_info("copybreak enabled for "
237 "packets <= %u bytes\n", copybreak); 247 "packets <= %u bytes\n", copybreak);
238 } 248 }
239 return ret; 249 return ret;
240} 250}
@@ -265,8 +275,7 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
265 err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name, 275 err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name,
266 netdev); 276 netdev);
267 if (err) { 277 if (err) {
268 DPRINTK(PROBE, ERR, 278 e_err("Unable to allocate interrupt Error: %d\n", err);
269 "Unable to allocate interrupt Error: %d\n", err);
270 } 279 }
271 280
272 return err; 281 return err;
@@ -648,7 +657,7 @@ void e1000_reset(struct e1000_adapter *adapter)
648 ew32(WUC, 0); 657 ew32(WUC, 0);
649 658
650 if (e1000_init_hw(hw)) 659 if (e1000_init_hw(hw))
651 DPRINTK(PROBE, ERR, "Hardware Error\n"); 660 e_err("Hardware Error\n");
652 e1000_update_mng_vlan(adapter); 661 e1000_update_mng_vlan(adapter);
653 662
654 /* if (adapter->hwflags & HWFLAGS_PHY_PWR_BIT) { */ 663 /* if (adapter->hwflags & HWFLAGS_PHY_PWR_BIT) { */
@@ -689,8 +698,7 @@ static void e1000_dump_eeprom(struct e1000_adapter *adapter)
689 698
690 data = kmalloc(eeprom.len, GFP_KERNEL); 699 data = kmalloc(eeprom.len, GFP_KERNEL);
691 if (!data) { 700 if (!data) {
692 printk(KERN_ERR "Unable to allocate memory to dump EEPROM" 701 pr_err("Unable to allocate memory to dump EEPROM data\n");
693 " data\n");
694 return; 702 return;
695 } 703 }
696 704
@@ -702,30 +710,25 @@ static void e1000_dump_eeprom(struct e1000_adapter *adapter)
702 csum_new += data[i] + (data[i + 1] << 8); 710 csum_new += data[i] + (data[i + 1] << 8);
703 csum_new = EEPROM_SUM - csum_new; 711 csum_new = EEPROM_SUM - csum_new;
704 712
705 printk(KERN_ERR "/*********************/\n"); 713 pr_err("/*********************/\n");
706 printk(KERN_ERR "Current EEPROM Checksum : 0x%04x\n", csum_old); 714 pr_err("Current EEPROM Checksum : 0x%04x\n", csum_old);
707 printk(KERN_ERR "Calculated : 0x%04x\n", csum_new); 715 pr_err("Calculated : 0x%04x\n", csum_new);
708 716
709 printk(KERN_ERR "Offset Values\n"); 717 pr_err("Offset Values\n");
710 printk(KERN_ERR "======== ======\n"); 718 pr_err("======== ======\n");
711 print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 16, 1, data, 128, 0); 719 print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 16, 1, data, 128, 0);
712 720
713 printk(KERN_ERR "Include this output when contacting your support " 721 pr_err("Include this output when contacting your support provider.\n");
714 "provider.\n"); 722 pr_err("This is not a software error! Something bad happened to\n");
715 printk(KERN_ERR "This is not a software error! Something bad " 723 pr_err("your hardware or EEPROM image. Ignoring this problem could\n");
716 "happened to your hardware or\n"); 724 pr_err("result in further problems, possibly loss of data,\n");
717 printk(KERN_ERR "EEPROM image. Ignoring this " 725 pr_err("corruption or system hangs!\n");
718 "problem could result in further problems,\n"); 726 pr_err("The MAC Address will be reset to 00:00:00:00:00:00,\n");
719 printk(KERN_ERR "possibly loss of data, corruption or system hangs!\n"); 727 pr_err("which is invalid and requires you to set the proper MAC\n");
720 printk(KERN_ERR "The MAC Address will be reset to 00:00:00:00:00:00, " 728 pr_err("address manually before continuing to enable this network\n");
721 "which is invalid\n"); 729 pr_err("device. Please inspect the EEPROM dump and report the\n");
722 printk(KERN_ERR "and requires you to set the proper MAC " 730 pr_err("issue to your hardware vendor or Intel Customer Support.\n");
723 "address manually before continuing\n"); 731 pr_err("/*********************/\n");
724 printk(KERN_ERR "to enable this network device.\n");
725 printk(KERN_ERR "Please inspect the EEPROM dump and report the issue "
726 "to your hardware vendor\n");
727 printk(KERN_ERR "or Intel Customer Support.\n");
728 printk(KERN_ERR "/*********************/\n");
729 732
730 kfree(data); 733 kfree(data);
731} 734}
@@ -832,8 +835,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
832 err = dma_set_coherent_mask(&pdev->dev, 835 err = dma_set_coherent_mask(&pdev->dev,
833 DMA_BIT_MASK(32)); 836 DMA_BIT_MASK(32));
834 if (err) { 837 if (err) {
835 E1000_ERR("No usable DMA configuration, " 838 pr_err("No usable DMA config, aborting\n");
836 "aborting\n");
837 goto err_dma; 839 goto err_dma;
838 } 840 }
839 } 841 }
@@ -923,7 +925,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
923 925
924 /* initialize eeprom parameters */ 926 /* initialize eeprom parameters */
925 if (e1000_init_eeprom_params(hw)) { 927 if (e1000_init_eeprom_params(hw)) {
926 E1000_ERR("EEPROM initialization failed\n"); 928 e_err("EEPROM initialization failed\n");
927 goto err_eeprom; 929 goto err_eeprom;
928 } 930 }
929 931
@@ -934,7 +936,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
934 936
935 /* make sure the EEPROM is good */ 937 /* make sure the EEPROM is good */
936 if (e1000_validate_eeprom_checksum(hw) < 0) { 938 if (e1000_validate_eeprom_checksum(hw) < 0) {
937 DPRINTK(PROBE, ERR, "The EEPROM Checksum Is Not Valid\n"); 939 e_err("The EEPROM Checksum Is Not Valid\n");
938 e1000_dump_eeprom(adapter); 940 e1000_dump_eeprom(adapter);
939 /* 941 /*
940 * set MAC address to all zeroes to invalidate and temporary 942 * set MAC address to all zeroes to invalidate and temporary
@@ -948,14 +950,14 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
948 } else { 950 } else {
949 /* copy the MAC address out of the EEPROM */ 951 /* copy the MAC address out of the EEPROM */
950 if (e1000_read_mac_addr(hw)) 952 if (e1000_read_mac_addr(hw))
951 DPRINTK(PROBE, ERR, "EEPROM Read Error\n"); 953 e_err("EEPROM Read Error\n");
952 } 954 }
953 /* don't block initalization here due to bad MAC address */ 955 /* don't block initalization here due to bad MAC address */
954 memcpy(netdev->dev_addr, hw->mac_addr, netdev->addr_len); 956 memcpy(netdev->dev_addr, hw->mac_addr, netdev->addr_len);
955 memcpy(netdev->perm_addr, hw->mac_addr, netdev->addr_len); 957 memcpy(netdev->perm_addr, hw->mac_addr, netdev->addr_len);
956 958
957 if (!is_valid_ether_addr(netdev->perm_addr)) 959 if (!is_valid_ether_addr(netdev->perm_addr))
958 DPRINTK(PROBE, ERR, "Invalid MAC Address\n"); 960 e_err("Invalid MAC Address\n");
959 961
960 e1000_get_bus_info(hw); 962 e1000_get_bus_info(hw);
961 963
@@ -1036,8 +1038,16 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
1036 adapter->wol = adapter->eeprom_wol; 1038 adapter->wol = adapter->eeprom_wol;
1037 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); 1039 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
1038 1040
1041 /* reset the hardware with the new settings */
1042 e1000_reset(adapter);
1043
1044 strcpy(netdev->name, "eth%d");
1045 err = register_netdev(netdev);
1046 if (err)
1047 goto err_register;
1048
1039 /* print bus type/speed/width info */ 1049 /* print bus type/speed/width info */
1040 DPRINTK(PROBE, INFO, "(PCI%s:%s:%s) ", 1050 e_info("(PCI%s:%s:%s) ",
1041 ((hw->bus_type == e1000_bus_type_pcix) ? "-X" : ""), 1051 ((hw->bus_type == e1000_bus_type_pcix) ? "-X" : ""),
1042 ((hw->bus_speed == e1000_bus_speed_133) ? "133MHz" : 1052 ((hw->bus_speed == e1000_bus_speed_133) ? "133MHz" :
1043 (hw->bus_speed == e1000_bus_speed_120) ? "120MHz" : 1053 (hw->bus_speed == e1000_bus_speed_120) ? "120MHz" :
@@ -1045,20 +1055,12 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
1045 (hw->bus_speed == e1000_bus_speed_66) ? "66MHz" : "33MHz"), 1055 (hw->bus_speed == e1000_bus_speed_66) ? "66MHz" : "33MHz"),
1046 ((hw->bus_width == e1000_bus_width_64) ? "64-bit" : "32-bit")); 1056 ((hw->bus_width == e1000_bus_width_64) ? "64-bit" : "32-bit"));
1047 1057
1048 printk("%pM\n", netdev->dev_addr); 1058 e_info("%pM\n", netdev->dev_addr);
1049
1050 /* reset the hardware with the new settings */
1051 e1000_reset(adapter);
1052
1053 strcpy(netdev->name, "eth%d");
1054 err = register_netdev(netdev);
1055 if (err)
1056 goto err_register;
1057 1059
1058 /* carrier off reporting is important to ethtool even BEFORE open */ 1060 /* carrier off reporting is important to ethtool even BEFORE open */
1059 netif_carrier_off(netdev); 1061 netif_carrier_off(netdev);
1060 1062
1061 DPRINTK(PROBE, INFO, "Intel(R) PRO/1000 Network Connection\n"); 1063 e_info("Intel(R) PRO/1000 Network Connection\n");
1062 1064
1063 cards_found++; 1065 cards_found++;
1064 return 0; 1066 return 0;
@@ -1158,7 +1160,7 @@ static int __devinit e1000_sw_init(struct e1000_adapter *adapter)
1158 /* identify the MAC */ 1160 /* identify the MAC */
1159 1161
1160 if (e1000_set_mac_type(hw)) { 1162 if (e1000_set_mac_type(hw)) {
1161 DPRINTK(PROBE, ERR, "Unknown MAC Type\n"); 1163 e_err("Unknown MAC Type\n");
1162 return -EIO; 1164 return -EIO;
1163 } 1165 }
1164 1166
@@ -1191,7 +1193,7 @@ static int __devinit e1000_sw_init(struct e1000_adapter *adapter)
1191 adapter->num_rx_queues = 1; 1193 adapter->num_rx_queues = 1;
1192 1194
1193 if (e1000_alloc_queues(adapter)) { 1195 if (e1000_alloc_queues(adapter)) {
1194 DPRINTK(PROBE, ERR, "Unable to allocate memory for queues\n"); 1196 e_err("Unable to allocate memory for queues\n");
1195 return -ENOMEM; 1197 return -ENOMEM;
1196 } 1198 }
1197 1199
@@ -1385,8 +1387,7 @@ static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
1385 size = sizeof(struct e1000_buffer) * txdr->count; 1387 size = sizeof(struct e1000_buffer) * txdr->count;
1386 txdr->buffer_info = vmalloc(size); 1388 txdr->buffer_info = vmalloc(size);
1387 if (!txdr->buffer_info) { 1389 if (!txdr->buffer_info) {
1388 DPRINTK(PROBE, ERR, 1390 e_err("Unable to allocate memory for the Tx descriptor ring\n");
1389 "Unable to allocate memory for the transmit descriptor ring\n");
1390 return -ENOMEM; 1391 return -ENOMEM;
1391 } 1392 }
1392 memset(txdr->buffer_info, 0, size); 1393 memset(txdr->buffer_info, 0, size);
@@ -1401,8 +1402,7 @@ static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
1401 if (!txdr->desc) { 1402 if (!txdr->desc) {
1402setup_tx_desc_die: 1403setup_tx_desc_die:
1403 vfree(txdr->buffer_info); 1404 vfree(txdr->buffer_info);
1404 DPRINTK(PROBE, ERR, 1405 e_err("Unable to allocate memory for the Tx descriptor ring\n");
1405 "Unable to allocate memory for the transmit descriptor ring\n");
1406 return -ENOMEM; 1406 return -ENOMEM;
1407 } 1407 }
1408 1408
@@ -1410,8 +1410,8 @@ setup_tx_desc_die:
1410 if (!e1000_check_64k_bound(adapter, txdr->desc, txdr->size)) { 1410 if (!e1000_check_64k_bound(adapter, txdr->desc, txdr->size)) {
1411 void *olddesc = txdr->desc; 1411 void *olddesc = txdr->desc;
1412 dma_addr_t olddma = txdr->dma; 1412 dma_addr_t olddma = txdr->dma;
1413 DPRINTK(TX_ERR, ERR, "txdr align check failed: %u bytes " 1413 e_err("txdr align check failed: %u bytes at %p\n",
1414 "at %p\n", txdr->size, txdr->desc); 1414 txdr->size, txdr->desc);
1415 /* Try again, without freeing the previous */ 1415 /* Try again, without freeing the previous */
1416 txdr->desc = dma_alloc_coherent(&pdev->dev, txdr->size, 1416 txdr->desc = dma_alloc_coherent(&pdev->dev, txdr->size,
1417 &txdr->dma, GFP_KERNEL); 1417 &txdr->dma, GFP_KERNEL);
@@ -1428,9 +1428,8 @@ setup_tx_desc_die:
1428 txdr->dma); 1428 txdr->dma);
1429 dma_free_coherent(&pdev->dev, txdr->size, olddesc, 1429 dma_free_coherent(&pdev->dev, txdr->size, olddesc,
1430 olddma); 1430 olddma);
1431 DPRINTK(PROBE, ERR, 1431 e_err("Unable to allocate aligned memory "
1432 "Unable to allocate aligned memory " 1432 "for the transmit descriptor ring\n");
1433 "for the transmit descriptor ring\n");
1434 vfree(txdr->buffer_info); 1433 vfree(txdr->buffer_info);
1435 return -ENOMEM; 1434 return -ENOMEM;
1436 } else { 1435 } else {
@@ -1462,8 +1461,7 @@ int e1000_setup_all_tx_resources(struct e1000_adapter *adapter)
1462 for (i = 0; i < adapter->num_tx_queues; i++) { 1461 for (i = 0; i < adapter->num_tx_queues; i++) {
1463 err = e1000_setup_tx_resources(adapter, &adapter->tx_ring[i]); 1462 err = e1000_setup_tx_resources(adapter, &adapter->tx_ring[i]);
1464 if (err) { 1463 if (err) {
1465 DPRINTK(PROBE, ERR, 1464 e_err("Allocation for Tx Queue %u failed\n", i);
1466 "Allocation for Tx Queue %u failed\n", i);
1467 for (i-- ; i >= 0; i--) 1465 for (i-- ; i >= 0; i--)
1468 e1000_free_tx_resources(adapter, 1466 e1000_free_tx_resources(adapter,
1469 &adapter->tx_ring[i]); 1467 &adapter->tx_ring[i]);
@@ -1583,8 +1581,7 @@ static int e1000_setup_rx_resources(struct e1000_adapter *adapter,
1583 size = sizeof(struct e1000_buffer) * rxdr->count; 1581 size = sizeof(struct e1000_buffer) * rxdr->count;
1584 rxdr->buffer_info = vmalloc(size); 1582 rxdr->buffer_info = vmalloc(size);
1585 if (!rxdr->buffer_info) { 1583 if (!rxdr->buffer_info) {
1586 DPRINTK(PROBE, ERR, 1584 e_err("Unable to allocate memory for the Rx descriptor ring\n");
1587 "Unable to allocate memory for the receive descriptor ring\n");
1588 return -ENOMEM; 1585 return -ENOMEM;
1589 } 1586 }
1590 memset(rxdr->buffer_info, 0, size); 1587 memset(rxdr->buffer_info, 0, size);
@@ -1600,8 +1597,7 @@ static int e1000_setup_rx_resources(struct e1000_adapter *adapter,
1600 GFP_KERNEL); 1597 GFP_KERNEL);
1601 1598
1602 if (!rxdr->desc) { 1599 if (!rxdr->desc) {
1603 DPRINTK(PROBE, ERR, 1600 e_err("Unable to allocate memory for the Rx descriptor ring\n");
1604 "Unable to allocate memory for the receive descriptor ring\n");
1605setup_rx_desc_die: 1601setup_rx_desc_die:
1606 vfree(rxdr->buffer_info); 1602 vfree(rxdr->buffer_info);
1607 return -ENOMEM; 1603 return -ENOMEM;
@@ -1611,8 +1607,8 @@ setup_rx_desc_die:
1611 if (!e1000_check_64k_bound(adapter, rxdr->desc, rxdr->size)) { 1607 if (!e1000_check_64k_bound(adapter, rxdr->desc, rxdr->size)) {
1612 void *olddesc = rxdr->desc; 1608 void *olddesc = rxdr->desc;
1613 dma_addr_t olddma = rxdr->dma; 1609 dma_addr_t olddma = rxdr->dma;
1614 DPRINTK(RX_ERR, ERR, "rxdr align check failed: %u bytes " 1610 e_err("rxdr align check failed: %u bytes at %p\n",
1615 "at %p\n", rxdr->size, rxdr->desc); 1611 rxdr->size, rxdr->desc);
1616 /* Try again, without freeing the previous */ 1612 /* Try again, without freeing the previous */
1617 rxdr->desc = dma_alloc_coherent(&pdev->dev, rxdr->size, 1613 rxdr->desc = dma_alloc_coherent(&pdev->dev, rxdr->size,
1618 &rxdr->dma, GFP_KERNEL); 1614 &rxdr->dma, GFP_KERNEL);
@@ -1620,9 +1616,8 @@ setup_rx_desc_die:
1620 if (!rxdr->desc) { 1616 if (!rxdr->desc) {
1621 dma_free_coherent(&pdev->dev, rxdr->size, olddesc, 1617 dma_free_coherent(&pdev->dev, rxdr->size, olddesc,
1622 olddma); 1618 olddma);
1623 DPRINTK(PROBE, ERR, 1619 e_err("Unable to allocate memory for the Rx descriptor "
1624 "Unable to allocate memory " 1620 "ring\n");
1625 "for the receive descriptor ring\n");
1626 goto setup_rx_desc_die; 1621 goto setup_rx_desc_die;
1627 } 1622 }
1628 1623
@@ -1632,9 +1627,8 @@ setup_rx_desc_die:
1632 rxdr->dma); 1627 rxdr->dma);
1633 dma_free_coherent(&pdev->dev, rxdr->size, olddesc, 1628 dma_free_coherent(&pdev->dev, rxdr->size, olddesc,
1634 olddma); 1629 olddma);
1635 DPRINTK(PROBE, ERR, 1630 e_err("Unable to allocate aligned memory for the Rx "
1636 "Unable to allocate aligned memory " 1631 "descriptor ring\n");
1637 "for the receive descriptor ring\n");
1638 goto setup_rx_desc_die; 1632 goto setup_rx_desc_die;
1639 } else { 1633 } else {
1640 /* Free old allocation, new allocation was successful */ 1634 /* Free old allocation, new allocation was successful */
@@ -1666,8 +1660,7 @@ int e1000_setup_all_rx_resources(struct e1000_adapter *adapter)
1666 for (i = 0; i < adapter->num_rx_queues; i++) { 1660 for (i = 0; i < adapter->num_rx_queues; i++) {
1667 err = e1000_setup_rx_resources(adapter, &adapter->rx_ring[i]); 1661 err = e1000_setup_rx_resources(adapter, &adapter->rx_ring[i]);
1668 if (err) { 1662 if (err) {
1669 DPRINTK(PROBE, ERR, 1663 e_err("Allocation for Rx Queue %u failed\n", i);
1670 "Allocation for Rx Queue %u failed\n", i);
1671 for (i-- ; i >= 0; i--) 1664 for (i-- ; i >= 0; i--)
1672 e1000_free_rx_resources(adapter, 1665 e1000_free_rx_resources(adapter,
1673 &adapter->rx_ring[i]); 1666 &adapter->rx_ring[i]);
@@ -2118,7 +2111,7 @@ static void e1000_set_rx_mode(struct net_device *netdev)
2118 u32 *mcarray = kcalloc(mta_reg_count, sizeof(u32), GFP_ATOMIC); 2111 u32 *mcarray = kcalloc(mta_reg_count, sizeof(u32), GFP_ATOMIC);
2119 2112
2120 if (!mcarray) { 2113 if (!mcarray) {
2121 DPRINTK(PROBE, ERR, "memory allocation failed\n"); 2114 e_err("memory allocation failed\n");
2122 return; 2115 return;
2123 } 2116 }
2124 2117
@@ -2314,16 +2307,16 @@ static void e1000_watchdog(unsigned long data)
2314 &adapter->link_duplex); 2307 &adapter->link_duplex);
2315 2308
2316 ctrl = er32(CTRL); 2309 ctrl = er32(CTRL);
2317 printk(KERN_INFO "e1000: %s NIC Link is Up %d Mbps %s, " 2310 pr_info("%s NIC Link is Up %d Mbps %s, "
2318 "Flow Control: %s\n", 2311 "Flow Control: %s\n",
2319 netdev->name, 2312 netdev->name,
2320 adapter->link_speed, 2313 adapter->link_speed,
2321 adapter->link_duplex == FULL_DUPLEX ? 2314 adapter->link_duplex == FULL_DUPLEX ?
2322 "Full Duplex" : "Half Duplex", 2315 "Full Duplex" : "Half Duplex",
2323 ((ctrl & E1000_CTRL_TFCE) && (ctrl & 2316 ((ctrl & E1000_CTRL_TFCE) && (ctrl &
2324 E1000_CTRL_RFCE)) ? "RX/TX" : ((ctrl & 2317 E1000_CTRL_RFCE)) ? "RX/TX" : ((ctrl &
2325 E1000_CTRL_RFCE) ? "RX" : ((ctrl & 2318 E1000_CTRL_RFCE) ? "RX" : ((ctrl &
2326 E1000_CTRL_TFCE) ? "TX" : "None" ))); 2319 E1000_CTRL_TFCE) ? "TX" : "None")));
2327 2320
2328 /* adjust timeout factor according to speed/duplex */ 2321 /* adjust timeout factor according to speed/duplex */
2329 adapter->tx_timeout_factor = 1; 2322 adapter->tx_timeout_factor = 1;
@@ -2353,8 +2346,8 @@ static void e1000_watchdog(unsigned long data)
2353 if (netif_carrier_ok(netdev)) { 2346 if (netif_carrier_ok(netdev)) {
2354 adapter->link_speed = 0; 2347 adapter->link_speed = 0;
2355 adapter->link_duplex = 0; 2348 adapter->link_duplex = 0;
2356 printk(KERN_INFO "e1000: %s NIC Link is Down\n", 2349 pr_info("%s NIC Link is Down\n",
2357 netdev->name); 2350 netdev->name);
2358 netif_carrier_off(netdev); 2351 netif_carrier_off(netdev);
2359 2352
2360 if (!test_bit(__E1000_DOWN, &adapter->flags)) 2353 if (!test_bit(__E1000_DOWN, &adapter->flags))
@@ -2644,8 +2637,7 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter,
2644 break; 2637 break;
2645 default: 2638 default:
2646 if (unlikely(net_ratelimit())) 2639 if (unlikely(net_ratelimit()))
2647 DPRINTK(DRV, WARNING, 2640 e_warn("checksum_partial proto=%x!\n", skb->protocol);
2648 "checksum_partial proto=%x!\n", skb->protocol);
2649 break; 2641 break;
2650 } 2642 }
2651 2643
@@ -2989,8 +2981,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
2989 /* fall through */ 2981 /* fall through */
2990 pull_size = min((unsigned int)4, skb->data_len); 2982 pull_size = min((unsigned int)4, skb->data_len);
2991 if (!__pskb_pull_tail(skb, pull_size)) { 2983 if (!__pskb_pull_tail(skb, pull_size)) {
2992 DPRINTK(DRV, ERR, 2984 e_err("__pskb_pull_tail failed.\n");
2993 "__pskb_pull_tail failed.\n");
2994 dev_kfree_skb_any(skb); 2985 dev_kfree_skb_any(skb);
2995 return NETDEV_TX_OK; 2986 return NETDEV_TX_OK;
2996 } 2987 }
@@ -3138,7 +3129,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
3138 3129
3139 if ((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) || 3130 if ((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) ||
3140 (max_frame > MAX_JUMBO_FRAME_SIZE)) { 3131 (max_frame > MAX_JUMBO_FRAME_SIZE)) {
3141 DPRINTK(PROBE, ERR, "Invalid MTU setting\n"); 3132 e_err("Invalid MTU setting\n");
3142 return -EINVAL; 3133 return -EINVAL;
3143 } 3134 }
3144 3135
@@ -3146,7 +3137,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
3146 switch (hw->mac_type) { 3137 switch (hw->mac_type) {
3147 case e1000_undefined ... e1000_82542_rev2_1: 3138 case e1000_undefined ... e1000_82542_rev2_1:
3148 if (max_frame > (ETH_FRAME_LEN + ETH_FCS_LEN)) { 3139 if (max_frame > (ETH_FRAME_LEN + ETH_FCS_LEN)) {
3149 DPRINTK(PROBE, ERR, "Jumbo Frames not supported.\n"); 3140 e_err("Jumbo Frames not supported.\n");
3150 return -EINVAL; 3141 return -EINVAL;
3151 } 3142 }
3152 break; 3143 break;
@@ -3184,8 +3175,8 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
3184 (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE))) 3175 (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE)))
3185 adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE; 3176 adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
3186 3177
3187 printk(KERN_INFO "e1000: %s changing MTU from %d to %d\n", 3178 pr_info("%s changing MTU from %d to %d\n",
3188 netdev->name, netdev->mtu, new_mtu); 3179 netdev->name, netdev->mtu, new_mtu);
3189 netdev->mtu = new_mtu; 3180 netdev->mtu = new_mtu;
3190 3181
3191 if (netif_running(netdev)) 3182 if (netif_running(netdev))
@@ -3498,17 +3489,17 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
3498 !(er32(STATUS) & E1000_STATUS_TXOFF)) { 3489 !(er32(STATUS) & E1000_STATUS_TXOFF)) {
3499 3490
3500 /* detected Tx unit hang */ 3491 /* detected Tx unit hang */
3501 DPRINTK(DRV, ERR, "Detected Tx Unit Hang\n" 3492 e_err("Detected Tx Unit Hang\n"
3502 " Tx Queue <%lu>\n" 3493 " Tx Queue <%lu>\n"
3503 " TDH <%x>\n" 3494 " TDH <%x>\n"
3504 " TDT <%x>\n" 3495 " TDT <%x>\n"
3505 " next_to_use <%x>\n" 3496 " next_to_use <%x>\n"
3506 " next_to_clean <%x>\n" 3497 " next_to_clean <%x>\n"
3507 "buffer_info[next_to_clean]\n" 3498 "buffer_info[next_to_clean]\n"
3508 " time_stamp <%lx>\n" 3499 " time_stamp <%lx>\n"
3509 " next_to_watch <%x>\n" 3500 " next_to_watch <%x>\n"
3510 " jiffies <%lx>\n" 3501 " jiffies <%lx>\n"
3511 " next_to_watch.status <%x>\n", 3502 " next_to_watch.status <%x>\n",
3512 (unsigned long)((tx_ring - adapter->tx_ring) / 3503 (unsigned long)((tx_ring - adapter->tx_ring) /
3513 sizeof(struct e1000_tx_ring)), 3504 sizeof(struct e1000_tx_ring)),
3514 readl(hw->hw_addr + tx_ring->tdh), 3505 readl(hw->hw_addr + tx_ring->tdh),
@@ -3747,7 +3738,7 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
3747 3738
3748 /* eth type trans needs skb->data to point to something */ 3739 /* eth type trans needs skb->data to point to something */
3749 if (!pskb_may_pull(skb, ETH_HLEN)) { 3740 if (!pskb_may_pull(skb, ETH_HLEN)) {
3750 DPRINTK(DRV, ERR, "pskb_may_pull failed.\n"); 3741 e_err("pskb_may_pull failed.\n");
3751 dev_kfree_skb(skb); 3742 dev_kfree_skb(skb);
3752 goto next_desc; 3743 goto next_desc;
3753 } 3744 }
@@ -3847,8 +3838,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
3847 3838
3848 if (adapter->discarding) { 3839 if (adapter->discarding) {
3849 /* All receives must fit into a single buffer */ 3840 /* All receives must fit into a single buffer */
3850 E1000_DBG("%s: Receive packet consumed multiple" 3841 e_info("Receive packet consumed multiple buffers\n");
3851 " buffers\n", netdev->name);
3852 /* recycle */ 3842 /* recycle */
3853 buffer_info->skb = skb; 3843 buffer_info->skb = skb;
3854 if (status & E1000_RXD_STAT_EOP) 3844 if (status & E1000_RXD_STAT_EOP)
@@ -3978,8 +3968,8 @@ e1000_alloc_jumbo_rx_buffers(struct e1000_adapter *adapter,
3978 /* Fix for errata 23, can't cross 64kB boundary */ 3968 /* Fix for errata 23, can't cross 64kB boundary */
3979 if (!e1000_check_64k_bound(adapter, skb->data, bufsz)) { 3969 if (!e1000_check_64k_bound(adapter, skb->data, bufsz)) {
3980 struct sk_buff *oldskb = skb; 3970 struct sk_buff *oldskb = skb;
3981 DPRINTK(PROBE, ERR, "skb align check failed: %u bytes " 3971 e_err("skb align check failed: %u bytes at %p\n",
3982 "at %p\n", bufsz, skb->data); 3972 bufsz, skb->data);
3983 /* Try again, without freeing the previous */ 3973 /* Try again, without freeing the previous */
3984 skb = netdev_alloc_skb_ip_align(netdev, bufsz); 3974 skb = netdev_alloc_skb_ip_align(netdev, bufsz);
3985 /* Failed allocation, critical failure */ 3975 /* Failed allocation, critical failure */
@@ -4087,8 +4077,8 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
4087 /* Fix for errata 23, can't cross 64kB boundary */ 4077 /* Fix for errata 23, can't cross 64kB boundary */
4088 if (!e1000_check_64k_bound(adapter, skb->data, bufsz)) { 4078 if (!e1000_check_64k_bound(adapter, skb->data, bufsz)) {
4089 struct sk_buff *oldskb = skb; 4079 struct sk_buff *oldskb = skb;
4090 DPRINTK(RX_ERR, ERR, "skb align check failed: %u bytes " 4080 e_err("skb align check failed: %u bytes at %p\n",
4091 "at %p\n", bufsz, skb->data); 4081 bufsz, skb->data);
4092 /* Try again, without freeing the previous */ 4082 /* Try again, without freeing the previous */
4093 skb = netdev_alloc_skb_ip_align(netdev, bufsz); 4083 skb = netdev_alloc_skb_ip_align(netdev, bufsz);
4094 /* Failed allocation, critical failure */ 4084 /* Failed allocation, critical failure */
@@ -4133,10 +4123,9 @@ map_skb:
4133 if (!e1000_check_64k_bound(adapter, 4123 if (!e1000_check_64k_bound(adapter,
4134 (void *)(unsigned long)buffer_info->dma, 4124 (void *)(unsigned long)buffer_info->dma,
4135 adapter->rx_buffer_len)) { 4125 adapter->rx_buffer_len)) {
4136 DPRINTK(RX_ERR, ERR, 4126 e_err("dma align check failed: %u bytes at %p\n",
4137 "dma align check failed: %u bytes at %p\n", 4127 adapter->rx_buffer_len,
4138 adapter->rx_buffer_len, 4128 (void *)(unsigned long)buffer_info->dma);
4139 (void *)(unsigned long)buffer_info->dma);
4140 dev_kfree_skb(skb); 4129 dev_kfree_skb(skb);
4141 buffer_info->skb = NULL; 4130 buffer_info->skb = NULL;
4142 4131
@@ -4348,7 +4337,7 @@ void e1000_pci_set_mwi(struct e1000_hw *hw)
4348 int ret_val = pci_set_mwi(adapter->pdev); 4337 int ret_val = pci_set_mwi(adapter->pdev);
4349 4338
4350 if (ret_val) 4339 if (ret_val)
4351 DPRINTK(PROBE, ERR, "Error in setting MWI\n"); 4340 e_err("Error in setting MWI\n");
4352} 4341}
4353 4342
4354void e1000_pci_clear_mwi(struct e1000_hw *hw) 4343void e1000_pci_clear_mwi(struct e1000_hw *hw)
@@ -4479,7 +4468,7 @@ int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
4479 /* Fiber NICs only allow 1000 gbps Full duplex */ 4468 /* Fiber NICs only allow 1000 gbps Full duplex */
4480 if ((hw->media_type == e1000_media_type_fiber) && 4469 if ((hw->media_type == e1000_media_type_fiber) &&
4481 spddplx != (SPEED_1000 + DUPLEX_FULL)) { 4470 spddplx != (SPEED_1000 + DUPLEX_FULL)) {
4482 DPRINTK(PROBE, ERR, "Unsupported Speed/Duplex configuration\n"); 4471 e_err("Unsupported Speed/Duplex configuration\n");
4483 return -EINVAL; 4472 return -EINVAL;
4484 } 4473 }
4485 4474
@@ -4502,7 +4491,7 @@ int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
4502 break; 4491 break;
4503 case SPEED_1000 + DUPLEX_HALF: /* not supported */ 4492 case SPEED_1000 + DUPLEX_HALF: /* not supported */
4504 default: 4493 default:
4505 DPRINTK(PROBE, ERR, "Unsupported Speed/Duplex configuration\n"); 4494 e_err("Unsupported Speed/Duplex configuration\n");
4506 return -EINVAL; 4495 return -EINVAL;
4507 } 4496 }
4508 return 0; 4497 return 0;
@@ -4625,7 +4614,7 @@ static int e1000_resume(struct pci_dev *pdev)
4625 else 4614 else
4626 err = pci_enable_device_mem(pdev); 4615 err = pci_enable_device_mem(pdev);
4627 if (err) { 4616 if (err) {
4628 printk(KERN_ERR "e1000: Cannot enable PCI device from suspend\n"); 4617 pr_err("Cannot enable PCI device from suspend\n");
4629 return err; 4618 return err;
4630 } 4619 }
4631 pci_set_master(pdev); 4620 pci_set_master(pdev);
@@ -4728,7 +4717,7 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
4728 else 4717 else
4729 err = pci_enable_device_mem(pdev); 4718 err = pci_enable_device_mem(pdev);
4730 if (err) { 4719 if (err) {
4731 printk(KERN_ERR "e1000: Cannot re-enable PCI device after reset.\n"); 4720 pr_err("Cannot re-enable PCI device after reset.\n");
4732 return PCI_ERS_RESULT_DISCONNECT; 4721 return PCI_ERS_RESULT_DISCONNECT;
4733 } 4722 }
4734 pci_set_master(pdev); 4723 pci_set_master(pdev);
@@ -4759,7 +4748,7 @@ static void e1000_io_resume(struct pci_dev *pdev)
4759 4748
4760 if (netif_running(netdev)) { 4749 if (netif_running(netdev)) {
4761 if (e1000_up(adapter)) { 4750 if (e1000_up(adapter)) {
4762 printk("e1000: can't bring device back up after reset\n"); 4751 pr_info("can't bring device back up after reset\n");
4763 return; 4752 return;
4764 } 4753 }
4765 } 4754 }