]> git.openfabrics.org - ~emulex/infiniband.git/commit
net: fec: fix the error to get the previous BD entry
authorDuan Fugang-B38611 <B38611@freescale.com>
Tue, 3 Sep 2013 02:41:18 +0000 (10:41 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Sep 2013 18:14:54 +0000 (14:14 -0400)
commit36e24e2ee29e25480b4be4a9ea467f4739be22fb
tree27b6cfe1502229c2fb46291aee0b383de229ee3e
parent639739b5e609a5074839bb22fc061b37baa06269
net: fec: fix the error to get the previous BD entry

Bug: error to get the previous BD entry. When the current BD
is the first BD, the previous BD entry must be the last BD,
not "bdp - 1" in current logic.

V4:
  * Optimize fec_enet_get_nextdesc() for code clean.
    Replace "ex_new_bd - ring_size" with "ex_base".
    Replace "new_bd - ring_size" with "base".

V3:
  * Restore the API name because David suggest to use fec_enet_
    prefix for all function in fec driver.
    So, change next_bd() -> fec_enet_get_nextdesc()
        change pre_bd()  -> fec_enet_get_prevdesc()
  * Reduce the two APIs parameters for easy to call.

V2:
  * Add tx_ring_size and rx_ring_size to struct fec_enet_private.
  * Replace api fec_enet_get_nextdesc() with next_bd().
    Replace api fec_enet_get_prevdesc() with pre_bd().

  * Move all ring size check logic to next_bd() and pre_bd(), which
    simplifies the code redundancy.

V1:
  * Add BD ring size check to get the previous BD entry in correctly.

Reviewed-by: Li Frank <B20596@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
Acked-by: Frank Li <frank.li@freescale.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec.h
drivers/net/ethernet/freescale/fec_main.c