diff options
author | John Crispin <blogic@openwrt.org> | 2015-10-05 10:26:21 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2015-10-05 10:26:21 +0000 |
commit | 7277c63b491331225f45567cc579d52d7b04b6b5 (patch) | |
tree | 6cf285e9884518743518675b962d9493312d31ff | |
parent | b5dcc9c862dc6366e25c00984cc5663670791e0d (diff) | |
download | master-187ad058-7277c63b491331225f45567cc579d52d7b04b6b5.tar.gz master-187ad058-7277c63b491331225f45567cc579d52d7b04b6b5.tar.bz2 master-187ad058-7277c63b491331225f45567cc579d52d7b04b6b5.zip |
ramips: Fix setting of rx buffer length
The length of the DMA rx buffer was always set to 0 because the function
for extracting the length was used to calculate the value for setting it.
Instead the macro has to be split in a get and set function similar to the
TX_DMA_(GET_|)PLEN(0|1) macro.
No problem was noticed on MT7621a before this was changed and thus maybe it
was hidden by different problem which is not yet fixed.
Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47115 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c | 2 | ||||
-rw-r--r-- | target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c index db6b1977f8..2691cfb710 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c @@ -849,7 +849,7 @@ static int fe_poll_rx(struct napi_struct *napi, int budget, dma_unmap_single(&netdev->dev, trxd.rxd1, ring->rx_buf_size, DMA_FROM_DEVICE); - pktlen = RX_DMA_PLEN0(trxd.rxd2); + pktlen = RX_DMA_GET_PLEN0(trxd.rxd2); skb->dev = netdev; skb_put(skb, pktlen); if (trxd.rxd4 & checksum_bit) { diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h index 78e04b025e..51b087c6db 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h @@ -310,7 +310,8 @@ enum fe_work_flag { /* rxd2 */ #define RX_DMA_DONE BIT(31) #define RX_DMA_LSO BIT(30) -#define RX_DMA_PLEN0(_x) (((_x) >> 16) & 0x3fff) +#define RX_DMA_PLEN0(_x) (((_x) & 0x3fff) << 16) +#define RX_DMA_GET_PLEN0(_x) (((_x) >> 16) & 0x3fff) #define RX_DMA_TAG BIT(15) /* rxd3 */ #define RX_DMA_TPID(_x) (((_x) >> 16) & 0xffff) |