goto no_rx_mem;
priv->rx_dma[i].rxd1 = (unsigned int) dma_addr;
- if (priv->soc->rx_dma)
- priv->soc->rx_dma(&priv->rx_dma[i], priv->rx_buf_size);
+ if (priv->flags & FE_FLAG_RX_SG_DMA)
+ priv->rx_dma[i].rxd2 = RX_DMA_PLEN0(priv->rx_buf_size);
else
priv->rx_dma[i].rxd2 = RX_DMA_LSO;
}
rxd->rxd1 = (unsigned int) dma_addr;
release_desc:
- if (soc->rx_dma)
- soc->rx_dma(rxd, priv->rx_buf_size);
+ if (priv->flags & FE_FLAG_RX_SG_DMA)
+ rxd->rxd2 = RX_DMA_PLEN0(priv->rx_buf_size);
else
rxd->rxd2 = RX_DMA_LSO;
void (*set_mac)(struct fe_priv *priv, unsigned char *mac);
int (*fwd_config)(struct fe_priv *priv);
void (*tx_dma)(struct fe_tx_dma *txd);
- void (*rx_dma)(struct fe_rx_dma *rxd, u16 len);
int (*switch_init)(struct fe_priv *priv);
int (*switch_config)(struct fe_priv *priv);
void (*port_init)(struct fe_priv *priv, struct device_node *port);
txd->txd4 = BIT(25);
}
-static void mt7620_rx_dma(struct fe_rx_dma *rxd, u16 len)
-{
- rxd->rxd2 = RX_DMA_PLEN0(len);
-}
-
static void mt7620_init_data(struct fe_soc_data *data,
struct net_device *netdev)
{
struct fe_priv *priv = netdev_priv(netdev);
- priv->flags = FE_FLAG_PADDING_64B | FE_FLAG_RX_2B_OFFSET;
+ priv->flags = FE_FLAG_PADDING_64B | FE_FLAG_RX_2B_OFFSET |
+ FE_FLAG_RX_SG_DMA;
netdev->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM |
NETIF_F_HW_VLAN_CTAG_TX;
{
struct fe_priv *priv = netdev_priv(netdev);
- priv->flags = FE_FLAG_PADDING_64B | FE_FLAG_RX_2B_OFFSET;
+ priv->flags = FE_FLAG_PADDING_64B | FE_FLAG_RX_2B_OFFSET |
+ FE_FLAG_RX_SG_DMA;
netdev->hw_features = NETIF_F_HW_VLAN_CTAG_TX;
}
.set_mac = mt7620_set_mac,
.fwd_config = mt7620_fwd_config,
.tx_dma = mt7620_tx_dma,
- .rx_dma = mt7620_rx_dma,
.switch_init = mt7620_gsw_probe,
.switch_config = mt7620_gsw_config,
.port_init = mt7620_port_init,
.set_mac = mt7621_set_mac,
.fwd_config = mt7621_fwd_config,
.tx_dma = mt7621_tx_dma,
- .rx_dma = mt7620_rx_dma,
.switch_init = mt7620_gsw_probe,
.switch_config = mt7621_gsw_config,
.reg_table = mt7621_reg_table,