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

drivers/net/chelsio: Use pr_<level>, netif_msg_<type>

Convert CH_<level> and CH_DBG uses to pr_<level> and netif equivalents
Remove CH_<level> and CH_DBG macro definitions
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 003bdb27
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
* * * *
****************************************************************************/ ****************************************************************************/
#define pr_fmt(fmt) "cxgb: " fmt
#ifndef _CXGB_COMMON_H_ #ifndef _CXGB_COMMON_H_
#define _CXGB_COMMON_H_ #define _CXGB_COMMON_H_
...@@ -55,28 +57,6 @@ ...@@ -55,28 +57,6 @@
#define DRV_DESCRIPTION "Chelsio 10Gb Ethernet Driver" #define DRV_DESCRIPTION "Chelsio 10Gb Ethernet Driver"
#define DRV_NAME "cxgb" #define DRV_NAME "cxgb"
#define DRV_VERSION "2.2" #define DRV_VERSION "2.2"
#define PFX DRV_NAME ": "
#define CH_ERR(fmt, ...) printk(KERN_ERR PFX fmt, ## __VA_ARGS__)
#define CH_WARN(fmt, ...) printk(KERN_WARNING PFX fmt, ## __VA_ARGS__)
#define CH_ALERT(fmt, ...) printk(KERN_ALERT PFX fmt, ## __VA_ARGS__)
/*
* More powerful macro that selectively prints messages based on msg_enable.
* For info and debugging messages.
*/
#define CH_MSG(adapter, level, category, fmt, ...) do { \
if ((adapter)->msg_enable & NETIF_MSG_##category) \
printk(KERN_##level PFX "%s: " fmt, (adapter)->name, \
## __VA_ARGS__); \
} while (0)
#ifdef DEBUG
# define CH_DBG(adapter, category, fmt, ...) \
CH_MSG(adapter, DEBUG, category, fmt, ## __VA_ARGS__)
#else
# define CH_DBG(fmt, ...)
#endif
#define CH_DEVICE(devid, ssid, idx) \ #define CH_DEVICE(devid, ssid, idx) \
{ PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, ssid, 0, 0, idx } { PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, ssid, 0, 0, idx }
......
...@@ -974,7 +974,7 @@ void t1_fatal_err(struct adapter *adapter) ...@@ -974,7 +974,7 @@ void t1_fatal_err(struct adapter *adapter)
t1_sge_stop(adapter->sge); t1_sge_stop(adapter->sge);
t1_interrupts_disable(adapter); t1_interrupts_disable(adapter);
} }
CH_ALERT("%s: encountered fatal error, operation suspended\n", pr_alert("%s: encountered fatal error, operation suspended\n",
adapter->name); adapter->name);
} }
...@@ -1018,7 +1018,7 @@ static int __devinit init_one(struct pci_dev *pdev, ...@@ -1018,7 +1018,7 @@ static int __devinit init_one(struct pci_dev *pdev,
return err; return err;
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
CH_ERR("%s: cannot find PCI device memory base address\n", pr_err("%s: cannot find PCI device memory base address\n",
pci_name(pdev)); pci_name(pdev));
err = -ENODEV; err = -ENODEV;
goto out_disable_pdev; goto out_disable_pdev;
...@@ -1028,20 +1028,20 @@ static int __devinit init_one(struct pci_dev *pdev, ...@@ -1028,20 +1028,20 @@ static int __devinit init_one(struct pci_dev *pdev,
pci_using_dac = 1; pci_using_dac = 1;
if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) { if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
CH_ERR("%s: unable to obtain 64-bit DMA for " pr_err("%s: unable to obtain 64-bit DMA for "
"consistent allocations\n", pci_name(pdev)); "consistent allocations\n", pci_name(pdev));
err = -ENODEV; err = -ENODEV;
goto out_disable_pdev; goto out_disable_pdev;
} }
} else if ((err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) != 0) { } else if ((err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) != 0) {
CH_ERR("%s: no usable DMA configuration\n", pci_name(pdev)); pr_err("%s: no usable DMA configuration\n", pci_name(pdev));
goto out_disable_pdev; goto out_disable_pdev;
} }
err = pci_request_regions(pdev, DRV_NAME); err = pci_request_regions(pdev, DRV_NAME);
if (err) { if (err) {
CH_ERR("%s: cannot obtain PCI resources\n", pci_name(pdev)); pr_err("%s: cannot obtain PCI resources\n", pci_name(pdev));
goto out_disable_pdev; goto out_disable_pdev;
} }
...@@ -1069,7 +1069,7 @@ static int __devinit init_one(struct pci_dev *pdev, ...@@ -1069,7 +1069,7 @@ static int __devinit init_one(struct pci_dev *pdev,
adapter->regs = ioremap(mmio_start, mmio_len); adapter->regs = ioremap(mmio_start, mmio_len);
if (!adapter->regs) { if (!adapter->regs) {
CH_ERR("%s: cannot map device registers\n", pr_err("%s: cannot map device registers\n",
pci_name(pdev)); pci_name(pdev));
err = -ENOMEM; err = -ENOMEM;
goto out_free_dev; goto out_free_dev;
...@@ -1148,8 +1148,8 @@ static int __devinit init_one(struct pci_dev *pdev, ...@@ -1148,8 +1148,8 @@ static int __devinit init_one(struct pci_dev *pdev,
for (i = 0; i < bi->port_number; ++i) { for (i = 0; i < bi->port_number; ++i) {
err = register_netdev(adapter->port[i].dev); err = register_netdev(adapter->port[i].dev);
if (err) if (err)
CH_WARN("%s: cannot register net device %s, skipping\n", pr_warning("%s: cannot register net device %s, skipping\n",
pci_name(pdev), adapter->port[i].dev->name); pci_name(pdev), adapter->port[i].dev->name);
else { else {
/* /*
* Change the name we use for messages to the name of * Change the name we use for messages to the name of
...@@ -1162,7 +1162,7 @@ static int __devinit init_one(struct pci_dev *pdev, ...@@ -1162,7 +1162,7 @@ static int __devinit init_one(struct pci_dev *pdev,
} }
} }
if (!adapter->registered_device_map) { if (!adapter->registered_device_map) {
CH_ERR("%s: could not register any net devices\n", pr_err("%s: could not register any net devices\n",
pci_name(pdev)); pci_name(pdev));
goto out_release_adapter_res; goto out_release_adapter_res;
} }
......
...@@ -76,7 +76,7 @@ static int tricn_write(adapter_t *adapter, int bundle_addr, int module_addr, ...@@ -76,7 +76,7 @@ static int tricn_write(adapter_t *adapter, int bundle_addr, int module_addr,
} while (busy && --attempts); } while (busy && --attempts);
if (busy) if (busy)
CH_ERR("%s: TRICN write timed out\n", adapter->name); pr_err("%s: TRICN write timed out\n", adapter->name);
return busy; return busy;
} }
...@@ -86,7 +86,7 @@ static int tricn_init(adapter_t *adapter) ...@@ -86,7 +86,7 @@ static int tricn_init(adapter_t *adapter)
int i, sme = 1; int i, sme = 1;
if (!(readl(adapter->regs + A_ESPI_RX_RESET) & F_RX_CLK_STATUS)) { if (!(readl(adapter->regs + A_ESPI_RX_RESET) & F_RX_CLK_STATUS)) {
CH_ERR("%s: ESPI clock not ready\n", adapter->name); pr_err("%s: ESPI clock not ready\n", adapter->name);
return -1; return -1;
} }
......
...@@ -251,8 +251,9 @@ static int pm3393_interrupt_handler(struct cmac *cmac) ...@@ -251,8 +251,9 @@ static int pm3393_interrupt_handler(struct cmac *cmac)
/* Read the master interrupt status register. */ /* Read the master interrupt status register. */
pmread(cmac, SUNI1x10GEXP_REG_MASTER_INTERRUPT_STATUS, pmread(cmac, SUNI1x10GEXP_REG_MASTER_INTERRUPT_STATUS,
&master_intr_status); &master_intr_status);
CH_DBG(cmac->adapter, INTR, "PM3393 intr cause 0x%x\n", if (netif_msg_intr(cmac->adapter))
master_intr_status); dev_dbg(&cmac->adapter->pdev->dev, "PM3393 intr cause 0x%x\n",
master_intr_status);
/* TBD XXX Lets just clear everything for now */ /* TBD XXX Lets just clear everything for now */
pm3393_interrupt_clear(cmac); pm3393_interrupt_clear(cmac);
...@@ -776,11 +777,12 @@ static int pm3393_mac_reset(adapter_t * adapter) ...@@ -776,11 +777,12 @@ static int pm3393_mac_reset(adapter_t * adapter)
successful_reset = (is_pl4_reset_finished && !is_pl4_outof_lock successful_reset = (is_pl4_reset_finished && !is_pl4_outof_lock
&& is_xaui_mabc_pll_locked); && is_xaui_mabc_pll_locked);
CH_DBG(adapter, HW, if (netif_msg_hw(adapter))
"PM3393 HW reset %d: pl4_reset 0x%x, val 0x%x, " dev_dbg(&adapter->pdev->dev,
"is_pl4_outof_lock 0x%x, xaui_locked 0x%x\n", "PM3393 HW reset %d: pl4_reset 0x%x, val 0x%x, "
i, is_pl4_reset_finished, val, is_pl4_outof_lock, "is_pl4_outof_lock 0x%x, xaui_locked 0x%x\n",
is_xaui_mabc_pll_locked); i, is_pl4_reset_finished, val,
is_pl4_outof_lock, is_xaui_mabc_pll_locked);
} }
return successful_reset ? 0 : 1; return successful_reset ? 0 : 1;
} }
......
...@@ -953,7 +953,7 @@ int t1_sge_intr_error_handler(struct sge *sge) ...@@ -953,7 +953,7 @@ int t1_sge_intr_error_handler(struct sge *sge)
sge->stats.respQ_empty++; sge->stats.respQ_empty++;
if (cause & F_RESPQ_OVERFLOW) { if (cause & F_RESPQ_OVERFLOW) {
sge->stats.respQ_overflow++; sge->stats.respQ_overflow++;
CH_ALERT("%s: SGE response queue overflow\n", pr_alert("%s: SGE response queue overflow\n",
adapter->name); adapter->name);
} }
if (cause & F_FL_EXHAUSTED) { if (cause & F_FL_EXHAUSTED) {
...@@ -962,12 +962,12 @@ int t1_sge_intr_error_handler(struct sge *sge) ...@@ -962,12 +962,12 @@ int t1_sge_intr_error_handler(struct sge *sge)
} }
if (cause & F_PACKET_TOO_BIG) { if (cause & F_PACKET_TOO_BIG) {
sge->stats.pkt_too_big++; sge->stats.pkt_too_big++;
CH_ALERT("%s: SGE max packet size exceeded\n", pr_alert("%s: SGE max packet size exceeded\n",
adapter->name); adapter->name);
} }
if (cause & F_PACKET_MISMATCH) { if (cause & F_PACKET_MISMATCH) {
sge->stats.pkt_mismatch++; sge->stats.pkt_mismatch++;
CH_ALERT("%s: SGE packet mismatch\n", adapter->name); pr_alert("%s: SGE packet mismatch\n", adapter->name);
} }
if (cause & SGE_INT_FATAL) if (cause & SGE_INT_FATAL)
t1_fatal_err(adapter); t1_fatal_err(adapter);
...@@ -1101,7 +1101,7 @@ static void unexpected_offload(struct adapter *adapter, struct freelQ *fl) ...@@ -1101,7 +1101,7 @@ static void unexpected_offload(struct adapter *adapter, struct freelQ *fl)
pci_dma_sync_single_for_cpu(adapter->pdev, pci_unmap_addr(ce, dma_addr), pci_dma_sync_single_for_cpu(adapter->pdev, pci_unmap_addr(ce, dma_addr),
pci_unmap_len(ce, dma_len), PCI_DMA_FROMDEVICE); pci_unmap_len(ce, dma_len), PCI_DMA_FROMDEVICE);
CH_ERR("%s: unexpected offload packet, cmd %u\n", pr_err("%s: unexpected offload packet, cmd %u\n",
adapter->name, *skb->data); adapter->name, *skb->data);
recycle_fl_buf(fl, fl->cidx); recycle_fl_buf(fl, fl->cidx);
} }
...@@ -1687,7 +1687,7 @@ static int t1_sge_tx(struct sk_buff *skb, struct adapter *adapter, ...@@ -1687,7 +1687,7 @@ static int t1_sge_tx(struct sk_buff *skb, struct adapter *adapter,
netif_stop_queue(dev); netif_stop_queue(dev);
set_bit(dev->if_port, &sge->stopped_tx_queues); set_bit(dev->if_port, &sge->stopped_tx_queues);
sge->stats.cmdQ_full[2]++; sge->stats.cmdQ_full[2]++;
CH_ERR("%s: Tx ring full while queue awake!\n", pr_err("%s: Tx ring full while queue awake!\n",
adapter->name); adapter->name);
} }
spin_unlock(&q->lock); spin_unlock(&q->lock);
......
...@@ -90,7 +90,7 @@ int __t1_tpi_write(adapter_t *adapter, u32 addr, u32 value) ...@@ -90,7 +90,7 @@ int __t1_tpi_write(adapter_t *adapter, u32 addr, u32 value)
tpi_busy = t1_wait_op_done(adapter, A_TPI_CSR, F_TPIRDY, 1, tpi_busy = t1_wait_op_done(adapter, A_TPI_CSR, F_TPIRDY, 1,
TPI_ATTEMPTS, 3); TPI_ATTEMPTS, 3);
if (tpi_busy) if (tpi_busy)
CH_ALERT("%s: TPI write to 0x%x failed\n", pr_alert("%s: TPI write to 0x%x failed\n",
adapter->name, addr); adapter->name, addr);
return tpi_busy; return tpi_busy;
} }
...@@ -118,7 +118,7 @@ int __t1_tpi_read(adapter_t *adapter, u32 addr, u32 *valp) ...@@ -118,7 +118,7 @@ int __t1_tpi_read(adapter_t *adapter, u32 addr, u32 *valp)
tpi_busy = t1_wait_op_done(adapter, A_TPI_CSR, F_TPIRDY, 1, tpi_busy = t1_wait_op_done(adapter, A_TPI_CSR, F_TPIRDY, 1,
TPI_ATTEMPTS, 3); TPI_ATTEMPTS, 3);
if (tpi_busy) if (tpi_busy)
CH_ALERT("%s: TPI read from 0x%x failed\n", pr_alert("%s: TPI read from 0x%x failed\n",
adapter->name, addr); adapter->name, addr);
else else
*valp = readl(adapter->regs + A_TPI_RD_DATA); *valp = readl(adapter->regs + A_TPI_RD_DATA);
...@@ -262,7 +262,7 @@ static int mi1_wait_until_ready(adapter_t *adapter, int mi1_reg) ...@@ -262,7 +262,7 @@ static int mi1_wait_until_ready(adapter_t *adapter, int mi1_reg)
udelay(10); udelay(10);
} while (busy && --attempts); } while (busy && --attempts);
if (busy) if (busy)
CH_ALERT("%s: MDIO operation timed out\n", adapter->name); pr_alert("%s: MDIO operation timed out\n", adapter->name);
return busy; return busy;
} }
...@@ -581,7 +581,7 @@ int t1_seeprom_read(adapter_t *adapter, u32 addr, __le32 *data) ...@@ -581,7 +581,7 @@ int t1_seeprom_read(adapter_t *adapter, u32 addr, __le32 *data)
} while (!(val & F_VPD_OP_FLAG) && --i); } while (!(val & F_VPD_OP_FLAG) && --i);
if (!(val & F_VPD_OP_FLAG)) { if (!(val & F_VPD_OP_FLAG)) {
CH_ERR("%s: reading EEPROM address 0x%x failed\n", pr_err("%s: reading EEPROM address 0x%x failed\n",
adapter->name, addr); adapter->name, addr);
return -EIO; return -EIO;
} }
...@@ -734,8 +734,9 @@ int t1_elmer0_ext_intr_handler(adapter_t *adapter) ...@@ -734,8 +734,9 @@ int t1_elmer0_ext_intr_handler(adapter_t *adapter)
break; break;
case CHBT_BOARD_8000: case CHBT_BOARD_8000:
case CHBT_BOARD_CHT110: case CHBT_BOARD_CHT110:
CH_DBG(adapter, INTR, "External interrupt cause 0x%x\n", if (netif_msg_intr(adapter))
cause); dev_dbg(&adapter->pdev->dev,
"External interrupt cause 0x%x\n", cause);
if (cause & ELMER0_GP_BIT1) { /* PMC3393 INTB */ if (cause & ELMER0_GP_BIT1) { /* PMC3393 INTB */
struct cmac *mac = adapter->port[0].mac; struct cmac *mac = adapter->port[0].mac;
...@@ -746,8 +747,9 @@ int t1_elmer0_ext_intr_handler(adapter_t *adapter) ...@@ -746,8 +747,9 @@ int t1_elmer0_ext_intr_handler(adapter_t *adapter)
t1_tpi_read(adapter, t1_tpi_read(adapter,
A_ELMER0_GPI_STAT, &mod_detect); A_ELMER0_GPI_STAT, &mod_detect);
CH_MSG(adapter, INFO, LINK, "XPAK %s\n", if (netif_msg_link(adapter))
mod_detect ? "removed" : "inserted"); dev_info(&adapter->pdev->dev, "XPAK %s\n",
mod_detect ? "removed" : "inserted");
} }
break; break;
#ifdef CONFIG_CHELSIO_T1_COUGAR #ifdef CONFIG_CHELSIO_T1_COUGAR
...@@ -1084,7 +1086,7 @@ static void __devinit init_link_config(struct link_config *lc, ...@@ -1084,7 +1086,7 @@ static void __devinit init_link_config(struct link_config *lc,
#ifdef CONFIG_CHELSIO_T1_COUGAR #ifdef CONFIG_CHELSIO_T1_COUGAR
if (bi->clock_cspi && !(adapter->cspi = t1_cspi_create(adapter))) { if (bi->clock_cspi && !(adapter->cspi = t1_cspi_create(adapter))) {
CH_ERR("%s: CSPI initialization failed\n", pr_err("%s: CSPI initialization failed\n",
adapter->name); adapter->name);
goto error; goto error;
} }
...@@ -1105,20 +1107,20 @@ int __devinit t1_init_sw_modules(adapter_t *adapter, ...@@ -1105,20 +1107,20 @@ int __devinit t1_init_sw_modules(adapter_t *adapter,
adapter->sge = t1_sge_create(adapter, &adapter->params.sge); adapter->sge = t1_sge_create(adapter, &adapter->params.sge);
if (!adapter->sge) { if (!adapter->sge) {
CH_ERR("%s: SGE initialization failed\n", pr_err("%s: SGE initialization failed\n",
adapter->name); adapter->name);
goto error; goto error;
} }
if (bi->espi_nports && !(adapter->espi = t1_espi_create(adapter))) { if (bi->espi_nports && !(adapter->espi = t1_espi_create(adapter))) {
CH_ERR("%s: ESPI initialization failed\n", pr_err("%s: ESPI initialization failed\n",
adapter->name); adapter->name);
goto error; goto error;
} }
adapter->tp = t1_tp_create(adapter, &adapter->params.tp); adapter->tp = t1_tp_create(adapter, &adapter->params.tp);
if (!adapter->tp) { if (!adapter->tp) {
CH_ERR("%s: TP initialization failed\n", pr_err("%s: TP initialization failed\n",
adapter->name); adapter->name);
goto error; goto error;
} }
...@@ -1138,14 +1140,14 @@ int __devinit t1_init_sw_modules(adapter_t *adapter, ...@@ -1138,14 +1140,14 @@ int __devinit t1_init_sw_modules(adapter_t *adapter,
adapter->port[i].phy = bi->gphy->create(adapter->port[i].dev, adapter->port[i].phy = bi->gphy->create(adapter->port[i].dev,
phy_addr, bi->mdio_ops); phy_addr, bi->mdio_ops);
if (!adapter->port[i].phy) { if (!adapter->port[i].phy) {
CH_ERR("%s: PHY %d initialization failed\n", pr_err("%s: PHY %d initialization failed\n",
adapter->name, i); adapter->name, i);
goto error; goto error;
} }
adapter->port[i].mac = mac = bi->gmac->create(adapter, i); adapter->port[i].mac = mac = bi->gmac->create(adapter, i);
if (!mac) { if (!mac) {
CH_ERR("%s: MAC %d initialization failed\n", pr_err("%s: MAC %d initialization failed\n",
adapter->name, i); adapter->name, i);
goto error; goto error;
} }
...@@ -1157,7 +1159,7 @@ int __devinit t1_init_sw_modules(adapter_t *adapter, ...@@ -1157,7 +1159,7 @@ int __devinit t1_init_sw_modules(adapter_t *adapter,
if (!t1_is_asic(adapter) || bi->chip_mac == CHBT_MAC_DUMMY) if (!t1_is_asic(adapter) || bi->chip_mac == CHBT_MAC_DUMMY)
mac->ops->macaddress_get(mac, hw_addr); mac->ops->macaddress_get(mac, hw_addr);
else if (vpd_macaddress_get(adapter, i, hw_addr)) { else if (vpd_macaddress_get(adapter, i, hw_addr)) {
CH_ERR("%s: could not read MAC address from VPD ROM\n", pr_err("%s: could not read MAC address from VPD ROM\n",
adapter->port[i].dev->name); adapter->port[i].dev->name);
goto error; goto error;
} }
......
...@@ -48,14 +48,14 @@ static void vsc_read(adapter_t *adapter, u32 addr, u32 *val) ...@@ -48,14 +48,14 @@ static void vsc_read(adapter_t *adapter, u32 addr, u32 *val)
i++; i++;
} while (((status & 1) == 0) && (i < 50)); } while (((status & 1) == 0) && (i < 50));
if (i == 50) if (i == 50)
CH_ERR("Invalid tpi read from MAC, breaking loop.\n"); pr_err("Invalid tpi read from MAC, breaking loop.\n");
t1_tpi_read(adapter, (REG_LOCAL_DATA << 2) + 4, &vlo); t1_tpi_read(adapter, (REG_LOCAL_DATA << 2) + 4, &vlo);
t1_tpi_read(adapter, REG_LOCAL_DATA << 2, &vhi); t1_tpi_read(adapter, REG_LOCAL_DATA << 2, &vhi);
*val = (vhi << 16) | vlo; *val = (vhi << 16) | vlo;
/* CH_ERR("rd: block: 0x%x sublock: 0x%x reg: 0x%x data: 0x%x\n", /* pr_err("rd: block: 0x%x sublock: 0x%x reg: 0x%x data: 0x%x\n",
((addr&0xe000)>>13), ((addr&0x1e00)>>9), ((addr&0xe000)>>13), ((addr&0x1e00)>>9),
((addr&0x01fe)>>1), *val); */ ((addr&0x01fe)>>1), *val); */
spin_unlock_bh(&adapter->mac_lock); spin_unlock_bh(&adapter->mac_lock);
...@@ -66,7 +66,7 @@ static void vsc_write(adapter_t *adapter, u32 addr, u32 data) ...@@ -66,7 +66,7 @@ static void vsc_write(adapter_t *adapter, u32 addr, u32 data)
spin_lock_bh(&adapter->mac_lock); spin_lock_bh(&adapter->mac_lock);
t1_tpi_write(adapter, (addr << 2) + 4, data & 0xFFFF); t1_tpi_write(adapter, (addr << 2) + 4, data & 0xFFFF);
t1_tpi_write(adapter, addr << 2, (data >> 16) & 0xFFFF); t1_tpi_write(adapter, addr << 2, (data >> 16) & 0xFFFF);
/* CH_ERR("wr: block: 0x%x sublock: 0x%x reg: 0x%x data: 0x%x\n", /* pr_err("wr: block: 0x%x sublock: 0x%x reg: 0x%x data: 0x%x\n",
((addr&0xe000)>>13), ((addr&0x1e00)>>9), ((addr&0xe000)>>13), ((addr&0x1e00)>>9),
((addr&0x01fe)>>1), data); */ ((addr&0x01fe)>>1), data); */
spin_unlock_bh(&adapter->mac_lock); spin_unlock_bh(&adapter->mac_lock);
...@@ -225,7 +225,7 @@ static void run_table(adapter_t *adapter, struct init_table *ib, int len) ...@@ -225,7 +225,7 @@ static void run_table(adapter_t *adapter, struct init_table *ib, int len)
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
if (ib[i].addr == INITBLOCK_SLEEP) { if (ib[i].addr == INITBLOCK_SLEEP) {
udelay( ib[i].data ); udelay( ib[i].data );
CH_ERR("sleep %d us\n",ib[i].data); pr_err("sleep %d us\n",ib[i].data);
} else } else
vsc_write( adapter, ib[i].addr, ib[i].data ); vsc_write( adapter, ib[i].addr, ib[i].data );
} }
...@@ -241,7 +241,7 @@ static int bist_rd(adapter_t *adapter, int moduleid, int address) ...@@ -241,7 +241,7 @@ static int bist_rd(adapter_t *adapter, int moduleid, int address)
(address != 0x2) && (address != 0x2) &&
(address != 0xd) && (address != 0xd) &&
(address != 0xe)) (address != 0xe))
CH_ERR("No bist address: 0x%x\n", address); pr_err("No bist address: 0x%x\n", address);
data = ((0x00 << 24) | ((address & 0xff) << 16) | (0x00 << 8) | data = ((0x00 << 24) | ((address & 0xff) << 16) | (0x00 << 8) |
((moduleid & 0xff) << 0)); ((moduleid & 0xff) << 0));
...@@ -251,9 +251,9 @@ static int bist_rd(adapter_t *adapter, int moduleid, int address) ...@@ -251,9 +251,9 @@ static int bist_rd(adapter_t *adapter, int moduleid, int address)
vsc_read(adapter, REG_RAM_BIST_RESULT, &result); vsc_read(adapter, REG_RAM_BIST_RESULT, &result);
if ((result & (1 << 9)) != 0x0) if ((result & (1 << 9)) != 0x0)
CH_ERR("Still in bist read: 0x%x\n", result); pr_err("Still in bist read: 0x%x\n", result);
else if ((result & (1 << 8)) != 0x0) else if ((result & (1 << 8)) != 0x0)
CH_ERR("bist read error: 0x%x\n", result); pr_err("bist read error: 0x%x\n", result);
return (result & 0xff); return (result & 0xff);
} }
...@@ -268,10 +268,10 @@ static int bist_wr(adapter_t *adapter, int moduleid, int address, int value) ...@@ -268,10 +268,10 @@ static int bist_wr(adapter_t *adapter, int moduleid, int address, int value)
(address != 0x2) && (address != 0x2) &&
(address != 0xd) && (address != 0xd) &&
(address != 0xe)) (address != 0xe))
CH_ERR("No bist address: 0x%x\n", address); pr_err("No bist address: 0x%x\n", address);
if (value > 255) if (value > 255)
CH_ERR("Suspicious write out of range value: 0x%x\n", value); pr_err("Suspicious write out of range value: 0x%x\n", value);
data = ((0x01 << 24) | ((address & 0xff) << 16) | (value << 8) | data = ((0x01 << 24) | ((address & 0xff) << 16) | (value << 8) |
((moduleid & 0xff) << 0)); ((moduleid & 0xff) << 0));
...@@ -281,9 +281,9 @@ static int bist_wr(adapter_t *adapter, int moduleid, int address, int value) ...@@ -281,9 +281,9 @@ static int bist_wr(adapter_t *adapter, int moduleid, int address, int value)
vsc_read(adapter, REG_RAM_BIST_CMD, &result); vsc_read(adapter, REG_RAM_BIST_CMD, &result);
if ((result & (1 << 27)) != 0x0) if ((result & (1 << 27)) != 0x0)
CH_ERR("Still in bist write: 0x%x\n", result); pr_err("Still in bist write: 0x%x\n", result);
else if ((result & (1 << 26)) != 0x0) else if ((result & (1 << 26)) != 0x0)
CH_ERR("bist write error: 0x%x\n", result); pr_err("bist write error: 0x%x\n", result);
return 0; return 0;
} }
...@@ -306,7 +306,7 @@ static int check_bist(adapter_t *adapter, int moduleid) ...@@ -306,7 +306,7 @@ static int check_bist(adapter_t *adapter, int moduleid)
column = ((bist_rd(adapter,moduleid, 0x0e)<<8) + column = ((bist_rd(adapter,moduleid, 0x0e)<<8) +
(bist_rd(adapter,moduleid, 0x0d))); (bist_rd(adapter,moduleid, 0x0d)));
if ((result & 3) != 0x3) if ((result & 3) != 0x3)
CH_ERR("Result: 0x%x BIST error in ram %d, column: 0x%04x\n", pr_err("Result: 0x%x BIST error in ram %d, column: 0x%04x\n",
result, moduleid, column); result, moduleid, column);
return 0; return 0;
} }
......
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