Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit abf76d76 authored by Emil Tantilov's avatar Emil Tantilov Committed by Jeff Kirsher
Browse files

ixgbe: fix setup_fc for x550em



mac->ops.setup_fc can be null for backplanes which can cause the driver
to crash on load.

Reported-by: default avatarPatrick McLean <patrickm@gaikai.com>
Signed-off-by: default avatarEmil Tantilov <emil.s.tantilov@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 1d94f987
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1618,6 +1618,8 @@ static void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw)
{
{
	struct ixgbe_mac_info *mac = &hw->mac;
	struct ixgbe_mac_info *mac = &hw->mac;


	mac->ops.setup_fc = ixgbe_setup_fc_x550em;

	switch (mac->ops.get_media_type(hw)) {
	switch (mac->ops.get_media_type(hw)) {
	case ixgbe_media_type_fiber:
	case ixgbe_media_type_fiber:
		/* CS4227 does not support autoneg, so disable the laser control
		/* CS4227 does not support autoneg, so disable the laser control
@@ -1627,7 +1629,6 @@ static void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw)
		mac->ops.enable_tx_laser = NULL;
		mac->ops.enable_tx_laser = NULL;
		mac->ops.flap_tx_laser = NULL;
		mac->ops.flap_tx_laser = NULL;
		mac->ops.setup_link = ixgbe_setup_mac_link_multispeed_fiber;
		mac->ops.setup_link = ixgbe_setup_mac_link_multispeed_fiber;
		mac->ops.setup_fc = ixgbe_setup_fc_x550em;
		switch (hw->device_id) {
		switch (hw->device_id) {
		case IXGBE_DEV_ID_X550EM_A_SFP_N:
		case IXGBE_DEV_ID_X550EM_A_SFP_N:
			mac->ops.setup_mac_link = ixgbe_setup_mac_link_sfp_n;
			mac->ops.setup_mac_link = ixgbe_setup_mac_link_sfp_n;
@@ -1655,7 +1656,6 @@ static void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw)
			mac->ops.setup_link = ixgbe_setup_sgmii;
			mac->ops.setup_link = ixgbe_setup_sgmii;
		break;
		break;
	default:
	default:
		mac->ops.setup_fc = ixgbe_setup_fc_x550em;
		break;
		break;
	}
	}
}
}