aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/chelsio
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/chelsio')
-rw-r--r--drivers/net/chelsio/common.h45
-rw-r--r--drivers/net/chelsio/cxgb2.c20
-rw-r--r--drivers/net/chelsio/espi.c4
-rw-r--r--drivers/net/chelsio/pm3393.c23
-rw-r--r--drivers/net/chelsio/sge.c20
-rw-r--r--drivers/net/chelsio/subr.c34
-rw-r--r--drivers/net/chelsio/vsc7326.c24
7 files changed, 71 insertions, 99 deletions
diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h
index 699d22c5fe09..036b2dfb1d40 100644
--- a/drivers/net/chelsio/common.h
+++ b/drivers/net/chelsio/common.h
@@ -36,6 +36,8 @@
36 * * 36 * *
37 ****************************************************************************/ 37 ****************************************************************************/
38 38
39#define pr_fmt(fmt) "cxgb: " fmt
40
39#ifndef _CXGB_COMMON_H_ 41#ifndef _CXGB_COMMON_H_
40#define _CXGB_COMMON_H_ 42#define _CXGB_COMMON_H_
41 43
@@ -49,34 +51,13 @@
49#include <linux/mdio.h> 51#include <linux/mdio.h>
50#include <linux/crc32.h> 52#include <linux/crc32.h>
51#include <linux/init.h> 53#include <linux/init.h>
54#include <linux/slab.h>
52#include <asm/io.h> 55#include <asm/io.h>
53#include <linux/pci_ids.h> 56#include <linux/pci_ids.h>
54 57
55#define DRV_DESCRIPTION "Chelsio 10Gb Ethernet Driver" 58#define DRV_DESCRIPTION "Chelsio 10Gb Ethernet Driver"
56#define DRV_NAME "cxgb" 59#define DRV_NAME "cxgb"
57#define DRV_VERSION "2.2" 60#define DRV_VERSION "2.2"
58#define PFX DRV_NAME ": "
59
60#define CH_ERR(fmt, ...) printk(KERN_ERR PFX fmt, ## __VA_ARGS__)
61#define CH_WARN(fmt, ...) printk(KERN_WARNING PFX fmt, ## __VA_ARGS__)
62#define CH_ALERT(fmt, ...) printk(KERN_ALERT PFX fmt, ## __VA_ARGS__)
63
64/*
65 * More powerful macro that selectively prints messages based on msg_enable.
66 * For info and debugging messages.
67 */
68#define CH_MSG(adapter, level, category, fmt, ...) do { \
69 if ((adapter)->msg_enable & NETIF_MSG_##category) \
70 printk(KERN_##level PFX "%s: " fmt, (adapter)->name, \
71 ## __VA_ARGS__); \
72} while (0)
73
74#ifdef DEBUG
75# define CH_DBG(adapter, category, fmt, ...) \
76 CH_MSG(adapter, DEBUG, category, fmt, ## __VA_ARGS__)
77#else
78# define CH_DBG(fmt, ...)
79#endif
80 61
81#define CH_DEVICE(devid, ssid, idx) \ 62#define CH_DEVICE(devid, ssid, idx) \
82 { PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, ssid, 0, 0, idx } 63 { PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, ssid, 0, 0, idx }
@@ -90,25 +71,13 @@
90typedef struct adapter adapter_t; 71typedef struct adapter adapter_t;
91 72
92struct t1_rx_mode { 73struct t1_rx_mode {
93 struct net_device *dev; 74 struct net_device *dev;
94 u32 idx;
95 struct dev_mc_list *list;
96}; 75};
97 76
98#define t1_rx_mode_promisc(rm) (rm->dev->flags & IFF_PROMISC) 77#define t1_rx_mode_promisc(rm) (rm->dev->flags & IFF_PROMISC)
99#define t1_rx_mode_allmulti(rm) (rm->dev->flags & IFF_ALLMULTI) 78#define t1_rx_mode_allmulti(rm) (rm->dev->flags & IFF_ALLMULTI)
100#define t1_rx_mode_mc_cnt(rm) (rm->dev->mc_count) 79#define t1_rx_mode_mc_cnt(rm) (netdev_mc_count(rm->dev))
101 80#define t1_get_netdev(rm) (rm->dev)
102static inline u8 *t1_get_next_mcaddr(struct t1_rx_mode *rm)
103{
104 u8 *addr = NULL;
105
106 if (rm->idx++ < rm->dev->mc_count) {
107 addr = rm->list->dmi_addr;
108 rm->list = rm->list->next;
109 }
110 return addr;
111}
112 81
113#define MAX_NPORTS 4 82#define MAX_NPORTS 4
114#define PORT_MASK ((1 << MAX_NPORTS) - 1) 83#define PORT_MASK ((1 << MAX_NPORTS) - 1)
@@ -334,7 +303,7 @@ static inline int t1_is_asic(const adapter_t *adapter)
334 return adapter->params.is_asic; 303 return adapter->params.is_asic;
335} 304}
336 305
337extern struct pci_device_id t1_pci_tbl[]; 306extern const struct pci_device_id t1_pci_tbl[];
338 307
339static inline int adapter_matches_type(const adapter_t *adapter, 308static inline int adapter_matches_type(const adapter_t *adapter,
340 int version, int revision) 309 int version, int revision)
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index 082cdb28b510..0f71304e0542 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -125,8 +125,6 @@ static void t1_set_rxmode(struct net_device *dev)
125 struct t1_rx_mode rm; 125 struct t1_rx_mode rm;
126 126
127 rm.dev = dev; 127 rm.dev = dev;
128 rm.idx = 0;
129 rm.list = dev->mc_list;
130 mac->ops->set_rx_mode(mac, &rm); 128 mac->ops->set_rx_mode(mac, &rm);
131} 129}
132 130
@@ -976,7 +974,7 @@ void t1_fatal_err(struct adapter *adapter)
976 t1_sge_stop(adapter->sge); 974 t1_sge_stop(adapter->sge);
977 t1_interrupts_disable(adapter); 975 t1_interrupts_disable(adapter);
978 } 976 }
979 CH_ALERT("%s: encountered fatal error, operation suspended\n", 977 pr_alert("%s: encountered fatal error, operation suspended\n",
980 adapter->name); 978 adapter->name);
981} 979}
982 980
@@ -1020,7 +1018,7 @@ static int __devinit init_one(struct pci_dev *pdev,
1020 return err; 1018 return err;
1021 1019
1022 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { 1020 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
1023 CH_ERR("%s: cannot find PCI device memory base address\n", 1021 pr_err("%s: cannot find PCI device memory base address\n",
1024 pci_name(pdev)); 1022 pci_name(pdev));
1025 err = -ENODEV; 1023 err = -ENODEV;
1026 goto out_disable_pdev; 1024 goto out_disable_pdev;
@@ -1030,20 +1028,20 @@ static int __devinit init_one(struct pci_dev *pdev,
1030 pci_using_dac = 1; 1028 pci_using_dac = 1;
1031 1029
1032 if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) { 1030 if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
1033 CH_ERR("%s: unable to obtain 64-bit DMA for " 1031 pr_err("%s: unable to obtain 64-bit DMA for "
1034 "consistent allocations\n", pci_name(pdev)); 1032 "consistent allocations\n", pci_name(pdev));
1035 err = -ENODEV; 1033 err = -ENODEV;
1036 goto out_disable_pdev; 1034 goto out_disable_pdev;
1037 } 1035 }
1038 1036
1039 } else if ((err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) != 0) { 1037 } else if ((err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) != 0) {
1040 CH_ERR("%s: no usable DMA configuration\n", pci_name(pdev)); 1038 pr_err("%s: no usable DMA configuration\n", pci_name(pdev));
1041 goto out_disable_pdev; 1039 goto out_disable_pdev;
1042 } 1040 }
1043 1041
1044 err = pci_request_regions(pdev, DRV_NAME); 1042 err = pci_request_regions(pdev, DRV_NAME);
1045 if (err) { 1043 if (err) {
1046 CH_ERR("%s: cannot obtain PCI resources\n", pci_name(pdev)); 1044 pr_err("%s: cannot obtain PCI resources\n", pci_name(pdev));
1047 goto out_disable_pdev; 1045 goto out_disable_pdev;
1048 } 1046 }
1049 1047
@@ -1071,7 +1069,7 @@ static int __devinit init_one(struct pci_dev *pdev,
1071 1069
1072 adapter->regs = ioremap(mmio_start, mmio_len); 1070 adapter->regs = ioremap(mmio_start, mmio_len);
1073 if (!adapter->regs) { 1071 if (!adapter->regs) {
1074 CH_ERR("%s: cannot map device registers\n", 1072 pr_err("%s: cannot map device registers\n",
1075 pci_name(pdev)); 1073 pci_name(pdev));
1076 err = -ENOMEM; 1074 err = -ENOMEM;
1077 goto out_free_dev; 1075 goto out_free_dev;
@@ -1150,8 +1148,8 @@ static int __devinit init_one(struct pci_dev *pdev,
1150 for (i = 0; i < bi->port_number; ++i) { 1148 for (i = 0; i < bi->port_number; ++i) {
1151 err = register_netdev(adapter->port[i].dev); 1149 err = register_netdev(adapter->port[i].dev);
1152 if (err) 1150 if (err)
1153 CH_WARN("%s: cannot register net device %s, skipping\n", 1151 pr_warning("%s: cannot register net device %s, skipping\n",
1154 pci_name(pdev), adapter->port[i].dev->name); 1152 pci_name(pdev), adapter->port[i].dev->name);
1155 else { 1153 else {
1156 /* 1154 /*
1157 * Change the name we use for messages to the name of 1155 * Change the name we use for messages to the name of
@@ -1164,7 +1162,7 @@ static int __devinit init_one(struct pci_dev *pdev,
1164 } 1162 }
1165 } 1163 }
1166 if (!adapter->registered_device_map) { 1164 if (!adapter->registered_device_map) {
1167 CH_ERR("%s: could not register any net devices\n", 1165 pr_err("%s: could not register any net devices\n",
1168 pci_name(pdev)); 1166 pci_name(pdev));
1169 goto out_release_adapter_res; 1167 goto out_release_adapter_res;
1170 } 1168 }
diff --git a/drivers/net/chelsio/espi.c b/drivers/net/chelsio/espi.c
index 1e0749e000b0..639ff1955739 100644
--- a/drivers/net/chelsio/espi.c
+++ b/drivers/net/chelsio/espi.c
@@ -76,7 +76,7 @@ static int tricn_write(adapter_t *adapter, int bundle_addr, int module_addr,
76 } while (busy && --attempts); 76 } while (busy && --attempts);
77 77
78 if (busy) 78 if (busy)
79 CH_ERR("%s: TRICN write timed out\n", adapter->name); 79 pr_err("%s: TRICN write timed out\n", adapter->name);
80 80
81 return busy; 81 return busy;
82} 82}
@@ -86,7 +86,7 @@ static int tricn_init(adapter_t *adapter)
86 int i, sme = 1; 86 int i, sme = 1;
87 87
88 if (!(readl(adapter->regs + A_ESPI_RX_RESET) & F_RX_CLK_STATUS)) { 88 if (!(readl(adapter->regs + A_ESPI_RX_RESET) & F_RX_CLK_STATUS)) {
89 CH_ERR("%s: ESPI clock not ready\n", adapter->name); 89 pr_err("%s: ESPI clock not ready\n", adapter->name);
90 return -1; 90 return -1;
91 } 91 }
92 92
diff --git a/drivers/net/chelsio/pm3393.c b/drivers/net/chelsio/pm3393.c
index 2117c4fbb107..9e631b9d3948 100644
--- a/drivers/net/chelsio/pm3393.c
+++ b/drivers/net/chelsio/pm3393.c
@@ -44,6 +44,7 @@
44#include "suni1x10gexp_regs.h" 44#include "suni1x10gexp_regs.h"
45 45
46#include <linux/crc32.h> 46#include <linux/crc32.h>
47#include <linux/slab.h>
47 48
48#define OFFSET(REG_ADDR) ((REG_ADDR) << 2) 49#define OFFSET(REG_ADDR) ((REG_ADDR) << 2)
49 50
@@ -251,8 +252,9 @@ static int pm3393_interrupt_handler(struct cmac *cmac)
251 /* Read the master interrupt status register. */ 252 /* Read the master interrupt status register. */
252 pmread(cmac, SUNI1x10GEXP_REG_MASTER_INTERRUPT_STATUS, 253 pmread(cmac, SUNI1x10GEXP_REG_MASTER_INTERRUPT_STATUS,
253 &master_intr_status); 254 &master_intr_status);
254 CH_DBG(cmac->adapter, INTR, "PM3393 intr cause 0x%x\n", 255 if (netif_msg_intr(cmac->adapter))
255 master_intr_status); 256 dev_dbg(&cmac->adapter->pdev->dev, "PM3393 intr cause 0x%x\n",
257 master_intr_status);
256 258
257 /* TBD XXX Lets just clear everything for now */ 259 /* TBD XXX Lets just clear everything for now */
258 pm3393_interrupt_clear(cmac); 260 pm3393_interrupt_clear(cmac);
@@ -375,12 +377,12 @@ static int pm3393_set_rx_mode(struct cmac *cmac, struct t1_rx_mode *rm)
375 rx_mode |= SUNI1x10GEXP_BITMSK_RXXG_MHASH_EN; 377 rx_mode |= SUNI1x10GEXP_BITMSK_RXXG_MHASH_EN;
376 } else if (t1_rx_mode_mc_cnt(rm)) { 378 } else if (t1_rx_mode_mc_cnt(rm)) {
377 /* Accept one or more multicast(s). */ 379 /* Accept one or more multicast(s). */
378 u8 *addr; 380 struct dev_mc_list *dmi;
379 int bit; 381 int bit;
380 u16 mc_filter[4] = { 0, }; 382 u16 mc_filter[4] = { 0, };
381 383
382 while ((addr = t1_get_next_mcaddr(rm))) { 384 netdev_for_each_mc_addr(dmi, t1_get_netdev(rm)) {
383 bit = (ether_crc(ETH_ALEN, addr) >> 23) & 0x3f; /* bit[23:28] */ 385 bit = (ether_crc(ETH_ALEN, dmi->dmi_addr) >> 23) & 0x3f; /* bit[23:28] */
384 mc_filter[bit >> 4] |= 1 << (bit & 0xf); 386 mc_filter[bit >> 4] |= 1 << (bit & 0xf);
385 } 387 }
386 pmwrite(cmac, SUNI1x10GEXP_REG_RXXG_MULTICAST_HASH_LOW, mc_filter[0]); 388 pmwrite(cmac, SUNI1x10GEXP_REG_RXXG_MULTICAST_HASH_LOW, mc_filter[0]);
@@ -776,11 +778,12 @@ static int pm3393_mac_reset(adapter_t * adapter)
776 successful_reset = (is_pl4_reset_finished && !is_pl4_outof_lock 778 successful_reset = (is_pl4_reset_finished && !is_pl4_outof_lock
777 && is_xaui_mabc_pll_locked); 779 && is_xaui_mabc_pll_locked);
778 780
779 CH_DBG(adapter, HW, 781 if (netif_msg_hw(adapter))
780 "PM3393 HW reset %d: pl4_reset 0x%x, val 0x%x, " 782 dev_dbg(&adapter->pdev->dev,
781 "is_pl4_outof_lock 0x%x, xaui_locked 0x%x\n", 783 "PM3393 HW reset %d: pl4_reset 0x%x, val 0x%x, "
782 i, is_pl4_reset_finished, val, is_pl4_outof_lock, 784 "is_pl4_outof_lock 0x%x, xaui_locked 0x%x\n",
783 is_xaui_mabc_pll_locked); 785 i, is_pl4_reset_finished, val,
786 is_pl4_outof_lock, is_xaui_mabc_pll_locked);
784 } 787 }
785 return successful_reset ? 0 : 1; 788 return successful_reset ? 0 : 1;
786} 789}
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c
index 8c658cf6f62f..df3a1410696e 100644
--- a/drivers/net/chelsio/sge.c
+++ b/drivers/net/chelsio/sge.c
@@ -53,6 +53,7 @@
53#include <linux/ip.h> 53#include <linux/ip.h>
54#include <linux/in.h> 54#include <linux/in.h>
55#include <linux/if_arp.h> 55#include <linux/if_arp.h>
56#include <linux/slab.h>
56 57
57#include "cpl5_cmd.h" 58#include "cpl5_cmd.h"
58#include "sge.h" 59#include "sge.h"
@@ -248,7 +249,7 @@ static void restart_sched(unsigned long);
248 * 249 *
249 * Interrupts are handled by a single CPU and it is likely that on a MP system 250 * Interrupts are handled by a single CPU and it is likely that on a MP system
250 * the application is migrated to another CPU. In that scenario, we try to 251 * the application is migrated to another CPU. In that scenario, we try to
251 * seperate the RX(in irq context) and TX state in order to decrease memory 252 * separate the RX(in irq context) and TX state in order to decrease memory
252 * contention. 253 * contention.
253 */ 254 */
254struct sge { 255struct sge {
@@ -267,7 +268,7 @@ struct sge {
267 struct sk_buff *espibug_skb[MAX_NPORTS]; 268 struct sk_buff *espibug_skb[MAX_NPORTS];
268 u32 sge_control; /* shadow value of sge control reg */ 269 u32 sge_control; /* shadow value of sge control reg */
269 struct sge_intr_counts stats; 270 struct sge_intr_counts stats;
270 struct sge_port_stats *port_stats[MAX_NPORTS]; 271 struct sge_port_stats __percpu *port_stats[MAX_NPORTS];
271 struct sched *tx_sched; 272 struct sched *tx_sched;
272 struct cmdQ cmdQ[SGE_CMDQ_N] ____cacheline_aligned_in_smp; 273 struct cmdQ cmdQ[SGE_CMDQ_N] ____cacheline_aligned_in_smp;
273}; 274};
@@ -953,7 +954,7 @@ int t1_sge_intr_error_handler(struct sge *sge)
953 sge->stats.respQ_empty++; 954 sge->stats.respQ_empty++;
954 if (cause & F_RESPQ_OVERFLOW) { 955 if (cause & F_RESPQ_OVERFLOW) {
955 sge->stats.respQ_overflow++; 956 sge->stats.respQ_overflow++;
956 CH_ALERT("%s: SGE response queue overflow\n", 957 pr_alert("%s: SGE response queue overflow\n",
957 adapter->name); 958 adapter->name);
958 } 959 }
959 if (cause & F_FL_EXHAUSTED) { 960 if (cause & F_FL_EXHAUSTED) {
@@ -962,12 +963,12 @@ int t1_sge_intr_error_handler(struct sge *sge)
962 } 963 }
963 if (cause & F_PACKET_TOO_BIG) { 964 if (cause & F_PACKET_TOO_BIG) {
964 sge->stats.pkt_too_big++; 965 sge->stats.pkt_too_big++;
965 CH_ALERT("%s: SGE max packet size exceeded\n", 966 pr_alert("%s: SGE max packet size exceeded\n",
966 adapter->name); 967 adapter->name);
967 } 968 }
968 if (cause & F_PACKET_MISMATCH) { 969 if (cause & F_PACKET_MISMATCH) {
969 sge->stats.pkt_mismatch++; 970 sge->stats.pkt_mismatch++;
970 CH_ALERT("%s: SGE packet mismatch\n", adapter->name); 971 pr_alert("%s: SGE packet mismatch\n", adapter->name);
971 } 972 }
972 if (cause & SGE_INT_FATAL) 973 if (cause & SGE_INT_FATAL)
973 t1_fatal_err(adapter); 974 t1_fatal_err(adapter);
@@ -1101,7 +1102,7 @@ static void unexpected_offload(struct adapter *adapter, struct freelQ *fl)
1101 1102
1102 pci_dma_sync_single_for_cpu(adapter->pdev, pci_unmap_addr(ce, dma_addr), 1103 pci_dma_sync_single_for_cpu(adapter->pdev, pci_unmap_addr(ce, dma_addr),
1103 pci_unmap_len(ce, dma_len), PCI_DMA_FROMDEVICE); 1104 pci_unmap_len(ce, dma_len), PCI_DMA_FROMDEVICE);
1104 CH_ERR("%s: unexpected offload packet, cmd %u\n", 1105 pr_err("%s: unexpected offload packet, cmd %u\n",
1105 adapter->name, *skb->data); 1106 adapter->name, *skb->data);
1106 recycle_fl_buf(fl, fl->cidx); 1107 recycle_fl_buf(fl, fl->cidx);
1107} 1108}
@@ -1378,7 +1379,7 @@ static void sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len)
1378 } 1379 }
1379 __skb_pull(skb, sizeof(*p)); 1380 __skb_pull(skb, sizeof(*p));
1380 1381
1381 st = per_cpu_ptr(sge->port_stats[p->iff], smp_processor_id()); 1382 st = this_cpu_ptr(sge->port_stats[p->iff]);
1382 1383
1383 skb->protocol = eth_type_trans(skb, adapter->port[p->iff].dev); 1384 skb->protocol = eth_type_trans(skb, adapter->port[p->iff].dev);
1384 if ((adapter->flags & RX_CSUM_ENABLED) && p->csum == 0xffff && 1385 if ((adapter->flags & RX_CSUM_ENABLED) && p->csum == 0xffff &&
@@ -1687,7 +1688,7 @@ static int t1_sge_tx(struct sk_buff *skb, struct adapter *adapter,
1687 netif_stop_queue(dev); 1688 netif_stop_queue(dev);
1688 set_bit(dev->if_port, &sge->stopped_tx_queues); 1689 set_bit(dev->if_port, &sge->stopped_tx_queues);
1689 sge->stats.cmdQ_full[2]++; 1690 sge->stats.cmdQ_full[2]++;
1690 CH_ERR("%s: Tx ring full while queue awake!\n", 1691 pr_err("%s: Tx ring full while queue awake!\n",
1691 adapter->name); 1692 adapter->name);
1692 } 1693 }
1693 spin_unlock(&q->lock); 1694 spin_unlock(&q->lock);
@@ -1780,8 +1781,7 @@ netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
1780{ 1781{
1781 struct adapter *adapter = dev->ml_priv; 1782 struct adapter *adapter = dev->ml_priv;
1782 struct sge *sge = adapter->sge; 1783 struct sge *sge = adapter->sge;
1783 struct sge_port_stats *st = per_cpu_ptr(sge->port_stats[dev->if_port], 1784 struct sge_port_stats *st = this_cpu_ptr(sge->port_stats[dev->if_port]);
1784 smp_processor_id());
1785 struct cpl_tx_pkt *cpl; 1785 struct cpl_tx_pkt *cpl;
1786 struct sk_buff *orig_skb = skb; 1786 struct sk_buff *orig_skb = skb;
1787 int ret; 1787 int ret;
diff --git a/drivers/net/chelsio/subr.c b/drivers/net/chelsio/subr.c
index 17720c6e5bfe..53bde15fc94d 100644
--- a/drivers/net/chelsio/subr.c
+++ b/drivers/net/chelsio/subr.c
@@ -90,7 +90,7 @@ int __t1_tpi_write(adapter_t *adapter, u32 addr, u32 value)
90 tpi_busy = t1_wait_op_done(adapter, A_TPI_CSR, F_TPIRDY, 1, 90 tpi_busy = t1_wait_op_done(adapter, A_TPI_CSR, F_TPIRDY, 1,
91 TPI_ATTEMPTS, 3); 91 TPI_ATTEMPTS, 3);
92 if (tpi_busy) 92 if (tpi_busy)
93 CH_ALERT("%s: TPI write to 0x%x failed\n", 93 pr_alert("%s: TPI write to 0x%x failed\n",
94 adapter->name, addr); 94 adapter->name, addr);
95 return tpi_busy; 95 return tpi_busy;
96} 96}
@@ -118,7 +118,7 @@ int __t1_tpi_read(adapter_t *adapter, u32 addr, u32 *valp)
118 tpi_busy = t1_wait_op_done(adapter, A_TPI_CSR, F_TPIRDY, 1, 118 tpi_busy = t1_wait_op_done(adapter, A_TPI_CSR, F_TPIRDY, 1,
119 TPI_ATTEMPTS, 3); 119 TPI_ATTEMPTS, 3);
120 if (tpi_busy) 120 if (tpi_busy)
121 CH_ALERT("%s: TPI read from 0x%x failed\n", 121 pr_alert("%s: TPI read from 0x%x failed\n",
122 adapter->name, addr); 122 adapter->name, addr);
123 else 123 else
124 *valp = readl(adapter->regs + A_TPI_RD_DATA); 124 *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 udelay(10); 262 udelay(10);
263 } while (busy && --attempts); 263 } while (busy && --attempts);
264 if (busy) 264 if (busy)
265 CH_ALERT("%s: MDIO operation timed out\n", adapter->name); 265 pr_alert("%s: MDIO operation timed out\n", adapter->name);
266 return busy; 266 return busy;
267} 267}
268 268
@@ -528,7 +528,7 @@ static const struct board_info t1_board[] = {
528 528
529}; 529};
530 530
531struct pci_device_id t1_pci_tbl[] = { 531DEFINE_PCI_DEVICE_TABLE(t1_pci_tbl) = {
532 CH_DEVICE(8, 0, CH_BRD_T110_1CU), 532 CH_DEVICE(8, 0, CH_BRD_T110_1CU),
533 CH_DEVICE(8, 1, CH_BRD_T110_1CU), 533 CH_DEVICE(8, 1, CH_BRD_T110_1CU),
534 CH_DEVICE(7, 0, CH_BRD_N110_1F), 534 CH_DEVICE(7, 0, CH_BRD_N110_1F),
@@ -581,7 +581,7 @@ int t1_seeprom_read(adapter_t *adapter, u32 addr, __le32 *data)
581 } while (!(val & F_VPD_OP_FLAG) && --i); 581 } while (!(val & F_VPD_OP_FLAG) && --i);
582 582
583 if (!(val & F_VPD_OP_FLAG)) { 583 if (!(val & F_VPD_OP_FLAG)) {
584 CH_ERR("%s: reading EEPROM address 0x%x failed\n", 584 pr_err("%s: reading EEPROM address 0x%x failed\n",
585 adapter->name, addr); 585 adapter->name, addr);
586 return -EIO; 586 return -EIO;
587 } 587 }
@@ -734,8 +734,9 @@ int t1_elmer0_ext_intr_handler(adapter_t *adapter)
734 break; 734 break;
735 case CHBT_BOARD_8000: 735 case CHBT_BOARD_8000:
736 case CHBT_BOARD_CHT110: 736 case CHBT_BOARD_CHT110:
737 CH_DBG(adapter, INTR, "External interrupt cause 0x%x\n", 737 if (netif_msg_intr(adapter))
738 cause); 738 dev_dbg(&adapter->pdev->dev,
739 "External interrupt cause 0x%x\n", cause);
739 if (cause & ELMER0_GP_BIT1) { /* PMC3393 INTB */ 740 if (cause & ELMER0_GP_BIT1) { /* PMC3393 INTB */
740 struct cmac *mac = adapter->port[0].mac; 741 struct cmac *mac = adapter->port[0].mac;
741 742
@@ -746,8 +747,9 @@ int t1_elmer0_ext_intr_handler(adapter_t *adapter)
746 747
747 t1_tpi_read(adapter, 748 t1_tpi_read(adapter,
748 A_ELMER0_GPI_STAT, &mod_detect); 749 A_ELMER0_GPI_STAT, &mod_detect);
749 CH_MSG(adapter, INFO, LINK, "XPAK %s\n", 750 if (netif_msg_link(adapter))
750 mod_detect ? "removed" : "inserted"); 751 dev_info(&adapter->pdev->dev, "XPAK %s\n",
752 mod_detect ? "removed" : "inserted");
751 } 753 }
752 break; 754 break;
753#ifdef CONFIG_CHELSIO_T1_COUGAR 755#ifdef CONFIG_CHELSIO_T1_COUGAR
@@ -1084,7 +1086,7 @@ static void __devinit init_link_config(struct link_config *lc,
1084 1086
1085#ifdef CONFIG_CHELSIO_T1_COUGAR 1087#ifdef CONFIG_CHELSIO_T1_COUGAR
1086 if (bi->clock_cspi && !(adapter->cspi = t1_cspi_create(adapter))) { 1088 if (bi->clock_cspi && !(adapter->cspi = t1_cspi_create(adapter))) {
1087 CH_ERR("%s: CSPI initialization failed\n", 1089 pr_err("%s: CSPI initialization failed\n",
1088 adapter->name); 1090 adapter->name);
1089 goto error; 1091 goto error;
1090 } 1092 }
@@ -1105,20 +1107,20 @@ int __devinit t1_init_sw_modules(adapter_t *adapter,
1105 1107
1106 adapter->sge = t1_sge_create(adapter, &adapter->params.sge); 1108 adapter->sge = t1_sge_create(adapter, &adapter->params.sge);
1107 if (!adapter->sge) { 1109 if (!adapter->sge) {
1108 CH_ERR("%s: SGE initialization failed\n", 1110 pr_err("%s: SGE initialization failed\n",
1109 adapter->name); 1111 adapter->name);
1110 goto error; 1112 goto error;
1111 } 1113 }
1112 1114
1113 if (bi->espi_nports && !(adapter->espi = t1_espi_create(adapter))) { 1115 if (bi->espi_nports && !(adapter->espi = t1_espi_create(adapter))) {
1114 CH_ERR("%s: ESPI initialization failed\n", 1116 pr_err("%s: ESPI initialization failed\n",
1115 adapter->name); 1117 adapter->name);
1116 goto error; 1118 goto error;
1117 } 1119 }
1118 1120
1119 adapter->tp = t1_tp_create(adapter, &adapter->params.tp); 1121 adapter->tp = t1_tp_create(adapter, &adapter->params.tp);
1120 if (!adapter->tp) { 1122 if (!adapter->tp) {
1121 CH_ERR("%s: TP initialization failed\n", 1123 pr_err("%s: TP initialization failed\n",
1122 adapter->name); 1124 adapter->name);
1123 goto error; 1125 goto error;
1124 } 1126 }
@@ -1138,14 +1140,14 @@ int __devinit t1_init_sw_modules(adapter_t *adapter,
1138 adapter->port[i].phy = bi->gphy->create(adapter->port[i].dev, 1140 adapter->port[i].phy = bi->gphy->create(adapter->port[i].dev,
1139 phy_addr, bi->mdio_ops); 1141 phy_addr, bi->mdio_ops);
1140 if (!adapter->port[i].phy) { 1142 if (!adapter->port[i].phy) {
1141 CH_ERR("%s: PHY %d initialization failed\n", 1143 pr_err("%s: PHY %d initialization failed\n",
1142 adapter->name, i); 1144 adapter->name, i);
1143 goto error; 1145 goto error;
1144 } 1146 }
1145 1147
1146 adapter->port[i].mac = mac = bi->gmac->create(adapter, i); 1148 adapter->port[i].mac = mac = bi->gmac->create(adapter, i);
1147 if (!mac) { 1149 if (!mac) {
1148 CH_ERR("%s: MAC %d initialization failed\n", 1150 pr_err("%s: MAC %d initialization failed\n",
1149 adapter->name, i); 1151 adapter->name, i);
1150 goto error; 1152 goto error;
1151 } 1153 }
@@ -1157,7 +1159,7 @@ int __devinit t1_init_sw_modules(adapter_t *adapter,
1157 if (!t1_is_asic(adapter) || bi->chip_mac == CHBT_MAC_DUMMY) 1159 if (!t1_is_asic(adapter) || bi->chip_mac == CHBT_MAC_DUMMY)
1158 mac->ops->macaddress_get(mac, hw_addr); 1160 mac->ops->macaddress_get(mac, hw_addr);
1159 else if (vpd_macaddress_get(adapter, i, hw_addr)) { 1161 else if (vpd_macaddress_get(adapter, i, hw_addr)) {
1160 CH_ERR("%s: could not read MAC address from VPD ROM\n", 1162 pr_err("%s: could not read MAC address from VPD ROM\n",
1161 adapter->port[i].dev->name); 1163 adapter->port[i].dev->name);
1162 goto error; 1164 goto error;
1163 } 1165 }
diff --git a/drivers/net/chelsio/vsc7326.c b/drivers/net/chelsio/vsc7326.c
index 99b51f61fe77..c844111cffeb 100644
--- a/drivers/net/chelsio/vsc7326.c
+++ b/drivers/net/chelsio/vsc7326.c
@@ -48,14 +48,14 @@ static void vsc_read(adapter_t *adapter, u32 addr, u32 *val)
48 i++; 48 i++;
49 } while (((status & 1) == 0) && (i < 50)); 49 } while (((status & 1) == 0) && (i < 50));
50 if (i == 50) 50 if (i == 50)
51 CH_ERR("Invalid tpi read from MAC, breaking loop.\n"); 51 pr_err("Invalid tpi read from MAC, breaking loop.\n");
52 52
53 t1_tpi_read(adapter, (REG_LOCAL_DATA << 2) + 4, &vlo); 53 t1_tpi_read(adapter, (REG_LOCAL_DATA << 2) + 4, &vlo);
54 t1_tpi_read(adapter, REG_LOCAL_DATA << 2, &vhi); 54 t1_tpi_read(adapter, REG_LOCAL_DATA << 2, &vhi);
55 55
56 *val = (vhi << 16) | vlo; 56 *val = (vhi << 16) | vlo;
57 57
58 /* CH_ERR("rd: block: 0x%x sublock: 0x%x reg: 0x%x data: 0x%x\n", 58 /* pr_err("rd: block: 0x%x sublock: 0x%x reg: 0x%x data: 0x%x\n",
59 ((addr&0xe000)>>13), ((addr&0x1e00)>>9), 59 ((addr&0xe000)>>13), ((addr&0x1e00)>>9),
60 ((addr&0x01fe)>>1), *val); */ 60 ((addr&0x01fe)>>1), *val); */
61 spin_unlock_bh(&adapter->mac_lock); 61 spin_unlock_bh(&adapter->mac_lock);
@@ -66,7 +66,7 @@ static void vsc_write(adapter_t *adapter, u32 addr, u32 data)
66 spin_lock_bh(&adapter->mac_lock); 66 spin_lock_bh(&adapter->mac_lock);
67 t1_tpi_write(adapter, (addr << 2) + 4, data & 0xFFFF); 67 t1_tpi_write(adapter, (addr << 2) + 4, data & 0xFFFF);
68 t1_tpi_write(adapter, addr << 2, (data >> 16) & 0xFFFF); 68 t1_tpi_write(adapter, addr << 2, (data >> 16) & 0xFFFF);
69 /* CH_ERR("wr: block: 0x%x sublock: 0x%x reg: 0x%x data: 0x%x\n", 69 /* pr_err("wr: block: 0x%x sublock: 0x%x reg: 0x%x data: 0x%x\n",
70 ((addr&0xe000)>>13), ((addr&0x1e00)>>9), 70 ((addr&0xe000)>>13), ((addr&0x1e00)>>9),
71 ((addr&0x01fe)>>1), data); */ 71 ((addr&0x01fe)>>1), data); */
72 spin_unlock_bh(&adapter->mac_lock); 72 spin_unlock_bh(&adapter->mac_lock);
@@ -225,7 +225,7 @@ static void run_table(adapter_t *adapter, struct init_table *ib, int len)
225 for (i = 0; i < len; i++) { 225 for (i = 0; i < len; i++) {
226 if (ib[i].addr == INITBLOCK_SLEEP) { 226 if (ib[i].addr == INITBLOCK_SLEEP) {
227 udelay( ib[i].data ); 227 udelay( ib[i].data );
228 CH_ERR("sleep %d us\n",ib[i].data); 228 pr_err("sleep %d us\n",ib[i].data);
229 } else 229 } else
230 vsc_write( adapter, ib[i].addr, ib[i].data ); 230 vsc_write( adapter, ib[i].addr, ib[i].data );
231 } 231 }
@@ -241,7 +241,7 @@ static int bist_rd(adapter_t *adapter, int moduleid, int address)
241 (address != 0x2) && 241 (address != 0x2) &&
242 (address != 0xd) && 242 (address != 0xd) &&
243 (address != 0xe)) 243 (address != 0xe))
244 CH_ERR("No bist address: 0x%x\n", address); 244 pr_err("No bist address: 0x%x\n", address);
245 245
246 data = ((0x00 << 24) | ((address & 0xff) << 16) | (0x00 << 8) | 246 data = ((0x00 << 24) | ((address & 0xff) << 16) | (0x00 << 8) |
247 ((moduleid & 0xff) << 0)); 247 ((moduleid & 0xff) << 0));
@@ -251,9 +251,9 @@ static int bist_rd(adapter_t *adapter, int moduleid, int address)
251 251
252 vsc_read(adapter, REG_RAM_BIST_RESULT, &result); 252 vsc_read(adapter, REG_RAM_BIST_RESULT, &result);
253 if ((result & (1 << 9)) != 0x0) 253 if ((result & (1 << 9)) != 0x0)
254 CH_ERR("Still in bist read: 0x%x\n", result); 254 pr_err("Still in bist read: 0x%x\n", result);
255 else if ((result & (1 << 8)) != 0x0) 255 else if ((result & (1 << 8)) != 0x0)
256 CH_ERR("bist read error: 0x%x\n", result); 256 pr_err("bist read error: 0x%x\n", result);
257 257
258 return (result & 0xff); 258 return (result & 0xff);
259} 259}
@@ -268,10 +268,10 @@ static int bist_wr(adapter_t *adapter, int moduleid, int address, int value)
268 (address != 0x2) && 268 (address != 0x2) &&
269 (address != 0xd) && 269 (address != 0xd) &&
270 (address != 0xe)) 270 (address != 0xe))
271 CH_ERR("No bist address: 0x%x\n", address); 271 pr_err("No bist address: 0x%x\n", address);
272 272
273 if (value > 255) 273 if (value > 255)
274 CH_ERR("Suspicious write out of range value: 0x%x\n", value); 274 pr_err("Suspicious write out of range value: 0x%x\n", value);
275 275
276 data = ((0x01 << 24) | ((address & 0xff) << 16) | (value << 8) | 276 data = ((0x01 << 24) | ((address & 0xff) << 16) | (value << 8) |
277 ((moduleid & 0xff) << 0)); 277 ((moduleid & 0xff) << 0));
@@ -281,9 +281,9 @@ static int bist_wr(adapter_t *adapter, int moduleid, int address, int value)
281 281
282 vsc_read(adapter, REG_RAM_BIST_CMD, &result); 282 vsc_read(adapter, REG_RAM_BIST_CMD, &result);
283 if ((result & (1 << 27)) != 0x0) 283 if ((result & (1 << 27)) != 0x0)
284 CH_ERR("Still in bist write: 0x%x\n", result); 284 pr_err("Still in bist write: 0x%x\n", result);
285 else if ((result & (1 << 26)) != 0x0) 285 else if ((result & (1 << 26)) != 0x0)
286 CH_ERR("bist write error: 0x%x\n", result); 286 pr_err("bist write error: 0x%x\n", result);
287 287
288 return 0; 288 return 0;
289} 289}
@@ -306,7 +306,7 @@ static int check_bist(adapter_t *adapter, int moduleid)
306 column = ((bist_rd(adapter,moduleid, 0x0e)<<8) + 306 column = ((bist_rd(adapter,moduleid, 0x0e)<<8) +
307 (bist_rd(adapter,moduleid, 0x0d))); 307 (bist_rd(adapter,moduleid, 0x0d)));
308 if ((result & 3) != 0x3) 308 if ((result & 3) != 0x3)
309 CH_ERR("Result: 0x%x BIST error in ram %d, column: 0x%04x\n", 309 pr_err("Result: 0x%x BIST error in ram %d, column: 0x%04x\n",
310 result, moduleid, column); 310 result, moduleid, column);
311 return 0; 311 return 0;
312} 312}