Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171817
b: refs/heads/master
c: 278c062
h: refs/heads/master
i:
  171815: ab80e23
v: v3
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Nov 24, 2009
1 parent cb88124 commit e10dd1b
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 76 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 981fc1b4b8cc6bfe8c6f0c07052e25738d959c68
refs/heads/master: 278c0621fbc4ef52177969edb6f07352da816fdb
25 changes: 6 additions & 19 deletions trunk/drivers/net/sfc/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ static void efx_monitor(struct work_struct *data)
goto out_requeue;
if (!efx->port_enabled)
goto out_unlock;
rc = efx->board_info.monitor(efx);
rc = falcon_board(efx)->monitor(efx);
if (rc) {
EFX_ERR(efx, "Board sensor %s; shutting down PHY\n",
(rc == -ERANGE) ? "reported fault" : "failed");
Expand Down Expand Up @@ -1908,7 +1908,7 @@ static struct efx_phy_operations efx_dummy_phy_operations = {
.clear_interrupt = efx_port_dummy_op_void,
};

static struct efx_board efx_dummy_board_info = {
static struct falcon_board efx_dummy_board_info = {
.init = efx_port_dummy_op_int,
.init_phy = efx_port_dummy_op_void,
.set_id_led = efx_port_dummy_op_set_id_led,
Expand Down Expand Up @@ -2026,10 +2026,6 @@ static void efx_pci_remove_main(struct efx_nic *efx)
falcon_fini_interrupt(efx);
efx_fini_channels(efx);
efx_fini_port(efx);

/* Shutdown the board, then the NIC and board state */
efx->board_info.fini(efx);

efx_fini_napi(efx);
efx_remove_all(efx);
}
Expand Down Expand Up @@ -2089,39 +2085,30 @@ static int efx_pci_probe_main(struct efx_nic *efx)
if (rc)
goto fail2;

/* Initialise the board */
rc = efx->board_info.init(efx);
if (rc) {
EFX_ERR(efx, "failed to initialise board\n");
goto fail3;
}

rc = falcon_init_nic(efx);
if (rc) {
EFX_ERR(efx, "failed to initialise NIC\n");
goto fail4;
goto fail3;
}

rc = efx_init_port(efx);
if (rc) {
EFX_ERR(efx, "failed to initialise port\n");
goto fail5;
goto fail4;
}

efx_init_channels(efx);

rc = falcon_init_interrupt(efx);
if (rc)
goto fail6;
goto fail5;

return 0;

fail6:
fail5:
efx_fini_channels(efx);
efx_fini_port(efx);
fail5:
fail4:
efx->board_info.fini(efx);
fail3:
efx_fini_napi(efx);
fail2:
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/sfc/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,14 @@ static int efx_ethtool_phys_id(struct net_device *net_dev, u32 count)
struct efx_nic *efx = netdev_priv(net_dev);

do {
efx->board_info.set_id_led(efx, EFX_LED_ON);
falcon_board(efx)->set_id_led(efx, EFX_LED_ON);
schedule_timeout_interruptible(HZ / 2);

efx->board_info.set_id_led(efx, EFX_LED_OFF);
falcon_board(efx)->set_id_led(efx, EFX_LED_OFF);
schedule_timeout_interruptible(HZ / 2);
} while (!signal_pending(current) && --count != 0);

efx->board_info.set_id_led(efx, EFX_LED_DEFAULT);
falcon_board(efx)->set_id_led(efx, EFX_LED_DEFAULT);
return 0;
}

Expand Down
11 changes: 11 additions & 0 deletions trunk/drivers/net/sfc/falcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2877,8 +2877,17 @@ int falcon_probe_nic(struct efx_nic *efx)
if (rc)
goto fail5;

rc = falcon_board(efx)->init(efx);
if (rc) {
EFX_ERR(efx, "failed to initialise board\n");
goto fail6;
}

return 0;

fail6:
BUG_ON(i2c_del_adapter(&efx->i2c_adap));
memset(&efx->i2c_adap, 0, sizeof(efx->i2c_adap));
fail5:
falcon_remove_spi_devices(efx);
falcon_free_buffer(efx, &efx->irq_status);
Expand Down Expand Up @@ -3070,6 +3079,8 @@ void falcon_remove_nic(struct efx_nic *efx)
struct falcon_nic_data *nic_data = efx->nic_data;
int rc;

falcon_board(efx)->fini(efx);

/* Remove I2C adapter and clear it in preparation for a retry */
rc = i2c_del_adapter(&efx->i2c_adap);
BUG_ON(rc);
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/net/sfc/falcon.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ static inline int falcon_rev(struct efx_nic *efx)
return efx->pci_dev->revision;
}

static inline struct falcon_board *falcon_board(struct efx_nic *efx)
{
return &efx->board_info;
}

extern struct efx_nic_type falcon_a_nic_type;
extern struct efx_nic_type falcon_b_nic_type;

Expand Down
Loading

0 comments on commit e10dd1b

Please sign in to comment.