Author: blogic
Date: 2015-10-05 12:26:21 +0200 (Mon, 05 Oct 2015)
New Revision: 47115

Modified:
   trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c
   trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h
Log:
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 <[email protected]>

Modified: 
trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c
===================================================================
--- 
trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c    
    2015-10-05 10:26:09 UTC (rev 47114)
+++ 
trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c    
    2015-10-05 10:26:21 UTC (rev 47115)
@@ -849,7 +849,7 @@
 
                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) {

Modified: 
trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h
===================================================================
--- 
trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h    
    2015-10-05 10:26:09 UTC (rev 47114)
+++ 
trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.h    
    2015-10-05 10:26:21 UTC (rev 47115)
@@ -310,7 +310,8 @@
 /* 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)
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to