]> git.sur5r.net Git - u-boot/blobdiff - drivers/net/rtl8169.c
powerpc: T4160: Remove macro CONFIG_PPC_T4160
[u-boot] / drivers / net / rtl8169.c
index 843b083f8f90460b9992f9f232003a06bc82b119..a3f4423a20ca3d7196480b010cba2eb50f23f41f 100644 (file)
@@ -629,11 +629,12 @@ static int rtl_send_common(pci_dev_t dev, unsigned long dev_iobase,
        /* point to the current txb incase multiple tx_rings are used */
        ptxb = tpc->Tx_skbuff[entry * MAX_ETH_FRAME_SIZE];
        memcpy(ptxb, (char *)packet, (int)length);
-       rtl_flush_buffer(ptxb, length);
 
        while (len < ETH_ZLEN)
                ptxb[len++] = '\0';
 
+       rtl_flush_buffer(ptxb, ALIGN(len, RTL8169_ALIGN));
+
        tpc->TxDescArray[entry].buf_Haddr = 0;
 #ifdef CONFIG_DM_ETH
        tpc->TxDescArray[entry].buf_addr = cpu_to_le32(
@@ -666,12 +667,12 @@ static int rtl_send_common(pci_dev_t dev, unsigned long dev_iobase,
                puts("tx timeout/error\n");
                printf("%s elapsed time : %lu\n", __func__, currticks()-stime);
 #endif
-               ret = 0;
+               ret = -ETIMEDOUT;
        } else {
 #ifdef DEBUG_RTL8169_TX
                puts("tx done\n");
 #endif
-               ret = length;
+               ret = 0;
        }
        /* Delay to make net console (nc) work properly */
        udelay(20);