diff options
author | Varka Bhadram <varkab@cdac.in> | 2014-07-10 01:35:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-10 03:40:36 -0400 |
commit | 8bcd5c6d513274f93d81584ad5b2d6b1841f63aa (patch) | |
tree | b3dc945a607e7a6829549b00d29151d0222b1fec | |
parent | af5951545164d0849f86e1a9ab8948ff17170395 (diff) |
net: cpmac: fix comments
This patch convert the normal comments to networking subsystem
style comments.
Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/ti/cpmac.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c index 61eb69145b30..1d8ef39f370f 100644 --- a/drivers/net/ethernet/ti/cpmac.c +++ b/drivers/net/ethernet/ti/cpmac.c | |||
@@ -118,8 +118,8 @@ MODULE_PARM_DESC(dumb_switch, "Assume switch is not connected to MDIO bus"); | |||
118 | #define CPMAC_TX_ACK(channel) (0x0640 + (channel) * 4) | 118 | #define CPMAC_TX_ACK(channel) (0x0640 + (channel) * 4) |
119 | #define CPMAC_RX_ACK(channel) (0x0660 + (channel) * 4) | 119 | #define CPMAC_RX_ACK(channel) (0x0660 + (channel) * 4) |
120 | #define CPMAC_REG_END 0x0680 | 120 | #define CPMAC_REG_END 0x0680 |
121 | /* | 121 | |
122 | * Rx/Tx statistics | 122 | /* Rx/Tx statistics |
123 | * TODO: use some of them to fill stats in cpmac_stats() | 123 | * TODO: use some of them to fill stats in cpmac_stats() |
124 | */ | 124 | */ |
125 | #define CPMAC_STATS_RX_GOOD 0x0200 | 125 | #define CPMAC_STATS_RX_GOOD 0x0200 |
@@ -331,8 +331,7 @@ static void cpmac_set_multicast_list(struct net_device *dev) | |||
331 | cpmac_write(priv->regs, CPMAC_MAC_HASH_LO, 0xffffffff); | 331 | cpmac_write(priv->regs, CPMAC_MAC_HASH_LO, 0xffffffff); |
332 | cpmac_write(priv->regs, CPMAC_MAC_HASH_HI, 0xffffffff); | 332 | cpmac_write(priv->regs, CPMAC_MAC_HASH_HI, 0xffffffff); |
333 | } else { | 333 | } else { |
334 | /* | 334 | /* cpmac uses some strange mac address hashing |
335 | * cpmac uses some strange mac address hashing | ||
336 | * (not crc32) | 335 | * (not crc32) |
337 | */ | 336 | */ |
338 | netdev_for_each_mc_addr(ha, dev) { | 337 | netdev_for_each_mc_addr(ha, dev) { |
@@ -432,10 +431,10 @@ static int cpmac_poll(struct napi_struct *napi, int budget) | |||
432 | 431 | ||
433 | if ((desc->dataflags & CPMAC_EOQ) != 0) { | 432 | if ((desc->dataflags & CPMAC_EOQ) != 0) { |
434 | /* The last update to eoq->hw_next didn't happen | 433 | /* The last update to eoq->hw_next didn't happen |
435 | * soon enough, and the receiver stopped here. | 434 | * soon enough, and the receiver stopped here. |
436 | *Remember this descriptor so we can restart | 435 | * Remember this descriptor so we can restart |
437 | * the receiver after freeing some space. | 436 | * the receiver after freeing some space. |
438 | */ | 437 | */ |
439 | if (unlikely(restart)) { | 438 | if (unlikely(restart)) { |
440 | if (netif_msg_rx_err(priv)) | 439 | if (netif_msg_rx_err(priv)) |
441 | printk(KERN_ERR "%s: poll found a" | 440 | printk(KERN_ERR "%s: poll found a" |
@@ -457,25 +456,27 @@ static int cpmac_poll(struct napi_struct *napi, int budget) | |||
457 | 456 | ||
458 | if (desc != priv->rx_head) { | 457 | if (desc != priv->rx_head) { |
459 | /* We freed some buffers, but not the whole ring, | 458 | /* We freed some buffers, but not the whole ring, |
460 | * add what we did free to the rx list */ | 459 | * add what we did free to the rx list |
460 | */ | ||
461 | desc->prev->hw_next = (u32)0; | 461 | desc->prev->hw_next = (u32)0; |
462 | priv->rx_head->prev->hw_next = priv->rx_head->mapping; | 462 | priv->rx_head->prev->hw_next = priv->rx_head->mapping; |
463 | } | 463 | } |
464 | 464 | ||
465 | /* Optimization: If we did not actually process an EOQ (perhaps because | 465 | /* Optimization: If we did not actually process an EOQ (perhaps because |
466 | * of quota limits), check to see if the tail of the queue has EOQ set. | 466 | * of quota limits), check to see if the tail of the queue has EOQ set. |
467 | * We should immediately restart in that case so that the receiver can | 467 | * We should immediately restart in that case so that the receiver can |
468 | * restart and run in parallel with more packet processing. | 468 | * restart and run in parallel with more packet processing. |
469 | * This lets us handle slightly larger bursts before running | 469 | * This lets us handle slightly larger bursts before running |
470 | * out of ring space (assuming dev->weight < ring_size) */ | 470 | * out of ring space (assuming dev->weight < ring_size) |
471 | */ | ||
471 | 472 | ||
472 | if (!restart && | 473 | if (!restart && |
473 | (priv->rx_head->prev->dataflags & (CPMAC_OWN|CPMAC_EOQ)) | 474 | (priv->rx_head->prev->dataflags & (CPMAC_OWN|CPMAC_EOQ)) |
474 | == CPMAC_EOQ && | 475 | == CPMAC_EOQ && |
475 | (priv->rx_head->dataflags & CPMAC_OWN) != 0) { | 476 | (priv->rx_head->dataflags & CPMAC_OWN) != 0) { |
476 | /* reset EOQ so the poll loop (above) doesn't try to | 477 | /* reset EOQ so the poll loop (above) doesn't try to |
477 | * restart this when it eventually gets to this descriptor. | 478 | * restart this when it eventually gets to this descriptor. |
478 | */ | 479 | */ |
479 | priv->rx_head->prev->dataflags &= ~CPMAC_EOQ; | 480 | priv->rx_head->prev->dataflags &= ~CPMAC_EOQ; |
480 | restart = priv->rx_head; | 481 | restart = priv->rx_head; |
481 | } | 482 | } |
@@ -506,7 +507,8 @@ static int cpmac_poll(struct napi_struct *napi, int budget) | |||
506 | priv->dev->name, received); | 507 | priv->dev->name, received); |
507 | if (processed == 0) { | 508 | if (processed == 0) { |
508 | /* we ran out of packets to read, | 509 | /* we ran out of packets to read, |
509 | * revert to interrupt-driven mode */ | 510 | * revert to interrupt-driven mode |
511 | */ | ||
510 | napi_complete(napi); | 512 | napi_complete(napi); |
511 | cpmac_write(priv->regs, CPMAC_RX_INT_ENABLE, 1); | 513 | cpmac_write(priv->regs, CPMAC_RX_INT_ENABLE, 1); |
512 | return 0; | 514 | return 0; |
@@ -516,8 +518,8 @@ static int cpmac_poll(struct napi_struct *napi, int budget) | |||
516 | 518 | ||
517 | fatal_error: | 519 | fatal_error: |
518 | /* Something went horribly wrong. | 520 | /* Something went horribly wrong. |
519 | * Reset hardware to try to recover rather than wedging. */ | 521 | * Reset hardware to try to recover rather than wedging. |
520 | 522 | */ | |
521 | if (netif_msg_drv(priv)) { | 523 | if (netif_msg_drv(priv)) { |
522 | printk(KERN_ERR "%s: cpmac_poll is confused. " | 524 | printk(KERN_ERR "%s: cpmac_poll is confused. " |
523 | "Resetting hardware\n", priv->dev->name); | 525 | "Resetting hardware\n", priv->dev->name); |
@@ -751,7 +753,7 @@ static void cpmac_check_status(struct net_device *dev) | |||
751 | if (rx_code || tx_code) { | 753 | if (rx_code || tx_code) { |
752 | if (netif_msg_drv(priv) && net_ratelimit()) { | 754 | if (netif_msg_drv(priv) && net_ratelimit()) { |
753 | /* Can't find any documentation on what these | 755 | /* Can't find any documentation on what these |
754 | *error codes actually are. So just log them and hope.. | 756 | * error codes actually are. So just log them and hope.. |
755 | */ | 757 | */ |
756 | if (rx_code) | 758 | if (rx_code) |
757 | printk(KERN_WARNING "%s: host error %d on rx " | 759 | printk(KERN_WARNING "%s: host error %d on rx " |