diff options
author | Jay Cliburn <jacliburn@bellsouth.net> | 2007-04-29 22:42:10 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-05-08 01:20:15 -0400 |
commit | 1e0063645ef1e89c63778fbb0417e79b7dc65b5f (patch) | |
tree | d0804c056ea4e711d8ebe75cb09473096aca8ce2 /drivers/net | |
parent | 88ca2d070c3a169611ec38f00e945a036564ca26 (diff) |
atl1: use dev_printk macros
Use dev_printk macros for PCI related errors, warnings, debug and info
console messages.
Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/atl1/atl1_ethtool.c | 19 | ||||
-rw-r--r-- | drivers/net/atl1/atl1_hw.c | 22 | ||||
-rw-r--r-- | drivers/net/atl1/atl1_main.c | 83 | ||||
-rw-r--r-- | drivers/net/atl1/atl1_param.c | 31 |
4 files changed, 68 insertions, 87 deletions
diff --git a/drivers/net/atl1/atl1_ethtool.c b/drivers/net/atl1/atl1_ethtool.c index c11c27798e5c..1f616c5c1473 100644 --- a/drivers/net/atl1/atl1_ethtool.c +++ b/drivers/net/atl1/atl1_ethtool.c | |||
@@ -156,8 +156,7 @@ static int atl1_set_settings(struct net_device *netdev, | |||
156 | u16 old_media_type = hw->media_type; | 156 | u16 old_media_type = hw->media_type; |
157 | 157 | ||
158 | if (netif_running(adapter->netdev)) { | 158 | if (netif_running(adapter->netdev)) { |
159 | printk(KERN_DEBUG "%s: ethtool shutting down adapter\n", | 159 | dev_dbg(&adapter->pdev->dev, "ethtool shutting down adapter\n"); |
160 | atl1_driver_name); | ||
161 | atl1_down(adapter); | 160 | atl1_down(adapter); |
162 | } | 161 | } |
163 | 162 | ||
@@ -166,9 +165,8 @@ static int atl1_set_settings(struct net_device *netdev, | |||
166 | else { | 165 | else { |
167 | if (ecmd->speed == SPEED_1000) { | 166 | if (ecmd->speed == SPEED_1000) { |
168 | if (ecmd->duplex != DUPLEX_FULL) { | 167 | if (ecmd->duplex != DUPLEX_FULL) { |
169 | printk(KERN_WARNING | 168 | dev_warn(&adapter->pdev->dev, |
170 | "%s: can't force to 1000M half duplex\n", | 169 | "can't force to 1000M half duplex\n"); |
171 | atl1_driver_name); | ||
172 | ret_val = -EINVAL; | 170 | ret_val = -EINVAL; |
173 | goto exit_sset; | 171 | goto exit_sset; |
174 | } | 172 | } |
@@ -206,9 +204,8 @@ static int atl1_set_settings(struct net_device *netdev, | |||
206 | } | 204 | } |
207 | if (atl1_phy_setup_autoneg_adv(hw)) { | 205 | if (atl1_phy_setup_autoneg_adv(hw)) { |
208 | ret_val = -EINVAL; | 206 | ret_val = -EINVAL; |
209 | printk(KERN_WARNING | 207 | dev_warn(&adapter->pdev->dev, |
210 | "%s: invalid ethtool speed/duplex setting\n", | 208 | "invalid ethtool speed/duplex setting\n"); |
211 | atl1_driver_name); | ||
212 | goto exit_sset; | 209 | goto exit_sset; |
213 | } | 210 | } |
214 | if (hw->media_type == MEDIA_TYPE_AUTO_SENSOR || | 211 | if (hw->media_type == MEDIA_TYPE_AUTO_SENSOR || |
@@ -239,12 +236,10 @@ exit_sset: | |||
239 | hw->media_type = old_media_type; | 236 | hw->media_type = old_media_type; |
240 | 237 | ||
241 | if (netif_running(adapter->netdev)) { | 238 | if (netif_running(adapter->netdev)) { |
242 | printk(KERN_DEBUG "%s: ethtool starting adapter\n", | 239 | dev_dbg(&adapter->pdev->dev, "ethtool starting adapter\n"); |
243 | atl1_driver_name); | ||
244 | atl1_up(adapter); | 240 | atl1_up(adapter); |
245 | } else if (!ret_val) { | 241 | } else if (!ret_val) { |
246 | printk(KERN_DEBUG "%s: ethtool resetting adapter\n", | 242 | dev_dbg(&adapter->pdev->dev, "ethtool resetting adapter\n"); |
247 | atl1_driver_name); | ||
248 | atl1_reset(adapter); | 243 | atl1_reset(adapter); |
249 | } | 244 | } |
250 | return ret_val; | 245 | return ret_val; |
diff --git a/drivers/net/atl1/atl1_hw.c b/drivers/net/atl1/atl1_hw.c index 69482e0d849b..5b9dd3c1e84b 100644 --- a/drivers/net/atl1/atl1_hw.c +++ b/drivers/net/atl1/atl1_hw.c | |||
@@ -38,6 +38,7 @@ | |||
38 | */ | 38 | */ |
39 | s32 atl1_reset_hw(struct atl1_hw *hw) | 39 | s32 atl1_reset_hw(struct atl1_hw *hw) |
40 | { | 40 | { |
41 | struct pci_dev *pdev = hw->back->pdev; | ||
41 | u32 icr; | 42 | u32 icr; |
42 | int i; | 43 | int i; |
43 | 44 | ||
@@ -74,7 +75,7 @@ s32 atl1_reset_hw(struct atl1_hw *hw) | |||
74 | } | 75 | } |
75 | 76 | ||
76 | if (icr) { | 77 | if (icr) { |
77 | printk (KERN_DEBUG "icr = %x\n", icr); | 78 | dev_dbg(&pdev->dev, "ICR = 0x%x\n", icr); |
78 | return icr; | 79 | return icr; |
79 | } | 80 | } |
80 | 81 | ||
@@ -437,6 +438,7 @@ s32 atl1_phy_enter_power_saving(struct atl1_hw *hw) | |||
437 | */ | 438 | */ |
438 | static s32 atl1_phy_reset(struct atl1_hw *hw) | 439 | static s32 atl1_phy_reset(struct atl1_hw *hw) |
439 | { | 440 | { |
441 | struct pci_dev *pdev = hw->back->pdev; | ||
440 | s32 ret_val; | 442 | s32 ret_val; |
441 | u16 phy_data; | 443 | u16 phy_data; |
442 | 444 | ||
@@ -468,8 +470,7 @@ static s32 atl1_phy_reset(struct atl1_hw *hw) | |||
468 | u32 val; | 470 | u32 val; |
469 | int i; | 471 | int i; |
470 | /* pcie serdes link may be down! */ | 472 | /* pcie serdes link may be down! */ |
471 | printk(KERN_DEBUG "%s: autoneg caused pcie phy link down\n", | 473 | dev_dbg(&pdev->dev, "pcie phy link down\n"); |
472 | atl1_driver_name); | ||
473 | 474 | ||
474 | for (i = 0; i < 25; i++) { | 475 | for (i = 0; i < 25; i++) { |
475 | msleep(1); | 476 | msleep(1); |
@@ -479,9 +480,7 @@ static s32 atl1_phy_reset(struct atl1_hw *hw) | |||
479 | } | 480 | } |
480 | 481 | ||
481 | if ((val & (MDIO_START | MDIO_BUSY)) != 0) { | 482 | if ((val & (MDIO_START | MDIO_BUSY)) != 0) { |
482 | printk(KERN_WARNING | 483 | dev_warn(&pdev->dev, "pcie link down at least 25ms\n"); |
483 | "%s: pcie link down at least for 25ms\n", | ||
484 | atl1_driver_name); | ||
485 | return ret_val; | 484 | return ret_val; |
486 | } | 485 | } |
487 | } | 486 | } |
@@ -571,6 +570,7 @@ s32 atl1_phy_setup_autoneg_adv(struct atl1_hw *hw) | |||
571 | */ | 570 | */ |
572 | static s32 atl1_setup_link(struct atl1_hw *hw) | 571 | static s32 atl1_setup_link(struct atl1_hw *hw) |
573 | { | 572 | { |
573 | struct pci_dev *pdev = hw->back->pdev; | ||
574 | s32 ret_val; | 574 | s32 ret_val; |
575 | 575 | ||
576 | /* | 576 | /* |
@@ -581,15 +581,13 @@ static s32 atl1_setup_link(struct atl1_hw *hw) | |||
581 | */ | 581 | */ |
582 | ret_val = atl1_phy_setup_autoneg_adv(hw); | 582 | ret_val = atl1_phy_setup_autoneg_adv(hw); |
583 | if (ret_val) { | 583 | if (ret_val) { |
584 | printk(KERN_DEBUG "%s: error setting up autonegotiation\n", | 584 | dev_dbg(&pdev->dev, "error setting up autonegotiation\n"); |
585 | atl1_driver_name); | ||
586 | return ret_val; | 585 | return ret_val; |
587 | } | 586 | } |
588 | /* SW.Reset , En-Auto-Neg if needed */ | 587 | /* SW.Reset , En-Auto-Neg if needed */ |
589 | ret_val = atl1_phy_reset(hw); | 588 | ret_val = atl1_phy_reset(hw); |
590 | if (ret_val) { | 589 | if (ret_val) { |
591 | printk(KERN_DEBUG "%s: error resetting the phy\n", | 590 | dev_dbg(&pdev->dev, "error resetting phy\n"); |
592 | atl1_driver_name); | ||
593 | return ret_val; | 591 | return ret_val; |
594 | } | 592 | } |
595 | hw->phy_configured = true; | 593 | hw->phy_configured = true; |
@@ -669,6 +667,7 @@ s32 atl1_init_hw(struct atl1_hw *hw) | |||
669 | */ | 667 | */ |
670 | s32 atl1_get_speed_and_duplex(struct atl1_hw *hw, u16 *speed, u16 *duplex) | 668 | s32 atl1_get_speed_and_duplex(struct atl1_hw *hw, u16 *speed, u16 *duplex) |
671 | { | 669 | { |
670 | struct pci_dev *pdev = hw->back->pdev; | ||
672 | s32 ret_val; | 671 | s32 ret_val; |
673 | u16 phy_data; | 672 | u16 phy_data; |
674 | 673 | ||
@@ -691,8 +690,7 @@ s32 atl1_get_speed_and_duplex(struct atl1_hw *hw, u16 *speed, u16 *duplex) | |||
691 | *speed = SPEED_10; | 690 | *speed = SPEED_10; |
692 | break; | 691 | break; |
693 | default: | 692 | default: |
694 | printk(KERN_DEBUG "%s: error getting speed\n", | 693 | dev_dbg(&pdev->dev, "error getting speed\n"); |
695 | atl1_driver_name); | ||
696 | return ATL1_ERR_PHY_SPEED; | 694 | return ATL1_ERR_PHY_SPEED; |
697 | break; | 695 | break; |
698 | } | 696 | } |
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c index 4b1d4d153ecf..d28f88bbdd5f 100644 --- a/drivers/net/atl1/atl1_main.c +++ b/drivers/net/atl1/atl1_main.c | |||
@@ -188,8 +188,7 @@ s32 atl1_setup_ring_resources(struct atl1_adapter *adapter) | |||
188 | size = sizeof(struct atl1_buffer) * (tpd_ring->count + rfd_ring->count); | 188 | size = sizeof(struct atl1_buffer) * (tpd_ring->count + rfd_ring->count); |
189 | tpd_ring->buffer_info = kzalloc(size, GFP_KERNEL); | 189 | tpd_ring->buffer_info = kzalloc(size, GFP_KERNEL); |
190 | if (unlikely(!tpd_ring->buffer_info)) { | 190 | if (unlikely(!tpd_ring->buffer_info)) { |
191 | printk(KERN_WARNING "%s: kzalloc failed , size = D%d\n", | 191 | dev_err(&pdev->dev, "kzalloc failed , size = D%d\n", size); |
192 | atl1_driver_name, size); | ||
193 | goto err_nomem; | 192 | goto err_nomem; |
194 | } | 193 | } |
195 | rfd_ring->buffer_info = | 194 | rfd_ring->buffer_info = |
@@ -207,9 +206,7 @@ s32 atl1_setup_ring_resources(struct atl1_adapter *adapter) | |||
207 | ring_header->desc = pci_alloc_consistent(pdev, ring_header->size, | 206 | ring_header->desc = pci_alloc_consistent(pdev, ring_header->size, |
208 | &ring_header->dma); | 207 | &ring_header->dma); |
209 | if (unlikely(!ring_header->desc)) { | 208 | if (unlikely(!ring_header->desc)) { |
210 | printk(KERN_WARNING | 209 | dev_err(&pdev->dev, "pci_alloc_consistent failed\n"); |
211 | "%s: pci_alloc_consistent failed, size = D%d\n", | ||
212 | atl1_driver_name, size); | ||
213 | goto err_nomem; | 210 | goto err_nomem; |
214 | } | 211 | } |
215 | 212 | ||
@@ -373,8 +370,7 @@ static void atl1_rx_checksum(struct atl1_adapter *adapter, | |||
373 | if (rrd->err_flg & (ERR_FLAG_CRC | ERR_FLAG_TRUNC | | 370 | if (rrd->err_flg & (ERR_FLAG_CRC | ERR_FLAG_TRUNC | |
374 | ERR_FLAG_CODE | ERR_FLAG_OV)) { | 371 | ERR_FLAG_CODE | ERR_FLAG_OV)) { |
375 | adapter->hw_csum_err++; | 372 | adapter->hw_csum_err++; |
376 | printk(KERN_DEBUG "%s: rx checksum error\n", | 373 | dev_dbg(&adapter->pdev->dev, "rx checksum error\n"); |
377 | atl1_driver_name); | ||
378 | return; | 374 | return; |
379 | } | 375 | } |
380 | } | 376 | } |
@@ -393,8 +389,9 @@ static void atl1_rx_checksum(struct atl1_adapter *adapter, | |||
393 | } | 389 | } |
394 | 390 | ||
395 | /* IPv4, but hardware thinks its checksum is wrong */ | 391 | /* IPv4, but hardware thinks its checksum is wrong */ |
396 | printk(KERN_DEBUG "%s: hw csum wrong pkt_flag:%x, err_flag:%x\n", | 392 | dev_dbg(&adapter->pdev->dev, |
397 | atl1_driver_name, rrd->pkt_flg, rrd->err_flg); | 393 | "hw csum wrong, pkt_flag:%x, err_flag:%x\n", |
394 | rrd->pkt_flg, rrd->err_flg); | ||
398 | skb->ip_summed = CHECKSUM_COMPLETE; | 395 | skb->ip_summed = CHECKSUM_COMPLETE; |
399 | skb->csum = htons(rrd->xsz.xsum_sz.rx_chksum); | 396 | skb->csum = htons(rrd->xsz.xsum_sz.rx_chksum); |
400 | adapter->hw_csum_err++; | 397 | adapter->hw_csum_err++; |
@@ -507,14 +504,13 @@ chk_rrd: | |||
507 | /* rrd seems to be bad */ | 504 | /* rrd seems to be bad */ |
508 | if (unlikely(i-- > 0)) { | 505 | if (unlikely(i-- > 0)) { |
509 | /* rrd may not be DMAed completely */ | 506 | /* rrd may not be DMAed completely */ |
510 | printk(KERN_DEBUG | 507 | dev_dbg(&adapter->pdev->dev, |
511 | "%s: RRD may not be DMAed completely\n", | 508 | "incomplete RRD DMA transfer\n"); |
512 | atl1_driver_name); | ||
513 | udelay(1); | 509 | udelay(1); |
514 | goto chk_rrd; | 510 | goto chk_rrd; |
515 | } | 511 | } |
516 | /* bad rrd */ | 512 | /* bad rrd */ |
517 | printk(KERN_DEBUG "%s: bad RRD\n", atl1_driver_name); | 513 | dev_dbg(&adapter->pdev->dev, "bad RRD\n"); |
518 | /* see if update RFD index */ | 514 | /* see if update RFD index */ |
519 | if (rrd->num_buf > 1) { | 515 | if (rrd->num_buf > 1) { |
520 | u16 num_buf; | 516 | u16 num_buf; |
@@ -685,8 +681,8 @@ static void atl1_check_for_link(struct atl1_adapter *adapter) | |||
685 | /* notify upper layer link down ASAP */ | 681 | /* notify upper layer link down ASAP */ |
686 | if (!(phy_data & BMSR_LSTATUS)) { /* Link Down */ | 682 | if (!(phy_data & BMSR_LSTATUS)) { /* Link Down */ |
687 | if (netif_carrier_ok(netdev)) { /* old link state: Up */ | 683 | if (netif_carrier_ok(netdev)) { /* old link state: Up */ |
688 | printk(KERN_INFO "%s: %s link is down\n", | 684 | dev_info(&adapter->pdev->dev, "%s link is down\n", |
689 | atl1_driver_name, netdev->name); | 685 | netdev->name); |
690 | adapter->link_speed = SPEED_0; | 686 | adapter->link_speed = SPEED_0; |
691 | netif_carrier_off(netdev); | 687 | netif_carrier_off(netdev); |
692 | netif_stop_queue(netdev); | 688 | netif_stop_queue(netdev); |
@@ -731,8 +727,8 @@ static irqreturn_t atl1_intr(int irq, void *data) | |||
731 | 727 | ||
732 | /* check if PCIE PHY Link down */ | 728 | /* check if PCIE PHY Link down */ |
733 | if (status & ISR_PHY_LINKDOWN) { | 729 | if (status & ISR_PHY_LINKDOWN) { |
734 | printk(KERN_DEBUG "%s: pcie phy link down %x\n", | 730 | dev_dbg(&adapter->pdev->dev, "pcie phy link down %x\n", |
735 | atl1_driver_name, status); | 731 | status); |
736 | if (netif_running(adapter->netdev)) { /* reset MAC */ | 732 | if (netif_running(adapter->netdev)) { /* reset MAC */ |
737 | iowrite32(0, adapter->hw.hw_addr + REG_IMR); | 733 | iowrite32(0, adapter->hw.hw_addr + REG_IMR); |
738 | schedule_work(&adapter->pcie_dma_to_rst_task); | 734 | schedule_work(&adapter->pcie_dma_to_rst_task); |
@@ -742,9 +738,9 @@ static irqreturn_t atl1_intr(int irq, void *data) | |||
742 | 738 | ||
743 | /* check if DMA read/write error ? */ | 739 | /* check if DMA read/write error ? */ |
744 | if (status & (ISR_DMAR_TO_RST | ISR_DMAW_TO_RST)) { | 740 | if (status & (ISR_DMAR_TO_RST | ISR_DMAW_TO_RST)) { |
745 | printk(KERN_DEBUG | 741 | dev_dbg(&adapter->pdev->dev, |
746 | "%s: pcie DMA r/w error (status = 0x%x)\n", | 742 | "pcie DMA r/w error (status = 0x%x)\n", |
747 | atl1_driver_name, status); | 743 | status); |
748 | iowrite32(0, adapter->hw.hw_addr + REG_IMR); | 744 | iowrite32(0, adapter->hw.hw_addr + REG_IMR); |
749 | schedule_work(&adapter->pcie_dma_to_rst_task); | 745 | schedule_work(&adapter->pcie_dma_to_rst_task); |
750 | return IRQ_HANDLED; | 746 | return IRQ_HANDLED; |
@@ -762,14 +758,13 @@ static irqreturn_t atl1_intr(int irq, void *data) | |||
762 | 758 | ||
763 | /* rx exception */ | 759 | /* rx exception */ |
764 | if (unlikely(status & (ISR_RXF_OV | ISR_RFD_UNRUN | | 760 | if (unlikely(status & (ISR_RXF_OV | ISR_RFD_UNRUN | |
761 | ISR_RRD_OV | ISR_HOST_RFD_UNRUN | | ||
762 | ISR_HOST_RRD_OV | ISR_CMB_RX))) { | ||
763 | if (status & (ISR_RXF_OV | ISR_RFD_UNRUN | | ||
765 | ISR_RRD_OV | ISR_HOST_RFD_UNRUN | | 764 | ISR_RRD_OV | ISR_HOST_RFD_UNRUN | |
766 | ISR_HOST_RRD_OV | ISR_CMB_RX))) { | 765 | ISR_HOST_RRD_OV)) |
767 | if (status & | 766 | dev_dbg(&adapter->pdev->dev, |
768 | (ISR_RXF_OV | ISR_RFD_UNRUN | ISR_RRD_OV | | 767 | "rx exception, ISR = 0x%x\n", status); |
769 | ISR_HOST_RFD_UNRUN | ISR_HOST_RRD_OV)) | ||
770 | printk(KERN_INFO | ||
771 | "%s: rx exception: status = 0x%x\n", | ||
772 | atl1_driver_name, status); | ||
773 | atl1_intr_rx(adapter); | 768 | atl1_intr_rx(adapter); |
774 | } | 769 | } |
775 | 770 | ||
@@ -874,8 +869,7 @@ static u32 atl1_check_link(struct atl1_adapter *adapter) | |||
874 | atl1_read_phy_reg(hw, MII_BMSR, &phy_data); | 869 | atl1_read_phy_reg(hw, MII_BMSR, &phy_data); |
875 | if (!(phy_data & BMSR_LSTATUS)) { /* link down */ | 870 | if (!(phy_data & BMSR_LSTATUS)) { /* link down */ |
876 | if (netif_carrier_ok(netdev)) { /* old link state: Up */ | 871 | if (netif_carrier_ok(netdev)) { /* old link state: Up */ |
877 | printk(KERN_INFO "%s: link is down\n", | 872 | dev_info(&adapter->pdev->dev, "link is down\n"); |
878 | atl1_driver_name); | ||
879 | adapter->link_speed = SPEED_0; | 873 | adapter->link_speed = SPEED_0; |
880 | netif_carrier_off(netdev); | 874 | netif_carrier_off(netdev); |
881 | netif_stop_queue(netdev); | 875 | netif_stop_queue(netdev); |
@@ -918,11 +912,11 @@ static u32 atl1_check_link(struct atl1_adapter *adapter) | |||
918 | adapter->link_speed = speed; | 912 | adapter->link_speed = speed; |
919 | adapter->link_duplex = duplex; | 913 | adapter->link_duplex = duplex; |
920 | atl1_setup_mac_ctrl(adapter); | 914 | atl1_setup_mac_ctrl(adapter); |
921 | printk(KERN_INFO "%s: %s link is up %d Mbps %s\n", | 915 | dev_info(&adapter->pdev->dev, |
922 | atl1_driver_name, netdev->name, | 916 | "%s link is up %d Mbps %s\n", |
923 | adapter->link_speed, | 917 | netdev->name, adapter->link_speed, |
924 | adapter->link_duplex == | 918 | adapter->link_duplex == FULL_DUPLEX ? |
925 | FULL_DUPLEX ? "full duplex" : "half duplex"); | 919 | "full duplex" : "half duplex"); |
926 | } | 920 | } |
927 | if (!netif_carrier_ok(netdev)) { /* Link down -> Up */ | 921 | if (!netif_carrier_ok(netdev)) { /* Link down -> Up */ |
928 | netif_carrier_on(netdev); | 922 | netif_carrier_on(netdev); |
@@ -1330,8 +1324,8 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb, | |||
1330 | cso = skb_transport_offset(skb); | 1324 | cso = skb_transport_offset(skb); |
1331 | css = cso + skb->csum_offset; | 1325 | css = cso + skb->csum_offset; |
1332 | if (unlikely(cso & 0x1)) { | 1326 | if (unlikely(cso & 0x1)) { |
1333 | printk(KERN_DEBUG "%s: payload offset != even number\n", | 1327 | dev_dbg(&adapter->pdev->dev, |
1334 | atl1_driver_name); | 1328 | "payload offset not an even number\n"); |
1335 | return -1; | 1329 | return -1; |
1336 | } | 1330 | } |
1337 | csum->csumpl |= (cso & CSUM_PARAM_PLOADOFFSET_MASK) << | 1331 | csum->csumpl |= (cso & CSUM_PARAM_PLOADOFFSET_MASK) << |
@@ -1579,7 +1573,7 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1579 | if (!spin_trylock(&adapter->lock)) { | 1573 | if (!spin_trylock(&adapter->lock)) { |
1580 | /* Can't get lock - tell upper layer to requeue */ | 1574 | /* Can't get lock - tell upper layer to requeue */ |
1581 | local_irq_restore(flags); | 1575 | local_irq_restore(flags); |
1582 | printk(KERN_DEBUG "%s: TX locked\n", atl1_driver_name); | 1576 | dev_dbg(&adapter->pdev->dev, "tx locked\n"); |
1583 | return NETDEV_TX_LOCKED; | 1577 | return NETDEV_TX_LOCKED; |
1584 | } | 1578 | } |
1585 | 1579 | ||
@@ -1587,7 +1581,7 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1587 | /* not enough descriptors */ | 1581 | /* not enough descriptors */ |
1588 | netif_stop_queue(netdev); | 1582 | netif_stop_queue(netdev); |
1589 | spin_unlock_irqrestore(&adapter->lock, flags); | 1583 | spin_unlock_irqrestore(&adapter->lock, flags); |
1590 | printk(KERN_DEBUG "%s: TX busy\n", atl1_driver_name); | 1584 | dev_dbg(&adapter->pdev->dev, "tx busy\n"); |
1591 | return NETDEV_TX_BUSY; | 1585 | return NETDEV_TX_BUSY; |
1592 | } | 1586 | } |
1593 | 1587 | ||
@@ -1841,8 +1835,7 @@ static int atl1_change_mtu(struct net_device *netdev, int new_mtu) | |||
1841 | 1835 | ||
1842 | if ((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) || | 1836 | if ((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) || |
1843 | (max_frame > MAX_JUMBO_FRAME_SIZE)) { | 1837 | (max_frame > MAX_JUMBO_FRAME_SIZE)) { |
1844 | printk(KERN_WARNING "%s: invalid MTU setting\n", | 1838 | dev_warn(&adapter->pdev->dev, "invalid MTU setting\n"); |
1845 | atl1_driver_name); | ||
1846 | return -EINVAL; | 1839 | return -EINVAL; |
1847 | } | 1840 | } |
1848 | 1841 | ||
@@ -2136,9 +2129,7 @@ static int __devinit atl1_probe(struct pci_dev *pdev, | |||
2136 | if (err) { | 2129 | if (err) { |
2137 | err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); | 2130 | err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); |
2138 | if (err) { | 2131 | if (err) { |
2139 | printk(KERN_DEBUG | 2132 | dev_err(&pdev->dev, "no usable DMA configuration\n"); |
2140 | "%s: no usable DMA configuration, aborting\n", | ||
2141 | atl1_driver_name); | ||
2142 | goto err_dma; | 2133 | goto err_dma; |
2143 | } | 2134 | } |
2144 | pci_using_64 = false; | 2135 | pci_using_64 = false; |
@@ -2175,7 +2166,9 @@ static int __devinit atl1_probe(struct pci_dev *pdev, | |||
2175 | goto err_pci_iomap; | 2166 | goto err_pci_iomap; |
2176 | } | 2167 | } |
2177 | /* get device revision number */ | 2168 | /* get device revision number */ |
2178 | adapter->hw.dev_rev = ioread16(adapter->hw.hw_addr + (REG_MASTER_CTRL + 2)); | 2169 | adapter->hw.dev_rev = ioread16(adapter->hw.hw_addr + |
2170 | (REG_MASTER_CTRL + 2)); | ||
2171 | dev_info(&pdev->dev, "version %s\n", DRIVER_VERSION); | ||
2179 | 2172 | ||
2180 | /* set default ring resource counts */ | 2173 | /* set default ring resource counts */ |
2181 | adapter->rfd_ring.count = adapter->rrd_ring.count = ATL1_DEFAULT_RFD; | 2174 | adapter->rfd_ring.count = adapter->rrd_ring.count = ATL1_DEFAULT_RFD; |
@@ -2466,8 +2459,6 @@ static void __exit atl1_exit_module(void) | |||
2466 | */ | 2459 | */ |
2467 | static int __init atl1_init_module(void) | 2460 | static int __init atl1_init_module(void) |
2468 | { | 2461 | { |
2469 | printk(KERN_INFO "%s - version %s\n", atl1_driver_string, DRIVER_VERSION); | ||
2470 | printk(KERN_INFO "%s\n", atl1_copyright); | ||
2471 | return pci_register_driver(&atl1_driver); | 2462 | return pci_register_driver(&atl1_driver); |
2472 | } | 2463 | } |
2473 | 2464 | ||
diff --git a/drivers/net/atl1/atl1_param.c b/drivers/net/atl1/atl1_param.c index bcd0bd891722..324f9f0ece99 100644 --- a/drivers/net/atl1/atl1_param.c +++ b/drivers/net/atl1/atl1_param.c | |||
@@ -93,7 +93,7 @@ struct atl1_option { | |||
93 | } arg; | 93 | } arg; |
94 | }; | 94 | }; |
95 | 95 | ||
96 | static int __devinit atl1_validate_option(int *value, struct atl1_option *opt) | 96 | static int __devinit atl1_validate_option(int *value, struct atl1_option *opt, struct pci_dev *pdev) |
97 | { | 97 | { |
98 | if (*value == OPTION_UNSET) { | 98 | if (*value == OPTION_UNSET) { |
99 | *value = opt->def; | 99 | *value = opt->def; |
@@ -104,19 +104,17 @@ static int __devinit atl1_validate_option(int *value, struct atl1_option *opt) | |||
104 | case enable_option: | 104 | case enable_option: |
105 | switch (*value) { | 105 | switch (*value) { |
106 | case OPTION_ENABLED: | 106 | case OPTION_ENABLED: |
107 | printk(KERN_INFO "%s: %s Enabled\n", atl1_driver_name, | 107 | dev_info(&pdev->dev, "%s enabled\n", opt->name); |
108 | opt->name); | ||
109 | return 0; | 108 | return 0; |
110 | case OPTION_DISABLED: | 109 | case OPTION_DISABLED: |
111 | printk(KERN_INFO "%s: %s Disabled\n", atl1_driver_name, | 110 | dev_info(&pdev->dev, "%s disabled\n", opt->name); |
112 | opt->name); | ||
113 | return 0; | 111 | return 0; |
114 | } | 112 | } |
115 | break; | 113 | break; |
116 | case range_option: | 114 | case range_option: |
117 | if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) { | 115 | if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) { |
118 | printk(KERN_INFO "%s: %s set to %i\n", | 116 | dev_info(&pdev->dev, "%s set to %i\n", opt->name, |
119 | atl1_driver_name, opt->name, *value); | 117 | *value); |
120 | return 0; | 118 | return 0; |
121 | } | 119 | } |
122 | break; | 120 | break; |
@@ -128,8 +126,8 @@ static int __devinit atl1_validate_option(int *value, struct atl1_option *opt) | |||
128 | ent = &opt->arg.l.p[i]; | 126 | ent = &opt->arg.l.p[i]; |
129 | if (*value == ent->i) { | 127 | if (*value == ent->i) { |
130 | if (ent->str[0] != '\0') | 128 | if (ent->str[0] != '\0') |
131 | printk(KERN_INFO "%s: %s\n", | 129 | dev_info(&pdev->dev, "%s\n", |
132 | atl1_driver_name, ent->str); | 130 | ent->str); |
133 | return 0; | 131 | return 0; |
134 | } | 132 | } |
135 | } | 133 | } |
@@ -140,8 +138,8 @@ static int __devinit atl1_validate_option(int *value, struct atl1_option *opt) | |||
140 | break; | 138 | break; |
141 | } | 139 | } |
142 | 140 | ||
143 | printk(KERN_INFO "%s: invalid %s specified (%i) %s\n", | 141 | dev_info(&pdev->dev, "invalid %s specified (%i) %s\n", |
144 | atl1_driver_name, opt->name, *value, opt->err); | 142 | opt->name, *value, opt->err); |
145 | *value = opt->def; | 143 | *value = opt->def; |
146 | return -1; | 144 | return -1; |
147 | } | 145 | } |
@@ -157,12 +155,11 @@ static int __devinit atl1_validate_option(int *value, struct atl1_option *opt) | |||
157 | */ | 155 | */ |
158 | void __devinit atl1_check_options(struct atl1_adapter *adapter) | 156 | void __devinit atl1_check_options(struct atl1_adapter *adapter) |
159 | { | 157 | { |
158 | struct pci_dev *pdev = adapter->pdev; | ||
160 | int bd = adapter->bd_number; | 159 | int bd = adapter->bd_number; |
161 | if (bd >= ATL1_MAX_NIC) { | 160 | if (bd >= ATL1_MAX_NIC) { |
162 | printk(KERN_NOTICE "%s: warning: no configuration for board #%i\n", | 161 | dev_notice(&pdev->dev, "no configuration for board#%i\n", bd); |
163 | atl1_driver_name, bd); | 162 | dev_notice(&pdev->dev, "using defaults for all values\n"); |
164 | printk(KERN_NOTICE "%s: using defaults for all values\n", | ||
165 | atl1_driver_name); | ||
166 | } | 163 | } |
167 | { /* Interrupt Moderate Timer */ | 164 | { /* Interrupt Moderate Timer */ |
168 | struct atl1_option opt = { | 165 | struct atl1_option opt = { |
@@ -177,7 +174,7 @@ void __devinit atl1_check_options(struct atl1_adapter *adapter) | |||
177 | int val; | 174 | int val; |
178 | if (num_int_mod_timer > bd) { | 175 | if (num_int_mod_timer > bd) { |
179 | val = int_mod_timer[bd]; | 176 | val = int_mod_timer[bd]; |
180 | atl1_validate_option(&val, &opt); | 177 | atl1_validate_option(&val, &opt, pdev); |
181 | adapter->imt = (u16) val; | 178 | adapter->imt = (u16) val; |
182 | } else | 179 | } else |
183 | adapter->imt = (u16) (opt.def); | 180 | adapter->imt = (u16) (opt.def); |
@@ -197,7 +194,7 @@ void __devinit atl1_check_options(struct atl1_adapter *adapter) | |||
197 | int val; | 194 | int val; |
198 | if (num_flash_vendor > bd) { | 195 | if (num_flash_vendor > bd) { |
199 | val = flash_vendor[bd]; | 196 | val = flash_vendor[bd]; |
200 | atl1_validate_option(&val, &opt); | 197 | atl1_validate_option(&val, &opt, pdev); |
201 | adapter->hw.flash_vendor = (u8) val; | 198 | adapter->hw.flash_vendor = (u8) val; |
202 | } else | 199 | } else |
203 | adapter->hw.flash_vendor = (u8) (opt.def); | 200 | adapter->hw.flash_vendor = (u8) (opt.def); |