diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-10-23 04:32:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-24 07:27:14 -0400 |
commit | 0484e0db7c4293d6202cff730ee359d8a7a6b085 (patch) | |
tree | d9eb02ef14b821323dc2548e303a8360aaf7357d /drivers/net/sfc/falcon.c | |
parent | 59cf09cc2fdbb651193e95d7c3335e751b8f748d (diff) |
sfc: Move shared members of struct falcon_nic_data into struct efx_nic
These will also be used with Siena NICs.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/falcon.c')
-rw-r--r-- | drivers/net/sfc/falcon.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 34b475e9b29d..1582df7aba7b 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -35,19 +35,12 @@ | |||
35 | 35 | ||
36 | /** | 36 | /** |
37 | * struct falcon_nic_data - Falcon NIC state | 37 | * struct falcon_nic_data - Falcon NIC state |
38 | * @next_buffer_table: First available buffer table id | ||
39 | * @pci_dev2: The secondary PCI device if present | 38 | * @pci_dev2: The secondary PCI device if present |
40 | * @i2c_data: Operations and state for I2C bit-bashing algorithm | 39 | * @i2c_data: Operations and state for I2C bit-bashing algorithm |
41 | * @int_error_count: Number of internal errors seen recently | ||
42 | * @int_error_expire: Time at which error count will be expired | ||
43 | */ | 40 | */ |
44 | struct falcon_nic_data { | 41 | struct falcon_nic_data { |
45 | unsigned next_buffer_table; | ||
46 | struct pci_dev *pci_dev2; | 42 | struct pci_dev *pci_dev2; |
47 | struct i2c_algo_bit_data i2c_data; | 43 | struct i2c_algo_bit_data i2c_data; |
48 | |||
49 | unsigned int_error_count; | ||
50 | unsigned long int_error_expire; | ||
51 | }; | 44 | }; |
52 | 45 | ||
53 | /************************************************************************** | 46 | /************************************************************************** |
@@ -304,8 +297,6 @@ static int falcon_alloc_special_buffer(struct efx_nic *efx, | |||
304 | struct efx_special_buffer *buffer, | 297 | struct efx_special_buffer *buffer, |
305 | unsigned int len) | 298 | unsigned int len) |
306 | { | 299 | { |
307 | struct falcon_nic_data *nic_data = efx->nic_data; | ||
308 | |||
309 | len = ALIGN(len, FALCON_BUF_SIZE); | 300 | len = ALIGN(len, FALCON_BUF_SIZE); |
310 | 301 | ||
311 | buffer->addr = pci_alloc_consistent(efx->pci_dev, len, | 302 | buffer->addr = pci_alloc_consistent(efx->pci_dev, len, |
@@ -320,8 +311,8 @@ static int falcon_alloc_special_buffer(struct efx_nic *efx, | |||
320 | memset(buffer->addr, 0xff, len); | 311 | memset(buffer->addr, 0xff, len); |
321 | 312 | ||
322 | /* Select new buffer ID */ | 313 | /* Select new buffer ID */ |
323 | buffer->index = nic_data->next_buffer_table; | 314 | buffer->index = efx->next_buffer_table; |
324 | nic_data->next_buffer_table += buffer->entries; | 315 | efx->next_buffer_table += buffer->entries; |
325 | 316 | ||
326 | EFX_LOG(efx, "allocating special buffers %d-%d at %llx+%x " | 317 | EFX_LOG(efx, "allocating special buffers %d-%d at %llx+%x " |
327 | "(virt %p phys %llx)\n", buffer->index, | 318 | "(virt %p phys %llx)\n", buffer->index, |
@@ -1411,13 +1402,13 @@ static irqreturn_t falcon_fatal_interrupt(struct efx_nic *efx) | |||
1411 | falcon_disable_interrupts(efx); | 1402 | falcon_disable_interrupts(efx); |
1412 | 1403 | ||
1413 | /* Count errors and reset or disable the NIC accordingly */ | 1404 | /* Count errors and reset or disable the NIC accordingly */ |
1414 | if (nic_data->int_error_count == 0 || | 1405 | if (efx->int_error_count == 0 || |
1415 | time_after(jiffies, nic_data->int_error_expire)) { | 1406 | time_after(jiffies, efx->int_error_expire)) { |
1416 | nic_data->int_error_count = 0; | 1407 | efx->int_error_count = 0; |
1417 | nic_data->int_error_expire = | 1408 | efx->int_error_expire = |
1418 | jiffies + FALCON_INT_ERROR_EXPIRE * HZ; | 1409 | jiffies + FALCON_INT_ERROR_EXPIRE * HZ; |
1419 | } | 1410 | } |
1420 | if (++nic_data->int_error_count < FALCON_MAX_INT_ERRORS) { | 1411 | if (++efx->int_error_count < FALCON_MAX_INT_ERRORS) { |
1421 | EFX_ERR(efx, "SYSTEM ERROR - reset scheduled\n"); | 1412 | EFX_ERR(efx, "SYSTEM ERROR - reset scheduled\n"); |
1422 | efx_schedule_reset(efx, RESET_TYPE_INT_ERROR); | 1413 | efx_schedule_reset(efx, RESET_TYPE_INT_ERROR); |
1423 | } else { | 1414 | } else { |