e1000: omit stats for broken counter in 82543
authorJeff Garzik <jeff@garzik.org>
Fri, 15 Dec 2006 15:41:15 +0000 (10:41 -0500)
committerJeff Garzik <jeff@garzik.org>
Tue, 26 Dec 2006 20:51:28 +0000 (15:51 -0500)
The 82543 chip does not count tx_carrier_errors properly in FD mode;
report zeros instead of garbage.

Originally from Jesse Brandeburg <jesse.brandeburg@intel.com>, rewritten
to use feature flags by me.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/e1000/e1000_hw.c
drivers/net/e1000/e1000_hw.h
drivers/net/e1000/e1000_main.c

index 0201ca548cd164ccccc14f358f14509050373ef5..ce82eb52ea9562c11616a4fa7f68ed0e7892e911 100644 (file)
@@ -442,6 +442,12 @@ e1000_set_mac_type(struct e1000_hw *hw)
                break;
        }
 
+       /* The 82543 chip does not count tx_carrier_errors properly in
+        * FD mode
+        */
+       if (hw->mac_type == e1000_82543)
+               hw->bad_tx_carr_stats_fd = TRUE;
+
        return E1000_SUCCESS;
 }
 
index 28cdfe39e39a063a4f0bf219c0b40288778f0e50..fef1f7b4845b78bc350032db444f747a8af44e35 100644 (file)
@@ -1460,6 +1460,7 @@ struct e1000_hw {
        boolean_t               mng_reg_access_disabled;
        boolean_t               leave_av_bit_off;
        boolean_t               kmrn_lock_loss_workaround_disabled;
+       boolean_t               bad_tx_carr_stats_fd;
 };
 
 
index 62ef267b3d64786be1040bfb354abbaddf3b2b0a..0816de267610a58fa9250bb595ddc6865b8ea7de 100644 (file)
@@ -3581,6 +3581,11 @@ e1000_update_stats(struct e1000_adapter *adapter)
        adapter->net_stats.tx_aborted_errors = adapter->stats.ecol;
        adapter->net_stats.tx_window_errors = adapter->stats.latecol;
        adapter->net_stats.tx_carrier_errors = adapter->stats.tncrs;
+       if (adapter->hw.bad_tx_carr_stats_fd &&
+           adapter->link_duplex == FULL_DUPLEX) {
+               adapter->net_stats.tx_carrier_errors = 0;
+               adapter->stats.tncrs = 0;
+       }
 
        /* Tx Dropped needs to be maintained elsewhere */