]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: gem: Define descriptors via macro
authorMichal Simek <michal.simek@xilinx.com>
Thu, 12 Nov 2015 12:59:56 +0000 (13:59 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 26 Nov 2015 10:03:51 +0000 (11:03 +0100)
Sync up with mainline where location of dummy BDs is defined by macro.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/zynq_gem.c

index 5a0719cbb7ae59173f9083145fddb6f6955af0f0..9f53d20a52cf9839d0aeb9107f49ff0b5a9d4dbc 100644 (file)
@@ -158,6 +158,9 @@ struct emac_bd {
 /* BD separation space */
 #define BD_SEPRN_SPACE (RX_BUF * sizeof(struct emac_bd))
 
+/* Setup the first free TX descriptor */
+#define TX_FREE_DESC   2
+
 /* Initialized, rxbd_current, rx_first_buf must be 0 after init */
 struct zynq_gem_priv {
        struct emac_bd *tx_bd;
@@ -315,8 +318,8 @@ static int zynq_gem_init(struct eth_device *dev, bd_t * bis)
        struct phy_device *phydev;
        struct zynq_gem_regs *regs = (struct zynq_gem_regs *)dev->iobase;
        struct zynq_gem_priv *priv = dev->priv;
-       struct emac_bd *dummy_tx_bd = &priv->tx_bd[4];
-       struct emac_bd *dummy_rx_bd = &priv->tx_bd[6];
+       struct emac_bd *dummy_tx_bd = &priv->tx_bd[TX_FREE_DESC];
+       struct emac_bd *dummy_rx_bd = &priv->tx_bd[TX_FREE_DESC + 2];
        const u32 supported = SUPPORTED_10baseT_Half |
                        SUPPORTED_10baseT_Full |
                        SUPPORTED_100baseT_Half |