OSDN Git Service

ice: Set physical link up/down when an interface is set up/down
authorBrett Creeley <brett.creeley@intel.com>
Wed, 19 Dec 2018 18:03:25 +0000 (10:03 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 15 Jan 2019 18:27:18 +0000 (10:27 -0800)
commitb6f934f027bbdb53b7e2653b23758e222f3dd65a
treeb7604f22da64538ef337d5cf59ec6dc6b90fed2d
parent4c98ab550cc624eb94b0cdb32f5deb1ebbb4f593
ice: Set physical link up/down when an interface is set up/down

When a netdev is set up/down we need to set the phsyical link state
accordingly. This patch adds that functionality by calling
ice_force_phys_link_state(vsi, link_up) in both the ice_stop() and
ice_open() paths.

In order to force link, ice_force_phys_link_state(vsi, link_up) will
first determine the current phy capabilities. If link has not changed
there is nothing to do. If link has changed, previous PHY capabilities
are saved and the "Enable Automatic Link Update" and "Link Establishment
State Machine (LESM)" enable bits are set. Then the new PHY config is
saved. The "Enable Automatic Link Update" will force the FW to execute
Setup link and restart auto-negotiation. This *should* then result in a
"Link Status Event (LSE)" which will cause the driver to get the current
link status.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
drivers/net/ethernet/intel/ice/ice_main.c