diff options
author | Joe Perches <joe@perches.com> | 2010-02-17 05:30:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 16:35:41 -0500 |
commit | a475f603d23392f386e45cf377b17c30ed3bbb80 (patch) | |
tree | 47e3377f1a1bf402f33dbddc4e14768e2a9881ec /drivers/net/usb | |
parent | 60b86755929e1a7e9038c8d860a8491cfdf8d93a (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')
-rw-r--r-- | drivers/net/usb/cdc_ether.c | 18 | ||||
-rw-r--r-- | drivers/net/usb/net1080.c | 96 | ||||
-rw-r--r-- | drivers/net/usb/pegasus.c | 170 | ||||
-rw-r--r-- | drivers/net/usb/rndis_host.c | 14 | ||||
-rw-r--r-- | drivers/net/usb/smsc95xx.c | 99 | ||||
-rw-r--r-- | drivers/net/usb/usbnet.c | 208 |
6 files changed, 264 insertions, 341 deletions
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 7e5a75269cc5..3486e8ca039a 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -339,10 +339,10 @@ EXPORT_SYMBOL_GPL(usbnet_cdc_unbind); | |||
339 | 339 | ||
340 | static void dumpspeed(struct usbnet *dev, __le32 *speeds) | 340 | static void dumpspeed(struct usbnet *dev, __le32 *speeds) |
341 | { | 341 | { |
342 | if (netif_msg_timer(dev)) | 342 | netif_info(dev, timer, dev->net, |
343 | netdev_info(dev->net, "link speeds: %u kbps up, %u kbps down\n", | 343 | "link speeds: %u kbps up, %u kbps down\n", |
344 | __le32_to_cpu(speeds[0]) / 1000, | 344 | __le32_to_cpu(speeds[0]) / 1000, |
345 | __le32_to_cpu(speeds[1]) / 1000); | 345 | __le32_to_cpu(speeds[1]) / 1000); |
346 | } | 346 | } |
347 | 347 | ||
348 | static void cdc_status(struct usbnet *dev, struct urb *urb) | 348 | static void cdc_status(struct usbnet *dev, struct urb *urb) |
@@ -361,18 +361,16 @@ static void cdc_status(struct usbnet *dev, struct urb *urb) | |||
361 | event = urb->transfer_buffer; | 361 | event = urb->transfer_buffer; |
362 | switch (event->bNotificationType) { | 362 | switch (event->bNotificationType) { |
363 | case USB_CDC_NOTIFY_NETWORK_CONNECTION: | 363 | case USB_CDC_NOTIFY_NETWORK_CONNECTION: |
364 | if (netif_msg_timer(dev)) | 364 | netif_dbg(dev, timer, dev->net, "CDC: carrier %s\n", |
365 | netdev_dbg(dev->net, "CDC: carrier %s\n", | 365 | event->wValue ? "on" : "off"); |
366 | event->wValue ? "on" : "off"); | ||
367 | if (event->wValue) | 366 | if (event->wValue) |
368 | netif_carrier_on(dev->net); | 367 | netif_carrier_on(dev->net); |
369 | else | 368 | else |
370 | netif_carrier_off(dev->net); | 369 | netif_carrier_off(dev->net); |
371 | break; | 370 | break; |
372 | case USB_CDC_NOTIFY_SPEED_CHANGE: /* tx/rx rates */ | 371 | case USB_CDC_NOTIFY_SPEED_CHANGE: /* tx/rx rates */ |
373 | if (netif_msg_timer(dev)) | 372 | netif_dbg(dev, timer, dev->net, "CDC: speed change (len %d)\n", |
374 | netdev_dbg(dev->net, "CDC: speed change (len %d)\n", | 373 | urb->actual_length); |
375 | urb->actual_length); | ||
376 | if (urb->actual_length != (sizeof *event + 8)) | 374 | if (urb->actual_length != (sizeof *event + 8)) |
377 | set_bit(EVENT_STS_SPLIT, &dev->flags); | 375 | set_bit(EVENT_STS_SPLIT, &dev->flags); |
378 | else | 376 | else |
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 | ||
204 | static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl) | 204 | static 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 | ||
250 | static inline void nc_dump_status(struct usbnet *dev, u16 status) | 247 | static 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 | ||
285 | static inline void nc_dump_ttl(struct usbnet *dev, u16 ttl) | 281 | static 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 | ||
341 | done: | 335 | done: |
@@ -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 | } |
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index 44ae8f6d3135..41838773b568 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c | |||
@@ -132,9 +132,10 @@ static void ctrl_callback(struct urb *urb) | |||
132 | case -ENOENT: | 132 | case -ENOENT: |
133 | break; | 133 | break; |
134 | default: | 134 | default: |
135 | if (netif_msg_drv(pegasus) && printk_ratelimit()) | 135 | if (net_ratelimit()) |
136 | dev_dbg(&pegasus->intf->dev, "%s, status %d\n", | 136 | netif_dbg(pegasus, drv, pegasus->net, |
137 | __func__, status); | 137 | "%s, status %d\n", __func__, status); |
138 | break; | ||
138 | } | 139 | } |
139 | pegasus->flags &= ~ETH_REGS_CHANGED; | 140 | pegasus->flags &= ~ETH_REGS_CHANGED; |
140 | wake_up(&pegasus->ctrl_wait); | 141 | wake_up(&pegasus->ctrl_wait); |
@@ -149,9 +150,8 @@ static int get_registers(pegasus_t * pegasus, __u16 indx, __u16 size, | |||
149 | 150 | ||
150 | buffer = kmalloc(size, GFP_KERNEL); | 151 | buffer = kmalloc(size, GFP_KERNEL); |
151 | if (!buffer) { | 152 | if (!buffer) { |
152 | if (netif_msg_drv(pegasus)) | 153 | netif_warn(pegasus, drv, pegasus->net, |
153 | dev_warn(&pegasus->intf->dev, "out of memory in %s\n", | 154 | "out of memory in %s\n", __func__); |
154 | __func__); | ||
155 | return -ENOMEM; | 155 | return -ENOMEM; |
156 | } | 156 | } |
157 | add_wait_queue(&pegasus->ctrl_wait, &wait); | 157 | add_wait_queue(&pegasus->ctrl_wait, &wait); |
@@ -181,9 +181,9 @@ static int get_registers(pegasus_t * pegasus, __u16 indx, __u16 size, | |||
181 | set_current_state(TASK_RUNNING); | 181 | set_current_state(TASK_RUNNING); |
182 | if (ret == -ENODEV) | 182 | if (ret == -ENODEV) |
183 | netif_device_detach(pegasus->net); | 183 | netif_device_detach(pegasus->net); |
184 | if (netif_msg_drv(pegasus) && printk_ratelimit()) | 184 | if (net_ratelimit()) |
185 | dev_err(&pegasus->intf->dev, "%s, status %d\n", | 185 | netif_err(pegasus, drv, pegasus->net, |
186 | __func__, ret); | 186 | "%s, status %d\n", __func__, ret); |
187 | goto out; | 187 | goto out; |
188 | } | 188 | } |
189 | 189 | ||
@@ -205,9 +205,8 @@ static int set_registers(pegasus_t * pegasus, __u16 indx, __u16 size, | |||
205 | 205 | ||
206 | buffer = kmalloc(size, GFP_KERNEL); | 206 | buffer = kmalloc(size, GFP_KERNEL); |
207 | if (!buffer) { | 207 | if (!buffer) { |
208 | if (netif_msg_drv(pegasus)) | 208 | netif_warn(pegasus, drv, pegasus->net, |
209 | dev_warn(&pegasus->intf->dev, "out of memory in %s\n", | 209 | "out of memory in %s\n", __func__); |
210 | __func__); | ||
211 | return -ENOMEM; | 210 | return -ENOMEM; |
212 | } | 211 | } |
213 | memcpy(buffer, data, size); | 212 | memcpy(buffer, data, size); |
@@ -237,9 +236,8 @@ static int set_registers(pegasus_t * pegasus, __u16 indx, __u16 size, | |||
237 | if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) { | 236 | if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) { |
238 | if (ret == -ENODEV) | 237 | if (ret == -ENODEV) |
239 | netif_device_detach(pegasus->net); | 238 | netif_device_detach(pegasus->net); |
240 | if (netif_msg_drv(pegasus)) | 239 | netif_err(pegasus, drv, pegasus->net, |
241 | dev_err(&pegasus->intf->dev, "%s, status %d\n", | 240 | "%s, status %d\n", __func__, ret); |
242 | __func__, ret); | ||
243 | goto out; | 241 | goto out; |
244 | } | 242 | } |
245 | 243 | ||
@@ -259,9 +257,8 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data) | |||
259 | 257 | ||
260 | tmp = kmalloc(1, GFP_KERNEL); | 258 | tmp = kmalloc(1, GFP_KERNEL); |
261 | if (!tmp) { | 259 | if (!tmp) { |
262 | if (netif_msg_drv(pegasus)) | 260 | netif_warn(pegasus, drv, pegasus->net, |
263 | dev_warn(&pegasus->intf->dev, "out of memory in %s\n", | 261 | "out of memory in %s\n", __func__); |
264 | __func__); | ||
265 | return -ENOMEM; | 262 | return -ENOMEM; |
266 | } | 263 | } |
267 | memcpy(tmp, &data, 1); | 264 | memcpy(tmp, &data, 1); |
@@ -290,9 +287,9 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data) | |||
290 | if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) { | 287 | if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) { |
291 | if (ret == -ENODEV) | 288 | if (ret == -ENODEV) |
292 | netif_device_detach(pegasus->net); | 289 | netif_device_detach(pegasus->net); |
293 | if (netif_msg_drv(pegasus) && printk_ratelimit()) | 290 | if (net_ratelimit()) |
294 | dev_err(&pegasus->intf->dev, "%s, status %d\n", | 291 | netif_err(pegasus, drv, pegasus->net, |
295 | __func__, ret); | 292 | "%s, status %d\n", __func__, ret); |
296 | goto out; | 293 | goto out; |
297 | } | 294 | } |
298 | 295 | ||
@@ -323,9 +320,8 @@ static int update_eth_regs_async(pegasus_t * pegasus) | |||
323 | if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) { | 320 | if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) { |
324 | if (ret == -ENODEV) | 321 | if (ret == -ENODEV) |
325 | netif_device_detach(pegasus->net); | 322 | netif_device_detach(pegasus->net); |
326 | if (netif_msg_drv(pegasus)) | 323 | netif_err(pegasus, drv, pegasus->net, |
327 | dev_err(&pegasus->intf->dev, "%s, status %d\n", | 324 | "%s, status %d\n", __func__, ret); |
328 | __func__, ret); | ||
329 | } | 325 | } |
330 | 326 | ||
331 | return ret; | 327 | return ret; |
@@ -349,14 +345,16 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd) | |||
349 | if (data[0] & PHY_DONE) | 345 | if (data[0] & PHY_DONE) |
350 | break; | 346 | break; |
351 | } | 347 | } |
352 | if (i < REG_TIMEOUT) { | 348 | |
353 | ret = get_registers(pegasus, PhyData, 2, ®di); | 349 | if (i >= REG_TIMEOUT) |
354 | *regd = le16_to_cpu(regdi); | 350 | goto fail; |
355 | return ret; | 351 | |
356 | } | 352 | ret = get_registers(pegasus, PhyData, 2, ®di); |
353 | *regd = le16_to_cpu(regdi); | ||
354 | return ret; | ||
355 | |||
357 | fail: | 356 | fail: |
358 | if (netif_msg_drv(pegasus)) | 357 | netif_warn(pegasus, drv, pegasus->net, "%s failed\n", __func__); |
359 | dev_warn(&pegasus->intf->dev, "%s failed\n", __func__); | ||
360 | 358 | ||
361 | return ret; | 359 | return ret; |
362 | } | 360 | } |
@@ -388,12 +386,14 @@ static int write_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 regd) | |||
388 | if (data[0] & PHY_DONE) | 386 | if (data[0] & PHY_DONE) |
389 | break; | 387 | break; |
390 | } | 388 | } |
391 | if (i < REG_TIMEOUT) | 389 | |
392 | return ret; | 390 | if (i >= REG_TIMEOUT) |
391 | goto fail; | ||
392 | |||
393 | return ret; | ||
393 | 394 | ||
394 | fail: | 395 | fail: |
395 | if (netif_msg_drv(pegasus)) | 396 | netif_warn(pegasus, drv, pegasus->net, "%s failed\n", __func__); |
396 | dev_warn(&pegasus->intf->dev, "%s failed\n", __func__); | ||
397 | return -ETIMEDOUT; | 397 | return -ETIMEDOUT; |
398 | } | 398 | } |
399 | 399 | ||
@@ -422,15 +422,15 @@ static int read_eprom_word(pegasus_t * pegasus, __u8 index, __u16 * retdata) | |||
422 | if (ret == -ESHUTDOWN) | 422 | if (ret == -ESHUTDOWN) |
423 | goto fail; | 423 | goto fail; |
424 | } | 424 | } |
425 | if (i < REG_TIMEOUT) { | 425 | if (i >= REG_TIMEOUT) |
426 | ret = get_registers(pegasus, EpromData, 2, &retdatai); | 426 | goto fail; |
427 | *retdata = le16_to_cpu(retdatai); | 427 | |
428 | return ret; | 428 | ret = get_registers(pegasus, EpromData, 2, &retdatai); |
429 | } | 429 | *retdata = le16_to_cpu(retdatai); |
430 | return ret; | ||
430 | 431 | ||
431 | fail: | 432 | fail: |
432 | if (netif_msg_drv(pegasus)) | 433 | netif_warn(pegasus, drv, pegasus->net, "%s failed\n", __func__); |
433 | dev_warn(&pegasus->intf->dev, "%s failed\n", __func__); | ||
434 | return -ETIMEDOUT; | 434 | return -ETIMEDOUT; |
435 | } | 435 | } |
436 | 436 | ||
@@ -475,11 +475,13 @@ static int write_eprom_word(pegasus_t * pegasus, __u8 index, __u16 data) | |||
475 | break; | 475 | break; |
476 | } | 476 | } |
477 | disable_eprom_write(pegasus); | 477 | disable_eprom_write(pegasus); |
478 | if (i < REG_TIMEOUT) | 478 | if (i >= REG_TIMEOUT) |
479 | return ret; | 479 | goto fail; |
480 | |||
481 | return ret; | ||
482 | |||
480 | fail: | 483 | fail: |
481 | if (netif_msg_drv(pegasus)) | 484 | netif_warn(pegasus, drv, pegasus->net, "%s failed\n", __func__); |
482 | dev_warn(&pegasus->intf->dev, "%s failed\n", __func__); | ||
483 | return -ETIMEDOUT; | 485 | return -ETIMEDOUT; |
484 | } | 486 | } |
485 | #endif /* PEGASUS_WRITE_EEPROM */ | 487 | #endif /* PEGASUS_WRITE_EEPROM */ |
@@ -642,25 +644,20 @@ static void read_bulk_callback(struct urb *urb) | |||
642 | case 0: | 644 | case 0: |
643 | break; | 645 | break; |
644 | case -ETIME: | 646 | case -ETIME: |
645 | if (netif_msg_rx_err(pegasus)) | 647 | netif_dbg(pegasus, rx_err, net, "reset MAC\n"); |
646 | pr_debug("%s: reset MAC\n", net->name); | ||
647 | pegasus->flags &= ~PEGASUS_RX_BUSY; | 648 | pegasus->flags &= ~PEGASUS_RX_BUSY; |
648 | break; | 649 | break; |
649 | case -EPIPE: /* stall, or disconnect from TT */ | 650 | case -EPIPE: /* stall, or disconnect from TT */ |
650 | /* FIXME schedule work to clear the halt */ | 651 | /* FIXME schedule work to clear the halt */ |
651 | if (netif_msg_rx_err(pegasus)) | 652 | netif_warn(pegasus, rx_err, net, "no rx stall recovery\n"); |
652 | printk(KERN_WARNING "%s: no rx stall recovery\n", | ||
653 | net->name); | ||
654 | return; | 653 | return; |
655 | case -ENOENT: | 654 | case -ENOENT: |
656 | case -ECONNRESET: | 655 | case -ECONNRESET: |
657 | case -ESHUTDOWN: | 656 | case -ESHUTDOWN: |
658 | if (netif_msg_ifdown(pegasus)) | 657 | netif_dbg(pegasus, ifdown, net, "rx unlink, %d\n", status); |
659 | pr_debug("%s: rx unlink, %d\n", net->name, status); | ||
660 | return; | 658 | return; |
661 | default: | 659 | default: |
662 | if (netif_msg_rx_err(pegasus)) | 660 | netif_dbg(pegasus, rx_err, net, "RX status %d\n", status); |
663 | pr_debug("%s: RX status %d\n", net->name, status); | ||
664 | goto goon; | 661 | goto goon; |
665 | } | 662 | } |
666 | 663 | ||
@@ -669,9 +666,8 @@ static void read_bulk_callback(struct urb *urb) | |||
669 | 666 | ||
670 | rx_status = buf[count - 2]; | 667 | rx_status = buf[count - 2]; |
671 | if (rx_status & 0x1e) { | 668 | if (rx_status & 0x1e) { |
672 | if (netif_msg_rx_err(pegasus)) | 669 | netif_dbg(pegasus, rx_err, net, |
673 | pr_debug("%s: RX packet error %x\n", | 670 | "RX packet error %x\n", rx_status); |
674 | net->name, rx_status); | ||
675 | pegasus->stats.rx_errors++; | 671 | pegasus->stats.rx_errors++; |
676 | if (rx_status & 0x06) // long or runt | 672 | if (rx_status & 0x06) // long or runt |
677 | pegasus->stats.rx_length_errors++; | 673 | pegasus->stats.rx_length_errors++; |
@@ -758,9 +754,7 @@ static void rx_fixup(unsigned long data) | |||
758 | pegasus->rx_skb = pull_skb(pegasus); | 754 | pegasus->rx_skb = pull_skb(pegasus); |
759 | } | 755 | } |
760 | if (pegasus->rx_skb == NULL) { | 756 | if (pegasus->rx_skb == NULL) { |
761 | if (netif_msg_rx_err(pegasus)) | 757 | netif_warn(pegasus, rx_err, pegasus->net, "low on memory\n"); |
762 | printk(KERN_WARNING "%s: low on memory\n", | ||
763 | pegasus->net->name); | ||
764 | tasklet_schedule(&pegasus->rx_tl); | 758 | tasklet_schedule(&pegasus->rx_tl); |
765 | goto done; | 759 | goto done; |
766 | } | 760 | } |
@@ -800,19 +794,15 @@ static void write_bulk_callback(struct urb *urb) | |||
800 | case -EPIPE: | 794 | case -EPIPE: |
801 | /* FIXME schedule_work() to clear the tx halt */ | 795 | /* FIXME schedule_work() to clear the tx halt */ |
802 | netif_stop_queue(net); | 796 | netif_stop_queue(net); |
803 | if (netif_msg_tx_err(pegasus)) | 797 | netif_warn(pegasus, tx_err, net, "no tx stall recovery\n"); |
804 | printk(KERN_WARNING "%s: no tx stall recovery\n", | ||
805 | net->name); | ||
806 | return; | 798 | return; |
807 | case -ENOENT: | 799 | case -ENOENT: |
808 | case -ECONNRESET: | 800 | case -ECONNRESET: |
809 | case -ESHUTDOWN: | 801 | case -ESHUTDOWN: |
810 | if (netif_msg_ifdown(pegasus)) | 802 | netif_dbg(pegasus, ifdown, net, "tx unlink, %d\n", status); |
811 | pr_debug("%s: tx unlink, %d\n", net->name, status); | ||
812 | return; | 803 | return; |
813 | default: | 804 | default: |
814 | if (netif_msg_tx_err(pegasus)) | 805 | netif_info(pegasus, tx_err, net, "TX status %d\n", status); |
815 | pr_info("%s: TX status %d\n", net->name, status); | ||
816 | /* FALL THROUGH */ | 806 | /* FALL THROUGH */ |
817 | case 0: | 807 | case 0: |
818 | break; | 808 | break; |
@@ -843,9 +833,7 @@ static void intr_callback(struct urb *urb) | |||
843 | /* some Pegasus-I products report LOTS of data | 833 | /* some Pegasus-I products report LOTS of data |
844 | * toggle errors... avoid log spamming | 834 | * toggle errors... avoid log spamming |
845 | */ | 835 | */ |
846 | if (netif_msg_timer(pegasus)) | 836 | netif_dbg(pegasus, timer, net, "intr status %d\n", status); |
847 | pr_debug("%s: intr status %d\n", net->name, | ||
848 | status); | ||
849 | } | 837 | } |
850 | 838 | ||
851 | if (urb->actual_length >= 6) { | 839 | if (urb->actual_length >= 6) { |
@@ -875,16 +863,15 @@ static void intr_callback(struct urb *urb) | |||
875 | res = usb_submit_urb(urb, GFP_ATOMIC); | 863 | res = usb_submit_urb(urb, GFP_ATOMIC); |
876 | if (res == -ENODEV) | 864 | if (res == -ENODEV) |
877 | netif_device_detach(pegasus->net); | 865 | netif_device_detach(pegasus->net); |
878 | if (res && netif_msg_timer(pegasus)) | 866 | if (res) |
879 | printk(KERN_ERR "%s: can't resubmit interrupt urb, %d\n", | 867 | netif_err(pegasus, timer, net, |
880 | net->name, res); | 868 | "can't resubmit interrupt urb, %d\n", res); |
881 | } | 869 | } |
882 | 870 | ||
883 | static void pegasus_tx_timeout(struct net_device *net) | 871 | static void pegasus_tx_timeout(struct net_device *net) |
884 | { | 872 | { |
885 | pegasus_t *pegasus = netdev_priv(net); | 873 | pegasus_t *pegasus = netdev_priv(net); |
886 | if (netif_msg_timer(pegasus)) | 874 | netif_warn(pegasus, timer, net, "tx timeout\n"); |
887 | printk(KERN_WARNING "%s: tx timeout\n", net->name); | ||
888 | usb_unlink_urb(pegasus->tx_urb); | 875 | usb_unlink_urb(pegasus->tx_urb); |
889 | pegasus->stats.tx_errors++; | 876 | pegasus->stats.tx_errors++; |
890 | } | 877 | } |
@@ -906,9 +893,7 @@ static netdev_tx_t pegasus_start_xmit(struct sk_buff *skb, | |||
906 | pegasus->tx_buff, count, | 893 | pegasus->tx_buff, count, |
907 | write_bulk_callback, pegasus); | 894 | write_bulk_callback, pegasus); |
908 | if ((res = usb_submit_urb(pegasus->tx_urb, GFP_ATOMIC))) { | 895 | if ((res = usb_submit_urb(pegasus->tx_urb, GFP_ATOMIC))) { |
909 | if (netif_msg_tx_err(pegasus)) | 896 | netif_warn(pegasus, tx_err, net, "fail tx, %d\n", res); |
910 | printk(KERN_WARNING "%s: fail tx, %d\n", | ||
911 | net->name, res); | ||
912 | switch (res) { | 897 | switch (res) { |
913 | case -EPIPE: /* stall, or disconnect from TT */ | 898 | case -EPIPE: /* stall, or disconnect from TT */ |
914 | /* cleanup should already have been scheduled */ | 899 | /* cleanup should already have been scheduled */ |
@@ -952,10 +937,9 @@ static inline void get_interrupt_interval(pegasus_t * pegasus) | |||
952 | interval = data >> 8; | 937 | interval = data >> 8; |
953 | if (pegasus->usb->speed != USB_SPEED_HIGH) { | 938 | if (pegasus->usb->speed != USB_SPEED_HIGH) { |
954 | if (interval < 0x80) { | 939 | if (interval < 0x80) { |
955 | if (netif_msg_timer(pegasus)) | 940 | netif_info(pegasus, timer, pegasus->net, |
956 | dev_info(&pegasus->intf->dev, "intr interval " | 941 | "intr interval changed from %ums to %ums\n", |
957 | "changed from %ums to %ums\n", | 942 | interval, 0x80); |
958 | interval, 0x80); | ||
959 | interval = 0x80; | 943 | interval = 0x80; |
960 | data = (data & 0x00FF) | ((u16)interval << 8); | 944 | data = (data & 0x00FF) | ((u16)interval << 8); |
961 | #ifdef PEGASUS_WRITE_EEPROM | 945 | #ifdef PEGASUS_WRITE_EEPROM |
@@ -1046,8 +1030,7 @@ static int pegasus_open(struct net_device *net) | |||
1046 | if ((res = usb_submit_urb(pegasus->rx_urb, GFP_KERNEL))) { | 1030 | if ((res = usb_submit_urb(pegasus->rx_urb, GFP_KERNEL))) { |
1047 | if (res == -ENODEV) | 1031 | if (res == -ENODEV) |
1048 | netif_device_detach(pegasus->net); | 1032 | netif_device_detach(pegasus->net); |
1049 | if (netif_msg_ifup(pegasus)) | 1033 | netif_dbg(pegasus, ifup, net, "failed rx_urb, %d\n", res); |
1050 | pr_debug("%s: failed rx_urb, %d", net->name, res); | ||
1051 | goto exit; | 1034 | goto exit; |
1052 | } | 1035 | } |
1053 | 1036 | ||
@@ -1058,15 +1041,13 @@ static int pegasus_open(struct net_device *net) | |||
1058 | if ((res = usb_submit_urb(pegasus->intr_urb, GFP_KERNEL))) { | 1041 | if ((res = usb_submit_urb(pegasus->intr_urb, GFP_KERNEL))) { |
1059 | if (res == -ENODEV) | 1042 | if (res == -ENODEV) |
1060 | netif_device_detach(pegasus->net); | 1043 | netif_device_detach(pegasus->net); |
1061 | if (netif_msg_ifup(pegasus)) | 1044 | netif_dbg(pegasus, ifup, net, "failed intr_urb, %d\n", res); |
1062 | pr_debug("%s: failed intr_urb, %d\n", net->name, res); | ||
1063 | usb_kill_urb(pegasus->rx_urb); | 1045 | usb_kill_urb(pegasus->rx_urb); |
1064 | goto exit; | 1046 | goto exit; |
1065 | } | 1047 | } |
1066 | if ((res = enable_net_traffic(net, pegasus->usb))) { | 1048 | if ((res = enable_net_traffic(net, pegasus->usb))) { |
1067 | if (netif_msg_ifup(pegasus)) | 1049 | netif_dbg(pegasus, ifup, net, |
1068 | pr_debug("%s: can't enable_net_traffic() - %d\n", | 1050 | "can't enable_net_traffic() - %d\n", res); |
1069 | net->name, res); | ||
1070 | res = -EIO; | 1051 | res = -EIO; |
1071 | usb_kill_urb(pegasus->rx_urb); | 1052 | usb_kill_urb(pegasus->rx_urb); |
1072 | usb_kill_urb(pegasus->intr_urb); | 1053 | usb_kill_urb(pegasus->intr_urb); |
@@ -1075,8 +1056,7 @@ static int pegasus_open(struct net_device *net) | |||
1075 | } | 1056 | } |
1076 | set_carrier(net); | 1057 | set_carrier(net); |
1077 | netif_start_queue(net); | 1058 | netif_start_queue(net); |
1078 | if (netif_msg_ifup(pegasus)) | 1059 | netif_dbg(pegasus, ifup, net, "open\n"); |
1079 | pr_debug("%s: open\n", net->name); | ||
1080 | res = 0; | 1060 | res = 0; |
1081 | exit: | 1061 | exit: |
1082 | return res; | 1062 | return res; |
@@ -1230,13 +1210,11 @@ static void pegasus_set_multicast(struct net_device *net) | |||
1230 | 1210 | ||
1231 | if (net->flags & IFF_PROMISC) { | 1211 | if (net->flags & IFF_PROMISC) { |
1232 | pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS; | 1212 | pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS; |
1233 | if (netif_msg_link(pegasus)) | 1213 | netif_info(pegasus, link, net, "Promiscuous mode enabled\n"); |
1234 | pr_info("%s: Promiscuous mode enabled.\n", net->name); | ||
1235 | } else if (!netdev_mc_empty(net) || (net->flags & IFF_ALLMULTI)) { | 1214 | } else if (!netdev_mc_empty(net) || (net->flags & IFF_ALLMULTI)) { |
1236 | pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST; | 1215 | pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST; |
1237 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; | 1216 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; |
1238 | if (netif_msg_link(pegasus)) | 1217 | netif_dbg(pegasus, link, net, "set allmulti\n"); |
1239 | pr_debug("%s: set allmulti\n", net->name); | ||
1240 | } else { | 1218 | } else { |
1241 | pegasus->eth_regs[EthCtrl0] &= ~RX_MULTICAST; | 1219 | pegasus->eth_regs[EthCtrl0] &= ~RX_MULTICAST; |
1242 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; | 1220 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; |
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index f01f02401856..4ce331fb1e1e 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -335,8 +335,8 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
335 | 335 | ||
336 | dev->maxpacket = usb_maxpacket(dev->udev, dev->out, 1); | 336 | dev->maxpacket = usb_maxpacket(dev->udev, dev->out, 1); |
337 | if (dev->maxpacket == 0) { | 337 | if (dev->maxpacket == 0) { |
338 | if (netif_msg_probe(dev)) | 338 | netif_dbg(dev, probe, dev->net, |
339 | dev_dbg(&intf->dev, "dev->maxpacket can't be 0\n"); | 339 | "dev->maxpacket can't be 0\n"); |
340 | retval = -EINVAL; | 340 | retval = -EINVAL; |
341 | goto fail_and_release; | 341 | goto fail_and_release; |
342 | } | 342 | } |
@@ -394,17 +394,15 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
394 | } | 394 | } |
395 | if ((flags & FLAG_RNDIS_PHYM_WIRELESS) && | 395 | if ((flags & FLAG_RNDIS_PHYM_WIRELESS) && |
396 | *phym != RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) { | 396 | *phym != RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) { |
397 | if (netif_msg_probe(dev)) | 397 | netif_dbg(dev, probe, dev->net, |
398 | dev_dbg(&intf->dev, "driver requires wireless " | 398 | "driver requires wireless physical medium, but device is not\n"); |
399 | "physical medium, but device is not.\n"); | ||
400 | retval = -ENODEV; | 399 | retval = -ENODEV; |
401 | goto halt_fail_and_release; | 400 | goto halt_fail_and_release; |
402 | } | 401 | } |
403 | if ((flags & FLAG_RNDIS_PHYM_NOT_WIRELESS) && | 402 | if ((flags & FLAG_RNDIS_PHYM_NOT_WIRELESS) && |
404 | *phym == RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) { | 403 | *phym == RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) { |
405 | if (netif_msg_probe(dev)) | 404 | netif_dbg(dev, probe, dev->net, |
406 | dev_dbg(&intf->dev, "driver requires non-wireless " | 405 | "driver requires non-wireless physical medium, but device is wireless.\n"); |
407 | "physical medium, but device is wireless.\n"); | ||
408 | retval = -ENODEV; | 406 | retval = -ENODEV; |
409 | goto halt_fail_and_release; | 407 | goto halt_fail_and_release; |
410 | } | 408 | } |
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index d4cbcefbff38..1ada51eb71f7 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -376,13 +376,11 @@ static void smsc95xx_set_multicast(struct net_device *netdev) | |||
376 | spin_lock_irqsave(&pdata->mac_cr_lock, flags); | 376 | spin_lock_irqsave(&pdata->mac_cr_lock, flags); |
377 | 377 | ||
378 | if (dev->net->flags & IFF_PROMISC) { | 378 | if (dev->net->flags & IFF_PROMISC) { |
379 | if (netif_msg_drv(dev)) | 379 | netif_dbg(dev, drv, dev->net, "promiscuous mode enabled\n"); |
380 | netdev_dbg(dev->net, "promiscuous mode enabled\n"); | ||
381 | pdata->mac_cr |= MAC_CR_PRMS_; | 380 | pdata->mac_cr |= MAC_CR_PRMS_; |
382 | pdata->mac_cr &= ~(MAC_CR_MCPAS_ | MAC_CR_HPFILT_); | 381 | pdata->mac_cr &= ~(MAC_CR_MCPAS_ | MAC_CR_HPFILT_); |
383 | } else if (dev->net->flags & IFF_ALLMULTI) { | 382 | } else if (dev->net->flags & IFF_ALLMULTI) { |
384 | if (netif_msg_drv(dev)) | 383 | netif_dbg(dev, drv, dev->net, "receive all multicast enabled\n"); |
385 | netdev_dbg(dev->net, "receive all multicast enabled\n"); | ||
386 | pdata->mac_cr |= MAC_CR_MCPAS_; | 384 | pdata->mac_cr |= MAC_CR_MCPAS_; |
387 | pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_); | 385 | pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_); |
388 | } else if (!netdev_mc_empty(dev->net)) { | 386 | } else if (!netdev_mc_empty(dev->net)) { |
@@ -410,12 +408,10 @@ static void smsc95xx_set_multicast(struct net_device *netdev) | |||
410 | if (count != ((u32) netdev_mc_count(dev->net))) | 408 | if (count != ((u32) netdev_mc_count(dev->net))) |
411 | netdev_warn(dev->net, "mc_count != dev->mc_count\n"); | 409 | netdev_warn(dev->net, "mc_count != dev->mc_count\n"); |
412 | 410 | ||
413 | if (netif_msg_drv(dev)) | 411 | netif_dbg(dev, drv, dev->net, "HASHH=0x%08X, HASHL=0x%08X\n", |
414 | netdev_dbg(dev->net, "HASHH=0x%08X, HASHL=0x%08X\n", | ||
415 | hash_hi, hash_lo); | 412 | hash_hi, hash_lo); |
416 | } else { | 413 | } else { |
417 | if (netif_msg_drv(dev)) | 414 | netif_dbg(dev, drv, dev->net, "receive own packets only\n"); |
418 | netdev_dbg(dev->net, "receive own packets only\n"); | ||
419 | pdata->mac_cr &= | 415 | pdata->mac_cr &= |
420 | ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_ | MAC_CR_HPFILT_); | 416 | ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_ | MAC_CR_HPFILT_); |
421 | } | 417 | } |
@@ -452,13 +448,11 @@ static void smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex, | |||
452 | else | 448 | else |
453 | afc_cfg &= ~0xF; | 449 | afc_cfg &= ~0xF; |
454 | 450 | ||
455 | if (netif_msg_link(dev)) | 451 | netif_dbg(dev, link, dev->net, "rx pause %s, tx pause %s\n", |
456 | netdev_dbg(dev->net, "rx pause %s, tx pause %s\n", | ||
457 | cap & FLOW_CTRL_RX ? "enabled" : "disabled", | 452 | cap & FLOW_CTRL_RX ? "enabled" : "disabled", |
458 | cap & FLOW_CTRL_TX ? "enabled" : "disabled"); | 453 | cap & FLOW_CTRL_TX ? "enabled" : "disabled"); |
459 | } else { | 454 | } else { |
460 | if (netif_msg_link(dev)) | 455 | netif_dbg(dev, link, dev->net, "half duplex\n"); |
461 | netdev_dbg(dev->net, "half duplex\n"); | ||
462 | flow = 0; | 456 | flow = 0; |
463 | afc_cfg |= 0xF; | 457 | afc_cfg |= 0xF; |
464 | } | 458 | } |
@@ -486,9 +480,8 @@ static int smsc95xx_link_reset(struct usbnet *dev) | |||
486 | lcladv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_ADVERTISE); | 480 | lcladv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_ADVERTISE); |
487 | rmtadv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_LPA); | 481 | rmtadv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_LPA); |
488 | 482 | ||
489 | if (netif_msg_link(dev)) | 483 | netif_dbg(dev, link, dev->net, "speed: %d duplex: %d lcladv: %04x rmtadv: %04x\n", |
490 | netdev_dbg(dev->net, "speed: %d duplex: %d lcladv: %04x rmtadv: %04x\n", | 484 | ecmd.speed, ecmd.duplex, lcladv, rmtadv); |
491 | ecmd.speed, ecmd.duplex, lcladv, rmtadv); | ||
492 | 485 | ||
493 | spin_lock_irqsave(&pdata->mac_cr_lock, flags); | 486 | spin_lock_irqsave(&pdata->mac_cr_lock, flags); |
494 | if (ecmd.duplex != DUPLEX_FULL) { | 487 | if (ecmd.duplex != DUPLEX_FULL) { |
@@ -520,8 +513,7 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb) | |||
520 | memcpy(&intdata, urb->transfer_buffer, 4); | 513 | memcpy(&intdata, urb->transfer_buffer, 4); |
521 | le32_to_cpus(&intdata); | 514 | le32_to_cpus(&intdata); |
522 | 515 | ||
523 | if (netif_msg_link(dev)) | 516 | netif_dbg(dev, link, dev->net, "intdata: 0x%08X\n", intdata); |
524 | netdev_dbg(dev->net, "intdata: 0x%08X\n", intdata); | ||
525 | 517 | ||
526 | if (intdata & INT_ENP_PHY_INT_) | 518 | if (intdata & INT_ENP_PHY_INT_) |
527 | usbnet_defer_kevent(dev, EVENT_LINK_RESET); | 519 | usbnet_defer_kevent(dev, EVENT_LINK_RESET); |
@@ -557,8 +549,7 @@ static int smsc95xx_set_csums(struct usbnet *dev) | |||
557 | return ret; | 549 | return ret; |
558 | } | 550 | } |
559 | 551 | ||
560 | if (netif_msg_hw(dev)) | 552 | netif_dbg(dev, hw, dev->net, "COE_CR = 0x%08x\n", read_buf); |
561 | netdev_dbg(dev->net, "COE_CR = 0x%08x\n", read_buf); | ||
562 | return 0; | 553 | return 0; |
563 | } | 554 | } |
564 | 555 | ||
@@ -662,16 +653,14 @@ static void smsc95xx_init_mac_address(struct usbnet *dev) | |||
662 | dev->net->dev_addr) == 0) { | 653 | dev->net->dev_addr) == 0) { |
663 | if (is_valid_ether_addr(dev->net->dev_addr)) { | 654 | if (is_valid_ether_addr(dev->net->dev_addr)) { |
664 | /* eeprom values are valid so use them */ | 655 | /* eeprom values are valid so use them */ |
665 | if (netif_msg_ifup(dev)) | 656 | netif_dbg(dev, ifup, dev->net, "MAC address read from EEPROM\n"); |
666 | netdev_dbg(dev->net, "MAC address read from EEPROM\n"); | ||
667 | return; | 657 | return; |
668 | } | 658 | } |
669 | } | 659 | } |
670 | 660 | ||
671 | /* no eeprom, or eeprom values are invalid. generate random MAC */ | 661 | /* no eeprom, or eeprom values are invalid. generate random MAC */ |
672 | random_ether_addr(dev->net->dev_addr); | 662 | random_ether_addr(dev->net->dev_addr); |
673 | if (netif_msg_ifup(dev)) | 663 | netif_dbg(dev, ifup, dev->net, "MAC address set to random_ether_addr\n"); |
674 | netdev_dbg(dev->net, "MAC address set to random_ether_addr\n"); | ||
675 | } | 664 | } |
676 | 665 | ||
677 | static int smsc95xx_set_mac_address(struct usbnet *dev) | 666 | static int smsc95xx_set_mac_address(struct usbnet *dev) |
@@ -750,8 +739,7 @@ static int smsc95xx_phy_initialize(struct usbnet *dev) | |||
750 | PHY_INT_MASK_DEFAULT_); | 739 | PHY_INT_MASK_DEFAULT_); |
751 | mii_nway_restart(&dev->mii); | 740 | mii_nway_restart(&dev->mii); |
752 | 741 | ||
753 | if (netif_msg_ifup(dev)) | 742 | netif_dbg(dev, ifup, dev->net, "phy initialised successfully\n"); |
754 | netdev_dbg(dev->net, "phy initialised successfully\n"); | ||
755 | return 0; | 743 | return 0; |
756 | } | 744 | } |
757 | 745 | ||
@@ -762,8 +750,7 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
762 | u32 read_buf, write_buf, burst_cap; | 750 | u32 read_buf, write_buf, burst_cap; |
763 | int ret = 0, timeout; | 751 | int ret = 0, timeout; |
764 | 752 | ||
765 | if (netif_msg_ifup(dev)) | 753 | netif_dbg(dev, ifup, dev->net, "entering smsc95xx_reset\n"); |
766 | netdev_dbg(dev->net, "entering smsc95xx_reset\n"); | ||
767 | 754 | ||
768 | write_buf = HW_CFG_LRST_; | 755 | write_buf = HW_CFG_LRST_; |
769 | ret = smsc95xx_write_reg(dev, HW_CFG, write_buf); | 756 | ret = smsc95xx_write_reg(dev, HW_CFG, write_buf); |
@@ -818,8 +805,8 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
818 | if (ret < 0) | 805 | if (ret < 0) |
819 | return ret; | 806 | return ret; |
820 | 807 | ||
821 | if (netif_msg_ifup(dev)) | 808 | netif_dbg(dev, ifup, dev->net, |
822 | netdev_dbg(dev->net, "MAC Address: %pM\n", dev->net->dev_addr); | 809 | "MAC Address: %pM\n", dev->net->dev_addr); |
823 | 810 | ||
824 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); | 811 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); |
825 | if (ret < 0) { | 812 | if (ret < 0) { |
@@ -827,8 +814,8 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
827 | return ret; | 814 | return ret; |
828 | } | 815 | } |
829 | 816 | ||
830 | if (netif_msg_ifup(dev)) | 817 | netif_dbg(dev, ifup, dev->net, |
831 | netdev_dbg(dev->net, "Read Value from HW_CFG : 0x%08x\n", read_buf); | 818 | "Read Value from HW_CFG : 0x%08x\n", read_buf); |
832 | 819 | ||
833 | read_buf |= HW_CFG_BIR_; | 820 | read_buf |= HW_CFG_BIR_; |
834 | 821 | ||
@@ -844,9 +831,9 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
844 | netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); | 831 | netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); |
845 | return ret; | 832 | return ret; |
846 | } | 833 | } |
847 | if (netif_msg_ifup(dev)) | 834 | netif_dbg(dev, ifup, dev->net, |
848 | netdev_dbg(dev->net, "Read Value from HW_CFG after writing HW_CFG_BIR_: 0x%08x\n", | 835 | "Read Value from HW_CFG after writing HW_CFG_BIR_: 0x%08x\n", |
849 | read_buf); | 836 | read_buf); |
850 | 837 | ||
851 | if (!turbo_mode) { | 838 | if (!turbo_mode) { |
852 | burst_cap = 0; | 839 | burst_cap = 0; |
@@ -859,8 +846,8 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
859 | dev->rx_urb_size = DEFAULT_FS_BURST_CAP_SIZE; | 846 | dev->rx_urb_size = DEFAULT_FS_BURST_CAP_SIZE; |
860 | } | 847 | } |
861 | 848 | ||
862 | if (netif_msg_ifup(dev)) | 849 | netif_dbg(dev, ifup, dev->net, |
863 | netdev_dbg(dev->net, "rx_urb_size=%ld\n", (ulong)dev->rx_urb_size); | 850 | "rx_urb_size=%ld\n", (ulong)dev->rx_urb_size); |
864 | 851 | ||
865 | ret = smsc95xx_write_reg(dev, BURST_CAP, burst_cap); | 852 | ret = smsc95xx_write_reg(dev, BURST_CAP, burst_cap); |
866 | if (ret < 0) { | 853 | if (ret < 0) { |
@@ -873,9 +860,9 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
873 | netdev_warn(dev->net, "Failed to read BURST_CAP: %d\n", ret); | 860 | netdev_warn(dev->net, "Failed to read BURST_CAP: %d\n", ret); |
874 | return ret; | 861 | return ret; |
875 | } | 862 | } |
876 | if (netif_msg_ifup(dev)) | 863 | netif_dbg(dev, ifup, dev->net, |
877 | netdev_dbg(dev->net, "Read Value from BURST_CAP after writing: 0x%08x\n", | 864 | "Read Value from BURST_CAP after writing: 0x%08x\n", |
878 | read_buf); | 865 | read_buf); |
879 | 866 | ||
880 | read_buf = DEFAULT_BULK_IN_DELAY; | 867 | read_buf = DEFAULT_BULK_IN_DELAY; |
881 | ret = smsc95xx_write_reg(dev, BULK_IN_DLY, read_buf); | 868 | ret = smsc95xx_write_reg(dev, BULK_IN_DLY, read_buf); |
@@ -889,17 +876,17 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
889 | netdev_warn(dev->net, "Failed to read BULK_IN_DLY: %d\n", ret); | 876 | netdev_warn(dev->net, "Failed to read BULK_IN_DLY: %d\n", ret); |
890 | return ret; | 877 | return ret; |
891 | } | 878 | } |
892 | if (netif_msg_ifup(dev)) | 879 | netif_dbg(dev, ifup, dev->net, |
893 | netdev_dbg(dev->net, "Read Value from BULK_IN_DLY after writing: 0x%08x\n", | 880 | "Read Value from BULK_IN_DLY after writing: 0x%08x\n", |
894 | read_buf); | 881 | read_buf); |
895 | 882 | ||
896 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); | 883 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); |
897 | if (ret < 0) { | 884 | if (ret < 0) { |
898 | netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); | 885 | netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); |
899 | return ret; | 886 | return ret; |
900 | } | 887 | } |
901 | if (netif_msg_ifup(dev)) | 888 | netif_dbg(dev, ifup, dev->net, |
902 | netdev_dbg(dev->net, "Read Value from HW_CFG: 0x%08x\n", read_buf); | 889 | "Read Value from HW_CFG: 0x%08x\n", read_buf); |
903 | 890 | ||
904 | if (turbo_mode) | 891 | if (turbo_mode) |
905 | read_buf |= (HW_CFG_MEF_ | HW_CFG_BCE_); | 892 | read_buf |= (HW_CFG_MEF_ | HW_CFG_BCE_); |
@@ -921,9 +908,8 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
921 | netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); | 908 | netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); |
922 | return ret; | 909 | return ret; |
923 | } | 910 | } |
924 | if (netif_msg_ifup(dev)) | 911 | netif_dbg(dev, ifup, dev->net, |
925 | netdev_dbg(dev->net, "Read Value from HW_CFG after writing: 0x%08x\n", | 912 | "Read Value from HW_CFG after writing: 0x%08x\n", read_buf); |
926 | read_buf); | ||
927 | 913 | ||
928 | write_buf = 0xFFFFFFFF; | 914 | write_buf = 0xFFFFFFFF; |
929 | ret = smsc95xx_write_reg(dev, INT_STS, write_buf); | 915 | ret = smsc95xx_write_reg(dev, INT_STS, write_buf); |
@@ -938,8 +924,7 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
938 | netdev_warn(dev->net, "Failed to read ID_REV: %d\n", ret); | 924 | netdev_warn(dev->net, "Failed to read ID_REV: %d\n", ret); |
939 | return ret; | 925 | return ret; |
940 | } | 926 | } |
941 | if (netif_msg_ifup(dev)) | 927 | netif_dbg(dev, ifup, dev->net, "ID_REV = 0x%08x\n", read_buf); |
942 | netdev_dbg(dev->net, "ID_REV = 0x%08x\n", read_buf); | ||
943 | 928 | ||
944 | /* Configure GPIO pins as LED outputs */ | 929 | /* Configure GPIO pins as LED outputs */ |
945 | write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED | | 930 | write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED | |
@@ -1013,8 +998,7 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
1013 | smsc95xx_start_tx_path(dev); | 998 | smsc95xx_start_tx_path(dev); |
1014 | smsc95xx_start_rx_path(dev); | 999 | smsc95xx_start_rx_path(dev); |
1015 | 1000 | ||
1016 | if (netif_msg_ifup(dev)) | 1001 | netif_dbg(dev, ifup, dev->net, "smsc95xx_reset, return 0\n"); |
1017 | netdev_dbg(dev->net, "smsc95xx_reset, return 0\n"); | ||
1018 | return 0; | 1002 | return 0; |
1019 | } | 1003 | } |
1020 | 1004 | ||
@@ -1071,8 +1055,7 @@ static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf) | |||
1071 | { | 1055 | { |
1072 | struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); | 1056 | struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); |
1073 | if (pdata) { | 1057 | if (pdata) { |
1074 | if (netif_msg_ifdown(dev)) | 1058 | netif_dbg(dev, ifdown, dev->net, "free pdata\n"); |
1075 | netdev_dbg(dev->net, "free pdata\n"); | ||
1076 | kfree(pdata); | 1059 | kfree(pdata); |
1077 | pdata = NULL; | 1060 | pdata = NULL; |
1078 | dev->data[0] = 0; | 1061 | dev->data[0] = 0; |
@@ -1106,9 +1089,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
1106 | align_count = (4 - ((size + NET_IP_ALIGN) % 4)) % 4; | 1089 | align_count = (4 - ((size + NET_IP_ALIGN) % 4)) % 4; |
1107 | 1090 | ||
1108 | if (unlikely(header & RX_STS_ES_)) { | 1091 | if (unlikely(header & RX_STS_ES_)) { |
1109 | if (netif_msg_rx_err(dev)) | 1092 | netif_dbg(dev, rx_err, dev->net, |
1110 | netdev_dbg(dev->net, "Error header=0x%08x\n", | 1093 | "Error header=0x%08x\n", header); |
1111 | header); | ||
1112 | dev->net->stats.rx_errors++; | 1094 | dev->net->stats.rx_errors++; |
1113 | dev->net->stats.rx_dropped++; | 1095 | dev->net->stats.rx_dropped++; |
1114 | 1096 | ||
@@ -1125,9 +1107,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
1125 | } else { | 1107 | } else { |
1126 | /* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */ | 1108 | /* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */ |
1127 | if (unlikely(size > (ETH_FRAME_LEN + 12))) { | 1109 | if (unlikely(size > (ETH_FRAME_LEN + 12))) { |
1128 | if (netif_msg_rx_err(dev)) | 1110 | netif_dbg(dev, rx_err, dev->net, |
1129 | netdev_dbg(dev->net, "size err header=0x%08x\n", | 1111 | "size err header=0x%08x\n", header); |
1130 | header); | ||
1131 | return 0; | 1112 | return 0; |
1132 | } | 1113 | } |
1133 | 1114 | ||
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 8e732930d249..17b6a62d206e 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -242,13 +242,13 @@ void usbnet_skb_return (struct usbnet *dev, struct sk_buff *skb) | |||
242 | dev->net->stats.rx_packets++; | 242 | dev->net->stats.rx_packets++; |
243 | dev->net->stats.rx_bytes += skb->len; | 243 | dev->net->stats.rx_bytes += skb->len; |
244 | 244 | ||
245 | if (netif_msg_rx_status (dev)) | 245 | netif_dbg(dev, rx_status, dev->net, "< rx, len %zu, type 0x%x\n", |
246 | netdev_dbg(dev->net, "< rx, len %zu, type 0x%x\n", | 246 | skb->len + sizeof (struct ethhdr), skb->protocol); |
247 | skb->len + sizeof (struct ethhdr), skb->protocol); | ||
248 | memset (skb->cb, 0, sizeof (struct skb_data)); | 247 | memset (skb->cb, 0, sizeof (struct skb_data)); |
249 | status = netif_rx (skb); | 248 | status = netif_rx (skb); |
250 | if (status != NET_RX_SUCCESS && netif_msg_rx_err (dev)) | 249 | if (status != NET_RX_SUCCESS) |
251 | netdev_dbg(dev->net, "netif_rx status %d\n", status); | 250 | netif_dbg(dev, rx_err, dev->net, |
251 | "netif_rx status %d\n", status); | ||
252 | } | 252 | } |
253 | EXPORT_SYMBOL_GPL(usbnet_skb_return); | 253 | EXPORT_SYMBOL_GPL(usbnet_skb_return); |
254 | 254 | ||
@@ -332,8 +332,7 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
332 | size_t size = dev->rx_urb_size; | 332 | size_t size = dev->rx_urb_size; |
333 | 333 | ||
334 | if ((skb = alloc_skb (size + NET_IP_ALIGN, flags)) == NULL) { | 334 | if ((skb = alloc_skb (size + NET_IP_ALIGN, flags)) == NULL) { |
335 | if (netif_msg_rx_err (dev)) | 335 | netif_dbg(dev, rx_err, dev->net, "no rx skb\n"); |
336 | netdev_dbg(dev->net, "no rx skb\n"); | ||
337 | usbnet_defer_kevent (dev, EVENT_RX_MEMORY); | 336 | usbnet_defer_kevent (dev, EVENT_RX_MEMORY); |
338 | usb_free_urb (urb); | 337 | usb_free_urb (urb); |
339 | return; | 338 | return; |
@@ -363,21 +362,19 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
363 | usbnet_defer_kevent (dev, EVENT_RX_MEMORY); | 362 | usbnet_defer_kevent (dev, EVENT_RX_MEMORY); |
364 | break; | 363 | break; |
365 | case -ENODEV: | 364 | case -ENODEV: |
366 | if (netif_msg_ifdown (dev)) | 365 | netif_dbg(dev, ifdown, dev->net, "device gone\n"); |
367 | netdev_dbg(dev->net, "device gone\n"); | ||
368 | netif_device_detach (dev->net); | 366 | netif_device_detach (dev->net); |
369 | break; | 367 | break; |
370 | default: | 368 | default: |
371 | if (netif_msg_rx_err (dev)) | 369 | netif_dbg(dev, rx_err, dev->net, |
372 | netdev_dbg(dev->net, "rx submit, %d\n", retval); | 370 | "rx submit, %d\n", retval); |
373 | tasklet_schedule (&dev->bh); | 371 | tasklet_schedule (&dev->bh); |
374 | break; | 372 | break; |
375 | case 0: | 373 | case 0: |
376 | __skb_queue_tail (&dev->rxq, skb); | 374 | __skb_queue_tail (&dev->rxq, skb); |
377 | } | 375 | } |
378 | } else { | 376 | } else { |
379 | if (netif_msg_ifdown (dev)) | 377 | netif_dbg(dev, ifdown, dev->net, "rx: stopped\n"); |
380 | netdev_dbg(dev->net, "rx: stopped\n"); | ||
381 | retval = -ENOLINK; | 378 | retval = -ENOLINK; |
382 | } | 379 | } |
383 | spin_unlock_irqrestore (&dev->rxq.lock, lockflags); | 380 | spin_unlock_irqrestore (&dev->rxq.lock, lockflags); |
@@ -400,8 +397,7 @@ static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) | |||
400 | if (skb->len) | 397 | if (skb->len) |
401 | usbnet_skb_return (dev, skb); | 398 | usbnet_skb_return (dev, skb); |
402 | else { | 399 | else { |
403 | if (netif_msg_rx_err (dev)) | 400 | netif_dbg(dev, rx_err, dev->net, "drop\n"); |
404 | netdev_dbg(dev->net, "drop\n"); | ||
405 | error: | 401 | error: |
406 | dev->net->stats.rx_errors++; | 402 | dev->net->stats.rx_errors++; |
407 | skb_queue_tail (&dev->done, skb); | 403 | skb_queue_tail (&dev->done, skb); |
@@ -428,8 +424,8 @@ static void rx_complete (struct urb *urb) | |||
428 | entry->state = rx_cleanup; | 424 | entry->state = rx_cleanup; |
429 | dev->net->stats.rx_errors++; | 425 | dev->net->stats.rx_errors++; |
430 | dev->net->stats.rx_length_errors++; | 426 | dev->net->stats.rx_length_errors++; |
431 | if (netif_msg_rx_err (dev)) | 427 | netif_dbg(dev, rx_err, dev->net, |
432 | netdev_dbg(dev->net, "rx length %d\n", skb->len); | 428 | "rx length %d\n", skb->len); |
433 | } | 429 | } |
434 | break; | 430 | break; |
435 | 431 | ||
@@ -446,8 +442,8 @@ static void rx_complete (struct urb *urb) | |||
446 | /* software-driven interface shutdown */ | 442 | /* software-driven interface shutdown */ |
447 | case -ECONNRESET: /* async unlink */ | 443 | case -ECONNRESET: /* async unlink */ |
448 | case -ESHUTDOWN: /* hardware gone */ | 444 | case -ESHUTDOWN: /* hardware gone */ |
449 | if (netif_msg_ifdown (dev)) | 445 | netif_dbg(dev, ifdown, dev->net, |
450 | netdev_dbg(dev->net, "rx shutdown, code %d\n", urb_status); | 446 | "rx shutdown, code %d\n", urb_status); |
451 | goto block; | 447 | goto block; |
452 | 448 | ||
453 | /* we get controller i/o faults during khubd disconnect() delays. | 449 | /* we get controller i/o faults during khubd disconnect() delays. |
@@ -460,8 +456,8 @@ static void rx_complete (struct urb *urb) | |||
460 | dev->net->stats.rx_errors++; | 456 | dev->net->stats.rx_errors++; |
461 | if (!timer_pending (&dev->delay)) { | 457 | if (!timer_pending (&dev->delay)) { |
462 | mod_timer (&dev->delay, jiffies + THROTTLE_JIFFIES); | 458 | mod_timer (&dev->delay, jiffies + THROTTLE_JIFFIES); |
463 | if (netif_msg_link (dev)) | 459 | netif_dbg(dev, link, dev->net, |
464 | netdev_dbg(dev->net, "rx throttle %d\n", urb_status); | 460 | "rx throttle %d\n", urb_status); |
465 | } | 461 | } |
466 | block: | 462 | block: |
467 | entry->state = rx_cleanup; | 463 | entry->state = rx_cleanup; |
@@ -477,8 +473,7 @@ block: | |||
477 | default: | 473 | default: |
478 | entry->state = rx_cleanup; | 474 | entry->state = rx_cleanup; |
479 | dev->net->stats.rx_errors++; | 475 | dev->net->stats.rx_errors++; |
480 | if (netif_msg_rx_err (dev)) | 476 | netif_dbg(dev, rx_err, dev->net, "rx status %d\n", urb_status); |
481 | netdev_dbg(dev->net, "rx status %d\n", urb_status); | ||
482 | break; | 477 | break; |
483 | } | 478 | } |
484 | 479 | ||
@@ -492,8 +487,7 @@ block: | |||
492 | } | 487 | } |
493 | usb_free_urb (urb); | 488 | usb_free_urb (urb); |
494 | } | 489 | } |
495 | if (netif_msg_rx_err (dev)) | 490 | netif_dbg(dev, rx_err, dev->net, "no read resubmitted\n"); |
496 | netdev_dbg(dev->net, "no read resubmitted\n"); | ||
497 | } | 491 | } |
498 | 492 | ||
499 | static void intr_complete (struct urb *urb) | 493 | static void intr_complete (struct urb *urb) |
@@ -510,8 +504,8 @@ static void intr_complete (struct urb *urb) | |||
510 | /* software-driven interface shutdown */ | 504 | /* software-driven interface shutdown */ |
511 | case -ENOENT: /* urb killed */ | 505 | case -ENOENT: /* urb killed */ |
512 | case -ESHUTDOWN: /* hardware gone */ | 506 | case -ESHUTDOWN: /* hardware gone */ |
513 | if (netif_msg_ifdown (dev)) | 507 | netif_dbg(dev, ifdown, dev->net, |
514 | netdev_dbg(dev->net, "intr shutdown, code %d\n", status); | 508 | "intr shutdown, code %d\n", status); |
515 | return; | 509 | return; |
516 | 510 | ||
517 | /* NOTE: not throttling like RX/TX, since this endpoint | 511 | /* NOTE: not throttling like RX/TX, since this endpoint |
@@ -527,8 +521,9 @@ static void intr_complete (struct urb *urb) | |||
527 | 521 | ||
528 | memset(urb->transfer_buffer, 0, urb->transfer_buffer_length); | 522 | memset(urb->transfer_buffer, 0, urb->transfer_buffer_length); |
529 | status = usb_submit_urb (urb, GFP_ATOMIC); | 523 | status = usb_submit_urb (urb, GFP_ATOMIC); |
530 | if (status != 0 && netif_msg_timer (dev)) | 524 | if (status != 0) |
531 | netdev_err(dev->net, "intr resubmit --> %d\n", status); | 525 | netif_err(dev, timer, dev->net, |
526 | "intr resubmit --> %d\n", status); | ||
532 | } | 527 | } |
533 | 528 | ||
534 | /*-------------------------------------------------------------------------*/ | 529 | /*-------------------------------------------------------------------------*/ |
@@ -536,8 +531,7 @@ void usbnet_pause_rx(struct usbnet *dev) | |||
536 | { | 531 | { |
537 | set_bit(EVENT_RX_PAUSED, &dev->flags); | 532 | set_bit(EVENT_RX_PAUSED, &dev->flags); |
538 | 533 | ||
539 | if (netif_msg_rx_status(dev)) | 534 | netif_dbg(dev, rx_status, dev->net, "paused rx queue enabled\n"); |
540 | netdev_dbg(dev->net, "paused rx queue enabled\n"); | ||
541 | } | 535 | } |
542 | EXPORT_SYMBOL_GPL(usbnet_pause_rx); | 536 | EXPORT_SYMBOL_GPL(usbnet_pause_rx); |
543 | 537 | ||
@@ -555,9 +549,8 @@ void usbnet_resume_rx(struct usbnet *dev) | |||
555 | 549 | ||
556 | tasklet_schedule(&dev->bh); | 550 | tasklet_schedule(&dev->bh); |
557 | 551 | ||
558 | if (netif_msg_rx_status(dev)) | 552 | netif_dbg(dev, rx_status, dev->net, |
559 | netdev_dbg(dev->net, "paused rx queue disabled, %d skbs requeued\n", | 553 | "paused rx queue disabled, %d skbs requeued\n", num); |
560 | num); | ||
561 | } | 554 | } |
562 | EXPORT_SYMBOL_GPL(usbnet_resume_rx); | 555 | EXPORT_SYMBOL_GPL(usbnet_resume_rx); |
563 | 556 | ||
@@ -632,9 +625,8 @@ static void usbnet_terminate_urbs(struct usbnet *dev) | |||
632 | && !skb_queue_empty(&dev->done)) { | 625 | && !skb_queue_empty(&dev->done)) { |
633 | schedule_timeout(UNLINK_TIMEOUT_MS); | 626 | schedule_timeout(UNLINK_TIMEOUT_MS); |
634 | set_current_state(TASK_UNINTERRUPTIBLE); | 627 | set_current_state(TASK_UNINTERRUPTIBLE); |
635 | if (netif_msg_ifdown(dev)) | 628 | netif_dbg(dev, ifdown, dev->net, |
636 | netdev_dbg(dev->net, "waited for %d urb completions\n", | 629 | "waited for %d urb completions\n", temp); |
637 | temp); | ||
638 | } | 630 | } |
639 | set_current_state(TASK_RUNNING); | 631 | set_current_state(TASK_RUNNING); |
640 | dev->wait = NULL; | 632 | dev->wait = NULL; |
@@ -649,21 +641,21 @@ int usbnet_stop (struct net_device *net) | |||
649 | 641 | ||
650 | netif_stop_queue (net); | 642 | netif_stop_queue (net); |
651 | 643 | ||
652 | if (netif_msg_ifdown (dev)) | 644 | netif_info(dev, ifdown, dev->net, |
653 | netdev_info(dev->net, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n", | 645 | "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n", |
654 | net->stats.rx_packets, net->stats.tx_packets, | 646 | net->stats.rx_packets, net->stats.tx_packets, |
655 | net->stats.rx_errors, net->stats.tx_errors); | 647 | net->stats.rx_errors, net->stats.tx_errors); |
656 | 648 | ||
657 | /* allow minidriver to stop correctly (wireless devices to turn off | 649 | /* allow minidriver to stop correctly (wireless devices to turn off |
658 | * radio etc) */ | 650 | * radio etc) */ |
659 | if (info->stop) { | 651 | if (info->stop) { |
660 | retval = info->stop(dev); | 652 | retval = info->stop(dev); |
661 | if (retval < 0 && netif_msg_ifdown(dev)) | 653 | if (retval < 0) |
662 | netdev_info(dev->net, | 654 | netif_info(dev, ifdown, dev->net, |
663 | "stop fail (%d) usbnet usb-%s-%s, %s\n", | 655 | "stop fail (%d) usbnet usb-%s-%s, %s\n", |
664 | retval, | 656 | retval, |
665 | dev->udev->bus->bus_name, dev->udev->devpath, | 657 | dev->udev->bus->bus_name, dev->udev->devpath, |
666 | info->description); | 658 | info->description); |
667 | } | 659 | } |
668 | 660 | ||
669 | if (!(info->flags & FLAG_AVOID_UNLINK_URBS)) | 661 | if (!(info->flags & FLAG_AVOID_UNLINK_URBS)) |
@@ -702,32 +694,29 @@ int usbnet_open (struct net_device *net) | |||
702 | struct driver_info *info = dev->driver_info; | 694 | struct driver_info *info = dev->driver_info; |
703 | 695 | ||
704 | if ((retval = usb_autopm_get_interface(dev->intf)) < 0) { | 696 | if ((retval = usb_autopm_get_interface(dev->intf)) < 0) { |
705 | if (netif_msg_ifup (dev)) | 697 | netif_info(dev, ifup, dev->net, |
706 | netdev_info(dev->net, | 698 | "resumption fail (%d) usbnet usb-%s-%s, %s\n", |
707 | "resumption fail (%d) usbnet usb-%s-%s, %s\n", | 699 | retval, |
708 | retval, | 700 | dev->udev->bus->bus_name, |
709 | dev->udev->bus->bus_name, | 701 | dev->udev->devpath, |
710 | dev->udev->devpath, | 702 | info->description); |
711 | info->description); | ||
712 | goto done_nopm; | 703 | goto done_nopm; |
713 | } | 704 | } |
714 | 705 | ||
715 | // put into "known safe" state | 706 | // put into "known safe" state |
716 | if (info->reset && (retval = info->reset (dev)) < 0) { | 707 | if (info->reset && (retval = info->reset (dev)) < 0) { |
717 | if (netif_msg_ifup (dev)) | 708 | netif_info(dev, ifup, dev->net, |
718 | netdev_info(dev->net, | 709 | "open reset fail (%d) usbnet usb-%s-%s, %s\n", |
719 | "open reset fail (%d) usbnet usb-%s-%s, %s\n", | 710 | retval, |
720 | retval, | 711 | dev->udev->bus->bus_name, |
721 | dev->udev->bus->bus_name, | 712 | dev->udev->devpath, |
722 | dev->udev->devpath, | 713 | info->description); |
723 | info->description); | ||
724 | goto done; | 714 | goto done; |
725 | } | 715 | } |
726 | 716 | ||
727 | // insist peer be connected | 717 | // insist peer be connected |
728 | if (info->check_connect && (retval = info->check_connect (dev)) < 0) { | 718 | if (info->check_connect && (retval = info->check_connect (dev)) < 0) { |
729 | if (netif_msg_ifup (dev)) | 719 | netif_dbg(dev, ifup, dev->net, "can't open; %d\n", retval); |
730 | netdev_dbg(dev->net, "can't open; %d\n", retval); | ||
731 | goto done; | 720 | goto done; |
732 | } | 721 | } |
733 | 722 | ||
@@ -735,33 +724,23 @@ int usbnet_open (struct net_device *net) | |||
735 | if (dev->interrupt) { | 724 | if (dev->interrupt) { |
736 | retval = usb_submit_urb (dev->interrupt, GFP_KERNEL); | 725 | retval = usb_submit_urb (dev->interrupt, GFP_KERNEL); |
737 | if (retval < 0) { | 726 | if (retval < 0) { |
738 | if (netif_msg_ifup (dev)) | 727 | netif_err(dev, ifup, dev->net, |
739 | netdev_err(dev->net, "intr submit %d\n", retval); | 728 | "intr submit %d\n", retval); |
740 | goto done; | 729 | goto done; |
741 | } | 730 | } |
742 | } | 731 | } |
743 | 732 | ||
744 | netif_start_queue (net); | 733 | netif_start_queue (net); |
745 | if (netif_msg_ifup (dev)) { | 734 | netif_info(dev, ifup, dev->net, |
746 | char *framing; | 735 | "open: enable queueing (rx %d, tx %d) mtu %d %s framing\n", |
747 | 736 | (int)RX_QLEN(dev), (int)TX_QLEN(dev), | |
748 | if (dev->driver_info->flags & FLAG_FRAMING_NC) | 737 | dev->net->mtu, |
749 | framing = "NetChip"; | 738 | (dev->driver_info->flags & FLAG_FRAMING_NC) ? "NetChip" : |
750 | else if (dev->driver_info->flags & FLAG_FRAMING_GL) | 739 | (dev->driver_info->flags & FLAG_FRAMING_GL) ? "GeneSys" : |
751 | framing = "GeneSys"; | 740 | (dev->driver_info->flags & FLAG_FRAMING_Z) ? "Zaurus" : |
752 | else if (dev->driver_info->flags & FLAG_FRAMING_Z) | 741 | (dev->driver_info->flags & FLAG_FRAMING_RN) ? "RNDIS" : |
753 | framing = "Zaurus"; | 742 | (dev->driver_info->flags & FLAG_FRAMING_AX) ? "ASIX" : |
754 | else if (dev->driver_info->flags & FLAG_FRAMING_RN) | 743 | "simple"); |
755 | framing = "RNDIS"; | ||
756 | else if (dev->driver_info->flags & FLAG_FRAMING_AX) | ||
757 | framing = "ASIX"; | ||
758 | else | ||
759 | framing = "simple"; | ||
760 | |||
761 | netdev_info(dev->net, "open: enable queueing (rx %d, tx %d) mtu %d %s framing\n", | ||
762 | (int)RX_QLEN(dev), (int)TX_QLEN(dev), | ||
763 | dev->net->mtu, framing); | ||
764 | } | ||
765 | 744 | ||
766 | // delay posting reads until we're fully open | 745 | // delay posting reads until we're fully open |
767 | tasklet_schedule (&dev->bh); | 746 | tasklet_schedule (&dev->bh); |
@@ -772,6 +751,7 @@ int usbnet_open (struct net_device *net) | |||
772 | usb_autopm_put_interface(dev->intf); | 751 | usb_autopm_put_interface(dev->intf); |
773 | } | 752 | } |
774 | return retval; | 753 | return retval; |
754 | |||
775 | done: | 755 | done: |
776 | usb_autopm_put_interface(dev->intf); | 756 | usb_autopm_put_interface(dev->intf); |
777 | done_nopm: | 757 | done_nopm: |
@@ -1015,16 +995,14 @@ static void tx_complete (struct urb *urb) | |||
1015 | if (!timer_pending (&dev->delay)) { | 995 | if (!timer_pending (&dev->delay)) { |
1016 | mod_timer (&dev->delay, | 996 | mod_timer (&dev->delay, |
1017 | jiffies + THROTTLE_JIFFIES); | 997 | jiffies + THROTTLE_JIFFIES); |
1018 | if (netif_msg_link (dev)) | 998 | netif_dbg(dev, link, dev->net, |
1019 | netdev_dbg(dev->net, "tx throttle %d\n", | 999 | "tx throttle %d\n", urb->status); |
1020 | urb->status); | ||
1021 | } | 1000 | } |
1022 | netif_stop_queue (dev->net); | 1001 | netif_stop_queue (dev->net); |
1023 | break; | 1002 | break; |
1024 | default: | 1003 | default: |
1025 | if (netif_msg_tx_err (dev)) | 1004 | netif_dbg(dev, tx_err, dev->net, |
1026 | netdev_dbg(dev->net, "tx err %d\n", | 1005 | "tx err %d\n", entry->urb->status); |
1027 | entry->urb->status); | ||
1028 | break; | 1006 | break; |
1029 | } | 1007 | } |
1030 | } | 1008 | } |
@@ -1066,16 +1044,14 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
1066 | if (info->tx_fixup) { | 1044 | if (info->tx_fixup) { |
1067 | skb = info->tx_fixup (dev, skb, GFP_ATOMIC); | 1045 | skb = info->tx_fixup (dev, skb, GFP_ATOMIC); |
1068 | if (!skb) { | 1046 | if (!skb) { |
1069 | if (netif_msg_tx_err (dev)) | 1047 | netif_dbg(dev, tx_err, dev->net, "can't tx_fixup skb\n"); |
1070 | netdev_dbg(dev->net, "can't tx_fixup skb\n"); | ||
1071 | goto drop; | 1048 | goto drop; |
1072 | } | 1049 | } |
1073 | } | 1050 | } |
1074 | length = skb->len; | 1051 | length = skb->len; |
1075 | 1052 | ||
1076 | if (!(urb = usb_alloc_urb (0, GFP_ATOMIC))) { | 1053 | if (!(urb = usb_alloc_urb (0, GFP_ATOMIC))) { |
1077 | if (netif_msg_tx_err (dev)) | 1054 | netif_dbg(dev, tx_err, dev->net, "no urb\n"); |
1078 | netdev_dbg(dev->net, "no urb\n"); | ||
1079 | goto drop; | 1055 | goto drop; |
1080 | } | 1056 | } |
1081 | 1057 | ||
@@ -1128,8 +1104,8 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
1128 | break; | 1104 | break; |
1129 | default: | 1105 | default: |
1130 | usb_autopm_put_interface_async(dev->intf); | 1106 | usb_autopm_put_interface_async(dev->intf); |
1131 | if (netif_msg_tx_err (dev)) | 1107 | netif_dbg(dev, tx_err, dev->net, |
1132 | netdev_dbg(dev->net, "tx: submit urb err %d\n", retval); | 1108 | "tx: submit urb err %d\n", retval); |
1133 | break; | 1109 | break; |
1134 | case 0: | 1110 | case 0: |
1135 | net->trans_start = jiffies; | 1111 | net->trans_start = jiffies; |
@@ -1140,17 +1116,15 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
1140 | spin_unlock_irqrestore (&dev->txq.lock, flags); | 1116 | spin_unlock_irqrestore (&dev->txq.lock, flags); |
1141 | 1117 | ||
1142 | if (retval) { | 1118 | if (retval) { |
1143 | if (netif_msg_tx_err (dev)) | 1119 | netif_dbg(dev, tx_err, dev->net, "drop, code %d\n", retval); |
1144 | netdev_dbg(dev->net, "drop, code %d\n", retval); | ||
1145 | drop: | 1120 | drop: |
1146 | dev->net->stats.tx_dropped++; | 1121 | dev->net->stats.tx_dropped++; |
1147 | if (skb) | 1122 | if (skb) |
1148 | dev_kfree_skb_any (skb); | 1123 | dev_kfree_skb_any (skb); |
1149 | usb_free_urb (urb); | 1124 | usb_free_urb (urb); |
1150 | } else if (netif_msg_tx_queued (dev)) { | 1125 | } else |
1151 | netdev_dbg(dev->net, "> tx, len %d, type 0x%x\n", | 1126 | netif_dbg(dev, tx_queued, dev->net, |
1152 | length, skb->protocol); | 1127 | "> tx, len %d, type 0x%x\n", length, skb->protocol); |
1153 | } | ||
1154 | #ifdef CONFIG_PM | 1128 | #ifdef CONFIG_PM |
1155 | deferred: | 1129 | deferred: |
1156 | #endif | 1130 | #endif |
@@ -1209,9 +1183,10 @@ static void usbnet_bh (unsigned long param) | |||
1209 | if (urb != NULL) | 1183 | if (urb != NULL) |
1210 | rx_submit (dev, urb, GFP_ATOMIC); | 1184 | rx_submit (dev, urb, GFP_ATOMIC); |
1211 | } | 1185 | } |
1212 | if (temp != dev->rxq.qlen && netif_msg_link (dev)) | 1186 | if (temp != dev->rxq.qlen) |
1213 | netdev_dbg(dev->net, "rxqlen %d --> %d\n", | 1187 | netif_dbg(dev, link, dev->net, |
1214 | temp, dev->rxq.qlen); | 1188 | "rxqlen %d --> %d\n", |
1189 | temp, dev->rxq.qlen); | ||
1215 | if (dev->rxq.qlen < qlen) | 1190 | if (dev->rxq.qlen < qlen) |
1216 | tasklet_schedule (&dev->bh); | 1191 | tasklet_schedule (&dev->bh); |
1217 | } | 1192 | } |
@@ -1242,11 +1217,10 @@ void usbnet_disconnect (struct usb_interface *intf) | |||
1242 | 1217 | ||
1243 | xdev = interface_to_usbdev (intf); | 1218 | xdev = interface_to_usbdev (intf); |
1244 | 1219 | ||
1245 | if (netif_msg_probe (dev)) | 1220 | netif_info(dev, probe, dev->net, "unregister '%s' usb-%s-%s, %s\n", |
1246 | netdev_info(dev->net, "unregister '%s' usb-%s-%s, %s\n", | 1221 | intf->dev.driver->name, |
1247 | intf->dev.driver->name, | 1222 | xdev->bus->bus_name, xdev->devpath, |
1248 | xdev->bus->bus_name, xdev->devpath, | 1223 | dev->driver_info->description); |
1249 | dev->driver_info->description); | ||
1250 | 1224 | ||
1251 | net = dev->net; | 1225 | net = dev->net; |
1252 | unregister_netdev (net); | 1226 | unregister_netdev (net); |
@@ -1409,12 +1383,12 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
1409 | status = register_netdev (net); | 1383 | status = register_netdev (net); |
1410 | if (status) | 1384 | if (status) |
1411 | goto out3; | 1385 | goto out3; |
1412 | if (netif_msg_probe (dev)) | 1386 | netif_info(dev, probe, dev->net, |
1413 | netdev_info(dev->net, "register '%s' at usb-%s-%s, %s, %pM\n", | 1387 | "register '%s' at usb-%s-%s, %s, %pM\n", |
1414 | udev->dev.driver->name, | 1388 | udev->dev.driver->name, |
1415 | xdev->bus->bus_name, xdev->devpath, | 1389 | xdev->bus->bus_name, xdev->devpath, |
1416 | dev->driver_info->description, | 1390 | dev->driver_info->description, |
1417 | net->dev_addr); | 1391 | net->dev_addr); |
1418 | 1392 | ||
1419 | // ok, it's ready to go. | 1393 | // ok, it's ready to go. |
1420 | usb_set_intfdata (udev, dev); | 1394 | usb_set_intfdata (udev, dev); |