Commit 436d27d1 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

drivers/net/cassini.c: Use (pr|netdev|netif)_<level> macro helpers

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Remove #define PFX
Use pr_<level>
Use netdev_<level>
Use netif_<level>
Remove periods from formats
Coalesce long formats
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7995c64e
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
* by default, the selective clear mask is set up to process rx packets. * by default, the selective clear mask is set up to process rx packets.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -143,7 +144,6 @@ ...@@ -143,7 +144,6 @@
#undef RX_COUNT_BUFFERS /* define to calculate RX buffer stats */ #undef RX_COUNT_BUFFERS /* define to calculate RX buffer stats */
#define DRV_MODULE_NAME "cassini" #define DRV_MODULE_NAME "cassini"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "1.6" #define DRV_MODULE_VERSION "1.6"
#define DRV_MODULE_RELDATE "21 May 2008" #define DRV_MODULE_RELDATE "21 May 2008"
...@@ -649,9 +649,8 @@ static cas_page_t *cas_page_dequeue(struct cas *cp) ...@@ -649,9 +649,8 @@ static cas_page_t *cas_page_dequeue(struct cas *cp)
cas_spare_recover(cp, GFP_ATOMIC); cas_spare_recover(cp, GFP_ATOMIC);
spin_lock(&cp->rx_spare_lock); spin_lock(&cp->rx_spare_lock);
if (list_empty(&cp->rx_spare_list)) { if (list_empty(&cp->rx_spare_list)) {
if (netif_msg_rx_err(cp)) netif_err(cp, rx_err, cp->dev,
printk(KERN_ERR "%s: no spare buffers " "no spare buffers available\n");
"available.\n", cp->dev->name);
spin_unlock(&cp->rx_spare_lock); spin_unlock(&cp->rx_spare_lock);
return NULL; return NULL;
} }
...@@ -728,12 +727,10 @@ static void cas_begin_auto_negotiation(struct cas *cp, struct ethtool_cmd *ep) ...@@ -728,12 +727,10 @@ static void cas_begin_auto_negotiation(struct cas *cp, struct ethtool_cmd *ep)
#endif #endif
start_aneg: start_aneg:
if (cp->lstate == link_up) { if (cp->lstate == link_up) {
printk(KERN_INFO "%s: PCS link down.\n", netdev_info(cp->dev, "PCS link down\n");
cp->dev->name);
} else { } else {
if (changed) { if (changed) {
printk(KERN_INFO "%s: link configuration changed\n", netdev_info(cp->dev, "link configuration changed\n");
cp->dev->name);
} }
} }
cp->lstate = link_down; cp->lstate = link_down;
...@@ -826,12 +823,12 @@ static int cas_saturn_firmware_init(struct cas *cp) ...@@ -826,12 +823,12 @@ static int cas_saturn_firmware_init(struct cas *cp)
err = request_firmware(&fw, fw_name, &cp->pdev->dev); err = request_firmware(&fw, fw_name, &cp->pdev->dev);
if (err) { if (err) {
printk(KERN_ERR "cassini: Failed to load firmware \"%s\"\n", pr_err("Failed to load firmware \"%s\"\n",
fw_name); fw_name);
return err; return err;
} }
if (fw->size < 2) { if (fw->size < 2) {
printk(KERN_ERR "cassini: bogus length %zu in \"%s\"\n", pr_err("bogus length %zu in \"%s\"\n",
fw->size, fw_name); fw->size, fw_name);
err = -EINVAL; err = -EINVAL;
goto out; goto out;
...@@ -841,7 +838,7 @@ static int cas_saturn_firmware_init(struct cas *cp) ...@@ -841,7 +838,7 @@ static int cas_saturn_firmware_init(struct cas *cp)
cp->fw_data = vmalloc(cp->fw_size); cp->fw_data = vmalloc(cp->fw_size);
if (!cp->fw_data) { if (!cp->fw_data) {
err = -ENOMEM; err = -ENOMEM;
printk(KERN_ERR "cassini: \"%s\" Failed %d\n", fw_name, err); pr_err("\"%s\" Failed %d\n", fw_name, err);
goto out; goto out;
} }
memcpy(cp->fw_data, &fw->data[2], cp->fw_size); memcpy(cp->fw_data, &fw->data[2], cp->fw_size);
...@@ -986,8 +983,7 @@ static void cas_phy_init(struct cas *cp) ...@@ -986,8 +983,7 @@ static void cas_phy_init(struct cas *cp)
break; break;
} }
if (limit <= 0) if (limit <= 0)
printk(KERN_WARNING "%s: PCS reset bit would not " netdev_warn(cp->dev, "PCS reset bit would not clear [%08x]\n",
"clear [%08x].\n", cp->dev->name,
readl(cp->regs + REG_PCS_STATE_MACHINE)); readl(cp->regs + REG_PCS_STATE_MACHINE));
/* Make sure PCS is disabled while changing advertisement /* Make sure PCS is disabled while changing advertisement
...@@ -1030,11 +1026,8 @@ static int cas_pcs_link_check(struct cas *cp) ...@@ -1030,11 +1026,8 @@ static int cas_pcs_link_check(struct cas *cp)
*/ */
if ((stat & (PCS_MII_STATUS_AUTONEG_COMP | if ((stat & (PCS_MII_STATUS_AUTONEG_COMP |
PCS_MII_STATUS_REMOTE_FAULT)) == PCS_MII_STATUS_REMOTE_FAULT)) ==
(PCS_MII_STATUS_AUTONEG_COMP | PCS_MII_STATUS_REMOTE_FAULT)) { (PCS_MII_STATUS_AUTONEG_COMP | PCS_MII_STATUS_REMOTE_FAULT))
if (netif_msg_link(cp)) netif_info(cp, link, cp->dev, "PCS RemoteFault\n");
printk(KERN_INFO "%s: PCS RemoteFault\n",
cp->dev->name);
}
/* work around link detection issue by querying the PCS state /* work around link detection issue by querying the PCS state
* machine directly. * machine directly.
...@@ -1081,10 +1074,8 @@ static int cas_pcs_link_check(struct cas *cp) ...@@ -1081,10 +1074,8 @@ static int cas_pcs_link_check(struct cas *cp)
cp->link_transition = LINK_TRANSITION_ON_FAILURE; cp->link_transition = LINK_TRANSITION_ON_FAILURE;
} }
netif_carrier_off(cp->dev); netif_carrier_off(cp->dev);
if (cp->opened && netif_msg_link(cp)) { if (cp->opened)
printk(KERN_INFO "%s: PCS link down.\n", netif_info(cp, link, cp->dev, "PCS link down\n");
cp->dev->name);
}
/* Cassini only: if you force a mode, there can be /* Cassini only: if you force a mode, there can be
* sync problems on link down. to fix that, the following * sync problems on link down. to fix that, the following
...@@ -1139,9 +1130,8 @@ static int cas_txmac_interrupt(struct net_device *dev, ...@@ -1139,9 +1130,8 @@ static int cas_txmac_interrupt(struct net_device *dev,
if (!txmac_stat) if (!txmac_stat)
return 0; return 0;
if (netif_msg_intr(cp)) netif_printk(cp, intr, KERN_DEBUG, cp->dev,
printk(KERN_DEBUG "%s: txmac interrupt, txmac_stat: 0x%x\n", "txmac interrupt, txmac_stat: 0x%x\n", txmac_stat);
cp->dev->name, txmac_stat);
/* Defer timer expiration is quite normal, /* Defer timer expiration is quite normal,
* don't even log the event. * don't even log the event.
...@@ -1152,14 +1142,12 @@ static int cas_txmac_interrupt(struct net_device *dev, ...@@ -1152,14 +1142,12 @@ static int cas_txmac_interrupt(struct net_device *dev,
spin_lock(&cp->stat_lock[0]); spin_lock(&cp->stat_lock[0]);
if (txmac_stat & MAC_TX_UNDERRUN) { if (txmac_stat & MAC_TX_UNDERRUN) {
printk(KERN_ERR "%s: TX MAC xmit underrun.\n", netdev_err(dev, "TX MAC xmit underrun\n");
dev->name);
cp->net_stats[0].tx_fifo_errors++; cp->net_stats[0].tx_fifo_errors++;
} }
if (txmac_stat & MAC_TX_MAX_PACKET_ERR) { if (txmac_stat & MAC_TX_MAX_PACKET_ERR) {
printk(KERN_ERR "%s: TX MAC max packet size error.\n", netdev_err(dev, "TX MAC max packet size error\n");
dev->name);
cp->net_stats[0].tx_errors++; cp->net_stats[0].tx_errors++;
} }
...@@ -1487,8 +1475,7 @@ static int cas_rxmac_reset(struct cas *cp) ...@@ -1487,8 +1475,7 @@ static int cas_rxmac_reset(struct cas *cp)
udelay(10); udelay(10);
} }
if (limit == STOP_TRIES) { if (limit == STOP_TRIES) {
printk(KERN_ERR "%s: RX MAC will not disable, resetting whole " netdev_err(dev, "RX MAC will not disable, resetting whole chip\n");
"chip.\n", dev->name);
return 1; return 1;
} }
...@@ -1500,8 +1487,7 @@ static int cas_rxmac_reset(struct cas *cp) ...@@ -1500,8 +1487,7 @@ static int cas_rxmac_reset(struct cas *cp)
udelay(10); udelay(10);
} }
if (limit == STOP_TRIES) { if (limit == STOP_TRIES) {
printk(KERN_ERR "%s: RX DMA will not disable, resetting whole " netdev_err(dev, "RX DMA will not disable, resetting whole chip\n");
"chip.\n", dev->name);
return 1; return 1;
} }
...@@ -1515,8 +1501,7 @@ static int cas_rxmac_reset(struct cas *cp) ...@@ -1515,8 +1501,7 @@ static int cas_rxmac_reset(struct cas *cp)
udelay(10); udelay(10);
} }
if (limit == STOP_TRIES) { if (limit == STOP_TRIES) {
printk(KERN_ERR "%s: RX reset command will not execute, " netdev_err(dev, "RX reset command will not execute, resetting whole chip\n");
"resetting whole chip.\n", dev->name);
return 1; return 1;
} }
...@@ -1545,9 +1530,7 @@ static int cas_rxmac_interrupt(struct net_device *dev, struct cas *cp, ...@@ -1545,9 +1530,7 @@ static int cas_rxmac_interrupt(struct net_device *dev, struct cas *cp,
if (!stat) if (!stat)
return 0; return 0;
if (netif_msg_intr(cp)) netif_dbg(cp, intr, cp->dev, "rxmac interrupt, stat: 0x%x\n", stat);
printk(KERN_DEBUG "%s: rxmac interrupt, stat: 0x%x\n",
cp->dev->name, stat);
/* these are all rollovers */ /* these are all rollovers */
spin_lock(&cp->stat_lock[0]); spin_lock(&cp->stat_lock[0]);
...@@ -1580,9 +1563,8 @@ static int cas_mac_interrupt(struct net_device *dev, struct cas *cp, ...@@ -1580,9 +1563,8 @@ static int cas_mac_interrupt(struct net_device *dev, struct cas *cp,
if (!stat) if (!stat)
return 0; return 0;
if (netif_msg_intr(cp)) netif_printk(cp, intr, KERN_DEBUG, cp->dev,
printk(KERN_DEBUG "%s: mac interrupt, stat: 0x%x\n", "mac interrupt, stat: 0x%x\n", stat);
cp->dev->name, stat);
/* This interrupt is just for pause frame and pause /* This interrupt is just for pause frame and pause
* tracking. It is useful for diagnostics and debug * tracking. It is useful for diagnostics and debug
...@@ -1605,9 +1587,7 @@ static inline int cas_mdio_link_not_up(struct cas *cp) ...@@ -1605,9 +1587,7 @@ static inline int cas_mdio_link_not_up(struct cas *cp)
switch (cp->lstate) { switch (cp->lstate) {
case link_force_ret: case link_force_ret:
if (netif_msg_link(cp)) netif_info(cp, link, cp->dev, "Autoneg failed again, keeping forced mode\n");
printk(KERN_INFO "%s: Autoneg failed again, keeping"
" forced mode\n", cp->dev->name);
cas_phy_write(cp, MII_BMCR, cp->link_fcntl); cas_phy_write(cp, MII_BMCR, cp->link_fcntl);
cp->timer_ticks = 5; cp->timer_ticks = 5;
cp->lstate = link_force_ok; cp->lstate = link_force_ok;
...@@ -1675,9 +1655,9 @@ static int cas_mii_link_check(struct cas *cp, const u16 bmsr) ...@@ -1675,9 +1655,9 @@ static int cas_mii_link_check(struct cas *cp, const u16 bmsr)
cas_mif_poll(cp, 0); cas_mif_poll(cp, 0);
cp->link_fcntl = cas_phy_read(cp, MII_BMCR); cp->link_fcntl = cas_phy_read(cp, MII_BMCR);
cp->timer_ticks = 5; cp->timer_ticks = 5;
if (cp->opened && netif_msg_link(cp)) if (cp->opened)
printk(KERN_INFO "%s: Got link after fallback, retrying" netif_info(cp, link, cp->dev,
" autoneg once...\n", cp->dev->name); "Got link after fallback, retrying autoneg once...\n");
cas_phy_write(cp, MII_BMCR, cas_phy_write(cp, MII_BMCR,
cp->link_fcntl | BMCR_ANENABLE | cp->link_fcntl | BMCR_ANENABLE |
BMCR_ANRESTART); BMCR_ANRESTART);
...@@ -1704,9 +1684,8 @@ static int cas_mii_link_check(struct cas *cp, const u16 bmsr) ...@@ -1704,9 +1684,8 @@ static int cas_mii_link_check(struct cas *cp, const u16 bmsr)
cp->link_transition = LINK_TRANSITION_LINK_DOWN; cp->link_transition = LINK_TRANSITION_LINK_DOWN;
netif_carrier_off(cp->dev); netif_carrier_off(cp->dev);
if (cp->opened && netif_msg_link(cp)) if (cp->opened)
printk(KERN_INFO "%s: Link down\n", netif_info(cp, link, cp->dev, "Link down\n");
cp->dev->name);
restart = 1; restart = 1;
} else if (++cp->timer_ticks > 10) } else if (++cp->timer_ticks > 10)
...@@ -1737,23 +1716,23 @@ static int cas_pci_interrupt(struct net_device *dev, struct cas *cp, ...@@ -1737,23 +1716,23 @@ static int cas_pci_interrupt(struct net_device *dev, struct cas *cp,
if (!stat) if (!stat)
return 0; return 0;
printk(KERN_ERR "%s: PCI error [%04x:%04x] ", dev->name, stat, netdev_err(dev, "PCI error [%04x:%04x]",
readl(cp->regs + REG_BIM_DIAG)); stat, readl(cp->regs + REG_BIM_DIAG));
/* cassini+ has this reserved */ /* cassini+ has this reserved */
if ((stat & PCI_ERR_BADACK) && if ((stat & PCI_ERR_BADACK) &&
((cp->cas_flags & CAS_FLAG_REG_PLUS) == 0)) ((cp->cas_flags & CAS_FLAG_REG_PLUS) == 0))
printk("<No ACK64# during ABS64 cycle> "); pr_cont(" <No ACK64# during ABS64 cycle>");
if (stat & PCI_ERR_DTRTO) if (stat & PCI_ERR_DTRTO)
printk("<Delayed transaction timeout> "); pr_cont(" <Delayed transaction timeout>");
if (stat & PCI_ERR_OTHER) if (stat & PCI_ERR_OTHER)
printk("<other> "); pr_cont(" <other>");
if (stat & PCI_ERR_BIM_DMA_WRITE) if (stat & PCI_ERR_BIM_DMA_WRITE)
printk("<BIM DMA 0 write req> "); pr_cont(" <BIM DMA 0 write req>");
if (stat & PCI_ERR_BIM_DMA_READ) if (stat & PCI_ERR_BIM_DMA_READ)
printk("<BIM DMA 0 read req> "); pr_cont(" <BIM DMA 0 read req>");
printk("\n"); pr_cont("\n");
if (stat & PCI_ERR_OTHER) { if (stat & PCI_ERR_OTHER) {
u16 cfg; u16 cfg;
...@@ -1762,25 +1741,19 @@ static int cas_pci_interrupt(struct net_device *dev, struct cas *cp, ...@@ -1762,25 +1741,19 @@ static int cas_pci_interrupt(struct net_device *dev, struct cas *cp,
* true cause. * true cause.
*/ */
pci_read_config_word(cp->pdev, PCI_STATUS, &cfg); pci_read_config_word(cp->pdev, PCI_STATUS, &cfg);
printk(KERN_ERR "%s: Read PCI cfg space status [%04x]\n", netdev_err(dev, "Read PCI cfg space status [%04x]\n", cfg);
dev->name, cfg);
if (cfg & PCI_STATUS_PARITY) if (cfg & PCI_STATUS_PARITY)
printk(KERN_ERR "%s: PCI parity error detected.\n", netdev_err(dev, "PCI parity error detected\n");
dev->name);
if (cfg & PCI_STATUS_SIG_TARGET_ABORT) if (cfg & PCI_STATUS_SIG_TARGET_ABORT)
printk(KERN_ERR "%s: PCI target abort.\n", netdev_err(dev, "PCI target abort\n");
dev->name);
if (cfg & PCI_STATUS_REC_TARGET_ABORT) if (cfg & PCI_STATUS_REC_TARGET_ABORT)
printk(KERN_ERR "%s: PCI master acks target abort.\n", netdev_err(dev, "PCI master acks target abort\n");
dev->name);
if (cfg & PCI_STATUS_REC_MASTER_ABORT) if (cfg & PCI_STATUS_REC_MASTER_ABORT)
printk(KERN_ERR "%s: PCI master abort.\n", dev->name); netdev_err(dev, "PCI master abort\n");
if (cfg & PCI_STATUS_SIG_SYSTEM_ERROR) if (cfg & PCI_STATUS_SIG_SYSTEM_ERROR)
printk(KERN_ERR "%s: PCI system error SERR#.\n", netdev_err(dev, "PCI system error SERR#\n");
dev->name);
if (cfg & PCI_STATUS_DETECTED_PARITY) if (cfg & PCI_STATUS_DETECTED_PARITY)
printk(KERN_ERR "%s: PCI parity error.\n", netdev_err(dev, "PCI parity error\n");
dev->name);
/* Write the error bits back to clear them. */ /* Write the error bits back to clear them. */
cfg &= (PCI_STATUS_PARITY | cfg &= (PCI_STATUS_PARITY |
...@@ -1806,9 +1779,8 @@ static int cas_abnormal_irq(struct net_device *dev, struct cas *cp, ...@@ -1806,9 +1779,8 @@ static int cas_abnormal_irq(struct net_device *dev, struct cas *cp,
{ {
if (status & INTR_RX_TAG_ERROR) { if (status & INTR_RX_TAG_ERROR) {
/* corrupt RX tag framing */ /* corrupt RX tag framing */
if (netif_msg_rx_err(cp)) netif_printk(cp, rx_err, KERN_DEBUG, cp->dev,
printk(KERN_DEBUG "%s: corrupt rx tag framing\n", "corrupt rx tag framing\n");
cp->dev->name);
spin_lock(&cp->stat_lock[0]); spin_lock(&cp->stat_lock[0]);
cp->net_stats[0].rx_errors++; cp->net_stats[0].rx_errors++;
spin_unlock(&cp->stat_lock[0]); spin_unlock(&cp->stat_lock[0]);
...@@ -1817,9 +1789,8 @@ static int cas_abnormal_irq(struct net_device *dev, struct cas *cp, ...@@ -1817,9 +1789,8 @@ static int cas_abnormal_irq(struct net_device *dev, struct cas *cp,
if (status & INTR_RX_LEN_MISMATCH) { if (status & INTR_RX_LEN_MISMATCH) {
/* length mismatch. */ /* length mismatch. */
if (netif_msg_rx_err(cp)) netif_printk(cp, rx_err, KERN_DEBUG, cp->dev,
printk(KERN_DEBUG "%s: length mismatch for rx frame\n", "length mismatch for rx frame\n");
cp->dev->name);
spin_lock(&cp->stat_lock[0]); spin_lock(&cp->stat_lock[0]);
cp->net_stats[0].rx_errors++; cp->net_stats[0].rx_errors++;
spin_unlock(&cp->stat_lock[0]); spin_unlock(&cp->stat_lock[0]);
...@@ -1861,12 +1832,11 @@ static int cas_abnormal_irq(struct net_device *dev, struct cas *cp, ...@@ -1861,12 +1832,11 @@ static int cas_abnormal_irq(struct net_device *dev, struct cas *cp,
#if 1 #if 1
atomic_inc(&cp->reset_task_pending); atomic_inc(&cp->reset_task_pending);
atomic_inc(&cp->reset_task_pending_all); atomic_inc(&cp->reset_task_pending_all);
printk(KERN_ERR "%s:reset called in cas_abnormal_irq [0x%x]\n", netdev_err(dev, "reset called in cas_abnormal_irq [0x%x]\n", status);
dev->name, status);
schedule_work(&cp->reset_task); schedule_work(&cp->reset_task);
#else #else
atomic_set(&cp->reset_task_pending, CAS_RESET_ALL); atomic_set(&cp->reset_task_pending, CAS_RESET_ALL);
printk(KERN_ERR "reset called in cas_abnormal_irq\n"); netdev_err(dev, "reset called in cas_abnormal_irq\n");
schedule_work(&cp->reset_task); schedule_work(&cp->reset_task);
#endif #endif
return 1; return 1;
...@@ -1920,9 +1890,8 @@ static inline void cas_tx_ringN(struct cas *cp, int ring, int limit) ...@@ -1920,9 +1890,8 @@ static inline void cas_tx_ringN(struct cas *cp, int ring, int limit)
if (count < 0) if (count < 0)
break; break;
if (netif_msg_tx_done(cp)) netif_printk(cp, tx_done, KERN_DEBUG, cp->dev,
printk(KERN_DEBUG "%s: tx[%d] done, slot %d\n", "tx[%d] done, slot %d\n", ring, entry);
cp->dev->name, ring, entry);
skbs[entry] = NULL; skbs[entry] = NULL;
cp->tx_tiny_use[ring][entry].nbufs = 0; cp->tx_tiny_use[ring][entry].nbufs = 0;
...@@ -1969,9 +1938,9 @@ static void cas_tx(struct net_device *dev, struct cas *cp, ...@@ -1969,9 +1938,9 @@ static void cas_tx(struct net_device *dev, struct cas *cp,
#ifdef USE_TX_COMPWB #ifdef USE_TX_COMPWB
u64 compwb = le64_to_cpu(cp->init_block->tx_compwb); u64 compwb = le64_to_cpu(cp->init_block->tx_compwb);
#endif #endif
if (netif_msg_intr(cp)) netif_printk(cp, intr, KERN_DEBUG, cp->dev,
printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %llx\n", "tx interrupt, status: 0x%x, %llx\n",
cp->dev->name, status, (unsigned long long)compwb); status, (unsigned long long)compwb);
/* process all the rings */ /* process all the rings */
for (ring = 0; ring < N_TX_RINGS; ring++) { for (ring = 0; ring < N_TX_RINGS; ring++) {
#ifdef USE_TX_COMPWB #ifdef USE_TX_COMPWB
...@@ -2050,10 +2019,8 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc, ...@@ -2050,10 +2019,8 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc,
hlen = min(cp->page_size - off, dlen); hlen = min(cp->page_size - off, dlen);
if (hlen < 0) { if (hlen < 0) {
if (netif_msg_rx_err(cp)) { netif_printk(cp, rx_err, KERN_DEBUG, cp->dev,
printk(KERN_DEBUG "%s: rx page overflow: " "rx page overflow: %d\n", hlen);
"%d\n", cp->dev->name, hlen);
}
dev_kfree_skb_irq(skb); dev_kfree_skb_irq(skb);
return -1; return -1;
} }
...@@ -2130,10 +2097,8 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc, ...@@ -2130,10 +2097,8 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc,
off = CAS_VAL(RX_COMP1_DATA_OFF, words[0]) + swivel; off = CAS_VAL(RX_COMP1_DATA_OFF, words[0]) + swivel;
hlen = min(cp->page_size - off, dlen); hlen = min(cp->page_size - off, dlen);
if (hlen < 0) { if (hlen < 0) {
if (netif_msg_rx_err(cp)) { netif_printk(cp, rx_err, KERN_DEBUG, cp->dev,
printk(KERN_DEBUG "%s: rx page overflow: " "rx page overflow: %d\n", hlen);
"%d\n", cp->dev->name, hlen);
}
dev_kfree_skb_irq(skb); dev_kfree_skb_irq(skb);
return -1; return -1;
} }
...@@ -2265,9 +2230,8 @@ static int cas_post_rxds_ringN(struct cas *cp, int ring, int num) ...@@ -2265,9 +2230,8 @@ static int cas_post_rxds_ringN(struct cas *cp, int ring, int num)
entry = cp->rx_old[ring]; entry = cp->rx_old[ring];
if (netif_msg_intr(cp)) netif_printk(cp, intr, KERN_DEBUG, cp->dev,
printk(KERN_DEBUG "%s: rxd[%d] interrupt, done: %d\n", "rxd[%d] interrupt, done: %d\n", ring, entry);
cp->dev->name, ring, entry);
cluster = -1; cluster = -1;
count = entry & 0x3; count = entry & 0x3;
...@@ -2337,11 +2301,10 @@ static int cas_rx_ringN(struct cas *cp, int ring, int budget) ...@@ -2337,11 +2301,10 @@ static int cas_rx_ringN(struct cas *cp, int ring, int budget)
int entry, drops; int entry, drops;
int npackets = 0; int npackets = 0;
if (netif_msg_intr(cp)) netif_printk(cp, intr, KERN_DEBUG, cp->dev,
printk(KERN_DEBUG "%s: rx[%d] interrupt, done: %d/%d\n", "rx[%d] interrupt, done: %d/%d\n",
cp->dev->name, ring, ring,
readl(cp->regs + REG_RX_COMP_HEAD), readl(cp->regs + REG_RX_COMP_HEAD), cp->rx_new[ring]);
cp->rx_new[ring]);
entry = cp->rx_new[ring]; entry = cp->rx_new[ring];
drops = 0; drops = 0;
...@@ -2442,8 +2405,7 @@ static int cas_rx_ringN(struct cas *cp, int ring, int budget) ...@@ -2442,8 +2405,7 @@ static int cas_rx_ringN(struct cas *cp, int ring, int budget)
cp->rx_new[ring] = entry; cp->rx_new[ring] = entry;
if (drops) if (drops)
printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n", netdev_info(cp->dev, "Memory squeeze, deferring packet\n");
cp->dev->name);
return npackets; return npackets;
} }
...@@ -2457,10 +2419,9 @@ static void cas_post_rxcs_ringN(struct net_device *dev, ...@@ -2457,10 +2419,9 @@ static void cas_post_rxcs_ringN(struct net_device *dev,
last = cp->rx_cur[ring]; last = cp->rx_cur[ring];
entry = cp->rx_new[ring]; entry = cp->rx_new[ring];
if (netif_msg_intr(cp)) netif_printk(cp, intr, KERN_DEBUG, dev,
printk(KERN_DEBUG "%s: rxc[%d] interrupt, done: %d/%d\n", "rxc[%d] interrupt, done: %d/%d\n",
dev->name, ring, readl(cp->regs + REG_RX_COMP_HEAD), ring, readl(cp->regs + REG_RX_COMP_HEAD), entry);
entry);
/* zero and re-mark descriptors */ /* zero and re-mark descriptors */
while (last != entry) { while (last != entry) {
...@@ -2729,21 +2690,19 @@ static void cas_tx_timeout(struct net_device *dev) ...@@ -2729,21 +2690,19 @@ static void cas_tx_timeout(struct net_device *dev)
{ {
struct cas *cp = netdev_priv(dev); struct cas *cp = netdev_priv(dev);
printk(KERN_ERR "%s: transmit timed out, resetting\n", dev->name); netdev_err(dev, "transmit timed out, resetting\n");
if (!cp->hw_running) { if (!cp->hw_running) {
printk("%s: hrm.. hw not running!\n", dev->name); netdev_err(dev, "hrm.. hw not running!\n");
return; return;
} }
printk(KERN_ERR "%s: MIF_STATE[%08x]\n", netdev_err(dev, "MIF_STATE[%08x]\n",
dev->name, readl(cp->regs + REG_MIF_STATE_MACHINE)); readl(cp->regs + REG_MIF_STATE_MACHINE));
printk(KERN_ERR "%s: MAC_STATE[%08x]\n", netdev_err(dev, "MAC_STATE[%08x]\n",
dev->name, readl(cp->regs + REG_MAC_STATE_MACHINE)); readl(cp->regs + REG_MAC_STATE_MACHINE));
printk(KERN_ERR "%s: TX_STATE[%08x:%08x:%08x] " netdev_err(dev, "TX_STATE[%08x:%08x:%08x] FIFO[%08x:%08x:%08x] SM1[%08x] SM2[%08x]\n",
"FIFO[%08x:%08x:%08x] SM1[%08x] SM2[%08x]\n",
dev->name,
readl(cp->regs + REG_TX_CFG), readl(cp->regs + REG_TX_CFG),
readl(cp->regs + REG_MAC_TX_STATUS), readl(cp->regs + REG_MAC_TX_STATUS),
readl(cp->regs + REG_MAC_TX_CFG), readl(cp->regs + REG_MAC_TX_CFG),
...@@ -2753,14 +2712,12 @@ static void cas_tx_timeout(struct net_device *dev) ...@@ -2753,14 +2712,12 @@ static void cas_tx_timeout(struct net_device *dev)
readl(cp->regs + REG_TX_SM_1), readl(cp->regs + REG_TX_SM_1),
readl(cp->regs + REG_TX_SM_2)); readl(cp->regs + REG_TX_SM_2));
printk(KERN_ERR "%s: RX_STATE[%08x:%08x:%08x]\n", netdev_err(dev, "RX_STATE[%08x:%08x:%08x]\n",
dev->name,
readl(cp->regs + REG_RX_CFG), readl(cp->regs + REG_RX_CFG),
readl(cp->regs + REG_MAC_RX_STATUS), readl(cp->regs + REG_MAC_RX_STATUS),
readl(cp->regs + REG_MAC_RX_CFG)); readl(cp->regs + REG_MAC_RX_CFG));
printk(KERN_ERR "%s: HP_STATE[%08x:%08x:%08x:%08x]\n", netdev_err(dev, "HP_STATE[%08x:%08x:%08x:%08x]\n",
dev->name,
readl(cp->regs + REG_HP_STATE_MACHINE), readl(cp->regs + REG_HP_STATE_MACHINE),
readl(cp->regs + REG_HP_STATUS0), readl(cp->regs + REG_HP_STATUS0),
readl(cp->regs + REG_HP_STATUS1), readl(cp->regs + REG_HP_STATUS1),
...@@ -2830,8 +2787,7 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring, ...@@ -2830,8 +2787,7 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring,
CAS_TABORT(cp)*(skb_shinfo(skb)->nr_frags + 1)) { CAS_TABORT(cp)*(skb_shinfo(skb)->nr_frags + 1)) {
netif_stop_queue(dev); netif_stop_queue(dev);
spin_unlock_irqrestore(&cp->tx_lock[ring], flags); spin_unlock_irqrestore(&cp->tx_lock[ring], flags);
printk(KERN_ERR PFX "%s: BUG! Tx Ring full when " netdev_err(dev, "BUG! Tx Ring full when queue awake!\n");
"queue awake!\n", dev->name);
return 1; return 1;
} }
...@@ -2908,11 +2864,9 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring, ...@@ -2908,11 +2864,9 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring,
if (TX_BUFFS_AVAIL(cp, ring) <= CAS_TABORT(cp)*(MAX_SKB_FRAGS + 1)) if (TX_BUFFS_AVAIL(cp, ring) <= CAS_TABORT(cp)*(MAX_SKB_FRAGS + 1))
netif_stop_queue(dev); netif_stop_queue(dev);
if (netif_msg_tx_queued(cp)) netif_printk(cp, tx_queued, KERN_DEBUG, dev,
printk(KERN_DEBUG "%s: tx[%d] queued, slot %d, skblen %d, " "tx[%d] queued, slot %d, skblen %d, avail %d\n",
"avail %d\n", ring, entry, skb->len, TX_BUFFS_AVAIL(cp, ring));
dev->name, ring, entry, skb->len,
TX_BUFFS_AVAIL(cp, ring));
writel(entry, cp->regs + REG_TX_KICKN(ring)); writel(entry, cp->regs + REG_TX_KICKN(ring));
spin_unlock_irqrestore(&cp->tx_lock[ring], flags); spin_unlock_irqrestore(&cp->tx_lock[ring], flags);
return 0; return 0;
...@@ -3098,8 +3052,8 @@ static void cas_mac_reset(struct cas *cp) ...@@ -3098,8 +3052,8 @@ static void cas_mac_reset(struct cas *cp)
if (readl(cp->regs + REG_MAC_TX_RESET) | if (readl(cp->regs + REG_MAC_TX_RESET) |
readl(cp->regs + REG_MAC_RX_RESET)) readl(cp->regs + REG_MAC_RX_RESET))
printk(KERN_ERR "%s: mac tx[%d]/rx[%d] reset failed [%08x]\n", netdev_err(cp->dev, "mac tx[%d]/rx[%d] reset failed [%08x]\n",
cp->dev->name, readl(cp->regs + REG_MAC_TX_RESET), readl(cp->regs + REG_MAC_TX_RESET),
readl(cp->regs + REG_MAC_RX_RESET), readl(cp->regs + REG_MAC_RX_RESET),
readl(cp->regs + REG_MAC_STATE_MACHINE)); readl(cp->regs + REG_MAC_STATE_MACHINE));
} }
...@@ -3421,7 +3375,7 @@ static int cas_get_vpd_info(struct cas *cp, unsigned char *dev_addr, ...@@ -3421,7 +3375,7 @@ static int cas_get_vpd_info(struct cas *cp, unsigned char *dev_addr,
goto done; goto done;
/* Sun MAC prefix then 3 random bytes. */ /* Sun MAC prefix then 3 random bytes. */
printk(PFX "MAC address not found in ROM VPD\n"); pr_info("MAC address not found in ROM VPD\n");
dev_addr[0] = 0x08; dev_addr[0] = 0x08;
dev_addr[1] = 0x00; dev_addr[1] = 0x00;
dev_addr[2] = 0x20; dev_addr[2] = 0x20;
...@@ -3482,7 +3436,7 @@ static int cas_check_invariants(struct cas *cp) ...@@ -3482,7 +3436,7 @@ static int cas_check_invariants(struct cas *cp)
__free_pages(page, CAS_JUMBO_PAGE_SHIFT - PAGE_SHIFT); __free_pages(page, CAS_JUMBO_PAGE_SHIFT - PAGE_SHIFT);
cp->page_order = CAS_JUMBO_PAGE_SHIFT - PAGE_SHIFT; cp->page_order = CAS_JUMBO_PAGE_SHIFT - PAGE_SHIFT;
} else { } else {
printk(PFX "MTU limited to %d bytes\n", CAS_MAX_MTU); printk("MTU limited to %d bytes\n", CAS_MAX_MTU);
} }
} }
#endif #endif
...@@ -3527,7 +3481,7 @@ static int cas_check_invariants(struct cas *cp) ...@@ -3527,7 +3481,7 @@ static int cas_check_invariants(struct cas *cp)
} }
} }
} }
printk(KERN_ERR PFX "MII phy did not respond [%08x]\n", pr_err("MII phy did not respond [%08x]\n",
readl(cp->regs + REG_MIF_STATE_MACHINE)); readl(cp->regs + REG_MIF_STATE_MACHINE));
return -1; return -1;
...@@ -3572,9 +3526,8 @@ static inline void cas_start_dma(struct cas *cp) ...@@ -3572,9 +3526,8 @@ static inline void cas_start_dma(struct cas *cp)
val = readl(cp->regs + REG_MAC_RX_CFG); val = readl(cp->regs + REG_MAC_RX_CFG);
if ((val & MAC_RX_CFG_EN)) { if ((val & MAC_RX_CFG_EN)) {
if (txfailed) { if (txfailed) {
printk(KERN_ERR netdev_err(cp->dev,
"%s: enabling mac failed [tx:%08x:%08x].\n", "enabling mac failed [tx:%08x:%08x]\n",
cp->dev->name,
readl(cp->regs + REG_MIF_STATE_MACHINE), readl(cp->regs + REG_MIF_STATE_MACHINE),
readl(cp->regs + REG_MAC_STATE_MACHINE)); readl(cp->regs + REG_MAC_STATE_MACHINE));
} }
...@@ -3582,9 +3535,8 @@ static inline void cas_start_dma(struct cas *cp) ...@@ -3582,9 +3535,8 @@ static inline void cas_start_dma(struct cas *cp)
} }
udelay(10); udelay(10);
} }
printk(KERN_ERR "%s: enabling mac failed [%s:%08x:%08x].\n", netdev_err(cp->dev, "enabling mac failed [%s:%08x:%08x]\n",
cp->dev->name, (txfailed ? "tx,rx" : "rx"),
(txfailed? "tx,rx":"rx"),
readl(cp->regs + REG_MIF_STATE_MACHINE), readl(cp->regs + REG_MIF_STATE_MACHINE),
readl(cp->regs + REG_MAC_STATE_MACHINE)); readl(cp->regs + REG_MAC_STATE_MACHINE));
...@@ -3688,9 +3640,8 @@ static void cas_set_link_modes(struct cas *cp) ...@@ -3688,9 +3640,8 @@ static void cas_set_link_modes(struct cas *cp)
} }
} }
if (netif_msg_link(cp)) netif_info(cp, link, cp->dev, "Link up at %d Mbps, %s-duplex\n",
printk(KERN_INFO "%s: Link up at %d Mbps, %s-duplex.\n", speed, full_duplex ? "full" : "half");
cp->dev->name, speed, (full_duplex ? "full" : "half"));
val = MAC_XIF_TX_MII_OUTPUT_EN | MAC_XIF_LINK_LED; val = MAC_XIF_TX_MII_OUTPUT_EN | MAC_XIF_LINK_LED;
if (CAS_PHY_MII(cp->phy_type)) { if (CAS_PHY_MII(cp->phy_type)) {
...@@ -3760,18 +3711,14 @@ static void cas_set_link_modes(struct cas *cp) ...@@ -3760,18 +3711,14 @@ static void cas_set_link_modes(struct cas *cp)
if (netif_msg_link(cp)) { if (netif_msg_link(cp)) {
if (pause & 0x01) { if (pause & 0x01) {
printk(KERN_INFO "%s: Pause is enabled " netdev_info(cp->dev, "Pause is enabled (rxfifo: %d off: %d on: %d)\n",
"(rxfifo: %d off: %d on: %d)\n",
cp->dev->name,
cp->rx_fifo_size, cp->rx_fifo_size,
cp->rx_pause_off, cp->rx_pause_off,
cp->rx_pause_on); cp->rx_pause_on);
} else if (pause & 0x10) { } else if (pause & 0x10) {
printk(KERN_INFO "%s: TX pause enabled\n", netdev_info(cp->dev, "TX pause enabled\n");
cp->dev->name);
} else { } else {
printk(KERN_INFO "%s: Pause is disabled\n", netdev_info(cp->dev, "Pause is disabled\n");
cp->dev->name);
} }
} }
...@@ -3847,7 +3794,7 @@ static void cas_global_reset(struct cas *cp, int blkflag) ...@@ -3847,7 +3794,7 @@ static void cas_global_reset(struct cas *cp, int blkflag)
goto done; goto done;
udelay(10); udelay(10);
} }
printk(KERN_ERR "%s: sw reset failed.\n", cp->dev->name); netdev_err(cp->dev, "sw reset failed\n");
done: done:
/* enable various BIM interrupts */ /* enable various BIM interrupts */
...@@ -3953,7 +3900,7 @@ static int cas_change_mtu(struct net_device *dev, int new_mtu) ...@@ -3953,7 +3900,7 @@ static int cas_change_mtu(struct net_device *dev, int new_mtu)
#else #else
atomic_set(&cp->reset_task_pending, (cp->phy_type & CAS_PHY_SERDES) ? atomic_set(&cp->reset_task_pending, (cp->phy_type & CAS_PHY_SERDES) ?
CAS_RESET_ALL : CAS_RESET_MTU); CAS_RESET_ALL : CAS_RESET_MTU);
printk(KERN_ERR "reset called in cas_change_mtu\n"); pr_err("reset called in cas_change_mtu\n");
schedule_work(&cp->reset_task); schedule_work(&cp->reset_task);
#endif #endif
...@@ -4235,10 +4182,8 @@ static void cas_link_timer(unsigned long data) ...@@ -4235,10 +4182,8 @@ static void cas_link_timer(unsigned long data)
if (((tlm == 0x5) || (tlm == 0x3)) && if (((tlm == 0x5) || (tlm == 0x3)) &&
(CAS_VAL(MAC_SM_ENCAP_SM, val) == 0)) { (CAS_VAL(MAC_SM_ENCAP_SM, val) == 0)) {
if (netif_msg_tx_err(cp)) netif_printk(cp, tx_err, KERN_DEBUG, cp->dev,
printk(KERN_DEBUG "%s: tx err: " "tx err: MAC_STATE[%08x]\n", val);
"MAC_STATE[%08x]\n",
cp->dev->name, val);
reset = 1; reset = 1;
goto done; goto done;
} }
...@@ -4247,10 +4192,9 @@ static void cas_link_timer(unsigned long data) ...@@ -4247,10 +4192,9 @@ static void cas_link_timer(unsigned long data)
wptr = readl(cp->regs + REG_TX_FIFO_WRITE_PTR); wptr = readl(cp->regs + REG_TX_FIFO_WRITE_PTR);
rptr = readl(cp->regs + REG_TX_FIFO_READ_PTR); rptr = readl(cp->regs + REG_TX_FIFO_READ_PTR);
if ((val == 0) && (wptr != rptr)) { if ((val == 0) && (wptr != rptr)) {
if (netif_msg_tx_err(cp)) netif_printk(cp, tx_err, KERN_DEBUG, cp->dev,
printk(KERN_DEBUG "%s: tx err: " "tx err: TX_FIFO[%08x:%08x:%08x]\n",
"TX_FIFO[%08x:%08x:%08x]\n", val, wptr, rptr);
cp->dev->name, val, wptr, rptr);
reset = 1; reset = 1;
} }
...@@ -4266,7 +4210,7 @@ static void cas_link_timer(unsigned long data) ...@@ -4266,7 +4210,7 @@ static void cas_link_timer(unsigned long data)
schedule_work(&cp->reset_task); schedule_work(&cp->reset_task);
#else #else
atomic_set(&cp->reset_task_pending, CAS_RESET_ALL); atomic_set(&cp->reset_task_pending, CAS_RESET_ALL);
printk(KERN_ERR "reset called in cas_link_timer\n"); pr_err("reset called in cas_link_timer\n");
schedule_work(&cp->reset_task); schedule_work(&cp->reset_task);
#endif #endif
} }
...@@ -4359,8 +4303,7 @@ static int cas_open(struct net_device *dev) ...@@ -4359,8 +4303,7 @@ static int cas_open(struct net_device *dev)
*/ */
if (request_irq(cp->pdev->irq, cas_interrupt, if (request_irq(cp->pdev->irq, cas_interrupt,
IRQF_SHARED, dev->name, (void *) dev)) { IRQF_SHARED, dev->name, (void *) dev)) {
printk(KERN_ERR "%s: failed to request irq !\n", netdev_err(cp->dev, "failed to request irq !\n");
cp->dev->name);
err = -EAGAIN; err = -EAGAIN;
goto err_spare; goto err_spare;
} }
...@@ -5000,24 +4943,24 @@ static int __devinit cas_init_one(struct pci_dev *pdev, ...@@ -5000,24 +4943,24 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
u8 orig_cacheline_size = 0, cas_cacheline_size = 0; u8 orig_cacheline_size = 0, cas_cacheline_size = 0;
if (cas_version_printed++ == 0) if (cas_version_printed++ == 0)
printk(KERN_INFO "%s", version); pr_info("%s", version);
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) { if (err) {
dev_err(&pdev->dev, "Cannot enable PCI device, aborting.\n"); dev_err(&pdev->dev, "Cannot enable PCI device, aborting\n");
return err; return err;
} }
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
dev_err(&pdev->dev, "Cannot find proper PCI device " dev_err(&pdev->dev, "Cannot find proper PCI device "
"base address, aborting.\n"); "base address, aborting\n");
err = -ENODEV; err = -ENODEV;
goto err_out_disable_pdev; goto err_out_disable_pdev;
} }
dev = alloc_etherdev(sizeof(*cp)); dev = alloc_etherdev(sizeof(*cp));
if (!dev) { if (!dev) {
dev_err(&pdev->dev, "Etherdev alloc failed, aborting.\n"); dev_err(&pdev->dev, "Etherdev alloc failed, aborting\n");
err = -ENOMEM; err = -ENOMEM;
goto err_out_disable_pdev; goto err_out_disable_pdev;
} }
...@@ -5025,7 +4968,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev, ...@@ -5025,7 +4968,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
err = pci_request_regions(pdev, dev->name); err = pci_request_regions(pdev, dev->name);
if (err) { if (err) {
dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting.\n"); dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting\n");
goto err_out_free_netdev; goto err_out_free_netdev;
} }
pci_set_master(pdev); pci_set_master(pdev);
...@@ -5039,8 +4982,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev, ...@@ -5039,8 +4982,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
pci_cmd |= PCI_COMMAND_PARITY; pci_cmd |= PCI_COMMAND_PARITY;
pci_write_config_word(pdev, PCI_COMMAND, pci_cmd); pci_write_config_word(pdev, PCI_COMMAND, pci_cmd);
if (pci_try_set_mwi(pdev)) if (pci_try_set_mwi(pdev))
printk(KERN_WARNING PFX "Could not enable MWI for %s\n", pr_warning("Could not enable MWI for %s\n", pci_name(pdev));
pci_name(pdev));
cas_program_bridge(pdev); cas_program_bridge(pdev);
...@@ -5083,7 +5025,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev, ...@@ -5083,7 +5025,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
if (err) { if (err) {
dev_err(&pdev->dev, "No usable DMA configuration, " dev_err(&pdev->dev, "No usable DMA configuration, "
"aborting.\n"); "aborting\n");
goto err_out_free_res; goto err_out_free_res;
} }
pci_using_dac = 0; pci_using_dac = 0;
...@@ -5142,7 +5084,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev, ...@@ -5142,7 +5084,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
/* give us access to cassini registers */ /* give us access to cassini registers */
cp->regs = pci_iomap(pdev, 0, casreg_len); cp->regs = pci_iomap(pdev, 0, casreg_len);
if (!cp->regs) { if (!cp->regs) {
dev_err(&pdev->dev, "Cannot map device registers, aborting.\n"); dev_err(&pdev->dev, "Cannot map device registers, aborting\n");
goto err_out_free_res; goto err_out_free_res;
} }
cp->casreg_len = casreg_len; cp->casreg_len = casreg_len;
...@@ -5161,7 +5103,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev, ...@@ -5161,7 +5103,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
pci_alloc_consistent(pdev, sizeof(struct cas_init_block), pci_alloc_consistent(pdev, sizeof(struct cas_init_block),
&cp->block_dvma); &cp->block_dvma);
if (!cp->init_block) { if (!cp->init_block) {
dev_err(&pdev->dev, "Cannot allocate init block, aborting.\n"); dev_err(&pdev->dev, "Cannot allocate init block, aborting\n");
goto err_out_iounmap; goto err_out_iounmap;
} }
...@@ -5195,13 +5137,12 @@ static int __devinit cas_init_one(struct pci_dev *pdev, ...@@ -5195,13 +5137,12 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
dev->features |= NETIF_F_HIGHDMA; dev->features |= NETIF_F_HIGHDMA;
if (register_netdev(dev)) { if (register_netdev(dev)) {
dev_err(&pdev->dev, "Cannot register net device, aborting.\n"); dev_err(&pdev->dev, "Cannot register net device, aborting\n");
goto err_out_free_consistent; goto err_out_free_consistent;
} }
i = readl(cp->regs + REG_BIM_CFG); i = readl(cp->regs + REG_BIM_CFG);
printk(KERN_INFO "%s: Sun Cassini%s (%sbit/%sMHz PCI/%s) " netdev_info(dev, "Sun Cassini%s (%sbit/%sMHz PCI/%s) Ethernet[%d] %pM\n",
"Ethernet[%d] %pM\n", dev->name,
(cp->cas_flags & CAS_FLAG_REG_PLUS) ? "+" : "", (cp->cas_flags & CAS_FLAG_REG_PLUS) ? "+" : "",
(i & BIM_CFG_32BIT) ? "32" : "64", (i & BIM_CFG_32BIT) ? "32" : "64",
(i & BIM_CFG_66MHZ) ? "66" : "33", (i & BIM_CFG_66MHZ) ? "66" : "33",
...@@ -5320,7 +5261,7 @@ static int cas_resume(struct pci_dev *pdev) ...@@ -5320,7 +5261,7 @@ static int cas_resume(struct pci_dev *pdev)
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
struct cas *cp = netdev_priv(dev); struct cas *cp = netdev_priv(dev);
printk(KERN_INFO "%s: resuming\n", dev->name); netdev_info(dev, "resuming\n");
mutex_lock(&cp->pm_mutex); mutex_lock(&cp->pm_mutex);
cas_hard_reset(cp); cas_hard_reset(cp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment