Commit c2eb2982 authored by nbd's avatar nbd
Browse files

ralink: improve check rx sg function. use check frags instead of function call


Signed-off-by: default avatarmichael lee <igvtee@gmail.com>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44046 3c298f89-4303-0410-b956-a3cf2f4a3e73
parent eed20d11
......@@ -271,8 +271,8 @@ static int fe_alloc_rx(struct fe_priv *priv)
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;
}
......@@ -827,8 +827,8 @@ static int fe_poll_rx(struct napi_struct *napi, int budget,
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;
......
......@@ -380,7 +380,6 @@ struct fe_soc_data
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);
......
......@@ -168,17 +168,13 @@ static void mt7621_tx_dma(struct fe_tx_dma *txd)
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;
......@@ -192,7 +188,8 @@ static void mt7621_init_data(struct fe_soc_data *data,
{
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;
}
......@@ -214,7 +211,6 @@ static struct fe_soc_data mt7620_data = {
.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,
......@@ -237,7 +233,6 @@ static struct fe_soc_data mt7621_data = {
.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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment