stmmac: Allow SOCs to use Store forward mode eventhough tx_coe is 0. (V2)
authorSrinivas Kandagatla <srinivas.kandagatla@st.com>
Sun, 17 Jul 2011 20:54:09 +0000 (20:54 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Jul 2011 17:47:24 +0000 (10:47 -0700)
This patch adds new field 'force_sf_dma_mode' to plat_stmmacenet_data
struct to allow users to specify if they want to use force store forward
eventhough tx_coe is not available in hw.
without this flag stmmac driver will use cut-thru mode not use
store-forward mode.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/stmmac/stmmac_main.c
include/linux/stmmac.h

index c8c9e5bc660805594d76c354e70c1ff9417daa16..d37ebc80623aa6992da5d19db64015ad4cfba2a5 100644 (file)
@@ -557,9 +557,11 @@ static void free_dma_desc_resources(struct stmmac_priv *priv)
  */
 static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
 {
-       if (likely((priv->plat->tx_coe) && (!priv->no_csum_insertion))) {
-               /* In case of GMAC, SF mode has to be enabled
-                * to perform the TX COE. This depends on:
+       if (likely(priv->plat->force_sf_dma_mode ||
+               ((priv->plat->tx_coe) && (!priv->no_csum_insertion)))) {
+               /*
+                * In case of GMAC, SF mode can be enabled
+                * to perform the TX COE in HW. This depends on:
                 * 1) TX COE if actually supported
                 * 2) There is no bugged Jumbo frame support
                 *    that needs to not insert csum in the TDES.
index 9529e49b0385f9818f28f87845aee27354fb0c24..05d775690b72d311b955e27bb9b3aeabe6d4c11b 100644 (file)
@@ -40,6 +40,7 @@ struct plat_stmmacenet_data {
        int tx_coe;
        int bugged_jumbo;
        int pmt;
+       int force_sf_dma_mode;
        void (*fix_mac_speed)(void *priv, unsigned int speed);
        void (*bus_setup)(void __iomem *ioaddr);
        int (*init)(struct platform_device *pdev);