Merge remote-tracking branch 'xen-tip/linux-next'
[deliverable/linux.git] / drivers / net / ethernet / sfc / siena.c
index 2219b5424d2bd3538f07dd9a407ba9372bec1fc7..04ed1b4c7cd98ac424d83e54dda2f4f6aee76af7 100644 (file)
@@ -34,19 +34,24 @@ static void siena_init_wol(struct efx_nic *efx);
 
 static void siena_push_irq_moderation(struct efx_channel *channel)
 {
+       struct efx_nic *efx = channel->efx;
        efx_dword_t timer_cmd;
 
-       if (channel->irq_moderation)
+       if (channel->irq_moderation_us) {
+               unsigned int ticks;
+
+               ticks = efx_usecs_to_ticks(efx, channel->irq_moderation_us);
                EFX_POPULATE_DWORD_2(timer_cmd,
                                     FRF_CZ_TC_TIMER_MODE,
                                     FFE_CZ_TIMER_MODE_INT_HLDOFF,
                                     FRF_CZ_TC_TIMER_VAL,
-                                    channel->irq_moderation - 1);
-       else
+                                    ticks - 1);
+       } else {
                EFX_POPULATE_DWORD_2(timer_cmd,
                                     FRF_CZ_TC_TIMER_MODE,
                                     FFE_CZ_TIMER_MODE_DIS,
                                     FRF_CZ_TC_TIMER_VAL, 0);
+       }
        efx_writed_page_locked(channel->efx, &timer_cmd, FR_BZ_TIMER_COMMAND_P0,
                               channel->channel);
 }
@@ -222,6 +227,9 @@ static int siena_probe_nvconfig(struct efx_nic *efx)
        efx->timer_quantum_ns =
                (caps & (1 << MC_CMD_CAPABILITIES_TURBO_ACTIVE_LBN)) ?
                3072 : 6144; /* 768 cycles */
+       efx->timer_max_ns = efx->type->timer_period_max *
+                           efx->timer_quantum_ns;
+
        return rc;
 }
 
This page took 0.025307 seconds and 5 git commands to generate.