aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/io.h
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2010-06-23 07:30:07 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-25 01:13:22 -0400
commit62776d034cc40c49bafdb3551a6ba35f78e3f08d (patch)
tree1cd2132940ced266ad53619a0c947e153cc83a5e /drivers/net/sfc/io.h
parent0c605a2061670412d3b5580c92f1e161b1a693d2 (diff)
sfc: Implement message level control
Replace EFX_ERR() with netif_err(), EFX_INFO() with netif_info(), EFX_LOG() with netif_dbg() and EFX_TRACE() and EFX_REGDUMP() with netif_vdbg(). Replace EFX_ERR_RL(), EFX_INFO_RL() and EFX_LOG_RL() using explicit calls to net_ratelimit(). Implement the ethtool operations to get and set message level flags, and add a 'debug' module parameter for the initial value. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/io.h')
-rw-r--r--drivers/net/sfc/io.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/drivers/net/sfc/io.h b/drivers/net/sfc/io.h
index 4317574c772d..85a99fe87437 100644
--- a/drivers/net/sfc/io.h
+++ b/drivers/net/sfc/io.h
@@ -78,8 +78,9 @@ static inline void efx_writeo(struct efx_nic *efx, efx_oword_t *value,
78{ 78{
79 unsigned long flags __attribute__ ((unused)); 79 unsigned long flags __attribute__ ((unused));
80 80
81 EFX_REGDUMP(efx, "writing register %x with " EFX_OWORD_FMT "\n", reg, 81 netif_vdbg(efx, hw, efx->net_dev,
82 EFX_OWORD_VAL(*value)); 82 "writing register %x with " EFX_OWORD_FMT "\n", reg,
83 EFX_OWORD_VAL(*value));
83 84
84 spin_lock_irqsave(&efx->biu_lock, flags); 85 spin_lock_irqsave(&efx->biu_lock, flags);
85#ifdef EFX_USE_QWORD_IO 86#ifdef EFX_USE_QWORD_IO
@@ -105,8 +106,9 @@ static inline void efx_sram_writeq(struct efx_nic *efx, void __iomem *membase,
105 unsigned int addr = index * sizeof(*value); 106 unsigned int addr = index * sizeof(*value);
106 unsigned long flags __attribute__ ((unused)); 107 unsigned long flags __attribute__ ((unused));
107 108
108 EFX_REGDUMP(efx, "writing SRAM address %x with " EFX_QWORD_FMT "\n", 109 netif_vdbg(efx, hw, efx->net_dev,
109 addr, EFX_QWORD_VAL(*value)); 110 "writing SRAM address %x with " EFX_QWORD_FMT "\n",
111 addr, EFX_QWORD_VAL(*value));
110 112
111 spin_lock_irqsave(&efx->biu_lock, flags); 113 spin_lock_irqsave(&efx->biu_lock, flags);
112#ifdef EFX_USE_QWORD_IO 114#ifdef EFX_USE_QWORD_IO
@@ -129,8 +131,9 @@ static inline void efx_sram_writeq(struct efx_nic *efx, void __iomem *membase,
129static inline void efx_writed(struct efx_nic *efx, efx_dword_t *value, 131static inline void efx_writed(struct efx_nic *efx, efx_dword_t *value,
130 unsigned int reg) 132 unsigned int reg)
131{ 133{
132 EFX_REGDUMP(efx, "writing partial register %x with "EFX_DWORD_FMT"\n", 134 netif_vdbg(efx, hw, efx->net_dev,
133 reg, EFX_DWORD_VAL(*value)); 135 "writing partial register %x with "EFX_DWORD_FMT"\n",
136 reg, EFX_DWORD_VAL(*value));
134 137
135 /* No lock required */ 138 /* No lock required */
136 _efx_writed(efx, value->u32[0], reg); 139 _efx_writed(efx, value->u32[0], reg);
@@ -155,8 +158,9 @@ static inline void efx_reado(struct efx_nic *efx, efx_oword_t *value,
155 value->u32[3] = _efx_readd(efx, reg + 12); 158 value->u32[3] = _efx_readd(efx, reg + 12);
156 spin_unlock_irqrestore(&efx->biu_lock, flags); 159 spin_unlock_irqrestore(&efx->biu_lock, flags);
157 160
158 EFX_REGDUMP(efx, "read from register %x, got " EFX_OWORD_FMT "\n", reg, 161 netif_vdbg(efx, hw, efx->net_dev,
159 EFX_OWORD_VAL(*value)); 162 "read from register %x, got " EFX_OWORD_FMT "\n", reg,
163 EFX_OWORD_VAL(*value));
160} 164}
161 165
162/* Read an 8-byte SRAM entry through supplied mapping, 166/* Read an 8-byte SRAM entry through supplied mapping,
@@ -177,8 +181,9 @@ static inline void efx_sram_readq(struct efx_nic *efx, void __iomem *membase,
177#endif 181#endif
178 spin_unlock_irqrestore(&efx->biu_lock, flags); 182 spin_unlock_irqrestore(&efx->biu_lock, flags);
179 183
180 EFX_REGDUMP(efx, "read from SRAM address %x, got "EFX_QWORD_FMT"\n", 184 netif_vdbg(efx, hw, efx->net_dev,
181 addr, EFX_QWORD_VAL(*value)); 185 "read from SRAM address %x, got "EFX_QWORD_FMT"\n",
186 addr, EFX_QWORD_VAL(*value));
182} 187}
183 188
184/* Read dword from register that allows partial writes (sic) */ 189/* Read dword from register that allows partial writes (sic) */
@@ -186,8 +191,9 @@ static inline void efx_readd(struct efx_nic *efx, efx_dword_t *value,
186 unsigned int reg) 191 unsigned int reg)
187{ 192{
188 value->u32[0] = _efx_readd(efx, reg); 193 value->u32[0] = _efx_readd(efx, reg);
189 EFX_REGDUMP(efx, "read from register %x, got "EFX_DWORD_FMT"\n", 194 netif_vdbg(efx, hw, efx->net_dev,
190 reg, EFX_DWORD_VAL(*value)); 195 "read from register %x, got "EFX_DWORD_FMT"\n",
196 reg, EFX_DWORD_VAL(*value));
191} 197}
192 198
193/* Write to a register forming part of a table */ 199/* Write to a register forming part of a table */