aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/net1080.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-02-17 05:30:24 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-17 16:35:41 -0500
commita475f603d23392f386e45cf377b17c30ed3bbb80 (patch)
tree47e3377f1a1bf402f33dbddc4e14768e2a9881ec /drivers/net/usb/net1080.c
parent60b86755929e1a7e9038c8d860a8491cfdf8d93a (diff)
drivers/net/usb: Use netif_<level> logging facilities
Convert from: if (netif_msg_<foo>(priv)) dev_<level>(dev... to netif_<level>(priv, foo, dev... Also convert a few: if (i < REG_TIMEOUT) { etc... return ret; } to if (i >= REG_TIMEOUT) goto fail; etc... return ret; Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/net1080.c')
-rw-r--r--drivers/net/usb/net1080.c96
1 files changed, 45 insertions, 51 deletions
diff --git a/drivers/net/usb/net1080.c b/drivers/net/usb/net1080.c
index f6994053c101..bdcad45954a3 100644
--- a/drivers/net/usb/net1080.c
+++ b/drivers/net/usb/net1080.c
@@ -203,26 +203,23 @@ static void nc_dump_registers(struct usbnet *dev)
203 203
204static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl) 204static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl)
205{ 205{
206 if (!netif_msg_link(dev)) 206 netif_dbg(dev, link, dev->net,
207 return; 207 "net1080 %s-%s usbctl 0x%x:%s%s%s%s%s; this%s%s; other%s%s; r/o 0x%x\n",
208 netdev_dbg(dev->net, "net1080 %s-%s usbctl 0x%x:%s%s%s%s%s;" 208 dev->udev->bus->bus_name, dev->udev->devpath,
209 " this%s%s;" 209 usbctl,
210 " other%s%s; r/o 0x%x\n", 210 (usbctl & USBCTL_ENABLE_LANG) ? " lang" : "",
211 dev->udev->bus->bus_name, dev->udev->devpath, 211 (usbctl & USBCTL_ENABLE_MFGR) ? " mfgr" : "",
212 usbctl, 212 (usbctl & USBCTL_ENABLE_PROD) ? " prod" : "",
213 (usbctl & USBCTL_ENABLE_LANG) ? " lang" : "", 213 (usbctl & USBCTL_ENABLE_SERIAL) ? " serial" : "",
214 (usbctl & USBCTL_ENABLE_MFGR) ? " mfgr" : "", 214 (usbctl & USBCTL_ENABLE_DEFAULTS) ? " defaults" : "",
215 (usbctl & USBCTL_ENABLE_PROD) ? " prod" : "", 215
216 (usbctl & USBCTL_ENABLE_SERIAL) ? " serial" : "", 216 (usbctl & USBCTL_FLUSH_THIS) ? " FLUSH" : "",
217 (usbctl & USBCTL_ENABLE_DEFAULTS) ? " defaults" : "", 217 (usbctl & USBCTL_DISCONN_THIS) ? " DIS" : "",
218 218
219 (usbctl & USBCTL_FLUSH_THIS) ? " FLUSH" : "", 219 (usbctl & USBCTL_FLUSH_OTHER) ? " FLUSH" : "",
220 (usbctl & USBCTL_DISCONN_THIS) ? " DIS" : "", 220 (usbctl & USBCTL_DISCONN_OTHER) ? " DIS" : "",
221 221
222 (usbctl & USBCTL_FLUSH_OTHER) ? " FLUSH" : "", 222 usbctl & ~USBCTL_WRITABLE_MASK);
223 (usbctl & USBCTL_DISCONN_OTHER) ? " DIS" : "",
224
225 usbctl & ~USBCTL_WRITABLE_MASK);
226} 223}
227 224
228/*-------------------------------------------------------------------------*/ 225/*-------------------------------------------------------------------------*/
@@ -249,27 +246,26 @@ static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl)
249 246
250static inline void nc_dump_status(struct usbnet *dev, u16 status) 247static inline void nc_dump_status(struct usbnet *dev, u16 status)
251{ 248{
252 if (!netif_msg_link(dev)) 249 netif_dbg(dev, link, dev->net,
253 return; 250 "net1080 %s-%s status 0x%x: this (%c) PKT=%d%s%s%s; other PKT=%d%s%s%s; unspec 0x%x\n",
254 netdev_dbg(dev->net, "net1080 %s-%s status 0x%x: this (%c) PKT=%d%s%s%s; other PKT=%d%s%s%s; unspec 0x%x\n", 251 dev->udev->bus->bus_name, dev->udev->devpath,
255 dev->udev->bus->bus_name, dev->udev->devpath, 252 status,
256 status, 253
257 254 // XXX the packet counts don't seem right
258 // XXX the packet counts don't seem right 255 // (1 at reset, not 0); maybe UNSPEC too
259 // (1 at reset, not 0); maybe UNSPEC too 256
260 257 (status & STATUS_PORT_A) ? 'A' : 'B',
261 (status & STATUS_PORT_A) ? 'A' : 'B', 258 STATUS_PACKETS_THIS(status),
262 STATUS_PACKETS_THIS(status), 259 (status & STATUS_CONN_THIS) ? " CON" : "",
263 (status & STATUS_CONN_THIS) ? " CON" : "", 260 (status & STATUS_SUSPEND_THIS) ? " SUS" : "",
264 (status & STATUS_SUSPEND_THIS) ? " SUS" : "", 261 (status & STATUS_MAILBOX_THIS) ? " MBOX" : "",
265 (status & STATUS_MAILBOX_THIS) ? " MBOX" : "", 262
266 263 STATUS_PACKETS_OTHER(status),
267 STATUS_PACKETS_OTHER(status), 264 (status & STATUS_CONN_OTHER) ? " CON" : "",
268 (status & STATUS_CONN_OTHER) ? " CON" : "", 265 (status & STATUS_SUSPEND_OTHER) ? " SUS" : "",
269 (status & STATUS_SUSPEND_OTHER) ? " SUS" : "", 266 (status & STATUS_MAILBOX_OTHER) ? " MBOX" : "",
270 (status & STATUS_MAILBOX_OTHER) ? " MBOX" : "", 267
271 268 status & STATUS_UNSPEC_MASK);
272 status & STATUS_UNSPEC_MASK);
273} 269}
274 270
275/*-------------------------------------------------------------------------*/ 271/*-------------------------------------------------------------------------*/
@@ -284,10 +280,9 @@ static inline void nc_dump_status(struct usbnet *dev, u16 status)
284 280
285static inline void nc_dump_ttl(struct usbnet *dev, u16 ttl) 281static inline void nc_dump_ttl(struct usbnet *dev, u16 ttl)
286{ 282{
287 if (netif_msg_link(dev)) 283 netif_dbg(dev, link, dev->net, "net1080 %s-%s ttl 0x%x this = %d, other = %d\n",
288 netdev_dbg(dev->net, "net1080 %s-%s ttl 0x%x this = %d, other = %d\n", 284 dev->udev->bus->bus_name, dev->udev->devpath,
289 dev->udev->bus->bus_name, dev->udev->devpath, 285 ttl, TTL_THIS(ttl), TTL_OTHER(ttl));
290 ttl, TTL_THIS(ttl), TTL_OTHER(ttl));
291} 286}
292 287
293/*-------------------------------------------------------------------------*/ 288/*-------------------------------------------------------------------------*/
@@ -332,10 +327,9 @@ static int net1080_reset(struct usbnet *dev)
332 MK_TTL(NC_READ_TTL_MS, TTL_OTHER(ttl)) ); 327 MK_TTL(NC_READ_TTL_MS, TTL_OTHER(ttl)) );
333 dbg("%s: assigned TTL, %d ms", dev->net->name, NC_READ_TTL_MS); 328 dbg("%s: assigned TTL, %d ms", dev->net->name, NC_READ_TTL_MS);
334 329
335 if (netif_msg_link(dev)) 330 netif_info(dev, link, dev->net, "port %c, peer %sconnected\n",
336 netdev_info(dev->net, "port %c, peer %sconnected\n", 331 (status & STATUS_PORT_A) ? 'A' : 'B',
337 (status & STATUS_PORT_A) ? 'A' : 'B', 332 (status & STATUS_CONN_OTHER) ? "" : "dis");
338 (status & STATUS_CONN_OTHER) ? "" : "dis");
339 retval = 0; 333 retval = 0;
340 334
341done: 335done:
@@ -412,8 +406,8 @@ static void nc_ensure_sync(struct usbnet *dev)
412 return; 406 return;
413 } 407 }
414 408
415 if (netif_msg_rx_err(dev)) 409 netif_dbg(dev, rx_err, dev->net,
416 netdev_dbg(dev->net, "flush net1080; too many framing errors\n"); 410 "flush net1080; too many framing errors\n");
417 dev->frame_errors = 0; 411 dev->frame_errors = 0;
418 } 412 }
419} 413}