Lines Matching refs:efx

87 static int ef4_init_lm87(struct ef4_nic *efx, const struct i2c_board_info *info,  in ef4_init_lm87()  argument
90 struct falcon_board *board = falcon_board(efx); in ef4_init_lm87()
116 static void ef4_fini_lm87(struct ef4_nic *efx) in ef4_fini_lm87() argument
118 i2c_unregister_device(falcon_board(efx)->hwmon_client); in ef4_fini_lm87()
121 static int ef4_check_lm87(struct ef4_nic *efx, unsigned mask) in ef4_check_lm87() argument
123 struct i2c_client *client = falcon_board(efx)->hwmon_client; in ef4_check_lm87()
129 if (EF4_WORKAROUND_7884(efx) && efx->link_state.up) in ef4_check_lm87()
161 netif_err(efx, hw, efx->net_dev, in ef4_check_lm87()
179 ef4_init_lm87(struct ef4_nic *efx, const struct i2c_board_info *info, in ef4_init_lm87() argument
184 static inline void ef4_fini_lm87(struct ef4_nic *efx) in ef4_fini_lm87() argument
187 static inline int ef4_check_lm87(struct ef4_nic *efx, unsigned mask) in ef4_check_lm87() argument
255 static void sfe4001_poweroff(struct ef4_nic *efx) in sfe4001_poweroff() argument
257 struct i2c_client *ioexp_client = falcon_board(efx)->ioexp_client; in sfe4001_poweroff()
258 struct i2c_client *hwmon_client = falcon_board(efx)->hwmon_client; in sfe4001_poweroff()
269 static int sfe4001_poweron(struct ef4_nic *efx) in sfe4001_poweron() argument
271 struct i2c_client *ioexp_client = falcon_board(efx)->ioexp_client; in sfe4001_poweron()
272 struct i2c_client *hwmon_client = falcon_board(efx)->hwmon_client; in sfe4001_poweron()
301 netif_info(efx, hw, efx->net_dev, "power-cycling PHY\n"); in sfe4001_poweron()
313 if (efx->phy_mode & PHY_MODE_SPECIAL) in sfe4001_poweron()
327 netif_info(efx, hw, efx->net_dev, in sfe4001_poweron()
333 if (efx->phy_mode & PHY_MODE_SPECIAL) { in sfe4001_poweron()
350 netif_info(efx, hw, efx->net_dev, "timed out waiting for DSP boot\n"); in sfe4001_poweron()
353 sfe4001_poweroff(efx); in sfe4001_poweron()
360 struct ef4_nic *efx = dev_get_drvdata(dev); in show_phy_flash_cfg() local
361 return sprintf(buf, "%d\n", !!(efx->phy_mode & PHY_MODE_SPECIAL)); in show_phy_flash_cfg()
368 struct ef4_nic *efx = dev_get_drvdata(dev); in set_phy_flash_cfg() local
373 old_mode = efx->phy_mode; in set_phy_flash_cfg()
380 } else if (efx->state != STATE_READY || netif_running(efx->net_dev)) { in set_phy_flash_cfg()
385 efx->phy_mode = new_mode; in set_phy_flash_cfg()
387 falcon_stop_nic_stats(efx); in set_phy_flash_cfg()
388 err = sfe4001_poweron(efx); in set_phy_flash_cfg()
390 err = ef4_reconfigure_port(efx); in set_phy_flash_cfg()
392 falcon_start_nic_stats(efx); in set_phy_flash_cfg()
401 static void sfe4001_fini(struct ef4_nic *efx) in sfe4001_fini() argument
403 struct falcon_board *board = falcon_board(efx); in sfe4001_fini()
405 netif_info(efx, drv, efx->net_dev, "%s\n", __func__); in sfe4001_fini()
407 device_remove_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg); in sfe4001_fini()
408 sfe4001_poweroff(efx); in sfe4001_fini()
413 static int sfe4001_check_hw(struct ef4_nic *efx) in sfe4001_check_hw() argument
415 struct falcon_nic_data *nic_data = efx->nic_data; in sfe4001_check_hw()
419 if (EF4_WORKAROUND_7884(efx) && !nic_data->xmac_poll_required) in sfe4001_check_hw()
430 status = i2c_smbus_read_byte_data(falcon_board(efx)->ioexp_client, P1_IN); in sfe4001_check_hw()
436 sfe4001_poweroff(efx); in sfe4001_check_hw()
437 efx->phy_mode = PHY_MODE_OFF; in sfe4001_check_hw()
450 static int sfe4001_init(struct ef4_nic *efx) in sfe4001_init() argument
452 struct falcon_board *board = falcon_board(efx); in sfe4001_init()
477 if (efx->phy_mode & PHY_MODE_SPECIAL) { in sfe4001_init()
480 falcon_stop_nic_stats(efx); in sfe4001_init()
482 rc = sfe4001_poweron(efx); in sfe4001_init()
486 rc = device_create_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg); in sfe4001_init()
490 netif_info(efx, hw, efx->net_dev, "PHY is powered on\n"); in sfe4001_init()
494 sfe4001_poweroff(efx); in sfe4001_init()
537 static void sfe4002_init_phy(struct ef4_nic *efx) in sfe4002_init_phy() argument
541 falcon_qt202x_set_led(efx, SFE4002_TX_LED, in sfe4002_init_phy()
543 falcon_qt202x_set_led(efx, SFE4002_RX_LED, in sfe4002_init_phy()
545 falcon_qt202x_set_led(efx, SFE4002_FAULT_LED, QUAKE_LED_OFF); in sfe4002_init_phy()
548 static void sfe4002_set_id_led(struct ef4_nic *efx, enum ef4_led_mode mode) in sfe4002_set_id_led() argument
551 efx, SFE4002_FAULT_LED, in sfe4002_set_id_led()
555 static int sfe4002_check_hw(struct ef4_nic *efx) in sfe4002_check_hw() argument
557 struct falcon_board *board = falcon_board(efx); in sfe4002_check_hw()
565 return ef4_check_lm87(efx, alarm_mask); in sfe4002_check_hw()
568 static int sfe4002_init(struct ef4_nic *efx) in sfe4002_init() argument
570 return ef4_init_lm87(efx, &sfe4002_hwmon_info, sfe4002_lm87_regs); in sfe4002_init()
599 static void sfn4112f_init_phy(struct ef4_nic *efx) in sfn4112f_init_phy() argument
601 falcon_qt202x_set_led(efx, SFN4112F_ACT_LED, in sfn4112f_init_phy()
603 falcon_qt202x_set_led(efx, SFN4112F_LINK_LED, in sfn4112f_init_phy()
607 static void sfn4112f_set_id_led(struct ef4_nic *efx, enum ef4_led_mode mode) in sfn4112f_set_id_led() argument
623 falcon_qt202x_set_led(efx, SFN4112F_LINK_LED, reg); in sfn4112f_set_id_led()
626 static int sfn4112f_check_hw(struct ef4_nic *efx) in sfn4112f_check_hw() argument
629 return ef4_check_lm87(efx, ~0x48); in sfn4112f_check_hw()
632 static int sfn4112f_init(struct ef4_nic *efx) in sfn4112f_init() argument
634 return ef4_init_lm87(efx, &sfn4112f_hwmon_info, sfn4112f_lm87_regs); in sfn4112f_init()
663 static void sfe4003_set_id_led(struct ef4_nic *efx, enum ef4_led_mode mode) in sfe4003_set_id_led() argument
665 struct falcon_board *board = falcon_board(efx); in sfe4003_set_id_led()
672 efx, SFE4003_RED_LED_GPIO, in sfe4003_set_id_led()
676 static void sfe4003_init_phy(struct ef4_nic *efx) in sfe4003_init_phy() argument
678 struct falcon_board *board = falcon_board(efx); in sfe4003_init_phy()
684 falcon_txc_set_gpio_dir(efx, SFE4003_RED_LED_GPIO, TXC_GPIO_DIR_OUTPUT); in sfe4003_init_phy()
685 falcon_txc_set_gpio_val(efx, SFE4003_RED_LED_GPIO, SFE4003_LED_OFF); in sfe4003_init_phy()
688 static int sfe4003_check_hw(struct ef4_nic *efx) in sfe4003_check_hw() argument
690 struct falcon_board *board = falcon_board(efx); in sfe4003_check_hw()
698 return ef4_check_lm87(efx, alarm_mask); in sfe4003_check_hw()
701 static int sfe4003_init(struct ef4_nic *efx) in sfe4003_init() argument
703 return ef4_init_lm87(efx, &sfe4003_hwmon_info, sfe4003_lm87_regs); in sfe4003_init()
741 int falcon_probe_board(struct ef4_nic *efx, u16 revision_info) in falcon_probe_board() argument
743 struct falcon_board *board = falcon_board(efx); in falcon_probe_board()
757 netif_err(efx, probe, efx->net_dev, "unknown board type %d\n", in falcon_probe_board()