1802 dev->name, i, RTL_R32 (TxStatus0 + (i * 4)), |
1802 dev->name, i, RTL_R32 (TxStatus0 + (i * 4)), |
1803 i == tp->dirty_tx % NUM_TX_DESC ? |
1803 i == tp->dirty_tx % NUM_TX_DESC ? |
1804 " (queue head)" : ""); |
1804 " (queue head)" : ""); |
1805 |
1805 |
1806 tp->xstats.tx_timeouts++; |
1806 tp->xstats.tx_timeouts++; |
1807 |
1807 printk(KERN_DEBUG "%s: tx_timeout\n", dev->name); |
1808 /* EtherCAT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ |
|
1809 |
|
1810 printk(KERN_DEBUG "%s: tx_timeout\n", dev->name); |
|
1811 |
|
1812 if (EtherCAT_dev_is_ec(rtl_ec_dev, dev)) |
|
1813 { |
|
1814 EtherCAT_dev_state(rtl_ec_dev, EC_DEVICE_STATE_TIMEOUT); |
|
1815 } |
|
1816 |
1808 |
1817 /* disable Tx ASAP, if not already */ |
1809 /* disable Tx ASAP, if not already */ |
1818 tmp8 = RTL_R8 (ChipCmd); |
1810 tmp8 = RTL_R8 (ChipCmd); |
1819 if (tmp8 & CmdTxEnb) |
1811 if (tmp8 & CmdTxEnb) |
1820 RTL_W8 (ChipCmd, CmdRxEnb); |
1812 RTL_W8 (ChipCmd, CmdRxEnb); |
|
1813 |
|
1814 /* EtherCAT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ |
|
1815 |
1821 |
1816 |
1822 if (!EtherCAT_dev_is_ec(rtl_ec_dev, dev)) |
1817 if (!EtherCAT_dev_is_ec(rtl_ec_dev, dev)) |
1823 { |
1818 { |
1824 spin_lock(&tp->rx_lock); |
1819 spin_lock(&tp->rx_lock); |
1825 |
1820 |
1949 } |
1944 } |
1950 if (txstatus & TxCarrierLost) |
1945 if (txstatus & TxCarrierLost) |
1951 tp->stats.tx_carrier_errors++; |
1946 tp->stats.tx_carrier_errors++; |
1952 if (txstatus & TxOutOfWindow) |
1947 if (txstatus & TxOutOfWindow) |
1953 tp->stats.tx_window_errors++; |
1948 tp->stats.tx_window_errors++; |
1954 |
|
1955 /* EtherCAT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ |
|
1956 |
|
1957 if (EtherCAT_dev_is_ec(rtl_ec_dev, dev)) |
|
1958 EtherCAT_dev_state(rtl_ec_dev, EC_DEVICE_STATE_ERROR); |
|
1959 |
|
1960 /* EtherCAT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/ |
|
1961 |
|
1962 } else { |
1949 } else { |
1963 if (txstatus & TxUnderrun) { |
1950 if (txstatus & TxUnderrun) { |
1964 /* Add 64 to the Tx FIFO threshold. */ |
1951 /* Add 64 to the Tx FIFO threshold. */ |
1965 if (tp->tx_flag < 0x00300000) |
1952 if (tp->tx_flag < 0x00300000) |
1966 tp->tx_flag += 0x00020000; |
1953 tp->tx_flag += 0x00020000; |
2030 if (rx_status & RxCRCErr) |
2017 if (rx_status & RxCRCErr) |
2031 tp->stats.rx_crc_errors++; |
2018 tp->stats.rx_crc_errors++; |
2032 } else { |
2019 } else { |
2033 tp->xstats.rx_lost_in_ring++; |
2020 tp->xstats.rx_lost_in_ring++; |
2034 } |
2021 } |
2035 |
|
2036 /* EtherCAT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ |
|
2037 |
|
2038 if (EtherCAT_dev_is_ec(rtl_ec_dev, dev)) |
|
2039 { |
|
2040 EtherCAT_dev_state(rtl_ec_dev, EC_DEVICE_STATE_ERROR); |
|
2041 } |
|
2042 |
|
2043 /* EtherCAT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/ |
|
2044 |
2022 |
2045 #ifndef CONFIG_8139_OLD_RX_RESET |
2023 #ifndef CONFIG_8139_OLD_RX_RESET |
2046 tmp8 = RTL_R8 (ChipCmd); |
2024 tmp8 = RTL_R8 (ChipCmd); |
2047 RTL_W8 (ChipCmd, tmp8 & ~CmdRxEnb); |
2025 RTL_W8 (ChipCmd, tmp8 & ~CmdRxEnb); |
2048 RTL_W8 (ChipCmd, tmp8); |
2026 RTL_W8 (ChipCmd, tmp8); |