diff options
author | Joe Perches <joe@perches.com> | 2012-11-23 20:27:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-11-25 16:14:54 -0500 |
commit | 1e1d74124257413cc26e53898560c1eac31cc798 (patch) | |
tree | 25daa32247dab6ed357b49af78304a258058da81 | |
parent | 63507592e3524405ce8b4887b61ebb3b60c10de2 (diff) |
smsc: Add logging message newlines
Avoid any possible message logging interleaving by adding
missing newlines.
Align arguments.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/usb/smsc75xx.c | 403 | ||||
-rw-r--r-- | drivers/net/usb/smsc95xx.c | 184 |
2 files changed, 296 insertions, 291 deletions
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index c5353cfc9c8c..953c4f44d505 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c | |||
@@ -103,8 +103,8 @@ static int __must_check __smsc75xx_read_reg(struct usbnet *dev, u32 index, | |||
103 | | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 103 | | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
104 | 0, index, &buf, 4); | 104 | 0, index, &buf, 4); |
105 | if (unlikely(ret < 0)) | 105 | if (unlikely(ret < 0)) |
106 | netdev_warn(dev->net, | 106 | netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n", |
107 | "Failed to read reg index 0x%08x: %d", index, ret); | 107 | index, ret); |
108 | 108 | ||
109 | le32_to_cpus(&buf); | 109 | le32_to_cpus(&buf); |
110 | *data = buf; | 110 | *data = buf; |
@@ -133,8 +133,8 @@ static int __must_check __smsc75xx_write_reg(struct usbnet *dev, u32 index, | |||
133 | | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 133 | | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
134 | 0, index, &buf, 4); | 134 | 0, index, &buf, 4); |
135 | if (unlikely(ret < 0)) | 135 | if (unlikely(ret < 0)) |
136 | netdev_warn(dev->net, | 136 | netdev_warn(dev->net, "Failed to write reg index 0x%08x: %d\n", |
137 | "Failed to write reg index 0x%08x: %d", index, ret); | 137 | index, ret); |
138 | 138 | ||
139 | return ret; | 139 | return ret; |
140 | } | 140 | } |
@@ -193,7 +193,7 @@ static int smsc75xx_phy_wait_not_busy(struct usbnet *dev) | |||
193 | 193 | ||
194 | do { | 194 | do { |
195 | ret = smsc75xx_read_reg(dev, MII_ACCESS, &val); | 195 | ret = smsc75xx_read_reg(dev, MII_ACCESS, &val); |
196 | check_warn_return(ret, "Error reading MII_ACCESS"); | 196 | check_warn_return(ret, "Error reading MII_ACCESS\n"); |
197 | 197 | ||
198 | if (!(val & MII_ACCESS_BUSY)) | 198 | if (!(val & MII_ACCESS_BUSY)) |
199 | return 0; | 199 | return 0; |
@@ -212,7 +212,7 @@ static int smsc75xx_mdio_read(struct net_device *netdev, int phy_id, int idx) | |||
212 | 212 | ||
213 | /* confirm MII not busy */ | 213 | /* confirm MII not busy */ |
214 | ret = smsc75xx_phy_wait_not_busy(dev); | 214 | ret = smsc75xx_phy_wait_not_busy(dev); |
215 | check_warn_goto_done(ret, "MII is busy in smsc75xx_mdio_read"); | 215 | check_warn_goto_done(ret, "MII is busy in smsc75xx_mdio_read\n"); |
216 | 216 | ||
217 | /* set the address, index & direction (read from PHY) */ | 217 | /* set the address, index & direction (read from PHY) */ |
218 | phy_id &= dev->mii.phy_id_mask; | 218 | phy_id &= dev->mii.phy_id_mask; |
@@ -221,13 +221,13 @@ static int smsc75xx_mdio_read(struct net_device *netdev, int phy_id, int idx) | |||
221 | | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR) | 221 | | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR) |
222 | | MII_ACCESS_READ | MII_ACCESS_BUSY; | 222 | | MII_ACCESS_READ | MII_ACCESS_BUSY; |
223 | ret = smsc75xx_write_reg(dev, MII_ACCESS, addr); | 223 | ret = smsc75xx_write_reg(dev, MII_ACCESS, addr); |
224 | check_warn_goto_done(ret, "Error writing MII_ACCESS"); | 224 | check_warn_goto_done(ret, "Error writing MII_ACCESS\n"); |
225 | 225 | ||
226 | ret = smsc75xx_phy_wait_not_busy(dev); | 226 | ret = smsc75xx_phy_wait_not_busy(dev); |
227 | check_warn_goto_done(ret, "Timed out reading MII reg %02X", idx); | 227 | check_warn_goto_done(ret, "Timed out reading MII reg %02X\n", idx); |
228 | 228 | ||
229 | ret = smsc75xx_read_reg(dev, MII_DATA, &val); | 229 | ret = smsc75xx_read_reg(dev, MII_DATA, &val); |
230 | check_warn_goto_done(ret, "Error reading MII_DATA"); | 230 | check_warn_goto_done(ret, "Error reading MII_DATA\n"); |
231 | 231 | ||
232 | ret = (u16)(val & 0xFFFF); | 232 | ret = (u16)(val & 0xFFFF); |
233 | 233 | ||
@@ -247,11 +247,11 @@ static void smsc75xx_mdio_write(struct net_device *netdev, int phy_id, int idx, | |||
247 | 247 | ||
248 | /* confirm MII not busy */ | 248 | /* confirm MII not busy */ |
249 | ret = smsc75xx_phy_wait_not_busy(dev); | 249 | ret = smsc75xx_phy_wait_not_busy(dev); |
250 | check_warn_goto_done(ret, "MII is busy in smsc75xx_mdio_write"); | 250 | check_warn_goto_done(ret, "MII is busy in smsc75xx_mdio_write\n"); |
251 | 251 | ||
252 | val = regval; | 252 | val = regval; |
253 | ret = smsc75xx_write_reg(dev, MII_DATA, val); | 253 | ret = smsc75xx_write_reg(dev, MII_DATA, val); |
254 | check_warn_goto_done(ret, "Error writing MII_DATA"); | 254 | check_warn_goto_done(ret, "Error writing MII_DATA\n"); |
255 | 255 | ||
256 | /* set the address, index & direction (write to PHY) */ | 256 | /* set the address, index & direction (write to PHY) */ |
257 | phy_id &= dev->mii.phy_id_mask; | 257 | phy_id &= dev->mii.phy_id_mask; |
@@ -260,10 +260,10 @@ static void smsc75xx_mdio_write(struct net_device *netdev, int phy_id, int idx, | |||
260 | | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR) | 260 | | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR) |
261 | | MII_ACCESS_WRITE | MII_ACCESS_BUSY; | 261 | | MII_ACCESS_WRITE | MII_ACCESS_BUSY; |
262 | ret = smsc75xx_write_reg(dev, MII_ACCESS, addr); | 262 | ret = smsc75xx_write_reg(dev, MII_ACCESS, addr); |
263 | check_warn_goto_done(ret, "Error writing MII_ACCESS"); | 263 | check_warn_goto_done(ret, "Error writing MII_ACCESS\n"); |
264 | 264 | ||
265 | ret = smsc75xx_phy_wait_not_busy(dev); | 265 | ret = smsc75xx_phy_wait_not_busy(dev); |
266 | check_warn_goto_done(ret, "Timed out writing MII reg %02X", idx); | 266 | check_warn_goto_done(ret, "Timed out writing MII reg %02X\n", idx); |
267 | 267 | ||
268 | done: | 268 | done: |
269 | mutex_unlock(&dev->phy_mutex); | 269 | mutex_unlock(&dev->phy_mutex); |
@@ -277,7 +277,7 @@ static int smsc75xx_wait_eeprom(struct usbnet *dev) | |||
277 | 277 | ||
278 | do { | 278 | do { |
279 | ret = smsc75xx_read_reg(dev, E2P_CMD, &val); | 279 | ret = smsc75xx_read_reg(dev, E2P_CMD, &val); |
280 | check_warn_return(ret, "Error reading E2P_CMD"); | 280 | check_warn_return(ret, "Error reading E2P_CMD\n"); |
281 | 281 | ||
282 | if (!(val & E2P_CMD_BUSY) || (val & E2P_CMD_TIMEOUT)) | 282 | if (!(val & E2P_CMD_BUSY) || (val & E2P_CMD_TIMEOUT)) |
283 | break; | 283 | break; |
@@ -285,7 +285,7 @@ static int smsc75xx_wait_eeprom(struct usbnet *dev) | |||
285 | } while (!time_after(jiffies, start_time + HZ)); | 285 | } while (!time_after(jiffies, start_time + HZ)); |
286 | 286 | ||
287 | if (val & (E2P_CMD_TIMEOUT | E2P_CMD_BUSY)) { | 287 | if (val & (E2P_CMD_TIMEOUT | E2P_CMD_BUSY)) { |
288 | netdev_warn(dev->net, "EEPROM read operation timeout"); | 288 | netdev_warn(dev->net, "EEPROM read operation timeout\n"); |
289 | return -EIO; | 289 | return -EIO; |
290 | } | 290 | } |
291 | 291 | ||
@@ -300,7 +300,7 @@ static int smsc75xx_eeprom_confirm_not_busy(struct usbnet *dev) | |||
300 | 300 | ||
301 | do { | 301 | do { |
302 | ret = smsc75xx_read_reg(dev, E2P_CMD, &val); | 302 | ret = smsc75xx_read_reg(dev, E2P_CMD, &val); |
303 | check_warn_return(ret, "Error reading E2P_CMD"); | 303 | check_warn_return(ret, "Error reading E2P_CMD\n"); |
304 | 304 | ||
305 | if (!(val & E2P_CMD_BUSY)) | 305 | if (!(val & E2P_CMD_BUSY)) |
306 | return 0; | 306 | return 0; |
@@ -308,7 +308,7 @@ static int smsc75xx_eeprom_confirm_not_busy(struct usbnet *dev) | |||
308 | udelay(40); | 308 | udelay(40); |
309 | } while (!time_after(jiffies, start_time + HZ)); | 309 | } while (!time_after(jiffies, start_time + HZ)); |
310 | 310 | ||
311 | netdev_warn(dev->net, "EEPROM is busy"); | 311 | netdev_warn(dev->net, "EEPROM is busy\n"); |
312 | return -EIO; | 312 | return -EIO; |
313 | } | 313 | } |
314 | 314 | ||
@@ -328,14 +328,14 @@ static int smsc75xx_read_eeprom(struct usbnet *dev, u32 offset, u32 length, | |||
328 | for (i = 0; i < length; i++) { | 328 | for (i = 0; i < length; i++) { |
329 | val = E2P_CMD_BUSY | E2P_CMD_READ | (offset & E2P_CMD_ADDR); | 329 | val = E2P_CMD_BUSY | E2P_CMD_READ | (offset & E2P_CMD_ADDR); |
330 | ret = smsc75xx_write_reg(dev, E2P_CMD, val); | 330 | ret = smsc75xx_write_reg(dev, E2P_CMD, val); |
331 | check_warn_return(ret, "Error writing E2P_CMD"); | 331 | check_warn_return(ret, "Error writing E2P_CMD\n"); |
332 | 332 | ||
333 | ret = smsc75xx_wait_eeprom(dev); | 333 | ret = smsc75xx_wait_eeprom(dev); |
334 | if (ret < 0) | 334 | if (ret < 0) |
335 | return ret; | 335 | return ret; |
336 | 336 | ||
337 | ret = smsc75xx_read_reg(dev, E2P_DATA, &val); | 337 | ret = smsc75xx_read_reg(dev, E2P_DATA, &val); |
338 | check_warn_return(ret, "Error reading E2P_DATA"); | 338 | check_warn_return(ret, "Error reading E2P_DATA\n"); |
339 | 339 | ||
340 | data[i] = val & 0xFF; | 340 | data[i] = val & 0xFF; |
341 | offset++; | 341 | offset++; |
@@ -360,7 +360,7 @@ static int smsc75xx_write_eeprom(struct usbnet *dev, u32 offset, u32 length, | |||
360 | /* Issue write/erase enable command */ | 360 | /* Issue write/erase enable command */ |
361 | val = E2P_CMD_BUSY | E2P_CMD_EWEN; | 361 | val = E2P_CMD_BUSY | E2P_CMD_EWEN; |
362 | ret = smsc75xx_write_reg(dev, E2P_CMD, val); | 362 | ret = smsc75xx_write_reg(dev, E2P_CMD, val); |
363 | check_warn_return(ret, "Error writing E2P_CMD"); | 363 | check_warn_return(ret, "Error writing E2P_CMD\n"); |
364 | 364 | ||
365 | ret = smsc75xx_wait_eeprom(dev); | 365 | ret = smsc75xx_wait_eeprom(dev); |
366 | if (ret < 0) | 366 | if (ret < 0) |
@@ -371,12 +371,12 @@ static int smsc75xx_write_eeprom(struct usbnet *dev, u32 offset, u32 length, | |||
371 | /* Fill data register */ | 371 | /* Fill data register */ |
372 | val = data[i]; | 372 | val = data[i]; |
373 | ret = smsc75xx_write_reg(dev, E2P_DATA, val); | 373 | ret = smsc75xx_write_reg(dev, E2P_DATA, val); |
374 | check_warn_return(ret, "Error writing E2P_DATA"); | 374 | check_warn_return(ret, "Error writing E2P_DATA\n"); |
375 | 375 | ||
376 | /* Send "write" command */ | 376 | /* Send "write" command */ |
377 | val = E2P_CMD_BUSY | E2P_CMD_WRITE | (offset & E2P_CMD_ADDR); | 377 | val = E2P_CMD_BUSY | E2P_CMD_WRITE | (offset & E2P_CMD_ADDR); |
378 | ret = smsc75xx_write_reg(dev, E2P_CMD, val); | 378 | ret = smsc75xx_write_reg(dev, E2P_CMD, val); |
379 | check_warn_return(ret, "Error writing E2P_CMD"); | 379 | check_warn_return(ret, "Error writing E2P_CMD\n"); |
380 | 380 | ||
381 | ret = smsc75xx_wait_eeprom(dev); | 381 | ret = smsc75xx_wait_eeprom(dev); |
382 | if (ret < 0) | 382 | if (ret < 0) |
@@ -395,7 +395,7 @@ static int smsc75xx_dataport_wait_not_busy(struct usbnet *dev) | |||
395 | for (i = 0; i < 100; i++) { | 395 | for (i = 0; i < 100; i++) { |
396 | u32 dp_sel; | 396 | u32 dp_sel; |
397 | ret = smsc75xx_read_reg(dev, DP_SEL, &dp_sel); | 397 | ret = smsc75xx_read_reg(dev, DP_SEL, &dp_sel); |
398 | check_warn_return(ret, "Error reading DP_SEL"); | 398 | check_warn_return(ret, "Error reading DP_SEL\n"); |
399 | 399 | ||
400 | if (dp_sel & DP_SEL_DPRDY) | 400 | if (dp_sel & DP_SEL_DPRDY) |
401 | return 0; | 401 | return 0; |
@@ -403,7 +403,7 @@ static int smsc75xx_dataport_wait_not_busy(struct usbnet *dev) | |||
403 | udelay(40); | 403 | udelay(40); |
404 | } | 404 | } |
405 | 405 | ||
406 | netdev_warn(dev->net, "smsc75xx_dataport_wait_not_busy timed out"); | 406 | netdev_warn(dev->net, "smsc75xx_dataport_wait_not_busy timed out\n"); |
407 | 407 | ||
408 | return -EIO; | 408 | return -EIO; |
409 | } | 409 | } |
@@ -418,28 +418,28 @@ static int smsc75xx_dataport_write(struct usbnet *dev, u32 ram_select, u32 addr, | |||
418 | mutex_lock(&pdata->dataport_mutex); | 418 | mutex_lock(&pdata->dataport_mutex); |
419 | 419 | ||
420 | ret = smsc75xx_dataport_wait_not_busy(dev); | 420 | ret = smsc75xx_dataport_wait_not_busy(dev); |
421 | check_warn_goto_done(ret, "smsc75xx_dataport_write busy on entry"); | 421 | check_warn_goto_done(ret, "smsc75xx_dataport_write busy on entry\n"); |
422 | 422 | ||
423 | ret = smsc75xx_read_reg(dev, DP_SEL, &dp_sel); | 423 | ret = smsc75xx_read_reg(dev, DP_SEL, &dp_sel); |
424 | check_warn_goto_done(ret, "Error reading DP_SEL"); | 424 | check_warn_goto_done(ret, "Error reading DP_SEL\n"); |
425 | 425 | ||
426 | dp_sel &= ~DP_SEL_RSEL; | 426 | dp_sel &= ~DP_SEL_RSEL; |
427 | dp_sel |= ram_select; | 427 | dp_sel |= ram_select; |
428 | ret = smsc75xx_write_reg(dev, DP_SEL, dp_sel); | 428 | ret = smsc75xx_write_reg(dev, DP_SEL, dp_sel); |
429 | check_warn_goto_done(ret, "Error writing DP_SEL"); | 429 | check_warn_goto_done(ret, "Error writing DP_SEL\n"); |
430 | 430 | ||
431 | for (i = 0; i < length; i++) { | 431 | for (i = 0; i < length; i++) { |
432 | ret = smsc75xx_write_reg(dev, DP_ADDR, addr + i); | 432 | ret = smsc75xx_write_reg(dev, DP_ADDR, addr + i); |
433 | check_warn_goto_done(ret, "Error writing DP_ADDR"); | 433 | check_warn_goto_done(ret, "Error writing DP_ADDR\n"); |
434 | 434 | ||
435 | ret = smsc75xx_write_reg(dev, DP_DATA, buf[i]); | 435 | ret = smsc75xx_write_reg(dev, DP_DATA, buf[i]); |
436 | check_warn_goto_done(ret, "Error writing DP_DATA"); | 436 | check_warn_goto_done(ret, "Error writing DP_DATA\n"); |
437 | 437 | ||
438 | ret = smsc75xx_write_reg(dev, DP_CMD, DP_CMD_WRITE); | 438 | ret = smsc75xx_write_reg(dev, DP_CMD, DP_CMD_WRITE); |
439 | check_warn_goto_done(ret, "Error writing DP_CMD"); | 439 | check_warn_goto_done(ret, "Error writing DP_CMD\n"); |
440 | 440 | ||
441 | ret = smsc75xx_dataport_wait_not_busy(dev); | 441 | ret = smsc75xx_dataport_wait_not_busy(dev); |
442 | check_warn_goto_done(ret, "smsc75xx_dataport_write timeout"); | 442 | check_warn_goto_done(ret, "smsc75xx_dataport_write timeout\n"); |
443 | } | 443 | } |
444 | 444 | ||
445 | done: | 445 | done: |
@@ -460,14 +460,14 @@ static void smsc75xx_deferred_multicast_write(struct work_struct *param) | |||
460 | struct usbnet *dev = pdata->dev; | 460 | struct usbnet *dev = pdata->dev; |
461 | int ret; | 461 | int ret; |
462 | 462 | ||
463 | netif_dbg(dev, drv, dev->net, "deferred multicast write 0x%08x", | 463 | netif_dbg(dev, drv, dev->net, "deferred multicast write 0x%08x\n", |
464 | pdata->rfe_ctl); | 464 | pdata->rfe_ctl); |
465 | 465 | ||
466 | smsc75xx_dataport_write(dev, DP_SEL_VHF, DP_SEL_VHF_VLAN_LEN, | 466 | smsc75xx_dataport_write(dev, DP_SEL_VHF, DP_SEL_VHF_VLAN_LEN, |
467 | DP_SEL_VHF_HASH_LEN, pdata->multicast_hash_table); | 467 | DP_SEL_VHF_HASH_LEN, pdata->multicast_hash_table); |
468 | 468 | ||
469 | ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl); | 469 | ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl); |
470 | check_warn(ret, "Error writing RFE_CRL"); | 470 | check_warn(ret, "Error writing RFE_CRL\n"); |
471 | } | 471 | } |
472 | 472 | ||
473 | static void smsc75xx_set_multicast(struct net_device *netdev) | 473 | static void smsc75xx_set_multicast(struct net_device *netdev) |
@@ -487,15 +487,15 @@ static void smsc75xx_set_multicast(struct net_device *netdev) | |||
487 | pdata->multicast_hash_table[i] = 0; | 487 | pdata->multicast_hash_table[i] = 0; |
488 | 488 | ||
489 | if (dev->net->flags & IFF_PROMISC) { | 489 | if (dev->net->flags & IFF_PROMISC) { |
490 | netif_dbg(dev, drv, dev->net, "promiscuous mode enabled"); | 490 | netif_dbg(dev, drv, dev->net, "promiscuous mode enabled\n"); |
491 | pdata->rfe_ctl |= RFE_CTL_AM | RFE_CTL_AU; | 491 | pdata->rfe_ctl |= RFE_CTL_AM | RFE_CTL_AU; |
492 | } else if (dev->net->flags & IFF_ALLMULTI) { | 492 | } else if (dev->net->flags & IFF_ALLMULTI) { |
493 | netif_dbg(dev, drv, dev->net, "receive all multicast enabled"); | 493 | netif_dbg(dev, drv, dev->net, "receive all multicast enabled\n"); |
494 | pdata->rfe_ctl |= RFE_CTL_AM | RFE_CTL_DPF; | 494 | pdata->rfe_ctl |= RFE_CTL_AM | RFE_CTL_DPF; |
495 | } else if (!netdev_mc_empty(dev->net)) { | 495 | } else if (!netdev_mc_empty(dev->net)) { |
496 | struct netdev_hw_addr *ha; | 496 | struct netdev_hw_addr *ha; |
497 | 497 | ||
498 | netif_dbg(dev, drv, dev->net, "receive multicast hash filter"); | 498 | netif_dbg(dev, drv, dev->net, "receive multicast hash filter\n"); |
499 | 499 | ||
500 | pdata->rfe_ctl |= RFE_CTL_MHF | RFE_CTL_DPF; | 500 | pdata->rfe_ctl |= RFE_CTL_MHF | RFE_CTL_DPF; |
501 | 501 | ||
@@ -505,7 +505,7 @@ static void smsc75xx_set_multicast(struct net_device *netdev) | |||
505 | (1 << (bitnum % 32)); | 505 | (1 << (bitnum % 32)); |
506 | } | 506 | } |
507 | } else { | 507 | } else { |
508 | netif_dbg(dev, drv, dev->net, "receive own packets only"); | 508 | netif_dbg(dev, drv, dev->net, "receive own packets only\n"); |
509 | pdata->rfe_ctl |= RFE_CTL_DPF; | 509 | pdata->rfe_ctl |= RFE_CTL_DPF; |
510 | } | 510 | } |
511 | 511 | ||
@@ -533,18 +533,18 @@ static int smsc75xx_update_flowcontrol(struct usbnet *dev, u8 duplex, | |||
533 | if (cap & FLOW_CTRL_RX) | 533 | if (cap & FLOW_CTRL_RX) |
534 | flow |= FLOW_RX_FCEN; | 534 | flow |= FLOW_RX_FCEN; |
535 | 535 | ||
536 | netif_dbg(dev, link, dev->net, "rx pause %s, tx pause %s", | 536 | netif_dbg(dev, link, dev->net, "rx pause %s, tx pause %s\n", |
537 | (cap & FLOW_CTRL_RX ? "enabled" : "disabled"), | 537 | (cap & FLOW_CTRL_RX ? "enabled" : "disabled"), |
538 | (cap & FLOW_CTRL_TX ? "enabled" : "disabled")); | 538 | (cap & FLOW_CTRL_TX ? "enabled" : "disabled")); |
539 | } else { | 539 | } else { |
540 | netif_dbg(dev, link, dev->net, "half duplex"); | 540 | netif_dbg(dev, link, dev->net, "half duplex\n"); |
541 | } | 541 | } |
542 | 542 | ||
543 | ret = smsc75xx_write_reg(dev, FLOW, flow); | 543 | ret = smsc75xx_write_reg(dev, FLOW, flow); |
544 | check_warn_return(ret, "Error writing FLOW"); | 544 | check_warn_return(ret, "Error writing FLOW\n"); |
545 | 545 | ||
546 | ret = smsc75xx_write_reg(dev, FCT_FLOW, fct_flow); | 546 | ret = smsc75xx_write_reg(dev, FCT_FLOW, fct_flow); |
547 | check_warn_return(ret, "Error writing FCT_FLOW"); | 547 | check_warn_return(ret, "Error writing FCT_FLOW\n"); |
548 | 548 | ||
549 | return 0; | 549 | return 0; |
550 | } | 550 | } |
@@ -561,16 +561,15 @@ static int smsc75xx_link_reset(struct usbnet *dev) | |||
561 | PHY_INT_SRC_CLEAR_ALL); | 561 | PHY_INT_SRC_CLEAR_ALL); |
562 | 562 | ||
563 | ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL); | 563 | ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL); |
564 | check_warn_return(ret, "Error writing INT_STS"); | 564 | check_warn_return(ret, "Error writing INT_STS\n"); |
565 | 565 | ||
566 | mii_check_media(mii, 1, 1); | 566 | mii_check_media(mii, 1, 1); |
567 | mii_ethtool_gset(&dev->mii, &ecmd); | 567 | mii_ethtool_gset(&dev->mii, &ecmd); |
568 | lcladv = smsc75xx_mdio_read(dev->net, mii->phy_id, MII_ADVERTISE); | 568 | lcladv = smsc75xx_mdio_read(dev->net, mii->phy_id, MII_ADVERTISE); |
569 | rmtadv = smsc75xx_mdio_read(dev->net, mii->phy_id, MII_LPA); | 569 | rmtadv = smsc75xx_mdio_read(dev->net, mii->phy_id, MII_LPA); |
570 | 570 | ||
571 | netif_dbg(dev, link, dev->net, "speed: %u duplex: %d lcladv: %04x" | 571 | netif_dbg(dev, link, dev->net, "speed: %u duplex: %d lcladv: %04x rmtadv: %04x\n", |
572 | " rmtadv: %04x", ethtool_cmd_speed(&ecmd), | 572 | ethtool_cmd_speed(&ecmd), ecmd.duplex, lcladv, rmtadv); |
573 | ecmd.duplex, lcladv, rmtadv); | ||
574 | 573 | ||
575 | return smsc75xx_update_flowcontrol(dev, ecmd.duplex, lcladv, rmtadv); | 574 | return smsc75xx_update_flowcontrol(dev, ecmd.duplex, lcladv, rmtadv); |
576 | } | 575 | } |
@@ -580,21 +579,21 @@ static void smsc75xx_status(struct usbnet *dev, struct urb *urb) | |||
580 | u32 intdata; | 579 | u32 intdata; |
581 | 580 | ||
582 | if (urb->actual_length != 4) { | 581 | if (urb->actual_length != 4) { |
583 | netdev_warn(dev->net, | 582 | netdev_warn(dev->net, "unexpected urb length %d\n", |
584 | "unexpected urb length %d", urb->actual_length); | 583 | urb->actual_length); |
585 | return; | 584 | return; |
586 | } | 585 | } |
587 | 586 | ||
588 | memcpy(&intdata, urb->transfer_buffer, 4); | 587 | memcpy(&intdata, urb->transfer_buffer, 4); |
589 | le32_to_cpus(&intdata); | 588 | le32_to_cpus(&intdata); |
590 | 589 | ||
591 | netif_dbg(dev, link, dev->net, "intdata: 0x%08X", intdata); | 590 | netif_dbg(dev, link, dev->net, "intdata: 0x%08X\n", intdata); |
592 | 591 | ||
593 | if (intdata & INT_ENP_PHY_INT) | 592 | if (intdata & INT_ENP_PHY_INT) |
594 | usbnet_defer_kevent(dev, EVENT_LINK_RESET); | 593 | usbnet_defer_kevent(dev, EVENT_LINK_RESET); |
595 | else | 594 | else |
596 | netdev_warn(dev->net, | 595 | netdev_warn(dev->net, "unexpected interrupt, intdata=0x%08X\n", |
597 | "unexpected interrupt, intdata=0x%08X", intdata); | 596 | intdata); |
598 | } | 597 | } |
599 | 598 | ||
600 | static int smsc75xx_ethtool_get_eeprom_len(struct net_device *net) | 599 | static int smsc75xx_ethtool_get_eeprom_len(struct net_device *net) |
@@ -618,8 +617,8 @@ static int smsc75xx_ethtool_set_eeprom(struct net_device *netdev, | |||
618 | struct usbnet *dev = netdev_priv(netdev); | 617 | struct usbnet *dev = netdev_priv(netdev); |
619 | 618 | ||
620 | if (ee->magic != LAN75XX_EEPROM_MAGIC) { | 619 | if (ee->magic != LAN75XX_EEPROM_MAGIC) { |
621 | netdev_warn(dev->net, | 620 | netdev_warn(dev->net, "EEPROM: magic value mismatch: 0x%x\n", |
622 | "EEPROM: magic value mismatch: 0x%x", ee->magic); | 621 | ee->magic); |
623 | return -EINVAL; | 622 | return -EINVAL; |
624 | } | 623 | } |
625 | 624 | ||
@@ -679,14 +678,14 @@ static void smsc75xx_init_mac_address(struct usbnet *dev) | |||
679 | if (is_valid_ether_addr(dev->net->dev_addr)) { | 678 | if (is_valid_ether_addr(dev->net->dev_addr)) { |
680 | /* eeprom values are valid so use them */ | 679 | /* eeprom values are valid so use them */ |
681 | netif_dbg(dev, ifup, dev->net, | 680 | netif_dbg(dev, ifup, dev->net, |
682 | "MAC address read from EEPROM"); | 681 | "MAC address read from EEPROM\n"); |
683 | return; | 682 | return; |
684 | } | 683 | } |
685 | } | 684 | } |
686 | 685 | ||
687 | /* no eeprom, or eeprom values are invalid. generate random MAC */ | 686 | /* no eeprom, or eeprom values are invalid. generate random MAC */ |
688 | eth_hw_addr_random(dev->net); | 687 | eth_hw_addr_random(dev->net); |
689 | netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr"); | 688 | netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n"); |
690 | } | 689 | } |
691 | 690 | ||
692 | static int smsc75xx_set_mac_address(struct usbnet *dev) | 691 | static int smsc75xx_set_mac_address(struct usbnet *dev) |
@@ -696,17 +695,17 @@ static int smsc75xx_set_mac_address(struct usbnet *dev) | |||
696 | u32 addr_hi = dev->net->dev_addr[4] | dev->net->dev_addr[5] << 8; | 695 | u32 addr_hi = dev->net->dev_addr[4] | dev->net->dev_addr[5] << 8; |
697 | 696 | ||
698 | int ret = smsc75xx_write_reg(dev, RX_ADDRH, addr_hi); | 697 | int ret = smsc75xx_write_reg(dev, RX_ADDRH, addr_hi); |
699 | check_warn_return(ret, "Failed to write RX_ADDRH: %d", ret); | 698 | check_warn_return(ret, "Failed to write RX_ADDRH: %d\n", ret); |
700 | 699 | ||
701 | ret = smsc75xx_write_reg(dev, RX_ADDRL, addr_lo); | 700 | ret = smsc75xx_write_reg(dev, RX_ADDRL, addr_lo); |
702 | check_warn_return(ret, "Failed to write RX_ADDRL: %d", ret); | 701 | check_warn_return(ret, "Failed to write RX_ADDRL: %d\n", ret); |
703 | 702 | ||
704 | addr_hi |= ADDR_FILTX_FB_VALID; | 703 | addr_hi |= ADDR_FILTX_FB_VALID; |
705 | ret = smsc75xx_write_reg(dev, ADDR_FILTX, addr_hi); | 704 | ret = smsc75xx_write_reg(dev, ADDR_FILTX, addr_hi); |
706 | check_warn_return(ret, "Failed to write ADDR_FILTX: %d", ret); | 705 | check_warn_return(ret, "Failed to write ADDR_FILTX: %d\n", ret); |
707 | 706 | ||
708 | ret = smsc75xx_write_reg(dev, ADDR_FILTX + 4, addr_lo); | 707 | ret = smsc75xx_write_reg(dev, ADDR_FILTX + 4, addr_lo); |
709 | check_warn_return(ret, "Failed to write ADDR_FILTX+4: %d", ret); | 708 | check_warn_return(ret, "Failed to write ADDR_FILTX+4: %d\n", ret); |
710 | 709 | ||
711 | return 0; | 710 | return 0; |
712 | } | 711 | } |
@@ -730,12 +729,12 @@ static int smsc75xx_phy_initialize(struct usbnet *dev) | |||
730 | do { | 729 | do { |
731 | msleep(10); | 730 | msleep(10); |
732 | bmcr = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR); | 731 | bmcr = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR); |
733 | check_warn_return(bmcr, "Error reading MII_BMCR"); | 732 | check_warn_return(bmcr, "Error reading MII_BMCR\n"); |
734 | timeout++; | 733 | timeout++; |
735 | } while ((bmcr & BMCR_RESET) && (timeout < 100)); | 734 | } while ((bmcr & BMCR_RESET) && (timeout < 100)); |
736 | 735 | ||
737 | if (timeout >= 100) { | 736 | if (timeout >= 100) { |
738 | netdev_warn(dev->net, "timeout on PHY Reset"); | 737 | netdev_warn(dev->net, "timeout on PHY Reset\n"); |
739 | return -EIO; | 738 | return -EIO; |
740 | } | 739 | } |
741 | 740 | ||
@@ -747,14 +746,14 @@ static int smsc75xx_phy_initialize(struct usbnet *dev) | |||
747 | 746 | ||
748 | /* read and write to clear phy interrupt status */ | 747 | /* read and write to clear phy interrupt status */ |
749 | ret = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC); | 748 | ret = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC); |
750 | check_warn_return(ret, "Error reading PHY_INT_SRC"); | 749 | check_warn_return(ret, "Error reading PHY_INT_SRC\n"); |
751 | smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_SRC, 0xffff); | 750 | smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_SRC, 0xffff); |
752 | 751 | ||
753 | smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK, | 752 | smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK, |
754 | PHY_INT_MASK_DEFAULT); | 753 | PHY_INT_MASK_DEFAULT); |
755 | mii_nway_restart(&dev->mii); | 754 | mii_nway_restart(&dev->mii); |
756 | 755 | ||
757 | netif_dbg(dev, ifup, dev->net, "phy initialised successfully"); | 756 | netif_dbg(dev, ifup, dev->net, "phy initialised successfully\n"); |
758 | return 0; | 757 | return 0; |
759 | } | 758 | } |
760 | 759 | ||
@@ -765,14 +764,14 @@ static int smsc75xx_set_rx_max_frame_length(struct usbnet *dev, int size) | |||
765 | bool rxenabled; | 764 | bool rxenabled; |
766 | 765 | ||
767 | ret = smsc75xx_read_reg(dev, MAC_RX, &buf); | 766 | ret = smsc75xx_read_reg(dev, MAC_RX, &buf); |
768 | check_warn_return(ret, "Failed to read MAC_RX: %d", ret); | 767 | check_warn_return(ret, "Failed to read MAC_RX: %d\n", ret); |
769 | 768 | ||
770 | rxenabled = ((buf & MAC_RX_RXEN) != 0); | 769 | rxenabled = ((buf & MAC_RX_RXEN) != 0); |
771 | 770 | ||
772 | if (rxenabled) { | 771 | if (rxenabled) { |
773 | buf &= ~MAC_RX_RXEN; | 772 | buf &= ~MAC_RX_RXEN; |
774 | ret = smsc75xx_write_reg(dev, MAC_RX, buf); | 773 | ret = smsc75xx_write_reg(dev, MAC_RX, buf); |
775 | check_warn_return(ret, "Failed to write MAC_RX: %d", ret); | 774 | check_warn_return(ret, "Failed to write MAC_RX: %d\n", ret); |
776 | } | 775 | } |
777 | 776 | ||
778 | /* add 4 to size for FCS */ | 777 | /* add 4 to size for FCS */ |
@@ -780,12 +779,12 @@ static int smsc75xx_set_rx_max_frame_length(struct usbnet *dev, int size) | |||
780 | buf |= (((size + 4) << MAC_RX_MAX_SIZE_SHIFT) & MAC_RX_MAX_SIZE); | 779 | buf |= (((size + 4) << MAC_RX_MAX_SIZE_SHIFT) & MAC_RX_MAX_SIZE); |
781 | 780 | ||
782 | ret = smsc75xx_write_reg(dev, MAC_RX, buf); | 781 | ret = smsc75xx_write_reg(dev, MAC_RX, buf); |
783 | check_warn_return(ret, "Failed to write MAC_RX: %d", ret); | 782 | check_warn_return(ret, "Failed to write MAC_RX: %d\n", ret); |
784 | 783 | ||
785 | if (rxenabled) { | 784 | if (rxenabled) { |
786 | buf |= MAC_RX_RXEN; | 785 | buf |= MAC_RX_RXEN; |
787 | ret = smsc75xx_write_reg(dev, MAC_RX, buf); | 786 | ret = smsc75xx_write_reg(dev, MAC_RX, buf); |
788 | check_warn_return(ret, "Failed to write MAC_RX: %d", ret); | 787 | check_warn_return(ret, "Failed to write MAC_RX: %d\n", ret); |
789 | } | 788 | } |
790 | 789 | ||
791 | return 0; | 790 | return 0; |
@@ -796,7 +795,7 @@ static int smsc75xx_change_mtu(struct net_device *netdev, int new_mtu) | |||
796 | struct usbnet *dev = netdev_priv(netdev); | 795 | struct usbnet *dev = netdev_priv(netdev); |
797 | 796 | ||
798 | int ret = smsc75xx_set_rx_max_frame_length(dev, new_mtu); | 797 | int ret = smsc75xx_set_rx_max_frame_length(dev, new_mtu); |
799 | check_warn_return(ret, "Failed to set mac rx frame length"); | 798 | check_warn_return(ret, "Failed to set mac rx frame length\n"); |
800 | 799 | ||
801 | return usbnet_change_mtu(netdev, new_mtu); | 800 | return usbnet_change_mtu(netdev, new_mtu); |
802 | } | 801 | } |
@@ -821,7 +820,7 @@ static int smsc75xx_set_features(struct net_device *netdev, | |||
821 | /* it's racing here! */ | 820 | /* it's racing here! */ |
822 | 821 | ||
823 | ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl); | 822 | ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl); |
824 | check_warn_return(ret, "Error writing RFE_CTL"); | 823 | check_warn_return(ret, "Error writing RFE_CTL\n"); |
825 | 824 | ||
826 | return 0; | 825 | return 0; |
827 | } | 826 | } |
@@ -836,7 +835,7 @@ static int smsc75xx_wait_ready(struct usbnet *dev, int in_pm) | |||
836 | 835 | ||
837 | ret = __smsc75xx_read_reg(dev, PMT_CTL, &buf, in_pm); | 836 | ret = __smsc75xx_read_reg(dev, PMT_CTL, &buf, in_pm); |
838 | 837 | ||
839 | check_warn_return(ret, "Failed to read PMT_CTL: %d", ret); | 838 | check_warn_return(ret, "Failed to read PMT_CTL: %d\n", ret); |
840 | 839 | ||
841 | if (buf & PMT_CTL_DEV_RDY) | 840 | if (buf & PMT_CTL_DEV_RDY) |
842 | return 0; | 841 | return 0; |
@@ -845,7 +844,7 @@ static int smsc75xx_wait_ready(struct usbnet *dev, int in_pm) | |||
845 | timeout++; | 844 | timeout++; |
846 | } while (timeout < 100); | 845 | } while (timeout < 100); |
847 | 846 | ||
848 | netdev_warn(dev->net, "timeout waiting for device ready"); | 847 | netdev_warn(dev->net, "timeout waiting for device ready\n"); |
849 | return -EIO; | 848 | return -EIO; |
850 | } | 849 | } |
851 | 850 | ||
@@ -855,79 +854,81 @@ static int smsc75xx_reset(struct usbnet *dev) | |||
855 | u32 buf; | 854 | u32 buf; |
856 | int ret = 0, timeout; | 855 | int ret = 0, timeout; |
857 | 856 | ||
858 | netif_dbg(dev, ifup, dev->net, "entering smsc75xx_reset"); | 857 | netif_dbg(dev, ifup, dev->net, "entering smsc75xx_reset\n"); |
859 | 858 | ||
860 | ret = smsc75xx_wait_ready(dev, 0); | 859 | ret = smsc75xx_wait_ready(dev, 0); |
861 | check_warn_return(ret, "device not ready in smsc75xx_reset"); | 860 | check_warn_return(ret, "device not ready in smsc75xx_reset\n"); |
862 | 861 | ||
863 | ret = smsc75xx_read_reg(dev, HW_CFG, &buf); | 862 | ret = smsc75xx_read_reg(dev, HW_CFG, &buf); |
864 | check_warn_return(ret, "Failed to read HW_CFG: %d", ret); | 863 | check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret); |
865 | 864 | ||
866 | buf |= HW_CFG_LRST; | 865 | buf |= HW_CFG_LRST; |
867 | 866 | ||
868 | ret = smsc75xx_write_reg(dev, HW_CFG, buf); | 867 | ret = smsc75xx_write_reg(dev, HW_CFG, buf); |
869 | check_warn_return(ret, "Failed to write HW_CFG: %d", ret); | 868 | check_warn_return(ret, "Failed to write HW_CFG: %d\n", ret); |
870 | 869 | ||
871 | timeout = 0; | 870 | timeout = 0; |
872 | do { | 871 | do { |
873 | msleep(10); | 872 | msleep(10); |
874 | ret = smsc75xx_read_reg(dev, HW_CFG, &buf); | 873 | ret = smsc75xx_read_reg(dev, HW_CFG, &buf); |
875 | check_warn_return(ret, "Failed to read HW_CFG: %d", ret); | 874 | check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret); |
876 | timeout++; | 875 | timeout++; |
877 | } while ((buf & HW_CFG_LRST) && (timeout < 100)); | 876 | } while ((buf & HW_CFG_LRST) && (timeout < 100)); |
878 | 877 | ||
879 | if (timeout >= 100) { | 878 | if (timeout >= 100) { |
880 | netdev_warn(dev->net, "timeout on completion of Lite Reset"); | 879 | netdev_warn(dev->net, "timeout on completion of Lite Reset\n"); |
881 | return -EIO; | 880 | return -EIO; |
882 | } | 881 | } |
883 | 882 | ||
884 | netif_dbg(dev, ifup, dev->net, "Lite reset complete, resetting PHY"); | 883 | netif_dbg(dev, ifup, dev->net, "Lite reset complete, resetting PHY\n"); |
885 | 884 | ||
886 | ret = smsc75xx_read_reg(dev, PMT_CTL, &buf); | 885 | ret = smsc75xx_read_reg(dev, PMT_CTL, &buf); |
887 | check_warn_return(ret, "Failed to read PMT_CTL: %d", ret); | 886 | check_warn_return(ret, "Failed to read PMT_CTL: %d\n", ret); |
888 | 887 | ||
889 | buf |= PMT_CTL_PHY_RST; | 888 | buf |= PMT_CTL_PHY_RST; |
890 | 889 | ||
891 | ret = smsc75xx_write_reg(dev, PMT_CTL, buf); | 890 | ret = smsc75xx_write_reg(dev, PMT_CTL, buf); |
892 | check_warn_return(ret, "Failed to write PMT_CTL: %d", ret); | 891 | check_warn_return(ret, "Failed to write PMT_CTL: %d\n", ret); |
893 | 892 | ||
894 | timeout = 0; | 893 | timeout = 0; |
895 | do { | 894 | do { |
896 | msleep(10); | 895 | msleep(10); |
897 | ret = smsc75xx_read_reg(dev, PMT_CTL, &buf); | 896 | ret = smsc75xx_read_reg(dev, PMT_CTL, &buf); |
898 | check_warn_return(ret, "Failed to read PMT_CTL: %d", ret); | 897 | check_warn_return(ret, "Failed to read PMT_CTL: %d\n", ret); |
899 | timeout++; | 898 | timeout++; |
900 | } while ((buf & PMT_CTL_PHY_RST) && (timeout < 100)); | 899 | } while ((buf & PMT_CTL_PHY_RST) && (timeout < 100)); |
901 | 900 | ||
902 | if (timeout >= 100) { | 901 | if (timeout >= 100) { |
903 | netdev_warn(dev->net, "timeout waiting for PHY Reset"); | 902 | netdev_warn(dev->net, "timeout waiting for PHY Reset\n"); |
904 | return -EIO; | 903 | return -EIO; |
905 | } | 904 | } |
906 | 905 | ||
907 | netif_dbg(dev, ifup, dev->net, "PHY reset complete"); | 906 | netif_dbg(dev, ifup, dev->net, "PHY reset complete\n"); |
908 | 907 | ||
909 | smsc75xx_init_mac_address(dev); | 908 | smsc75xx_init_mac_address(dev); |
910 | 909 | ||
911 | ret = smsc75xx_set_mac_address(dev); | 910 | ret = smsc75xx_set_mac_address(dev); |
912 | check_warn_return(ret, "Failed to set mac address"); | 911 | check_warn_return(ret, "Failed to set mac address\n"); |
913 | 912 | ||
914 | netif_dbg(dev, ifup, dev->net, "MAC Address: %pM", dev->net->dev_addr); | 913 | netif_dbg(dev, ifup, dev->net, "MAC Address: %pM\n", |
914 | dev->net->dev_addr); | ||
915 | 915 | ||
916 | ret = smsc75xx_read_reg(dev, HW_CFG, &buf); | 916 | ret = smsc75xx_read_reg(dev, HW_CFG, &buf); |
917 | check_warn_return(ret, "Failed to read HW_CFG: %d", ret); | 917 | check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret); |
918 | 918 | ||
919 | netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG : 0x%08x", buf); | 919 | netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG : 0x%08x\n", |
920 | buf); | ||
920 | 921 | ||
921 | buf |= HW_CFG_BIR; | 922 | buf |= HW_CFG_BIR; |
922 | 923 | ||
923 | ret = smsc75xx_write_reg(dev, HW_CFG, buf); | 924 | ret = smsc75xx_write_reg(dev, HW_CFG, buf); |
924 | check_warn_return(ret, "Failed to write HW_CFG: %d", ret); | 925 | check_warn_return(ret, "Failed to write HW_CFG: %d\n", ret); |
925 | 926 | ||
926 | ret = smsc75xx_read_reg(dev, HW_CFG, &buf); | 927 | ret = smsc75xx_read_reg(dev, HW_CFG, &buf); |
927 | check_warn_return(ret, "Failed to read HW_CFG: %d", ret); | 928 | check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret); |
928 | 929 | ||
929 | netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG after " | 930 | netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG after writing HW_CFG_BIR: 0x%08x\n", |
930 | "writing HW_CFG_BIR: 0x%08x", buf); | 931 | buf); |
931 | 932 | ||
932 | if (!turbo_mode) { | 933 | if (!turbo_mode) { |
933 | buf = 0; | 934 | buf = 0; |
@@ -940,99 +941,102 @@ static int smsc75xx_reset(struct usbnet *dev) | |||
940 | dev->rx_urb_size = DEFAULT_FS_BURST_CAP_SIZE; | 941 | dev->rx_urb_size = DEFAULT_FS_BURST_CAP_SIZE; |
941 | } | 942 | } |
942 | 943 | ||
943 | netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld", | 944 | netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n", |
944 | (ulong)dev->rx_urb_size); | 945 | (ulong)dev->rx_urb_size); |
945 | 946 | ||
946 | ret = smsc75xx_write_reg(dev, BURST_CAP, buf); | 947 | ret = smsc75xx_write_reg(dev, BURST_CAP, buf); |
947 | check_warn_return(ret, "Failed to write BURST_CAP: %d", ret); | 948 | check_warn_return(ret, "Failed to write BURST_CAP: %d\n", ret); |
948 | 949 | ||
949 | ret = smsc75xx_read_reg(dev, BURST_CAP, &buf); | 950 | ret = smsc75xx_read_reg(dev, BURST_CAP, &buf); |
950 | check_warn_return(ret, "Failed to read BURST_CAP: %d", ret); | 951 | check_warn_return(ret, "Failed to read BURST_CAP: %d\n", ret); |
951 | 952 | ||
952 | netif_dbg(dev, ifup, dev->net, | 953 | netif_dbg(dev, ifup, dev->net, |
953 | "Read Value from BURST_CAP after writing: 0x%08x", buf); | 954 | "Read Value from BURST_CAP after writing: 0x%08x\n", buf); |
954 | 955 | ||
955 | ret = smsc75xx_write_reg(dev, BULK_IN_DLY, DEFAULT_BULK_IN_DELAY); | 956 | ret = smsc75xx_write_reg(dev, BULK_IN_DLY, DEFAULT_BULK_IN_DELAY); |
956 | check_warn_return(ret, "Failed to write BULK_IN_DLY: %d", ret); | 957 | check_warn_return(ret, "Failed to write BULK_IN_DLY: %d\n", ret); |
957 | 958 | ||
958 | ret = smsc75xx_read_reg(dev, BULK_IN_DLY, &buf); | 959 | ret = smsc75xx_read_reg(dev, BULK_IN_DLY, &buf); |
959 | check_warn_return(ret, "Failed to read BULK_IN_DLY: %d", ret); | 960 | check_warn_return(ret, "Failed to read BULK_IN_DLY: %d\n", ret); |
960 | 961 | ||
961 | netif_dbg(dev, ifup, dev->net, | 962 | netif_dbg(dev, ifup, dev->net, |
962 | "Read Value from BULK_IN_DLY after writing: 0x%08x", buf); | 963 | "Read Value from BULK_IN_DLY after writing: 0x%08x\n", buf); |
963 | 964 | ||
964 | if (turbo_mode) { | 965 | if (turbo_mode) { |
965 | ret = smsc75xx_read_reg(dev, HW_CFG, &buf); | 966 | ret = smsc75xx_read_reg(dev, HW_CFG, &buf); |
966 | check_warn_return(ret, "Failed to read HW_CFG: %d", ret); | 967 | check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret); |
967 | 968 | ||
968 | netif_dbg(dev, ifup, dev->net, "HW_CFG: 0x%08x", buf); | 969 | netif_dbg(dev, ifup, dev->net, "HW_CFG: 0x%08x\n", buf); |
969 | 970 | ||
970 | buf |= (HW_CFG_MEF | HW_CFG_BCE); | 971 | buf |= (HW_CFG_MEF | HW_CFG_BCE); |
971 | 972 | ||
972 | ret = smsc75xx_write_reg(dev, HW_CFG, buf); | 973 | ret = smsc75xx_write_reg(dev, HW_CFG, buf); |
973 | check_warn_return(ret, "Failed to write HW_CFG: %d", ret); | 974 | check_warn_return(ret, "Failed to write HW_CFG: %d\n", ret); |
974 | 975 | ||
975 | ret = smsc75xx_read_reg(dev, HW_CFG, &buf); | 976 | ret = smsc75xx_read_reg(dev, HW_CFG, &buf); |
976 | check_warn_return(ret, "Failed to read HW_CFG: %d", ret); | 977 | check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret); |
977 | 978 | ||
978 | netif_dbg(dev, ifup, dev->net, "HW_CFG: 0x%08x", buf); | 979 | netif_dbg(dev, ifup, dev->net, "HW_CFG: 0x%08x\n", buf); |
979 | } | 980 | } |
980 | 981 | ||
981 | /* set FIFO sizes */ | 982 | /* set FIFO sizes */ |
982 | buf = (MAX_RX_FIFO_SIZE - 512) / 512; | 983 | buf = (MAX_RX_FIFO_SIZE - 512) / 512; |
983 | ret = smsc75xx_write_reg(dev, FCT_RX_FIFO_END, buf); | 984 | ret = smsc75xx_write_reg(dev, FCT_RX_FIFO_END, buf); |
984 | check_warn_return(ret, "Failed to write FCT_RX_FIFO_END: %d", ret); | 985 | check_warn_return(ret, "Failed to write FCT_RX_FIFO_END: %d\n", ret); |
985 | 986 | ||
986 | netif_dbg(dev, ifup, dev->net, "FCT_RX_FIFO_END set to 0x%08x", buf); | 987 | netif_dbg(dev, ifup, dev->net, "FCT_RX_FIFO_END set to 0x%08x\n", buf); |
987 | 988 | ||
988 | buf = (MAX_TX_FIFO_SIZE - 512) / 512; | 989 | buf = (MAX_TX_FIFO_SIZE - 512) / 512; |
989 | ret = smsc75xx_write_reg(dev, FCT_TX_FIFO_END, buf); | 990 | ret = smsc75xx_write_reg(dev, FCT_TX_FIFO_END, buf); |
990 | check_warn_return(ret, "Failed to write FCT_TX_FIFO_END: %d", ret); | 991 | check_warn_return(ret, "Failed to write FCT_TX_FIFO_END: %d\n", ret); |
991 | 992 | ||
992 | netif_dbg(dev, ifup, dev->net, "FCT_TX_FIFO_END set to 0x%08x", buf); | 993 | netif_dbg(dev, ifup, dev->net, "FCT_TX_FIFO_END set to 0x%08x\n", buf); |
993 | 994 | ||
994 | ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL); | 995 | ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL); |
995 | check_warn_return(ret, "Failed to write INT_STS: %d", ret); | 996 | check_warn_return(ret, "Failed to write INT_STS: %d\n", ret); |
996 | 997 | ||
997 | ret = smsc75xx_read_reg(dev, ID_REV, &buf); | 998 | ret = smsc75xx_read_reg(dev, ID_REV, &buf); |
998 | check_warn_return(ret, "Failed to read ID_REV: %d", ret); | 999 | check_warn_return(ret, "Failed to read ID_REV: %d\n", ret); |
999 | 1000 | ||
1000 | netif_dbg(dev, ifup, dev->net, "ID_REV = 0x%08x", buf); | 1001 | netif_dbg(dev, ifup, dev->net, "ID_REV = 0x%08x\n", buf); |
1001 | 1002 | ||
1002 | ret = smsc75xx_read_reg(dev, E2P_CMD, &buf); | 1003 | ret = smsc75xx_read_reg(dev, E2P_CMD, &buf); |
1003 | check_warn_return(ret, "Failed to read E2P_CMD: %d", ret); | 1004 | check_warn_return(ret, "Failed to read E2P_CMD: %d\n", ret); |
1004 | 1005 | ||
1005 | /* only set default GPIO/LED settings if no EEPROM is detected */ | 1006 | /* only set default GPIO/LED settings if no EEPROM is detected */ |
1006 | if (!(buf & E2P_CMD_LOADED)) { | 1007 | if (!(buf & E2P_CMD_LOADED)) { |
1007 | ret = smsc75xx_read_reg(dev, LED_GPIO_CFG, &buf); | 1008 | ret = smsc75xx_read_reg(dev, LED_GPIO_CFG, &buf); |
1008 | check_warn_return(ret, "Failed to read LED_GPIO_CFG: %d", ret); | 1009 | check_warn_return(ret, "Failed to read LED_GPIO_CFG: %d\n", |
1010 | ret); | ||
1009 | 1011 | ||
1010 | buf &= ~(LED_GPIO_CFG_LED2_FUN_SEL | LED_GPIO_CFG_LED10_FUN_SEL); | 1012 | buf &= ~(LED_GPIO_CFG_LED2_FUN_SEL | LED_GPIO_CFG_LED10_FUN_SEL); |
1011 | buf |= LED_GPIO_CFG_LEDGPIO_EN | LED_GPIO_CFG_LED2_FUN_SEL; | 1013 | buf |= LED_GPIO_CFG_LEDGPIO_EN | LED_GPIO_CFG_LED2_FUN_SEL; |
1012 | 1014 | ||
1013 | ret = smsc75xx_write_reg(dev, LED_GPIO_CFG, buf); | 1015 | ret = smsc75xx_write_reg(dev, LED_GPIO_CFG, buf); |
1014 | check_warn_return(ret, "Failed to write LED_GPIO_CFG: %d", ret); | 1016 | check_warn_return(ret, "Failed to write LED_GPIO_CFG: %d\n", |
1017 | ret); | ||
1015 | } | 1018 | } |
1016 | 1019 | ||
1017 | ret = smsc75xx_write_reg(dev, FLOW, 0); | 1020 | ret = smsc75xx_write_reg(dev, FLOW, 0); |
1018 | check_warn_return(ret, "Failed to write FLOW: %d", ret); | 1021 | check_warn_return(ret, "Failed to write FLOW: %d\n", ret); |
1019 | 1022 | ||
1020 | ret = smsc75xx_write_reg(dev, FCT_FLOW, 0); | 1023 | ret = smsc75xx_write_reg(dev, FCT_FLOW, 0); |
1021 | check_warn_return(ret, "Failed to write FCT_FLOW: %d", ret); | 1024 | check_warn_return(ret, "Failed to write FCT_FLOW: %d\n", ret); |
1022 | 1025 | ||
1023 | /* Don't need rfe_ctl_lock during initialisation */ | 1026 | /* Don't need rfe_ctl_lock during initialisation */ |
1024 | ret = smsc75xx_read_reg(dev, RFE_CTL, &pdata->rfe_ctl); | 1027 | ret = smsc75xx_read_reg(dev, RFE_CTL, &pdata->rfe_ctl); |
1025 | check_warn_return(ret, "Failed to read RFE_CTL: %d", ret); | 1028 | check_warn_return(ret, "Failed to read RFE_CTL: %d\n", ret); |
1026 | 1029 | ||
1027 | pdata->rfe_ctl |= RFE_CTL_AB | RFE_CTL_DPF; | 1030 | pdata->rfe_ctl |= RFE_CTL_AB | RFE_CTL_DPF; |
1028 | 1031 | ||
1029 | ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl); | 1032 | ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl); |
1030 | check_warn_return(ret, "Failed to write RFE_CTL: %d", ret); | 1033 | check_warn_return(ret, "Failed to write RFE_CTL: %d\n", ret); |
1031 | 1034 | ||
1032 | ret = smsc75xx_read_reg(dev, RFE_CTL, &pdata->rfe_ctl); | 1035 | ret = smsc75xx_read_reg(dev, RFE_CTL, &pdata->rfe_ctl); |
1033 | check_warn_return(ret, "Failed to read RFE_CTL: %d", ret); | 1036 | check_warn_return(ret, "Failed to read RFE_CTL: %d\n", ret); |
1034 | 1037 | ||
1035 | netif_dbg(dev, ifup, dev->net, "RFE_CTL set to 0x%08x", pdata->rfe_ctl); | 1038 | netif_dbg(dev, ifup, dev->net, "RFE_CTL set to 0x%08x\n", |
1039 | pdata->rfe_ctl); | ||
1036 | 1040 | ||
1037 | /* Enable or disable checksum offload engines */ | 1041 | /* Enable or disable checksum offload engines */ |
1038 | smsc75xx_set_features(dev->net, dev->net->features); | 1042 | smsc75xx_set_features(dev->net, dev->net->features); |
@@ -1040,69 +1044,69 @@ static int smsc75xx_reset(struct usbnet *dev) | |||
1040 | smsc75xx_set_multicast(dev->net); | 1044 | smsc75xx_set_multicast(dev->net); |
1041 | 1045 | ||
1042 | ret = smsc75xx_phy_initialize(dev); | 1046 | ret = smsc75xx_phy_initialize(dev); |
1043 | check_warn_return(ret, "Failed to initialize PHY: %d", ret); | 1047 | check_warn_return(ret, "Failed to initialize PHY: %d\n", ret); |
1044 | 1048 | ||
1045 | ret = smsc75xx_read_reg(dev, INT_EP_CTL, &buf); | 1049 | ret = smsc75xx_read_reg(dev, INT_EP_CTL, &buf); |
1046 | check_warn_return(ret, "Failed to read INT_EP_CTL: %d", ret); | 1050 | check_warn_return(ret, "Failed to read INT_EP_CTL: %d\n", ret); |
1047 | 1051 | ||
1048 | /* enable PHY interrupts */ | 1052 | /* enable PHY interrupts */ |
1049 | buf |= INT_ENP_PHY_INT; | 1053 | buf |= INT_ENP_PHY_INT; |
1050 | 1054 | ||
1051 | ret = smsc75xx_write_reg(dev, INT_EP_CTL, buf); | 1055 | ret = smsc75xx_write_reg(dev, INT_EP_CTL, buf); |
1052 | check_warn_return(ret, "Failed to write INT_EP_CTL: %d", ret); | 1056 | check_warn_return(ret, "Failed to write INT_EP_CTL: %d\n", ret); |
1053 | 1057 | ||
1054 | /* allow mac to detect speed and duplex from phy */ | 1058 | /* allow mac to detect speed and duplex from phy */ |
1055 | ret = smsc75xx_read_reg(dev, MAC_CR, &buf); | 1059 | ret = smsc75xx_read_reg(dev, MAC_CR, &buf); |
1056 | check_warn_return(ret, "Failed to read MAC_CR: %d", ret); | 1060 | check_warn_return(ret, "Failed to read MAC_CR: %d\n", ret); |
1057 | 1061 | ||
1058 | buf |= (MAC_CR_ADD | MAC_CR_ASD); | 1062 | buf |= (MAC_CR_ADD | MAC_CR_ASD); |
1059 | ret = smsc75xx_write_reg(dev, MAC_CR, buf); | 1063 | ret = smsc75xx_write_reg(dev, MAC_CR, buf); |
1060 | check_warn_return(ret, "Failed to write MAC_CR: %d", ret); | 1064 | check_warn_return(ret, "Failed to write MAC_CR: %d\n", ret); |
1061 | 1065 | ||
1062 | ret = smsc75xx_read_reg(dev, MAC_TX, &buf); | 1066 | ret = smsc75xx_read_reg(dev, MAC_TX, &buf); |
1063 | check_warn_return(ret, "Failed to read MAC_TX: %d", ret); | 1067 | check_warn_return(ret, "Failed to read MAC_TX: %d\n", ret); |
1064 | 1068 | ||
1065 | buf |= MAC_TX_TXEN; | 1069 | buf |= MAC_TX_TXEN; |
1066 | 1070 | ||
1067 | ret = smsc75xx_write_reg(dev, MAC_TX, buf); | 1071 | ret = smsc75xx_write_reg(dev, MAC_TX, buf); |
1068 | check_warn_return(ret, "Failed to write MAC_TX: %d", ret); | 1072 | check_warn_return(ret, "Failed to write MAC_TX: %d\n", ret); |
1069 | 1073 | ||
1070 | netif_dbg(dev, ifup, dev->net, "MAC_TX set to 0x%08x", buf); | 1074 | netif_dbg(dev, ifup, dev->net, "MAC_TX set to 0x%08x\n", buf); |
1071 | 1075 | ||
1072 | ret = smsc75xx_read_reg(dev, FCT_TX_CTL, &buf); | 1076 | ret = smsc75xx_read_reg(dev, FCT_TX_CTL, &buf); |
1073 | check_warn_return(ret, "Failed to read FCT_TX_CTL: %d", ret); | 1077 | check_warn_return(ret, "Failed to read FCT_TX_CTL: %d\n", ret); |
1074 | 1078 | ||
1075 | buf |= FCT_TX_CTL_EN; | 1079 | buf |= FCT_TX_CTL_EN; |
1076 | 1080 | ||
1077 | ret = smsc75xx_write_reg(dev, FCT_TX_CTL, buf); | 1081 | ret = smsc75xx_write_reg(dev, FCT_TX_CTL, buf); |
1078 | check_warn_return(ret, "Failed to write FCT_TX_CTL: %d", ret); | 1082 | check_warn_return(ret, "Failed to write FCT_TX_CTL: %d\n", ret); |
1079 | 1083 | ||
1080 | netif_dbg(dev, ifup, dev->net, "FCT_TX_CTL set to 0x%08x", buf); | 1084 | netif_dbg(dev, ifup, dev->net, "FCT_TX_CTL set to 0x%08x\n", buf); |
1081 | 1085 | ||
1082 | ret = smsc75xx_set_rx_max_frame_length(dev, 1514); | 1086 | ret = smsc75xx_set_rx_max_frame_length(dev, 1514); |
1083 | check_warn_return(ret, "Failed to set max rx frame length"); | 1087 | check_warn_return(ret, "Failed to set max rx frame length\n"); |
1084 | 1088 | ||
1085 | ret = smsc75xx_read_reg(dev, MAC_RX, &buf); | 1089 | ret = smsc75xx_read_reg(dev, MAC_RX, &buf); |
1086 | check_warn_return(ret, "Failed to read MAC_RX: %d", ret); | 1090 | check_warn_return(ret, "Failed to read MAC_RX: %d\n", ret); |
1087 | 1091 | ||
1088 | buf |= MAC_RX_RXEN; | 1092 | buf |= MAC_RX_RXEN; |
1089 | 1093 | ||
1090 | ret = smsc75xx_write_reg(dev, MAC_RX, buf); | 1094 | ret = smsc75xx_write_reg(dev, MAC_RX, buf); |
1091 | check_warn_return(ret, "Failed to write MAC_RX: %d", ret); | 1095 | check_warn_return(ret, "Failed to write MAC_RX: %d\n", ret); |
1092 | 1096 | ||
1093 | netif_dbg(dev, ifup, dev->net, "MAC_RX set to 0x%08x", buf); | 1097 | netif_dbg(dev, ifup, dev->net, "MAC_RX set to 0x%08x\n", buf); |
1094 | 1098 | ||
1095 | ret = smsc75xx_read_reg(dev, FCT_RX_CTL, &buf); | 1099 | ret = smsc75xx_read_reg(dev, FCT_RX_CTL, &buf); |
1096 | check_warn_return(ret, "Failed to read FCT_RX_CTL: %d", ret); | 1100 | check_warn_return(ret, "Failed to read FCT_RX_CTL: %d\n", ret); |
1097 | 1101 | ||
1098 | buf |= FCT_RX_CTL_EN; | 1102 | buf |= FCT_RX_CTL_EN; |
1099 | 1103 | ||
1100 | ret = smsc75xx_write_reg(dev, FCT_RX_CTL, buf); | 1104 | ret = smsc75xx_write_reg(dev, FCT_RX_CTL, buf); |
1101 | check_warn_return(ret, "Failed to write FCT_RX_CTL: %d", ret); | 1105 | check_warn_return(ret, "Failed to write FCT_RX_CTL: %d\n", ret); |
1102 | 1106 | ||
1103 | netif_dbg(dev, ifup, dev->net, "FCT_RX_CTL set to 0x%08x", buf); | 1107 | netif_dbg(dev, ifup, dev->net, "FCT_RX_CTL set to 0x%08x\n", buf); |
1104 | 1108 | ||
1105 | netif_dbg(dev, ifup, dev->net, "smsc75xx_reset, return 0"); | 1109 | netif_dbg(dev, ifup, dev->net, "smsc75xx_reset, return 0\n"); |
1106 | return 0; | 1110 | return 0; |
1107 | } | 1111 | } |
1108 | 1112 | ||
@@ -1127,14 +1131,14 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) | |||
1127 | printk(KERN_INFO SMSC_CHIPNAME " v" SMSC_DRIVER_VERSION "\n"); | 1131 | printk(KERN_INFO SMSC_CHIPNAME " v" SMSC_DRIVER_VERSION "\n"); |
1128 | 1132 | ||
1129 | ret = usbnet_get_endpoints(dev, intf); | 1133 | ret = usbnet_get_endpoints(dev, intf); |
1130 | check_warn_return(ret, "usbnet_get_endpoints failed: %d", ret); | 1134 | check_warn_return(ret, "usbnet_get_endpoints failed: %d\n", ret); |
1131 | 1135 | ||
1132 | dev->data[0] = (unsigned long)kzalloc(sizeof(struct smsc75xx_priv), | 1136 | dev->data[0] = (unsigned long)kzalloc(sizeof(struct smsc75xx_priv), |
1133 | GFP_KERNEL); | 1137 | GFP_KERNEL); |
1134 | 1138 | ||
1135 | pdata = (struct smsc75xx_priv *)(dev->data[0]); | 1139 | pdata = (struct smsc75xx_priv *)(dev->data[0]); |
1136 | if (!pdata) { | 1140 | if (!pdata) { |
1137 | netdev_warn(dev->net, "Unable to allocate smsc75xx_priv"); | 1141 | netdev_warn(dev->net, "Unable to allocate smsc75xx_priv\n"); |
1138 | return -ENOMEM; | 1142 | return -ENOMEM; |
1139 | } | 1143 | } |
1140 | 1144 | ||
@@ -1172,7 +1176,7 @@ static void smsc75xx_unbind(struct usbnet *dev, struct usb_interface *intf) | |||
1172 | { | 1176 | { |
1173 | struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]); | 1177 | struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]); |
1174 | if (pdata) { | 1178 | if (pdata) { |
1175 | netif_dbg(dev, ifdown, dev->net, "free pdata"); | 1179 | netif_dbg(dev, ifdown, dev->net, "free pdata\n"); |
1176 | kfree(pdata); | 1180 | kfree(pdata); |
1177 | pdata = NULL; | 1181 | pdata = NULL; |
1178 | dev->data[0] = 0; | 1182 | dev->data[0] = 0; |
@@ -1192,19 +1196,19 @@ static int smsc75xx_write_wuff(struct usbnet *dev, int filter, u32 wuf_cfg, | |||
1192 | int ret; | 1196 | int ret; |
1193 | 1197 | ||
1194 | ret = smsc75xx_write_reg(dev, cfg_base, wuf_cfg); | 1198 | ret = smsc75xx_write_reg(dev, cfg_base, wuf_cfg); |
1195 | check_warn_return(ret, "Error writing WUF_CFGX"); | 1199 | check_warn_return(ret, "Error writing WUF_CFGX\n"); |
1196 | 1200 | ||
1197 | ret = smsc75xx_write_reg(dev, mask_base, wuf_mask1); | 1201 | ret = smsc75xx_write_reg(dev, mask_base, wuf_mask1); |
1198 | check_warn_return(ret, "Error writing WUF_MASKX"); | 1202 | check_warn_return(ret, "Error writing WUF_MASKX\n"); |
1199 | 1203 | ||
1200 | ret = smsc75xx_write_reg(dev, mask_base + 4, 0); | 1204 | ret = smsc75xx_write_reg(dev, mask_base + 4, 0); |
1201 | check_warn_return(ret, "Error writing WUF_MASKX"); | 1205 | check_warn_return(ret, "Error writing WUF_MASKX\n"); |
1202 | 1206 | ||
1203 | ret = smsc75xx_write_reg(dev, mask_base + 8, 0); | 1207 | ret = smsc75xx_write_reg(dev, mask_base + 8, 0); |
1204 | check_warn_return(ret, "Error writing WUF_MASKX"); | 1208 | check_warn_return(ret, "Error writing WUF_MASKX\n"); |
1205 | 1209 | ||
1206 | ret = smsc75xx_write_reg(dev, mask_base + 12, 0); | 1210 | ret = smsc75xx_write_reg(dev, mask_base + 12, 0); |
1207 | check_warn_return(ret, "Error writing WUF_MASKX"); | 1211 | check_warn_return(ret, "Error writing WUF_MASKX\n"); |
1208 | 1212 | ||
1209 | return 0; | 1213 | return 0; |
1210 | } | 1214 | } |
@@ -1217,38 +1221,38 @@ static int smsc75xx_suspend(struct usb_interface *intf, pm_message_t message) | |||
1217 | u32 val; | 1221 | u32 val; |
1218 | 1222 | ||
1219 | ret = usbnet_suspend(intf, message); | 1223 | ret = usbnet_suspend(intf, message); |
1220 | check_warn_return(ret, "usbnet_suspend error"); | 1224 | check_warn_return(ret, "usbnet_suspend error\n"); |
1221 | 1225 | ||
1222 | /* if no wol options set, enter lowest power SUSPEND2 mode */ | 1226 | /* if no wol options set, enter lowest power SUSPEND2 mode */ |
1223 | if (!(pdata->wolopts & SUPPORTED_WAKE)) { | 1227 | if (!(pdata->wolopts & SUPPORTED_WAKE)) { |
1224 | netdev_info(dev->net, "entering SUSPEND2 mode"); | 1228 | netdev_info(dev->net, "entering SUSPEND2 mode\n"); |
1225 | 1229 | ||
1226 | /* disable energy detect (link up) & wake up events */ | 1230 | /* disable energy detect (link up) & wake up events */ |
1227 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); | 1231 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); |
1228 | check_warn_return(ret, "Error reading WUCSR"); | 1232 | check_warn_return(ret, "Error reading WUCSR\n"); |
1229 | 1233 | ||
1230 | val &= ~(WUCSR_MPEN | WUCSR_WUEN); | 1234 | val &= ~(WUCSR_MPEN | WUCSR_WUEN); |
1231 | 1235 | ||
1232 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); | 1236 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); |
1233 | check_warn_return(ret, "Error writing WUCSR"); | 1237 | check_warn_return(ret, "Error writing WUCSR\n"); |
1234 | 1238 | ||
1235 | ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); | 1239 | ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); |
1236 | check_warn_return(ret, "Error reading PMT_CTL"); | 1240 | check_warn_return(ret, "Error reading PMT_CTL\n"); |
1237 | 1241 | ||
1238 | val &= ~(PMT_CTL_ED_EN | PMT_CTL_WOL_EN); | 1242 | val &= ~(PMT_CTL_ED_EN | PMT_CTL_WOL_EN); |
1239 | 1243 | ||
1240 | ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); | 1244 | ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); |
1241 | check_warn_return(ret, "Error writing PMT_CTL"); | 1245 | check_warn_return(ret, "Error writing PMT_CTL\n"); |
1242 | 1246 | ||
1243 | /* enter suspend2 mode */ | 1247 | /* enter suspend2 mode */ |
1244 | ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); | 1248 | ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); |
1245 | check_warn_return(ret, "Error reading PMT_CTL"); | 1249 | check_warn_return(ret, "Error reading PMT_CTL\n"); |
1246 | 1250 | ||
1247 | val &= ~(PMT_CTL_SUS_MODE | PMT_CTL_WUPS | PMT_CTL_PHY_RST); | 1251 | val &= ~(PMT_CTL_SUS_MODE | PMT_CTL_WUPS | PMT_CTL_PHY_RST); |
1248 | val |= PMT_CTL_SUS_MODE_2; | 1252 | val |= PMT_CTL_SUS_MODE_2; |
1249 | 1253 | ||
1250 | ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); | 1254 | ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); |
1251 | check_warn_return(ret, "Error writing PMT_CTL"); | 1255 | check_warn_return(ret, "Error writing PMT_CTL\n"); |
1252 | 1256 | ||
1253 | return 0; | 1257 | return 0; |
1254 | } | 1258 | } |
@@ -1259,120 +1263,120 @@ static int smsc75xx_suspend(struct usb_interface *intf, pm_message_t message) | |||
1259 | /* disable all filters */ | 1263 | /* disable all filters */ |
1260 | for (i = 0; i < WUF_NUM; i++) { | 1264 | for (i = 0; i < WUF_NUM; i++) { |
1261 | ret = smsc75xx_write_reg_nopm(dev, WUF_CFGX + i * 4, 0); | 1265 | ret = smsc75xx_write_reg_nopm(dev, WUF_CFGX + i * 4, 0); |
1262 | check_warn_return(ret, "Error writing WUF_CFGX"); | 1266 | check_warn_return(ret, "Error writing WUF_CFGX\n"); |
1263 | } | 1267 | } |
1264 | 1268 | ||
1265 | if (pdata->wolopts & WAKE_MCAST) { | 1269 | if (pdata->wolopts & WAKE_MCAST) { |
1266 | const u8 mcast[] = {0x01, 0x00, 0x5E}; | 1270 | const u8 mcast[] = {0x01, 0x00, 0x5E}; |
1267 | netdev_info(dev->net, "enabling multicast detection"); | 1271 | netdev_info(dev->net, "enabling multicast detection\n"); |
1268 | 1272 | ||
1269 | val = WUF_CFGX_EN | WUF_CFGX_ATYPE_MULTICAST | 1273 | val = WUF_CFGX_EN | WUF_CFGX_ATYPE_MULTICAST |
1270 | | smsc_crc(mcast, 3); | 1274 | | smsc_crc(mcast, 3); |
1271 | ret = smsc75xx_write_wuff(dev, filter++, val, 0x0007); | 1275 | ret = smsc75xx_write_wuff(dev, filter++, val, 0x0007); |
1272 | check_warn_return(ret, "Error writing wakeup filter"); | 1276 | check_warn_return(ret, "Error writing wakeup filter\n"); |
1273 | } | 1277 | } |
1274 | 1278 | ||
1275 | if (pdata->wolopts & WAKE_ARP) { | 1279 | if (pdata->wolopts & WAKE_ARP) { |
1276 | const u8 arp[] = {0x08, 0x06}; | 1280 | const u8 arp[] = {0x08, 0x06}; |
1277 | netdev_info(dev->net, "enabling ARP detection"); | 1281 | netdev_info(dev->net, "enabling ARP detection\n"); |
1278 | 1282 | ||
1279 | val = WUF_CFGX_EN | WUF_CFGX_ATYPE_ALL | (0x0C << 16) | 1283 | val = WUF_CFGX_EN | WUF_CFGX_ATYPE_ALL | (0x0C << 16) |
1280 | | smsc_crc(arp, 2); | 1284 | | smsc_crc(arp, 2); |
1281 | ret = smsc75xx_write_wuff(dev, filter++, val, 0x0003); | 1285 | ret = smsc75xx_write_wuff(dev, filter++, val, 0x0003); |
1282 | check_warn_return(ret, "Error writing wakeup filter"); | 1286 | check_warn_return(ret, "Error writing wakeup filter\n"); |
1283 | } | 1287 | } |
1284 | 1288 | ||
1285 | /* clear any pending pattern match packet status */ | 1289 | /* clear any pending pattern match packet status */ |
1286 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); | 1290 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); |
1287 | check_warn_return(ret, "Error reading WUCSR"); | 1291 | check_warn_return(ret, "Error reading WUCSR\n"); |
1288 | 1292 | ||
1289 | val |= WUCSR_WUFR; | 1293 | val |= WUCSR_WUFR; |
1290 | 1294 | ||
1291 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); | 1295 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); |
1292 | check_warn_return(ret, "Error writing WUCSR"); | 1296 | check_warn_return(ret, "Error writing WUCSR\n"); |
1293 | 1297 | ||
1294 | netdev_info(dev->net, "enabling packet match detection"); | 1298 | netdev_info(dev->net, "enabling packet match detection\n"); |
1295 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); | 1299 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); |
1296 | check_warn_return(ret, "Error reading WUCSR"); | 1300 | check_warn_return(ret, "Error reading WUCSR\n"); |
1297 | 1301 | ||
1298 | val |= WUCSR_WUEN; | 1302 | val |= WUCSR_WUEN; |
1299 | 1303 | ||
1300 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); | 1304 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); |
1301 | check_warn_return(ret, "Error writing WUCSR"); | 1305 | check_warn_return(ret, "Error writing WUCSR\n"); |
1302 | } else { | 1306 | } else { |
1303 | netdev_info(dev->net, "disabling packet match detection"); | 1307 | netdev_info(dev->net, "disabling packet match detection\n"); |
1304 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); | 1308 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); |
1305 | check_warn_return(ret, "Error reading WUCSR"); | 1309 | check_warn_return(ret, "Error reading WUCSR\n"); |
1306 | 1310 | ||
1307 | val &= ~WUCSR_WUEN; | 1311 | val &= ~WUCSR_WUEN; |
1308 | 1312 | ||
1309 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); | 1313 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); |
1310 | check_warn_return(ret, "Error writing WUCSR"); | 1314 | check_warn_return(ret, "Error writing WUCSR\n"); |
1311 | } | 1315 | } |
1312 | 1316 | ||
1313 | /* disable magic, bcast & unicast wakeup sources */ | 1317 | /* disable magic, bcast & unicast wakeup sources */ |
1314 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); | 1318 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); |
1315 | check_warn_return(ret, "Error reading WUCSR"); | 1319 | check_warn_return(ret, "Error reading WUCSR\n"); |
1316 | 1320 | ||
1317 | val &= ~(WUCSR_MPEN | WUCSR_BCST_EN | WUCSR_PFDA_EN); | 1321 | val &= ~(WUCSR_MPEN | WUCSR_BCST_EN | WUCSR_PFDA_EN); |
1318 | 1322 | ||
1319 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); | 1323 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); |
1320 | check_warn_return(ret, "Error writing WUCSR"); | 1324 | check_warn_return(ret, "Error writing WUCSR\n"); |
1321 | 1325 | ||
1322 | if (pdata->wolopts & WAKE_MAGIC) { | 1326 | if (pdata->wolopts & WAKE_MAGIC) { |
1323 | netdev_info(dev->net, "enabling magic packet wakeup"); | 1327 | netdev_info(dev->net, "enabling magic packet wakeup\n"); |
1324 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); | 1328 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); |
1325 | check_warn_return(ret, "Error reading WUCSR"); | 1329 | check_warn_return(ret, "Error reading WUCSR\n"); |
1326 | 1330 | ||
1327 | /* clear any pending magic packet status */ | 1331 | /* clear any pending magic packet status */ |
1328 | val |= WUCSR_MPR | WUCSR_MPEN; | 1332 | val |= WUCSR_MPR | WUCSR_MPEN; |
1329 | 1333 | ||
1330 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); | 1334 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); |
1331 | check_warn_return(ret, "Error writing WUCSR"); | 1335 | check_warn_return(ret, "Error writing WUCSR\n"); |
1332 | } | 1336 | } |
1333 | 1337 | ||
1334 | if (pdata->wolopts & WAKE_BCAST) { | 1338 | if (pdata->wolopts & WAKE_BCAST) { |
1335 | netdev_info(dev->net, "enabling broadcast detection"); | 1339 | netdev_info(dev->net, "enabling broadcast detection\n"); |
1336 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); | 1340 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); |
1337 | check_warn_return(ret, "Error reading WUCSR"); | 1341 | check_warn_return(ret, "Error reading WUCSR\n"); |
1338 | 1342 | ||
1339 | val |= WUCSR_BCAST_FR | WUCSR_BCST_EN; | 1343 | val |= WUCSR_BCAST_FR | WUCSR_BCST_EN; |
1340 | 1344 | ||
1341 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); | 1345 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); |
1342 | check_warn_return(ret, "Error writing WUCSR"); | 1346 | check_warn_return(ret, "Error writing WUCSR\n"); |
1343 | } | 1347 | } |
1344 | 1348 | ||
1345 | if (pdata->wolopts & WAKE_UCAST) { | 1349 | if (pdata->wolopts & WAKE_UCAST) { |
1346 | netdev_info(dev->net, "enabling unicast detection"); | 1350 | netdev_info(dev->net, "enabling unicast detection\n"); |
1347 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); | 1351 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); |
1348 | check_warn_return(ret, "Error reading WUCSR"); | 1352 | check_warn_return(ret, "Error reading WUCSR\n"); |
1349 | 1353 | ||
1350 | val |= WUCSR_WUFR | WUCSR_PFDA_EN; | 1354 | val |= WUCSR_WUFR | WUCSR_PFDA_EN; |
1351 | 1355 | ||
1352 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); | 1356 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); |
1353 | check_warn_return(ret, "Error writing WUCSR"); | 1357 | check_warn_return(ret, "Error writing WUCSR\n"); |
1354 | } | 1358 | } |
1355 | 1359 | ||
1356 | /* enable receiver to enable frame reception */ | 1360 | /* enable receiver to enable frame reception */ |
1357 | ret = smsc75xx_read_reg_nopm(dev, MAC_RX, &val); | 1361 | ret = smsc75xx_read_reg_nopm(dev, MAC_RX, &val); |
1358 | check_warn_return(ret, "Failed to read MAC_RX: %d", ret); | 1362 | check_warn_return(ret, "Failed to read MAC_RX: %d\n", ret); |
1359 | 1363 | ||
1360 | val |= MAC_RX_RXEN; | 1364 | val |= MAC_RX_RXEN; |
1361 | 1365 | ||
1362 | ret = smsc75xx_write_reg_nopm(dev, MAC_RX, val); | 1366 | ret = smsc75xx_write_reg_nopm(dev, MAC_RX, val); |
1363 | check_warn_return(ret, "Failed to write MAC_RX: %d", ret); | 1367 | check_warn_return(ret, "Failed to write MAC_RX: %d\n", ret); |
1364 | 1368 | ||
1365 | /* some wol options are enabled, so enter SUSPEND0 */ | 1369 | /* some wol options are enabled, so enter SUSPEND0 */ |
1366 | netdev_info(dev->net, "entering SUSPEND0 mode"); | 1370 | netdev_info(dev->net, "entering SUSPEND0 mode\n"); |
1367 | 1371 | ||
1368 | ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); | 1372 | ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); |
1369 | check_warn_return(ret, "Error reading PMT_CTL"); | 1373 | check_warn_return(ret, "Error reading PMT_CTL\n"); |
1370 | 1374 | ||
1371 | val &= (~(PMT_CTL_SUS_MODE | PMT_CTL_PHY_RST)); | 1375 | val &= (~(PMT_CTL_SUS_MODE | PMT_CTL_PHY_RST)); |
1372 | val |= PMT_CTL_SUS_MODE_0 | PMT_CTL_WOL_EN | PMT_CTL_WUPS; | 1376 | val |= PMT_CTL_SUS_MODE_0 | PMT_CTL_WOL_EN | PMT_CTL_WUPS; |
1373 | 1377 | ||
1374 | ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); | 1378 | ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); |
1375 | check_warn_return(ret, "Error writing PMT_CTL"); | 1379 | check_warn_return(ret, "Error writing PMT_CTL\n"); |
1376 | 1380 | ||
1377 | smsc75xx_set_feature(dev, USB_DEVICE_REMOTE_WAKEUP); | 1381 | smsc75xx_set_feature(dev, USB_DEVICE_REMOTE_WAKEUP); |
1378 | 1382 | ||
@@ -1387,43 +1391,43 @@ static int smsc75xx_resume(struct usb_interface *intf) | |||
1387 | u32 val; | 1391 | u32 val; |
1388 | 1392 | ||
1389 | if (pdata->wolopts) { | 1393 | if (pdata->wolopts) { |
1390 | netdev_info(dev->net, "resuming from SUSPEND0"); | 1394 | netdev_info(dev->net, "resuming from SUSPEND0\n"); |
1391 | 1395 | ||
1392 | smsc75xx_clear_feature(dev, USB_DEVICE_REMOTE_WAKEUP); | 1396 | smsc75xx_clear_feature(dev, USB_DEVICE_REMOTE_WAKEUP); |
1393 | 1397 | ||
1394 | /* Disable wakeup sources */ | 1398 | /* Disable wakeup sources */ |
1395 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); | 1399 | ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val); |
1396 | check_warn_return(ret, "Error reading WUCSR"); | 1400 | check_warn_return(ret, "Error reading WUCSR\n"); |
1397 | 1401 | ||
1398 | val &= ~(WUCSR_WUEN | WUCSR_MPEN | WUCSR_PFDA_EN | 1402 | val &= ~(WUCSR_WUEN | WUCSR_MPEN | WUCSR_PFDA_EN |
1399 | | WUCSR_BCST_EN); | 1403 | | WUCSR_BCST_EN); |
1400 | 1404 | ||
1401 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); | 1405 | ret = smsc75xx_write_reg_nopm(dev, WUCSR, val); |
1402 | check_warn_return(ret, "Error writing WUCSR"); | 1406 | check_warn_return(ret, "Error writing WUCSR\n"); |
1403 | 1407 | ||
1404 | /* clear wake-up status */ | 1408 | /* clear wake-up status */ |
1405 | ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); | 1409 | ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); |
1406 | check_warn_return(ret, "Error reading PMT_CTL"); | 1410 | check_warn_return(ret, "Error reading PMT_CTL\n"); |
1407 | 1411 | ||
1408 | val &= ~PMT_CTL_WOL_EN; | 1412 | val &= ~PMT_CTL_WOL_EN; |
1409 | val |= PMT_CTL_WUPS; | 1413 | val |= PMT_CTL_WUPS; |
1410 | 1414 | ||
1411 | ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); | 1415 | ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); |
1412 | check_warn_return(ret, "Error writing PMT_CTL"); | 1416 | check_warn_return(ret, "Error writing PMT_CTL\n"); |
1413 | } else { | 1417 | } else { |
1414 | netdev_info(dev->net, "resuming from SUSPEND2"); | 1418 | netdev_info(dev->net, "resuming from SUSPEND2\n"); |
1415 | 1419 | ||
1416 | ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); | 1420 | ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val); |
1417 | check_warn_return(ret, "Error reading PMT_CTL"); | 1421 | check_warn_return(ret, "Error reading PMT_CTL\n"); |
1418 | 1422 | ||
1419 | val |= PMT_CTL_PHY_PWRUP; | 1423 | val |= PMT_CTL_PHY_PWRUP; |
1420 | 1424 | ||
1421 | ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); | 1425 | ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val); |
1422 | check_warn_return(ret, "Error writing PMT_CTL"); | 1426 | check_warn_return(ret, "Error writing PMT_CTL\n"); |
1423 | } | 1427 | } |
1424 | 1428 | ||
1425 | ret = smsc75xx_wait_ready(dev, 1); | 1429 | ret = smsc75xx_wait_ready(dev, 1); |
1426 | check_warn_return(ret, "device not ready in smsc75xx_resume"); | 1430 | check_warn_return(ret, "device not ready in smsc75xx_resume\n"); |
1427 | 1431 | ||
1428 | return usbnet_resume(intf); | 1432 | return usbnet_resume(intf); |
1429 | } | 1433 | } |
@@ -1463,7 +1467,7 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
1463 | 1467 | ||
1464 | if (unlikely(rx_cmd_a & RX_CMD_A_RED)) { | 1468 | if (unlikely(rx_cmd_a & RX_CMD_A_RED)) { |
1465 | netif_dbg(dev, rx_err, dev->net, | 1469 | netif_dbg(dev, rx_err, dev->net, |
1466 | "Error rx_cmd_a=0x%08x", rx_cmd_a); | 1470 | "Error rx_cmd_a=0x%08x\n", rx_cmd_a); |
1467 | dev->net->stats.rx_errors++; | 1471 | dev->net->stats.rx_errors++; |
1468 | dev->net->stats.rx_dropped++; | 1472 | dev->net->stats.rx_dropped++; |
1469 | 1473 | ||
@@ -1475,7 +1479,8 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
1475 | /* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */ | 1479 | /* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */ |
1476 | if (unlikely(size > (ETH_FRAME_LEN + 12))) { | 1480 | if (unlikely(size > (ETH_FRAME_LEN + 12))) { |
1477 | netif_dbg(dev, rx_err, dev->net, | 1481 | netif_dbg(dev, rx_err, dev->net, |
1478 | "size err rx_cmd_a=0x%08x", rx_cmd_a); | 1482 | "size err rx_cmd_a=0x%08x\n", |
1483 | rx_cmd_a); | ||
1479 | return 0; | 1484 | return 0; |
1480 | } | 1485 | } |
1481 | 1486 | ||
@@ -1492,7 +1497,7 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
1492 | 1497 | ||
1493 | ax_skb = skb_clone(skb, GFP_ATOMIC); | 1498 | ax_skb = skb_clone(skb, GFP_ATOMIC); |
1494 | if (unlikely(!ax_skb)) { | 1499 | if (unlikely(!ax_skb)) { |
1495 | netdev_warn(dev->net, "Error allocating skb"); | 1500 | netdev_warn(dev->net, "Error allocating skb\n"); |
1496 | return 0; | 1501 | return 0; |
1497 | } | 1502 | } |
1498 | 1503 | ||
@@ -1517,7 +1522,7 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
1517 | } | 1522 | } |
1518 | 1523 | ||
1519 | if (unlikely(skb->len < 0)) { | 1524 | if (unlikely(skb->len < 0)) { |
1520 | netdev_warn(dev->net, "invalid rx length<0 %d", skb->len); | 1525 | netdev_warn(dev->net, "invalid rx length<0 %d\n", skb->len); |
1521 | return 0; | 1526 | return 0; |
1522 | } | 1527 | } |
1523 | 1528 | ||
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index bf8854386b88..79d495d15546 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -95,8 +95,8 @@ static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, | |||
95 | | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 95 | | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
96 | 0, index, &buf, 4); | 96 | 0, index, &buf, 4); |
97 | if (unlikely(ret < 0)) | 97 | if (unlikely(ret < 0)) |
98 | netdev_warn(dev->net, | 98 | netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n", |
99 | "Failed to read reg index 0x%08x: %d", index, ret); | 99 | index, ret); |
100 | 100 | ||
101 | le32_to_cpus(&buf); | 101 | le32_to_cpus(&buf); |
102 | *data = buf; | 102 | *data = buf; |
@@ -125,8 +125,8 @@ static int __must_check __smsc95xx_write_reg(struct usbnet *dev, u32 index, | |||
125 | | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 125 | | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
126 | 0, index, &buf, 4); | 126 | 0, index, &buf, 4); |
127 | if (unlikely(ret < 0)) | 127 | if (unlikely(ret < 0)) |
128 | netdev_warn(dev->net, | 128 | netdev_warn(dev->net, "Failed to write reg index 0x%08x: %d\n", |
129 | "Failed to write reg index 0x%08x: %d", index, ret); | 129 | index, ret); |
130 | 130 | ||
131 | return ret; | 131 | return ret; |
132 | } | 132 | } |
@@ -185,7 +185,7 @@ static int __must_check __smsc95xx_phy_wait_not_busy(struct usbnet *dev, | |||
185 | 185 | ||
186 | do { | 186 | do { |
187 | ret = __smsc95xx_read_reg(dev, MII_ADDR, &val, in_pm); | 187 | ret = __smsc95xx_read_reg(dev, MII_ADDR, &val, in_pm); |
188 | check_warn_return(ret, "Error reading MII_ACCESS"); | 188 | check_warn_return(ret, "Error reading MII_ACCESS\n"); |
189 | if (!(val & MII_BUSY_)) | 189 | if (!(val & MII_BUSY_)) |
190 | return 0; | 190 | return 0; |
191 | } while (!time_after(jiffies, start_time + HZ)); | 191 | } while (!time_after(jiffies, start_time + HZ)); |
@@ -204,20 +204,20 @@ static int __smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx, | |||
204 | 204 | ||
205 | /* confirm MII not busy */ | 205 | /* confirm MII not busy */ |
206 | ret = __smsc95xx_phy_wait_not_busy(dev, in_pm); | 206 | ret = __smsc95xx_phy_wait_not_busy(dev, in_pm); |
207 | check_warn_goto_done(ret, "MII is busy in smsc95xx_mdio_read"); | 207 | check_warn_goto_done(ret, "MII is busy in smsc95xx_mdio_read\n"); |
208 | 208 | ||
209 | /* set the address, index & direction (read from PHY) */ | 209 | /* set the address, index & direction (read from PHY) */ |
210 | phy_id &= dev->mii.phy_id_mask; | 210 | phy_id &= dev->mii.phy_id_mask; |
211 | idx &= dev->mii.reg_num_mask; | 211 | idx &= dev->mii.reg_num_mask; |
212 | addr = (phy_id << 11) | (idx << 6) | MII_READ_ | MII_BUSY_; | 212 | addr = (phy_id << 11) | (idx << 6) | MII_READ_ | MII_BUSY_; |
213 | ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm); | 213 | ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm); |
214 | check_warn_goto_done(ret, "Error writing MII_ADDR"); | 214 | check_warn_goto_done(ret, "Error writing MII_ADDR\n"); |
215 | 215 | ||
216 | ret = __smsc95xx_phy_wait_not_busy(dev, in_pm); | 216 | ret = __smsc95xx_phy_wait_not_busy(dev, in_pm); |
217 | check_warn_goto_done(ret, "Timed out reading MII reg %02X", idx); | 217 | check_warn_goto_done(ret, "Timed out reading MII reg %02X\n", idx); |
218 | 218 | ||
219 | ret = __smsc95xx_read_reg(dev, MII_DATA, &val, in_pm); | 219 | ret = __smsc95xx_read_reg(dev, MII_DATA, &val, in_pm); |
220 | check_warn_goto_done(ret, "Error reading MII_DATA"); | 220 | check_warn_goto_done(ret, "Error reading MII_DATA\n"); |
221 | 221 | ||
222 | ret = (u16)(val & 0xFFFF); | 222 | ret = (u16)(val & 0xFFFF); |
223 | 223 | ||
@@ -237,21 +237,21 @@ static void __smsc95xx_mdio_write(struct net_device *netdev, int phy_id, | |||
237 | 237 | ||
238 | /* confirm MII not busy */ | 238 | /* confirm MII not busy */ |
239 | ret = __smsc95xx_phy_wait_not_busy(dev, in_pm); | 239 | ret = __smsc95xx_phy_wait_not_busy(dev, in_pm); |
240 | check_warn_goto_done(ret, "MII is busy in smsc95xx_mdio_write"); | 240 | check_warn_goto_done(ret, "MII is busy in smsc95xx_mdio_write\n"); |
241 | 241 | ||
242 | val = regval; | 242 | val = regval; |
243 | ret = __smsc95xx_write_reg(dev, MII_DATA, val, in_pm); | 243 | ret = __smsc95xx_write_reg(dev, MII_DATA, val, in_pm); |
244 | check_warn_goto_done(ret, "Error writing MII_DATA"); | 244 | check_warn_goto_done(ret, "Error writing MII_DATA\n"); |
245 | 245 | ||
246 | /* set the address, index & direction (write to PHY) */ | 246 | /* set the address, index & direction (write to PHY) */ |
247 | phy_id &= dev->mii.phy_id_mask; | 247 | phy_id &= dev->mii.phy_id_mask; |
248 | idx &= dev->mii.reg_num_mask; | 248 | idx &= dev->mii.reg_num_mask; |
249 | addr = (phy_id << 11) | (idx << 6) | MII_WRITE_ | MII_BUSY_; | 249 | addr = (phy_id << 11) | (idx << 6) | MII_WRITE_ | MII_BUSY_; |
250 | ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm); | 250 | ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm); |
251 | check_warn_goto_done(ret, "Error writing MII_ADDR"); | 251 | check_warn_goto_done(ret, "Error writing MII_ADDR\n"); |
252 | 252 | ||
253 | ret = __smsc95xx_phy_wait_not_busy(dev, in_pm); | 253 | ret = __smsc95xx_phy_wait_not_busy(dev, in_pm); |
254 | check_warn_goto_done(ret, "Timed out writing MII reg %02X", idx); | 254 | check_warn_goto_done(ret, "Timed out writing MII reg %02X\n", idx); |
255 | 255 | ||
256 | done: | 256 | done: |
257 | mutex_unlock(&dev->phy_mutex); | 257 | mutex_unlock(&dev->phy_mutex); |
@@ -288,7 +288,7 @@ static int __must_check smsc95xx_wait_eeprom(struct usbnet *dev) | |||
288 | 288 | ||
289 | do { | 289 | do { |
290 | ret = smsc95xx_read_reg(dev, E2P_CMD, &val); | 290 | ret = smsc95xx_read_reg(dev, E2P_CMD, &val); |
291 | check_warn_return(ret, "Error reading E2P_CMD"); | 291 | check_warn_return(ret, "Error reading E2P_CMD\n"); |
292 | if (!(val & E2P_CMD_BUSY_) || (val & E2P_CMD_TIMEOUT_)) | 292 | if (!(val & E2P_CMD_BUSY_) || (val & E2P_CMD_TIMEOUT_)) |
293 | break; | 293 | break; |
294 | udelay(40); | 294 | udelay(40); |
@@ -310,7 +310,7 @@ static int __must_check smsc95xx_eeprom_confirm_not_busy(struct usbnet *dev) | |||
310 | 310 | ||
311 | do { | 311 | do { |
312 | ret = smsc95xx_read_reg(dev, E2P_CMD, &val); | 312 | ret = smsc95xx_read_reg(dev, E2P_CMD, &val); |
313 | check_warn_return(ret, "Error reading E2P_CMD"); | 313 | check_warn_return(ret, "Error reading E2P_CMD\n"); |
314 | 314 | ||
315 | if (!(val & E2P_CMD_BUSY_)) | 315 | if (!(val & E2P_CMD_BUSY_)) |
316 | return 0; | 316 | return 0; |
@@ -338,14 +338,14 @@ static int smsc95xx_read_eeprom(struct usbnet *dev, u32 offset, u32 length, | |||
338 | for (i = 0; i < length; i++) { | 338 | for (i = 0; i < length; i++) { |
339 | val = E2P_CMD_BUSY_ | E2P_CMD_READ_ | (offset & E2P_CMD_ADDR_); | 339 | val = E2P_CMD_BUSY_ | E2P_CMD_READ_ | (offset & E2P_CMD_ADDR_); |
340 | ret = smsc95xx_write_reg(dev, E2P_CMD, val); | 340 | ret = smsc95xx_write_reg(dev, E2P_CMD, val); |
341 | check_warn_return(ret, "Error writing E2P_CMD"); | 341 | check_warn_return(ret, "Error writing E2P_CMD\n"); |
342 | 342 | ||
343 | ret = smsc95xx_wait_eeprom(dev); | 343 | ret = smsc95xx_wait_eeprom(dev); |
344 | if (ret < 0) | 344 | if (ret < 0) |
345 | return ret; | 345 | return ret; |
346 | 346 | ||
347 | ret = smsc95xx_read_reg(dev, E2P_DATA, &val); | 347 | ret = smsc95xx_read_reg(dev, E2P_DATA, &val); |
348 | check_warn_return(ret, "Error reading E2P_DATA"); | 348 | check_warn_return(ret, "Error reading E2P_DATA\n"); |
349 | 349 | ||
350 | data[i] = val & 0xFF; | 350 | data[i] = val & 0xFF; |
351 | offset++; | 351 | offset++; |
@@ -370,7 +370,7 @@ static int smsc95xx_write_eeprom(struct usbnet *dev, u32 offset, u32 length, | |||
370 | /* Issue write/erase enable command */ | 370 | /* Issue write/erase enable command */ |
371 | val = E2P_CMD_BUSY_ | E2P_CMD_EWEN_; | 371 | val = E2P_CMD_BUSY_ | E2P_CMD_EWEN_; |
372 | ret = smsc95xx_write_reg(dev, E2P_CMD, val); | 372 | ret = smsc95xx_write_reg(dev, E2P_CMD, val); |
373 | check_warn_return(ret, "Error writing E2P_DATA"); | 373 | check_warn_return(ret, "Error writing E2P_DATA\n"); |
374 | 374 | ||
375 | ret = smsc95xx_wait_eeprom(dev); | 375 | ret = smsc95xx_wait_eeprom(dev); |
376 | if (ret < 0) | 376 | if (ret < 0) |
@@ -381,12 +381,12 @@ static int smsc95xx_write_eeprom(struct usbnet *dev, u32 offset, u32 length, | |||
381 | /* Fill data register */ | 381 | /* Fill data register */ |
382 | val = data[i]; | 382 | val = data[i]; |
383 | ret = smsc95xx_write_reg(dev, E2P_DATA, val); | 383 | ret = smsc95xx_write_reg(dev, E2P_DATA, val); |
384 | check_warn_return(ret, "Error writing E2P_DATA"); | 384 | check_warn_return(ret, "Error writing E2P_DATA\n"); |
385 | 385 | ||
386 | /* Send "write" command */ | 386 | /* Send "write" command */ |
387 | val = E2P_CMD_BUSY_ | E2P_CMD_WRITE_ | (offset & E2P_CMD_ADDR_); | 387 | val = E2P_CMD_BUSY_ | E2P_CMD_WRITE_ | (offset & E2P_CMD_ADDR_); |
388 | ret = smsc95xx_write_reg(dev, E2P_CMD, val); | 388 | ret = smsc95xx_write_reg(dev, E2P_CMD, val); |
389 | check_warn_return(ret, "Error writing E2P_CMD"); | 389 | check_warn_return(ret, "Error writing E2P_CMD\n"); |
390 | 390 | ||
391 | ret = smsc95xx_wait_eeprom(dev); | 391 | ret = smsc95xx_wait_eeprom(dev); |
392 | if (ret < 0) | 392 | if (ret < 0) |
@@ -469,13 +469,13 @@ static void smsc95xx_set_multicast(struct net_device *netdev) | |||
469 | 469 | ||
470 | /* Initiate async writes, as we can't wait for completion here */ | 470 | /* Initiate async writes, as we can't wait for completion here */ |
471 | ret = smsc95xx_write_reg_async(dev, HASHH, &pdata->hash_hi); | 471 | ret = smsc95xx_write_reg_async(dev, HASHH, &pdata->hash_hi); |
472 | check_warn(ret, "failed to initiate async write to HASHH"); | 472 | check_warn(ret, "failed to initiate async write to HASHH\n"); |
473 | 473 | ||
474 | ret = smsc95xx_write_reg_async(dev, HASHL, &pdata->hash_lo); | 474 | ret = smsc95xx_write_reg_async(dev, HASHL, &pdata->hash_lo); |
475 | check_warn(ret, "failed to initiate async write to HASHL"); | 475 | check_warn(ret, "failed to initiate async write to HASHL\n"); |
476 | 476 | ||
477 | ret = smsc95xx_write_reg_async(dev, MAC_CR, &pdata->mac_cr); | 477 | ret = smsc95xx_write_reg_async(dev, MAC_CR, &pdata->mac_cr); |
478 | check_warn(ret, "failed to initiate async write to MAC_CR"); | 478 | check_warn(ret, "failed to initiate async write to MAC_CR\n"); |
479 | } | 479 | } |
480 | 480 | ||
481 | static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex, | 481 | static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex, |
@@ -484,7 +484,7 @@ static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex, | |||
484 | u32 flow, afc_cfg = 0; | 484 | u32 flow, afc_cfg = 0; |
485 | 485 | ||
486 | int ret = smsc95xx_read_reg(dev, AFC_CFG, &afc_cfg); | 486 | int ret = smsc95xx_read_reg(dev, AFC_CFG, &afc_cfg); |
487 | check_warn_return(ret, "Error reading AFC_CFG"); | 487 | check_warn_return(ret, "Error reading AFC_CFG\n"); |
488 | 488 | ||
489 | if (duplex == DUPLEX_FULL) { | 489 | if (duplex == DUPLEX_FULL) { |
490 | u8 cap = mii_resolve_flowctrl_fdx(lcladv, rmtadv); | 490 | u8 cap = mii_resolve_flowctrl_fdx(lcladv, rmtadv); |
@@ -509,10 +509,10 @@ static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex, | |||
509 | } | 509 | } |
510 | 510 | ||
511 | ret = smsc95xx_write_reg(dev, FLOW, flow); | 511 | ret = smsc95xx_write_reg(dev, FLOW, flow); |
512 | check_warn_return(ret, "Error writing FLOW"); | 512 | check_warn_return(ret, "Error writing FLOW\n"); |
513 | 513 | ||
514 | ret = smsc95xx_write_reg(dev, AFC_CFG, afc_cfg); | 514 | ret = smsc95xx_write_reg(dev, AFC_CFG, afc_cfg); |
515 | check_warn_return(ret, "Error writing AFC_CFG"); | 515 | check_warn_return(ret, "Error writing AFC_CFG\n"); |
516 | 516 | ||
517 | return 0; | 517 | return 0; |
518 | } | 518 | } |
@@ -528,10 +528,10 @@ static int smsc95xx_link_reset(struct usbnet *dev) | |||
528 | 528 | ||
529 | /* clear interrupt status */ | 529 | /* clear interrupt status */ |
530 | ret = smsc95xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC); | 530 | ret = smsc95xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC); |
531 | check_warn_return(ret, "Error reading PHY_INT_SRC"); | 531 | check_warn_return(ret, "Error reading PHY_INT_SRC\n"); |
532 | 532 | ||
533 | ret = smsc95xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL_); | 533 | ret = smsc95xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL_); |
534 | check_warn_return(ret, "Error writing INT_STS"); | 534 | check_warn_return(ret, "Error writing INT_STS\n"); |
535 | 535 | ||
536 | mii_check_media(mii, 1, 1); | 536 | mii_check_media(mii, 1, 1); |
537 | mii_ethtool_gset(&dev->mii, &ecmd); | 537 | mii_ethtool_gset(&dev->mii, &ecmd); |
@@ -553,10 +553,10 @@ static int smsc95xx_link_reset(struct usbnet *dev) | |||
553 | spin_unlock_irqrestore(&pdata->mac_cr_lock, flags); | 553 | spin_unlock_irqrestore(&pdata->mac_cr_lock, flags); |
554 | 554 | ||
555 | ret = smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr); | 555 | ret = smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr); |
556 | check_warn_return(ret, "Error writing MAC_CR"); | 556 | check_warn_return(ret, "Error writing MAC_CR\n"); |
557 | 557 | ||
558 | ret = smsc95xx_phy_update_flowcontrol(dev, ecmd.duplex, lcladv, rmtadv); | 558 | ret = smsc95xx_phy_update_flowcontrol(dev, ecmd.duplex, lcladv, rmtadv); |
559 | check_warn_return(ret, "Error updating PHY flow control"); | 559 | check_warn_return(ret, "Error updating PHY flow control\n"); |
560 | 560 | ||
561 | return 0; | 561 | return 0; |
562 | } | 562 | } |
@@ -821,7 +821,7 @@ static int smsc95xx_phy_initialize(struct usbnet *dev) | |||
821 | 821 | ||
822 | /* read to clear */ | 822 | /* read to clear */ |
823 | ret = smsc95xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC); | 823 | ret = smsc95xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC); |
824 | check_warn_return(ret, "Failed to read PHY_INT_SRC during init"); | 824 | check_warn_return(ret, "Failed to read PHY_INT_SRC during init\n"); |
825 | 825 | ||
826 | smsc95xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK, | 826 | smsc95xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK, |
827 | PHY_INT_MASK_DEFAULT_); | 827 | PHY_INT_MASK_DEFAULT_); |
@@ -875,14 +875,14 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
875 | if (ret < 0) | 875 | if (ret < 0) |
876 | return ret; | 876 | return ret; |
877 | 877 | ||
878 | netif_dbg(dev, ifup, dev->net, | 878 | netif_dbg(dev, ifup, dev->net, "MAC Address: %pM\n", |
879 | "MAC Address: %pM\n", dev->net->dev_addr); | 879 | dev->net->dev_addr); |
880 | 880 | ||
881 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); | 881 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); |
882 | check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret); | 882 | check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret); |
883 | 883 | ||
884 | netif_dbg(dev, ifup, dev->net, | 884 | netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG : 0x%08x\n", |
885 | "Read Value from HW_CFG : 0x%08x\n", read_buf); | 885 | read_buf); |
886 | 886 | ||
887 | read_buf |= HW_CFG_BIR_; | 887 | read_buf |= HW_CFG_BIR_; |
888 | 888 | ||
@@ -906,8 +906,8 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
906 | dev->rx_urb_size = DEFAULT_FS_BURST_CAP_SIZE; | 906 | dev->rx_urb_size = DEFAULT_FS_BURST_CAP_SIZE; |
907 | } | 907 | } |
908 | 908 | ||
909 | netif_dbg(dev, ifup, dev->net, | 909 | netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n", |
910 | "rx_urb_size=%ld\n", (ulong)dev->rx_urb_size); | 910 | (ulong)dev->rx_urb_size); |
911 | 911 | ||
912 | ret = smsc95xx_write_reg(dev, BURST_CAP, burst_cap); | 912 | ret = smsc95xx_write_reg(dev, BURST_CAP, burst_cap); |
913 | check_warn_return(ret, "Failed to write BURST_CAP: %d\n", ret); | 913 | check_warn_return(ret, "Failed to write BURST_CAP: %d\n", ret); |
@@ -932,8 +932,8 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
932 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); | 932 | ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); |
933 | check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret); | 933 | check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret); |
934 | 934 | ||
935 | netif_dbg(dev, ifup, dev->net, | 935 | netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG: 0x%08x\n", |
936 | "Read Value from HW_CFG: 0x%08x\n", read_buf); | 936 | read_buf); |
937 | 937 | ||
938 | if (turbo_mode) | 938 | if (turbo_mode) |
939 | read_buf |= (HW_CFG_MEF_ | HW_CFG_BCE_); | 939 | read_buf |= (HW_CFG_MEF_ | HW_CFG_BCE_); |
@@ -983,12 +983,12 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
983 | 983 | ||
984 | /* Enable or disable checksum offload engines */ | 984 | /* Enable or disable checksum offload engines */ |
985 | ret = smsc95xx_set_features(dev->net, dev->net->features); | 985 | ret = smsc95xx_set_features(dev->net, dev->net->features); |
986 | check_warn_return(ret, "Failed to set checksum offload features"); | 986 | check_warn_return(ret, "Failed to set checksum offload features\n"); |
987 | 987 | ||
988 | smsc95xx_set_multicast(dev->net); | 988 | smsc95xx_set_multicast(dev->net); |
989 | 989 | ||
990 | ret = smsc95xx_phy_initialize(dev); | 990 | ret = smsc95xx_phy_initialize(dev); |
991 | check_warn_return(ret, "Failed to init PHY"); | 991 | check_warn_return(ret, "Failed to init PHY\n"); |
992 | 992 | ||
993 | ret = smsc95xx_read_reg(dev, INT_EP_CTL, &read_buf); | 993 | ret = smsc95xx_read_reg(dev, INT_EP_CTL, &read_buf); |
994 | check_warn_return(ret, "Failed to read INT_EP_CTL: %d\n", ret); | 994 | check_warn_return(ret, "Failed to read INT_EP_CTL: %d\n", ret); |
@@ -1000,10 +1000,10 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
1000 | check_warn_return(ret, "Failed to write INT_EP_CTL: %d\n", ret); | 1000 | check_warn_return(ret, "Failed to write INT_EP_CTL: %d\n", ret); |
1001 | 1001 | ||
1002 | ret = smsc95xx_start_tx_path(dev); | 1002 | ret = smsc95xx_start_tx_path(dev); |
1003 | check_warn_return(ret, "Failed to start TX path"); | 1003 | check_warn_return(ret, "Failed to start TX path\n"); |
1004 | 1004 | ||
1005 | ret = smsc95xx_start_rx_path(dev, 0); | 1005 | ret = smsc95xx_start_rx_path(dev, 0); |
1006 | check_warn_return(ret, "Failed to start RX path"); | 1006 | check_warn_return(ret, "Failed to start RX path\n"); |
1007 | 1007 | ||
1008 | netif_dbg(dev, ifup, dev->net, "smsc95xx_reset, return 0\n"); | 1008 | netif_dbg(dev, ifup, dev->net, "smsc95xx_reset, return 0\n"); |
1009 | return 0; | 1009 | return 0; |
@@ -1098,15 +1098,15 @@ static int smsc95xx_enable_phy_wakeup_interrupts(struct usbnet *dev, u16 mask) | |||
1098 | struct mii_if_info *mii = &dev->mii; | 1098 | struct mii_if_info *mii = &dev->mii; |
1099 | int ret; | 1099 | int ret; |
1100 | 1100 | ||
1101 | netdev_dbg(dev->net, "enabling PHY wakeup interrupts"); | 1101 | netdev_dbg(dev->net, "enabling PHY wakeup interrupts\n"); |
1102 | 1102 | ||
1103 | /* read to clear */ | 1103 | /* read to clear */ |
1104 | ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_INT_SRC); | 1104 | ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_INT_SRC); |
1105 | check_warn_return(ret, "Error reading PHY_INT_SRC"); | 1105 | check_warn_return(ret, "Error reading PHY_INT_SRC\n"); |
1106 | 1106 | ||
1107 | /* enable interrupt source */ | 1107 | /* enable interrupt source */ |
1108 | ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_INT_MASK); | 1108 | ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_INT_MASK); |
1109 | check_warn_return(ret, "Error reading PHY_INT_MASK"); | 1109 | check_warn_return(ret, "Error reading PHY_INT_MASK\n"); |
1110 | 1110 | ||
1111 | ret |= mask; | 1111 | ret |= mask; |
1112 | 1112 | ||
@@ -1122,10 +1122,10 @@ static int smsc95xx_link_ok_nopm(struct usbnet *dev) | |||
1122 | 1122 | ||
1123 | /* first, a dummy read, needed to latch some MII phys */ | 1123 | /* first, a dummy read, needed to latch some MII phys */ |
1124 | ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, MII_BMSR); | 1124 | ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, MII_BMSR); |
1125 | check_warn_return(ret, "Error reading MII_BMSR"); | 1125 | check_warn_return(ret, "Error reading MII_BMSR\n"); |
1126 | 1126 | ||
1127 | ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, MII_BMSR); | 1127 | ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, MII_BMSR); |
1128 | check_warn_return(ret, "Error reading MII_BMSR"); | 1128 | check_warn_return(ret, "Error reading MII_BMSR\n"); |
1129 | 1129 | ||
1130 | return !!(ret & BMSR_LSTATUS); | 1130 | return !!(ret & BMSR_LSTATUS); |
1131 | } | 1131 | } |
@@ -1137,13 +1137,13 @@ static int smsc95xx_enter_suspend0(struct usbnet *dev) | |||
1137 | int ret; | 1137 | int ret; |
1138 | 1138 | ||
1139 | ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); | 1139 | ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); |
1140 | check_warn_return(ret, "Error reading PM_CTRL"); | 1140 | check_warn_return(ret, "Error reading PM_CTRL\n"); |
1141 | 1141 | ||
1142 | val &= (~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_)); | 1142 | val &= (~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_)); |
1143 | val |= PM_CTL_SUS_MODE_0; | 1143 | val |= PM_CTL_SUS_MODE_0; |
1144 | 1144 | ||
1145 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); | 1145 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); |
1146 | check_warn_return(ret, "Error writing PM_CTRL"); | 1146 | check_warn_return(ret, "Error writing PM_CTRL\n"); |
1147 | 1147 | ||
1148 | /* clear wol status */ | 1148 | /* clear wol status */ |
1149 | val &= ~PM_CTL_WUPS_; | 1149 | val &= ~PM_CTL_WUPS_; |
@@ -1154,11 +1154,11 @@ static int smsc95xx_enter_suspend0(struct usbnet *dev) | |||
1154 | val |= PM_CTL_WUPS_ED_; | 1154 | val |= PM_CTL_WUPS_ED_; |
1155 | 1155 | ||
1156 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); | 1156 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); |
1157 | check_warn_return(ret, "Error writing PM_CTRL"); | 1157 | check_warn_return(ret, "Error writing PM_CTRL\n"); |
1158 | 1158 | ||
1159 | /* read back PM_CTRL */ | 1159 | /* read back PM_CTRL */ |
1160 | ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); | 1160 | ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); |
1161 | check_warn_return(ret, "Error reading PM_CTRL"); | 1161 | check_warn_return(ret, "Error reading PM_CTRL\n"); |
1162 | 1162 | ||
1163 | smsc95xx_set_feature(dev, USB_DEVICE_REMOTE_WAKEUP); | 1163 | smsc95xx_set_feature(dev, USB_DEVICE_REMOTE_WAKEUP); |
1164 | 1164 | ||
@@ -1181,7 +1181,7 @@ static int smsc95xx_enter_suspend1(struct usbnet *dev) | |||
1181 | 1181 | ||
1182 | /* enable energy detect power-down mode */ | 1182 | /* enable energy detect power-down mode */ |
1183 | ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_MODE_CTRL_STS); | 1183 | ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_MODE_CTRL_STS); |
1184 | check_warn_return(ret, "Error reading PHY_MODE_CTRL_STS"); | 1184 | check_warn_return(ret, "Error reading PHY_MODE_CTRL_STS\n"); |
1185 | 1185 | ||
1186 | ret |= MODE_CTRL_STS_EDPWRDOWN_; | 1186 | ret |= MODE_CTRL_STS_EDPWRDOWN_; |
1187 | 1187 | ||
@@ -1189,20 +1189,20 @@ static int smsc95xx_enter_suspend1(struct usbnet *dev) | |||
1189 | 1189 | ||
1190 | /* enter SUSPEND1 mode */ | 1190 | /* enter SUSPEND1 mode */ |
1191 | ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); | 1191 | ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); |
1192 | check_warn_return(ret, "Error reading PM_CTRL"); | 1192 | check_warn_return(ret, "Error reading PM_CTRL\n"); |
1193 | 1193 | ||
1194 | val &= ~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_); | 1194 | val &= ~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_); |
1195 | val |= PM_CTL_SUS_MODE_1; | 1195 | val |= PM_CTL_SUS_MODE_1; |
1196 | 1196 | ||
1197 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); | 1197 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); |
1198 | check_warn_return(ret, "Error writing PM_CTRL"); | 1198 | check_warn_return(ret, "Error writing PM_CTRL\n"); |
1199 | 1199 | ||
1200 | /* clear wol status, enable energy detection */ | 1200 | /* clear wol status, enable energy detection */ |
1201 | val &= ~PM_CTL_WUPS_; | 1201 | val &= ~PM_CTL_WUPS_; |
1202 | val |= (PM_CTL_WUPS_ED_ | PM_CTL_ED_EN_); | 1202 | val |= (PM_CTL_WUPS_ED_ | PM_CTL_ED_EN_); |
1203 | 1203 | ||
1204 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); | 1204 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); |
1205 | check_warn_return(ret, "Error writing PM_CTRL"); | 1205 | check_warn_return(ret, "Error writing PM_CTRL\n"); |
1206 | 1206 | ||
1207 | smsc95xx_set_feature(dev, USB_DEVICE_REMOTE_WAKEUP); | 1207 | smsc95xx_set_feature(dev, USB_DEVICE_REMOTE_WAKEUP); |
1208 | 1208 | ||
@@ -1215,13 +1215,13 @@ static int smsc95xx_enter_suspend2(struct usbnet *dev) | |||
1215 | int ret; | 1215 | int ret; |
1216 | 1216 | ||
1217 | ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); | 1217 | ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); |
1218 | check_warn_return(ret, "Error reading PM_CTRL"); | 1218 | check_warn_return(ret, "Error reading PM_CTRL\n"); |
1219 | 1219 | ||
1220 | val &= ~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_); | 1220 | val &= ~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_); |
1221 | val |= PM_CTL_SUS_MODE_2; | 1221 | val |= PM_CTL_SUS_MODE_2; |
1222 | 1222 | ||
1223 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); | 1223 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); |
1224 | check_warn_return(ret, "Error writing PM_CTRL"); | 1224 | check_warn_return(ret, "Error writing PM_CTRL\n"); |
1225 | 1225 | ||
1226 | return 0; | 1226 | return 0; |
1227 | } | 1227 | } |
@@ -1234,7 +1234,7 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) | |||
1234 | int ret; | 1234 | int ret; |
1235 | 1235 | ||
1236 | ret = usbnet_suspend(intf, message); | 1236 | ret = usbnet_suspend(intf, message); |
1237 | check_warn_return(ret, "usbnet_suspend error"); | 1237 | check_warn_return(ret, "usbnet_suspend error\n"); |
1238 | 1238 | ||
1239 | /* determine if link is up using only _nopm functions */ | 1239 | /* determine if link is up using only _nopm functions */ |
1240 | link_up = smsc95xx_link_ok_nopm(dev); | 1240 | link_up = smsc95xx_link_ok_nopm(dev); |
@@ -1244,24 +1244,24 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) | |||
1244 | */ | 1244 | */ |
1245 | if (!(pdata->wolopts & SUPPORTED_WAKE) || | 1245 | if (!(pdata->wolopts & SUPPORTED_WAKE) || |
1246 | !(link_up || (pdata->wolopts & WAKE_PHY))) { | 1246 | !(link_up || (pdata->wolopts & WAKE_PHY))) { |
1247 | netdev_info(dev->net, "entering SUSPEND2 mode"); | 1247 | netdev_info(dev->net, "entering SUSPEND2 mode\n"); |
1248 | 1248 | ||
1249 | /* disable energy detect (link up) & wake up events */ | 1249 | /* disable energy detect (link up) & wake up events */ |
1250 | ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val); | 1250 | ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val); |
1251 | check_warn_return(ret, "Error reading WUCSR"); | 1251 | check_warn_return(ret, "Error reading WUCSR\n"); |
1252 | 1252 | ||
1253 | val &= ~(WUCSR_MPEN_ | WUCSR_WAKE_EN_); | 1253 | val &= ~(WUCSR_MPEN_ | WUCSR_WAKE_EN_); |
1254 | 1254 | ||
1255 | ret = smsc95xx_write_reg_nopm(dev, WUCSR, val); | 1255 | ret = smsc95xx_write_reg_nopm(dev, WUCSR, val); |
1256 | check_warn_return(ret, "Error writing WUCSR"); | 1256 | check_warn_return(ret, "Error writing WUCSR\n"); |
1257 | 1257 | ||
1258 | ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); | 1258 | ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); |
1259 | check_warn_return(ret, "Error reading PM_CTRL"); | 1259 | check_warn_return(ret, "Error reading PM_CTRL\n"); |
1260 | 1260 | ||
1261 | val &= ~(PM_CTL_ED_EN_ | PM_CTL_WOL_EN_); | 1261 | val &= ~(PM_CTL_ED_EN_ | PM_CTL_WOL_EN_); |
1262 | 1262 | ||
1263 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); | 1263 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); |
1264 | check_warn_return(ret, "Error writing PM_CTRL"); | 1264 | check_warn_return(ret, "Error writing PM_CTRL\n"); |
1265 | 1265 | ||
1266 | return smsc95xx_enter_suspend2(dev); | 1266 | return smsc95xx_enter_suspend2(dev); |
1267 | } | 1267 | } |
@@ -1269,13 +1269,13 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) | |||
1269 | if (pdata->wolopts & WAKE_PHY) { | 1269 | if (pdata->wolopts & WAKE_PHY) { |
1270 | ret = smsc95xx_enable_phy_wakeup_interrupts(dev, | 1270 | ret = smsc95xx_enable_phy_wakeup_interrupts(dev, |
1271 | (PHY_INT_MASK_ANEG_COMP_ | PHY_INT_MASK_LINK_DOWN_)); | 1271 | (PHY_INT_MASK_ANEG_COMP_ | PHY_INT_MASK_LINK_DOWN_)); |
1272 | check_warn_return(ret, "error enabling PHY wakeup ints"); | 1272 | check_warn_return(ret, "error enabling PHY wakeup ints\n"); |
1273 | 1273 | ||
1274 | /* if link is down then configure EDPD and enter SUSPEND1, | 1274 | /* if link is down then configure EDPD and enter SUSPEND1, |
1275 | * otherwise enter SUSPEND0 below | 1275 | * otherwise enter SUSPEND0 below |
1276 | */ | 1276 | */ |
1277 | if (!link_up) { | 1277 | if (!link_up) { |
1278 | netdev_info(dev->net, "entering SUSPEND1 mode"); | 1278 | netdev_info(dev->net, "entering SUSPEND1 mode\n"); |
1279 | return smsc95xx_enter_suspend1(dev); | 1279 | return smsc95xx_enter_suspend1(dev); |
1280 | } | 1280 | } |
1281 | } | 1281 | } |
@@ -1296,7 +1296,7 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) | |||
1296 | 1296 | ||
1297 | if (pdata->wolopts & WAKE_BCAST) { | 1297 | if (pdata->wolopts & WAKE_BCAST) { |
1298 | const u8 bcast[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; | 1298 | const u8 bcast[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; |
1299 | netdev_info(dev->net, "enabling broadcast detection"); | 1299 | netdev_info(dev->net, "enabling broadcast detection\n"); |
1300 | filter_mask[filter * 4] = 0x003F; | 1300 | filter_mask[filter * 4] = 0x003F; |
1301 | filter_mask[filter * 4 + 1] = 0x00; | 1301 | filter_mask[filter * 4 + 1] = 0x00; |
1302 | filter_mask[filter * 4 + 2] = 0x00; | 1302 | filter_mask[filter * 4 + 2] = 0x00; |
@@ -1309,7 +1309,7 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) | |||
1309 | 1309 | ||
1310 | if (pdata->wolopts & WAKE_MCAST) { | 1310 | if (pdata->wolopts & WAKE_MCAST) { |
1311 | const u8 mcast[] = {0x01, 0x00, 0x5E}; | 1311 | const u8 mcast[] = {0x01, 0x00, 0x5E}; |
1312 | netdev_info(dev->net, "enabling multicast detection"); | 1312 | netdev_info(dev->net, "enabling multicast detection\n"); |
1313 | filter_mask[filter * 4] = 0x0007; | 1313 | filter_mask[filter * 4] = 0x0007; |
1314 | filter_mask[filter * 4 + 1] = 0x00; | 1314 | filter_mask[filter * 4 + 1] = 0x00; |
1315 | filter_mask[filter * 4 + 2] = 0x00; | 1315 | filter_mask[filter * 4 + 2] = 0x00; |
@@ -1322,7 +1322,7 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) | |||
1322 | 1322 | ||
1323 | if (pdata->wolopts & WAKE_ARP) { | 1323 | if (pdata->wolopts & WAKE_ARP) { |
1324 | const u8 arp[] = {0x08, 0x06}; | 1324 | const u8 arp[] = {0x08, 0x06}; |
1325 | netdev_info(dev->net, "enabling ARP detection"); | 1325 | netdev_info(dev->net, "enabling ARP detection\n"); |
1326 | filter_mask[filter * 4] = 0x0003; | 1326 | filter_mask[filter * 4] = 0x0003; |
1327 | filter_mask[filter * 4 + 1] = 0x00; | 1327 | filter_mask[filter * 4 + 1] = 0x00; |
1328 | filter_mask[filter * 4 + 2] = 0x00; | 1328 | filter_mask[filter * 4 + 2] = 0x00; |
@@ -1334,7 +1334,7 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) | |||
1334 | } | 1334 | } |
1335 | 1335 | ||
1336 | if (pdata->wolopts & WAKE_UCAST) { | 1336 | if (pdata->wolopts & WAKE_UCAST) { |
1337 | netdev_info(dev->net, "enabling unicast detection"); | 1337 | netdev_info(dev->net, "enabling unicast detection\n"); |
1338 | filter_mask[filter * 4] = 0x003F; | 1338 | filter_mask[filter * 4] = 0x003F; |
1339 | filter_mask[filter * 4 + 1] = 0x00; | 1339 | filter_mask[filter * 4 + 1] = 0x00; |
1340 | filter_mask[filter * 4 + 2] = 0x00; | 1340 | filter_mask[filter * 4 + 2] = 0x00; |
@@ -1349,72 +1349,72 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) | |||
1349 | ret = smsc95xx_write_reg_nopm(dev, WUFF, filter_mask[i]); | 1349 | ret = smsc95xx_write_reg_nopm(dev, WUFF, filter_mask[i]); |
1350 | if (ret < 0) | 1350 | if (ret < 0) |
1351 | kfree(filter_mask); | 1351 | kfree(filter_mask); |
1352 | check_warn_return(ret, "Error writing WUFF"); | 1352 | check_warn_return(ret, "Error writing WUFF\n"); |
1353 | } | 1353 | } |
1354 | kfree(filter_mask); | 1354 | kfree(filter_mask); |
1355 | 1355 | ||
1356 | for (i = 0; i < (wuff_filter_count / 4); i++) { | 1356 | for (i = 0; i < (wuff_filter_count / 4); i++) { |
1357 | ret = smsc95xx_write_reg_nopm(dev, WUFF, command[i]); | 1357 | ret = smsc95xx_write_reg_nopm(dev, WUFF, command[i]); |
1358 | check_warn_return(ret, "Error writing WUFF"); | 1358 | check_warn_return(ret, "Error writing WUFF\n"); |
1359 | } | 1359 | } |
1360 | 1360 | ||
1361 | for (i = 0; i < (wuff_filter_count / 4); i++) { | 1361 | for (i = 0; i < (wuff_filter_count / 4); i++) { |
1362 | ret = smsc95xx_write_reg_nopm(dev, WUFF, offset[i]); | 1362 | ret = smsc95xx_write_reg_nopm(dev, WUFF, offset[i]); |
1363 | check_warn_return(ret, "Error writing WUFF"); | 1363 | check_warn_return(ret, "Error writing WUFF\n"); |
1364 | } | 1364 | } |
1365 | 1365 | ||
1366 | for (i = 0; i < (wuff_filter_count / 2); i++) { | 1366 | for (i = 0; i < (wuff_filter_count / 2); i++) { |
1367 | ret = smsc95xx_write_reg_nopm(dev, WUFF, crc[i]); | 1367 | ret = smsc95xx_write_reg_nopm(dev, WUFF, crc[i]); |
1368 | check_warn_return(ret, "Error writing WUFF"); | 1368 | check_warn_return(ret, "Error writing WUFF\n"); |
1369 | } | 1369 | } |
1370 | 1370 | ||
1371 | /* clear any pending pattern match packet status */ | 1371 | /* clear any pending pattern match packet status */ |
1372 | ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val); | 1372 | ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val); |
1373 | check_warn_return(ret, "Error reading WUCSR"); | 1373 | check_warn_return(ret, "Error reading WUCSR\n"); |
1374 | 1374 | ||
1375 | val |= WUCSR_WUFR_; | 1375 | val |= WUCSR_WUFR_; |
1376 | 1376 | ||
1377 | ret = smsc95xx_write_reg_nopm(dev, WUCSR, val); | 1377 | ret = smsc95xx_write_reg_nopm(dev, WUCSR, val); |
1378 | check_warn_return(ret, "Error writing WUCSR"); | 1378 | check_warn_return(ret, "Error writing WUCSR\n"); |
1379 | } | 1379 | } |
1380 | 1380 | ||
1381 | if (pdata->wolopts & WAKE_MAGIC) { | 1381 | if (pdata->wolopts & WAKE_MAGIC) { |
1382 | /* clear any pending magic packet status */ | 1382 | /* clear any pending magic packet status */ |
1383 | ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val); | 1383 | ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val); |
1384 | check_warn_return(ret, "Error reading WUCSR"); | 1384 | check_warn_return(ret, "Error reading WUCSR\n"); |
1385 | 1385 | ||
1386 | val |= WUCSR_MPR_; | 1386 | val |= WUCSR_MPR_; |
1387 | 1387 | ||
1388 | ret = smsc95xx_write_reg_nopm(dev, WUCSR, val); | 1388 | ret = smsc95xx_write_reg_nopm(dev, WUCSR, val); |
1389 | check_warn_return(ret, "Error writing WUCSR"); | 1389 | check_warn_return(ret, "Error writing WUCSR\n"); |
1390 | } | 1390 | } |
1391 | 1391 | ||
1392 | /* enable/disable wakeup sources */ | 1392 | /* enable/disable wakeup sources */ |
1393 | ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val); | 1393 | ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val); |
1394 | check_warn_return(ret, "Error reading WUCSR"); | 1394 | check_warn_return(ret, "Error reading WUCSR\n"); |
1395 | 1395 | ||
1396 | if (pdata->wolopts & (WAKE_BCAST | WAKE_MCAST | WAKE_ARP | WAKE_UCAST)) { | 1396 | if (pdata->wolopts & (WAKE_BCAST | WAKE_MCAST | WAKE_ARP | WAKE_UCAST)) { |
1397 | netdev_info(dev->net, "enabling pattern match wakeup"); | 1397 | netdev_info(dev->net, "enabling pattern match wakeup\n"); |
1398 | val |= WUCSR_WAKE_EN_; | 1398 | val |= WUCSR_WAKE_EN_; |
1399 | } else { | 1399 | } else { |
1400 | netdev_info(dev->net, "disabling pattern match wakeup"); | 1400 | netdev_info(dev->net, "disabling pattern match wakeup\n"); |
1401 | val &= ~WUCSR_WAKE_EN_; | 1401 | val &= ~WUCSR_WAKE_EN_; |
1402 | } | 1402 | } |
1403 | 1403 | ||
1404 | if (pdata->wolopts & WAKE_MAGIC) { | 1404 | if (pdata->wolopts & WAKE_MAGIC) { |
1405 | netdev_info(dev->net, "enabling magic packet wakeup"); | 1405 | netdev_info(dev->net, "enabling magic packet wakeup\n"); |
1406 | val |= WUCSR_MPEN_; | 1406 | val |= WUCSR_MPEN_; |
1407 | } else { | 1407 | } else { |
1408 | netdev_info(dev->net, "disabling magic packet wakeup"); | 1408 | netdev_info(dev->net, "disabling magic packet wakeup\n"); |
1409 | val &= ~WUCSR_MPEN_; | 1409 | val &= ~WUCSR_MPEN_; |
1410 | } | 1410 | } |
1411 | 1411 | ||
1412 | ret = smsc95xx_write_reg_nopm(dev, WUCSR, val); | 1412 | ret = smsc95xx_write_reg_nopm(dev, WUCSR, val); |
1413 | check_warn_return(ret, "Error writing WUCSR"); | 1413 | check_warn_return(ret, "Error writing WUCSR\n"); |
1414 | 1414 | ||
1415 | /* enable wol wakeup source */ | 1415 | /* enable wol wakeup source */ |
1416 | ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); | 1416 | ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); |
1417 | check_warn_return(ret, "Error reading PM_CTRL"); | 1417 | check_warn_return(ret, "Error reading PM_CTRL\n"); |
1418 | 1418 | ||
1419 | val |= PM_CTL_WOL_EN_; | 1419 | val |= PM_CTL_WOL_EN_; |
1420 | 1420 | ||
@@ -1423,13 +1423,13 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) | |||
1423 | val |= PM_CTL_ED_EN_; | 1423 | val |= PM_CTL_ED_EN_; |
1424 | 1424 | ||
1425 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); | 1425 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); |
1426 | check_warn_return(ret, "Error writing PM_CTRL"); | 1426 | check_warn_return(ret, "Error writing PM_CTRL\n"); |
1427 | 1427 | ||
1428 | /* enable receiver to enable frame reception */ | 1428 | /* enable receiver to enable frame reception */ |
1429 | smsc95xx_start_rx_path(dev, 1); | 1429 | smsc95xx_start_rx_path(dev, 1); |
1430 | 1430 | ||
1431 | /* some wol options are enabled, so enter SUSPEND0 */ | 1431 | /* some wol options are enabled, so enter SUSPEND0 */ |
1432 | netdev_info(dev->net, "entering SUSPEND0 mode"); | 1432 | netdev_info(dev->net, "entering SUSPEND0 mode\n"); |
1433 | return smsc95xx_enter_suspend0(dev); | 1433 | return smsc95xx_enter_suspend0(dev); |
1434 | } | 1434 | } |
1435 | 1435 | ||
@@ -1447,26 +1447,26 @@ static int smsc95xx_resume(struct usb_interface *intf) | |||
1447 | 1447 | ||
1448 | /* clear wake-up sources */ | 1448 | /* clear wake-up sources */ |
1449 | ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val); | 1449 | ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val); |
1450 | check_warn_return(ret, "Error reading WUCSR"); | 1450 | check_warn_return(ret, "Error reading WUCSR\n"); |
1451 | 1451 | ||
1452 | val &= ~(WUCSR_WAKE_EN_ | WUCSR_MPEN_); | 1452 | val &= ~(WUCSR_WAKE_EN_ | WUCSR_MPEN_); |
1453 | 1453 | ||
1454 | ret = smsc95xx_write_reg_nopm(dev, WUCSR, val); | 1454 | ret = smsc95xx_write_reg_nopm(dev, WUCSR, val); |
1455 | check_warn_return(ret, "Error writing WUCSR"); | 1455 | check_warn_return(ret, "Error writing WUCSR\n"); |
1456 | 1456 | ||
1457 | /* clear wake-up status */ | 1457 | /* clear wake-up status */ |
1458 | ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); | 1458 | ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); |
1459 | check_warn_return(ret, "Error reading PM_CTRL"); | 1459 | check_warn_return(ret, "Error reading PM_CTRL\n"); |
1460 | 1460 | ||
1461 | val &= ~PM_CTL_WOL_EN_; | 1461 | val &= ~PM_CTL_WOL_EN_; |
1462 | val |= PM_CTL_WUPS_; | 1462 | val |= PM_CTL_WUPS_; |
1463 | 1463 | ||
1464 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); | 1464 | ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val); |
1465 | check_warn_return(ret, "Error writing PM_CTRL"); | 1465 | check_warn_return(ret, "Error writing PM_CTRL\n"); |
1466 | } | 1466 | } |
1467 | 1467 | ||
1468 | ret = usbnet_resume(intf); | 1468 | ret = usbnet_resume(intf); |
1469 | check_warn_return(ret, "usbnet_resume error"); | 1469 | check_warn_return(ret, "usbnet_resume error\n"); |
1470 | 1470 | ||
1471 | return 0; | 1471 | return 0; |
1472 | } | 1472 | } |