Skip to contentSkip to conversation

sfc: Rename efx_board::init_leds to init_phy and use for SFN4111T

PATCH In review Ben Hutchings 1 participant 1 message Nov 24, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 8/17 sfc: Rename efx_board::init_leds to init_phy and use for SFN4111T

efx_board::init_leds was introduced as a second stage of initialisation because of the inter-dependency between the board and PHY. We want to move board initialisation into NIC probing, which is too early to use MDIO, so SFN4111T initialisation also needs to be split.

---
 drivers/net/sfc/efx.c           |    2 +-
 drivers/net/sfc/falcon_boards.c |   43 ++++++++++++++++++++++----------------
 drivers/net/sfc/net_driver.h    |   11 +++------
 drivers/net/sfc/qt202x_phy.c    |    2 +-
 drivers/net/sfc/tenxpress.c     |    2 +
 5 files changed, 33 insertions(+), 27 deletions(-)
drivers/net/sfc/efx.c +1 -1
index 612cd81..d7705a7 100644
@@ -1910,7 +1910,7 @@ static struct efx_phy_operations efx_dummy_phy_operations = {
 
 static struct efx_board efx_dummy_board_info = {
 	.init		= efx_port_dummy_op_int,
-	.init_leds	= efx_port_dummy_op_void,
+	.init_phy	= efx_port_dummy_op_void,
 	.set_id_led	= efx_port_dummy_op_set_id_led,
 	.monitor	= efx_port_dummy_op_int,
 	.fini		= efx_port_dummy_op_void,
drivers/net/sfc/falcon_boards.c +25 -18

88 lines not on this page · raw message

drivers/net/sfc/net_driver.h +4 -7
index 6b05d69..e1df589 100644
@@ -399,11 +399,11 @@ enum efx_led_mode {
  * @type: Board model type
  * @major: Major rev. ('A', 'B' ...)
  * @minor: Minor rev. (0, 1, ...)
- * @init: Initialisation function
- * @init_leds: Sets up board LEDs. May be called repeatedly.
+ * @init: Allocate resources and initialise peripheral hardware
+ * @init_phy: Do board-specific PHY initialisation
  * @set_id_led: Set state of identifying LED or revert to automatic function
  * @monitor: Board-specific health check function
- * @fini: Cleanup function
+ * @fini: Shut down hardware and free resources
  * @hwmon_client: I2C client for hardware monitor
  * @ioexp_client: I2C client for power/port control
  */
@@ -412,10 +412,7 @@ struct efx_board {
 	int major;
 	int minor;
 	int (*init) (struct efx_nic *nic);
-	/* As the LEDs are typically attached to the PHY, LEDs
-	 * have a separate init callback that happens later than
-	 * board init. */
-	void (*init_leds)(struct efx_nic *efx);
+	void (*init_phy) (struct efx_nic *efx);
 	void (*set_id_led) (struct efx_nic *efx, enum efx_led_mode mode);
 	int (*monitor) (struct efx_nic *nic);
 	void (*fini) (struct efx_nic *nic);
drivers/net/sfc/qt202x_phy.c +1 -1
index 05c0f9a..f26684f 100644
@@ -126,7 +126,7 @@ static int qt202x_reset_phy(struct efx_nic *efx)
 	if (rc < 0)
 		goto fail;
 
-	efx->board_info.init_leds(efx);
+	efx->board_info.init_phy(efx);
 
 	return rc;
 
drivers/net/sfc/tenxpress.c +2 -0
index 6a8e3ea..2923e3d 100644
@@ -303,6 +303,8 @@ static int tenxpress_phy_init(struct efx_nic *efx)
 	u16 old_adv, adv;
 	int rc = 0;
 
+	efx->board_info.init_phy(efx);
+
 	phy_data = kzalloc(sizeof(*phy_data), GFP_KERNEL);
 	if (!phy_data)
 		return -ENOMEM;
Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.