igb: fix hw timestamping
[linux-2.6-block.git] / drivers / net / igb / igb_ethtool.c
index 61f7849cb5a70b1223ec7c88c5aa80e02fcf56fe..d976733bbcc2de9cbf527fe56c421c18f22172c6 100644 (file)
@@ -86,6 +86,10 @@ static const struct igb_stats igb_gstrings_stats[] = {
        IGB_STAT("tx_smbus", stats.mgptc),
        IGB_STAT("rx_smbus", stats.mgprc),
        IGB_STAT("dropped_smbus", stats.mgpdc),
+       IGB_STAT("os2bmc_rx_by_bmc", stats.o2bgptc),
+       IGB_STAT("os2bmc_tx_by_bmc", stats.b2ospc),
+       IGB_STAT("os2bmc_tx_by_host", stats.o2bspc),
+       IGB_STAT("os2bmc_rx_by_host", stats.b2ogprc),
 };
 
 #define IGB_NETDEV_STAT(_net_stat) { \
@@ -603,7 +607,10 @@ static void igb_get_regs(struct net_device *netdev,
        regs_buff[548] = rd32(E1000_TDFT);
        regs_buff[549] = rd32(E1000_TDFHS);
        regs_buff[550] = rd32(E1000_TDFPC);
-
+       regs_buff[551] = adapter->stats.o2bgptc;
+       regs_buff[552] = adapter->stats.b2ospc;
+       regs_buff[553] = adapter->stats.o2bspc;
+       regs_buff[554] = adapter->stats.b2ogprc;
 }
 
 static int igb_get_eeprom_len(struct net_device *netdev)
@@ -714,7 +721,7 @@ static int igb_set_eeprom(struct net_device *netdev,
        /* Update the checksum over the first part of the EEPROM if needed
         * and flush shadow RAM for 82573 controllers */
        if ((ret_val == 0) && ((first_word <= NVM_CHECKSUM_REG)))
-               igb_update_nvm_checksum(hw);
+               hw->nvm.ops.update(hw);
 
        kfree(eeprom_buff);
        return ret_val;
@@ -2002,6 +2009,12 @@ static int igb_set_coalesce(struct net_device *netdev,
        if ((adapter->flags & IGB_FLAG_QUEUE_PAIRS) && ec->tx_coalesce_usecs)
                return -EINVAL;
 
+       /* If ITR is disabled, disable DMAC */
+       if (ec->rx_coalesce_usecs == 0) {
+               if (adapter->flags & IGB_FLAG_DMAC)
+                       adapter->flags &= ~IGB_FLAG_DMAC;
+       }
+
        /* convert to rate of irq's per second */
        if (ec->rx_coalesce_usecs && ec->rx_coalesce_usecs <= 3)
                adapter->rx_itr_setting = ec->rx_coalesce_usecs;