diff options
author | Joe Perches <joe@perches.com> | 2010-02-15 03:34:20 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-16 18:45:42 -0500 |
commit | 6909c66dfbbab99dbbd9931627c9f6e8c45bfbdb (patch) | |
tree | b4926f52d4fd8f55da86cd7aff70102c49d30cbd /drivers | |
parent | 177867ce08f2756fa361e37086fc1792d7b4cf29 (diff) |
drivers/net/ixgb: Use netif_printk macros
Convert private DPRINTK macro uses to netif_<level> equivalents
Remove #define DPRINTK
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ixgb/ixgb.h | 11 | ||||
-rw-r--r-- | drivers/net/ixgb/ixgb_main.c | 89 |
2 files changed, 51 insertions, 49 deletions
diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h index 5257ae08b9f9..92d2e71d0c8b 100644 --- a/drivers/net/ixgb/ixgb.h +++ b/drivers/net/ixgb/ixgb.h | |||
@@ -75,19 +75,14 @@ struct ixgb_adapter; | |||
75 | #include "ixgb_ee.h" | 75 | #include "ixgb_ee.h" |
76 | #include "ixgb_ids.h" | 76 | #include "ixgb_ids.h" |
77 | 77 | ||
78 | #define PFX "ixgb: " | ||
79 | |||
78 | #ifdef _DEBUG_DRIVER_ | 80 | #ifdef _DEBUG_DRIVER_ |
79 | #define IXGB_DBG(args...) printk(KERN_DEBUG "ixgb: " args) | 81 | #define IXGB_DBG(args...) printk(KERN_DEBUG PFX args) |
80 | #else | 82 | #else |
81 | #define IXGB_DBG(args...) | 83 | #define IXGB_DBG(args...) |
82 | #endif | 84 | #endif |
83 | 85 | ||
84 | #define PFX "ixgb: " | ||
85 | #define DPRINTK(nlevel, klevel, fmt, args...) \ | ||
86 | (void)((NETIF_MSG_##nlevel & adapter->msg_enable) && \ | ||
87 | printk(KERN_##klevel PFX "%s: %s: " fmt, adapter->netdev->name, \ | ||
88 | __func__ , ## args)) | ||
89 | |||
90 | |||
91 | /* TX/RX descriptor defines */ | 86 | /* TX/RX descriptor defines */ |
92 | #define DEFAULT_TXD 256 | 87 | #define DEFAULT_TXD 256 |
93 | #define MAX_TXD 4096 | 88 | #define MAX_TXD 4096 |
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index 6a7b2ccef72c..93d018505ebb 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -238,8 +238,8 @@ ixgb_up(struct ixgb_adapter *adapter) | |||
238 | if (err) { | 238 | if (err) { |
239 | if (adapter->have_msi) | 239 | if (adapter->have_msi) |
240 | pci_disable_msi(adapter->pdev); | 240 | pci_disable_msi(adapter->pdev); |
241 | DPRINTK(PROBE, ERR, | 241 | netif_err(adapter, probe, adapter->netdev, |
242 | "Unable to allocate interrupt Error: %d\n", err); | 242 | "Unable to allocate interrupt Error: %d\n", err); |
243 | return err; | 243 | return err; |
244 | } | 244 | } |
245 | 245 | ||
@@ -310,7 +310,7 @@ ixgb_reset(struct ixgb_adapter *adapter) | |||
310 | 310 | ||
311 | ixgb_adapter_stop(hw); | 311 | ixgb_adapter_stop(hw); |
312 | if (!ixgb_init_hw(hw)) | 312 | if (!ixgb_init_hw(hw)) |
313 | DPRINTK(PROBE, ERR, "ixgb_init_hw failed.\n"); | 313 | netif_err(adapter, probe, adapter->netdev, "ixgb_init_hw failed\n"); |
314 | 314 | ||
315 | /* restore frame size information */ | 315 | /* restore frame size information */ |
316 | IXGB_WRITE_REG(hw, MFS, hw->max_frame_size << IXGB_MFS_SHIFT); | 316 | IXGB_WRITE_REG(hw, MFS, hw->max_frame_size << IXGB_MFS_SHIFT); |
@@ -447,7 +447,8 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
447 | /* make sure the EEPROM is good */ | 447 | /* make sure the EEPROM is good */ |
448 | 448 | ||
449 | if (!ixgb_validate_eeprom_checksum(&adapter->hw)) { | 449 | if (!ixgb_validate_eeprom_checksum(&adapter->hw)) { |
450 | DPRINTK(PROBE, ERR, "The EEPROM Checksum Is Not Valid\n"); | 450 | netif_err(adapter, probe, adapter->netdev, |
451 | "The EEPROM Checksum Is Not Valid\n"); | ||
451 | err = -EIO; | 452 | err = -EIO; |
452 | goto err_eeprom; | 453 | goto err_eeprom; |
453 | } | 454 | } |
@@ -456,7 +457,7 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
456 | memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len); | 457 | memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len); |
457 | 458 | ||
458 | if (!is_valid_ether_addr(netdev->perm_addr)) { | 459 | if (!is_valid_ether_addr(netdev->perm_addr)) { |
459 | DPRINTK(PROBE, ERR, "Invalid MAC Address\n"); | 460 | netif_err(adapter, probe, adapter->netdev, "Invalid MAC Address\n"); |
460 | err = -EIO; | 461 | err = -EIO; |
461 | goto err_eeprom; | 462 | goto err_eeprom; |
462 | } | 463 | } |
@@ -477,7 +478,8 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
477 | /* carrier off reporting is important to ethtool even BEFORE open */ | 478 | /* carrier off reporting is important to ethtool even BEFORE open */ |
478 | netif_carrier_off(netdev); | 479 | netif_carrier_off(netdev); |
479 | 480 | ||
480 | DPRINTK(PROBE, INFO, "Intel(R) PRO/10GbE Network Connection\n"); | 481 | netif_info(adapter, probe, adapter->netdev, |
482 | "Intel(R) PRO/10GbE Network Connection\n"); | ||
481 | ixgb_check_options(adapter); | 483 | ixgb_check_options(adapter); |
482 | /* reset the hardware with the new settings */ | 484 | /* reset the hardware with the new settings */ |
483 | 485 | ||
@@ -552,14 +554,14 @@ ixgb_sw_init(struct ixgb_adapter *adapter) | |||
552 | hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; | 554 | hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; |
553 | adapter->rx_buffer_len = hw->max_frame_size + 8; /* + 8 for errata */ | 555 | adapter->rx_buffer_len = hw->max_frame_size + 8; /* + 8 for errata */ |
554 | 556 | ||
555 | if ((hw->device_id == IXGB_DEVICE_ID_82597EX) | 557 | if ((hw->device_id == IXGB_DEVICE_ID_82597EX) || |
556 | || (hw->device_id == IXGB_DEVICE_ID_82597EX_CX4) | 558 | (hw->device_id == IXGB_DEVICE_ID_82597EX_CX4) || |
557 | || (hw->device_id == IXGB_DEVICE_ID_82597EX_LR) | 559 | (hw->device_id == IXGB_DEVICE_ID_82597EX_LR) || |
558 | || (hw->device_id == IXGB_DEVICE_ID_82597EX_SR)) | 560 | (hw->device_id == IXGB_DEVICE_ID_82597EX_SR)) |
559 | hw->mac_type = ixgb_82597; | 561 | hw->mac_type = ixgb_82597; |
560 | else { | 562 | else { |
561 | /* should never have loaded on this device */ | 563 | /* should never have loaded on this device */ |
562 | DPRINTK(PROBE, ERR, "unsupported device id\n"); | 564 | netif_err(adapter, probe, adapter->netdev, "unsupported device id\n"); |
563 | } | 565 | } |
564 | 566 | ||
565 | /* enable flow control to be programmed */ | 567 | /* enable flow control to be programmed */ |
@@ -661,8 +663,8 @@ ixgb_setup_tx_resources(struct ixgb_adapter *adapter) | |||
661 | size = sizeof(struct ixgb_buffer) * txdr->count; | 663 | size = sizeof(struct ixgb_buffer) * txdr->count; |
662 | txdr->buffer_info = vmalloc(size); | 664 | txdr->buffer_info = vmalloc(size); |
663 | if (!txdr->buffer_info) { | 665 | if (!txdr->buffer_info) { |
664 | DPRINTK(PROBE, ERR, | 666 | netif_err(adapter, probe, adapter->netdev, |
665 | "Unable to allocate transmit descriptor ring memory\n"); | 667 | "Unable to allocate transmit descriptor ring memory\n"); |
666 | return -ENOMEM; | 668 | return -ENOMEM; |
667 | } | 669 | } |
668 | memset(txdr->buffer_info, 0, size); | 670 | memset(txdr->buffer_info, 0, size); |
@@ -675,8 +677,8 @@ ixgb_setup_tx_resources(struct ixgb_adapter *adapter) | |||
675 | txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma); | 677 | txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma); |
676 | if (!txdr->desc) { | 678 | if (!txdr->desc) { |
677 | vfree(txdr->buffer_info); | 679 | vfree(txdr->buffer_info); |
678 | DPRINTK(PROBE, ERR, | 680 | netif_err(adapter, probe, adapter->netdev, |
679 | "Unable to allocate transmit descriptor memory\n"); | 681 | "Unable to allocate transmit descriptor memory\n"); |
680 | return -ENOMEM; | 682 | return -ENOMEM; |
681 | } | 683 | } |
682 | memset(txdr->desc, 0, txdr->size); | 684 | memset(txdr->desc, 0, txdr->size); |
@@ -750,8 +752,8 @@ ixgb_setup_rx_resources(struct ixgb_adapter *adapter) | |||
750 | size = sizeof(struct ixgb_buffer) * rxdr->count; | 752 | size = sizeof(struct ixgb_buffer) * rxdr->count; |
751 | rxdr->buffer_info = vmalloc(size); | 753 | rxdr->buffer_info = vmalloc(size); |
752 | if (!rxdr->buffer_info) { | 754 | if (!rxdr->buffer_info) { |
753 | DPRINTK(PROBE, ERR, | 755 | netif_err(adapter, probe, adapter->netdev, |
754 | "Unable to allocate receive descriptor ring\n"); | 756 | "Unable to allocate receive descriptor ring\n"); |
755 | return -ENOMEM; | 757 | return -ENOMEM; |
756 | } | 758 | } |
757 | memset(rxdr->buffer_info, 0, size); | 759 | memset(rxdr->buffer_info, 0, size); |
@@ -765,8 +767,8 @@ ixgb_setup_rx_resources(struct ixgb_adapter *adapter) | |||
765 | 767 | ||
766 | if (!rxdr->desc) { | 768 | if (!rxdr->desc) { |
767 | vfree(rxdr->buffer_info); | 769 | vfree(rxdr->buffer_info); |
768 | DPRINTK(PROBE, ERR, | 770 | netif_err(adapter, probe, adapter->netdev, |
769 | "Unable to allocate receive descriptors\n"); | 771 | "Unable to allocate receive descriptors\n"); |
770 | return -ENOMEM; | 772 | return -ENOMEM; |
771 | } | 773 | } |
772 | memset(rxdr->desc, 0, rxdr->size); | 774 | memset(rxdr->desc, 0, rxdr->size); |
@@ -1580,7 +1582,8 @@ ixgb_change_mtu(struct net_device *netdev, int new_mtu) | |||
1580 | /* MTU < 68 is an error for IPv4 traffic, just don't allow it */ | 1582 | /* MTU < 68 is an error for IPv4 traffic, just don't allow it */ |
1581 | if ((new_mtu < 68) || | 1583 | if ((new_mtu < 68) || |
1582 | (max_frame > IXGB_MAX_JUMBO_FRAME_SIZE + ENET_FCS_LENGTH)) { | 1584 | (max_frame > IXGB_MAX_JUMBO_FRAME_SIZE + ENET_FCS_LENGTH)) { |
1583 | DPRINTK(PROBE, ERR, "Invalid MTU setting %d\n", new_mtu); | 1585 | netif_err(adapter, probe, adapter->netdev, |
1586 | "Invalid MTU setting %d\n", new_mtu); | ||
1584 | return -EINVAL; | 1587 | return -EINVAL; |
1585 | } | 1588 | } |
1586 | 1589 | ||
@@ -1854,24 +1857,25 @@ ixgb_clean_tx_irq(struct ixgb_adapter *adapter) | |||
1854 | && !(IXGB_READ_REG(&adapter->hw, STATUS) & | 1857 | && !(IXGB_READ_REG(&adapter->hw, STATUS) & |
1855 | IXGB_STATUS_TXOFF)) { | 1858 | IXGB_STATUS_TXOFF)) { |
1856 | /* detected Tx unit hang */ | 1859 | /* detected Tx unit hang */ |
1857 | DPRINTK(DRV, ERR, "Detected Tx Unit Hang\n" | 1860 | netif_err(adapter, drv, adapter->netdev, |
1858 | " TDH <%x>\n" | 1861 | "Detected Tx Unit Hang\n" |
1859 | " TDT <%x>\n" | 1862 | " TDH <%x>\n" |
1860 | " next_to_use <%x>\n" | 1863 | " TDT <%x>\n" |
1861 | " next_to_clean <%x>\n" | 1864 | " next_to_use <%x>\n" |
1862 | "buffer_info[next_to_clean]\n" | 1865 | " next_to_clean <%x>\n" |
1863 | " time_stamp <%lx>\n" | 1866 | "buffer_info[next_to_clean]\n" |
1864 | " next_to_watch <%x>\n" | 1867 | " time_stamp <%lx>\n" |
1865 | " jiffies <%lx>\n" | 1868 | " next_to_watch <%x>\n" |
1866 | " next_to_watch.status <%x>\n", | 1869 | " jiffies <%lx>\n" |
1867 | IXGB_READ_REG(&adapter->hw, TDH), | 1870 | " next_to_watch.status <%x>\n", |
1868 | IXGB_READ_REG(&adapter->hw, TDT), | 1871 | IXGB_READ_REG(&adapter->hw, TDH), |
1869 | tx_ring->next_to_use, | 1872 | IXGB_READ_REG(&adapter->hw, TDT), |
1870 | tx_ring->next_to_clean, | 1873 | tx_ring->next_to_use, |
1871 | tx_ring->buffer_info[eop].time_stamp, | 1874 | tx_ring->next_to_clean, |
1872 | eop, | 1875 | tx_ring->buffer_info[eop].time_stamp, |
1873 | jiffies, | 1876 | eop, |
1874 | eop_desc->status); | 1877 | jiffies, |
1878 | eop_desc->status); | ||
1875 | netif_stop_queue(netdev); | 1879 | netif_stop_queue(netdev); |
1876 | } | 1880 | } |
1877 | } | 1881 | } |
@@ -2269,7 +2273,8 @@ static pci_ers_result_t ixgb_io_slot_reset(struct pci_dev *pdev) | |||
2269 | struct ixgb_adapter *adapter = netdev_priv(netdev); | 2273 | struct ixgb_adapter *adapter = netdev_priv(netdev); |
2270 | 2274 | ||
2271 | if (pci_enable_device(pdev)) { | 2275 | if (pci_enable_device(pdev)) { |
2272 | DPRINTK(PROBE, ERR, "Cannot re-enable PCI device after reset.\n"); | 2276 | netif_err(adapter, probe, adapter->netdev, |
2277 | "Cannot re-enable PCI device after reset\n"); | ||
2273 | return PCI_ERS_RESULT_DISCONNECT; | 2278 | return PCI_ERS_RESULT_DISCONNECT; |
2274 | } | 2279 | } |
2275 | 2280 | ||
@@ -2285,14 +2290,16 @@ static pci_ers_result_t ixgb_io_slot_reset(struct pci_dev *pdev) | |||
2285 | 2290 | ||
2286 | /* Make sure the EEPROM is good */ | 2291 | /* Make sure the EEPROM is good */ |
2287 | if (!ixgb_validate_eeprom_checksum(&adapter->hw)) { | 2292 | if (!ixgb_validate_eeprom_checksum(&adapter->hw)) { |
2288 | DPRINTK(PROBE, ERR, "After reset, the EEPROM checksum is not valid.\n"); | 2293 | netif_err(adapter, probe, adapter->netdev, |
2294 | "After reset, the EEPROM checksum is not valid\n"); | ||
2289 | return PCI_ERS_RESULT_DISCONNECT; | 2295 | return PCI_ERS_RESULT_DISCONNECT; |
2290 | } | 2296 | } |
2291 | ixgb_get_ee_mac_addr(&adapter->hw, netdev->dev_addr); | 2297 | ixgb_get_ee_mac_addr(&adapter->hw, netdev->dev_addr); |
2292 | memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len); | 2298 | memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len); |
2293 | 2299 | ||
2294 | if (!is_valid_ether_addr(netdev->perm_addr)) { | 2300 | if (!is_valid_ether_addr(netdev->perm_addr)) { |
2295 | DPRINTK(PROBE, ERR, "After reset, invalid MAC address.\n"); | 2301 | netif_err(adapter, probe, adapter->netdev, |
2302 | "After reset, invalid MAC address\n"); | ||
2296 | return PCI_ERS_RESULT_DISCONNECT; | 2303 | return PCI_ERS_RESULT_DISCONNECT; |
2297 | } | 2304 | } |
2298 | 2305 | ||