aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/efx.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-11-23 11:05:12 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-24 13:58:42 -0500
commit278c0621fbc4ef52177969edb6f07352da816fdb (patch)
tree1af11fc3f69948a0687df279255c754f5671bd99 /drivers/net/sfc/efx.c
parent981fc1b4b8cc6bfe8c6f0c07052e25738d959c68 (diff)
sfc: Make board information explicitly Falcon-specific
Rename struct efx_board to struct falcon_board. Introduce and use inline function to look up board info from struct efx_nic, in preparation for moving it. Move board init and fini calls into NIC probe and remove functions. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/efx.c')
-rw-r--r--drivers/net/sfc/efx.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index d7705a75516..c9f80042669 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1265,7 +1265,7 @@ static void efx_monitor(struct work_struct *data)
1265 goto out_requeue; 1265 goto out_requeue;
1266 if (!efx->port_enabled) 1266 if (!efx->port_enabled)
1267 goto out_unlock; 1267 goto out_unlock;
1268 rc = efx->board_info.monitor(efx); 1268 rc = falcon_board(efx)->monitor(efx);
1269 if (rc) { 1269 if (rc) {
1270 EFX_ERR(efx, "Board sensor %s; shutting down PHY\n", 1270 EFX_ERR(efx, "Board sensor %s; shutting down PHY\n",
1271 (rc == -ERANGE) ? "reported fault" : "failed"); 1271 (rc == -ERANGE) ? "reported fault" : "failed");
@@ -1908,7 +1908,7 @@ static struct efx_phy_operations efx_dummy_phy_operations = {
1908 .clear_interrupt = efx_port_dummy_op_void, 1908 .clear_interrupt = efx_port_dummy_op_void,
1909}; 1909};
1910 1910
1911static struct efx_board efx_dummy_board_info = { 1911static struct falcon_board efx_dummy_board_info = {
1912 .init = efx_port_dummy_op_int, 1912 .init = efx_port_dummy_op_int,
1913 .init_phy = efx_port_dummy_op_void, 1913 .init_phy = efx_port_dummy_op_void,
1914 .set_id_led = efx_port_dummy_op_set_id_led, 1914 .set_id_led = efx_port_dummy_op_set_id_led,
@@ -2026,10 +2026,6 @@ static void efx_pci_remove_main(struct efx_nic *efx)
2026 falcon_fini_interrupt(efx); 2026 falcon_fini_interrupt(efx);
2027 efx_fini_channels(efx); 2027 efx_fini_channels(efx);
2028 efx_fini_port(efx); 2028 efx_fini_port(efx);
2029
2030 /* Shutdown the board, then the NIC and board state */
2031 efx->board_info.fini(efx);
2032
2033 efx_fini_napi(efx); 2029 efx_fini_napi(efx);
2034 efx_remove_all(efx); 2030 efx_remove_all(efx);
2035} 2031}
@@ -2089,39 +2085,30 @@ static int efx_pci_probe_main(struct efx_nic *efx)
2089 if (rc) 2085 if (rc)
2090 goto fail2; 2086 goto fail2;
2091 2087
2092 /* Initialise the board */
2093 rc = efx->board_info.init(efx);
2094 if (rc) {
2095 EFX_ERR(efx, "failed to initialise board\n");
2096 goto fail3;
2097 }
2098
2099 rc = falcon_init_nic(efx); 2088 rc = falcon_init_nic(efx);
2100 if (rc) { 2089 if (rc) {
2101 EFX_ERR(efx, "failed to initialise NIC\n"); 2090 EFX_ERR(efx, "failed to initialise NIC\n");
2102 goto fail4; 2091 goto fail3;
2103 } 2092 }
2104 2093
2105 rc = efx_init_port(efx); 2094 rc = efx_init_port(efx);
2106 if (rc) { 2095 if (rc) {
2107 EFX_ERR(efx, "failed to initialise port\n"); 2096 EFX_ERR(efx, "failed to initialise port\n");
2108 goto fail5; 2097 goto fail4;
2109 } 2098 }
2110 2099
2111 efx_init_channels(efx); 2100 efx_init_channels(efx);
2112 2101
2113 rc = falcon_init_interrupt(efx); 2102 rc = falcon_init_interrupt(efx);
2114 if (rc) 2103 if (rc)
2115 goto fail6; 2104 goto fail5;
2116 2105
2117 return 0; 2106 return 0;
2118 2107
2119 fail6: 2108 fail5:
2120 efx_fini_channels(efx); 2109 efx_fini_channels(efx);
2121 efx_fini_port(efx); 2110 efx_fini_port(efx);
2122 fail5:
2123 fail4: 2111 fail4:
2124 efx->board_info.fini(efx);
2125 fail3: 2112 fail3:
2126 efx_fini_napi(efx); 2113 efx_fini_napi(efx);
2127 fail2: 2114 fail2: