diff options
author | Catherine Sullivan <catherine.sullivan@intel.com> | 2014-06-04 04:45:24 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-07-02 22:02:21 -0400 |
commit | 8109e1232b3e5322415a9b5e09951617c5fae277 (patch) | |
tree | f711c80bc7dfd874e2ace16fda80178435db7ac6 | |
parent | 4e91bcd5d47a92aa52a0520cb2b0c6f93c80dd6b (diff) |
i40e/i40evf: Add new HW link info variable an_enabled and function update_link_info
Add a new variable, hw.phy.link_info.an_enabled, to track whether autoneg is
enabled. Also add a new function update_link_info that will update that
variable as well as calling get_link_info to update the rest of the link info.
Also add get_phy_capabilities to support this.
Change-ID: I5157ef03492b6dd8ec5e608ba0cf9b0db9c01710
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_common.c | 75 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_prototype.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_type.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40e_type.h | 1 |
5 files changed, 80 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c index 9d09ab31ec89..debca01e684f 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c | |||
@@ -1037,6 +1037,52 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink) | |||
1037 | /* Admin command wrappers */ | 1037 | /* Admin command wrappers */ |
1038 | 1038 | ||
1039 | /** | 1039 | /** |
1040 | * i40e_aq_get_phy_capabilities | ||
1041 | * @hw: pointer to the hw struct | ||
1042 | * @abilities: structure for PHY capabilities to be filled | ||
1043 | * @qualified_modules: report Qualified Modules | ||
1044 | * @report_init: report init capabilities (active are default) | ||
1045 | * @cmd_details: pointer to command details structure or NULL | ||
1046 | * | ||
1047 | * Returns the various PHY abilities supported on the Port. | ||
1048 | **/ | ||
1049 | i40e_status i40e_aq_get_phy_capabilities(struct i40e_hw *hw, | ||
1050 | bool qualified_modules, bool report_init, | ||
1051 | struct i40e_aq_get_phy_abilities_resp *abilities, | ||
1052 | struct i40e_asq_cmd_details *cmd_details) | ||
1053 | { | ||
1054 | struct i40e_aq_desc desc; | ||
1055 | i40e_status status; | ||
1056 | u16 abilities_size = sizeof(struct i40e_aq_get_phy_abilities_resp); | ||
1057 | |||
1058 | if (!abilities) | ||
1059 | return I40E_ERR_PARAM; | ||
1060 | |||
1061 | i40e_fill_default_direct_cmd_desc(&desc, | ||
1062 | i40e_aqc_opc_get_phy_abilities); | ||
1063 | |||
1064 | desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_BUF); | ||
1065 | if (abilities_size > I40E_AQ_LARGE_BUF) | ||
1066 | desc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_LB); | ||
1067 | |||
1068 | if (qualified_modules) | ||
1069 | desc.params.external.param0 |= | ||
1070 | cpu_to_le32(I40E_AQ_PHY_REPORT_QUALIFIED_MODULES); | ||
1071 | |||
1072 | if (report_init) | ||
1073 | desc.params.external.param0 |= | ||
1074 | cpu_to_le32(I40E_AQ_PHY_REPORT_INITIAL_VALUES); | ||
1075 | |||
1076 | status = i40e_asq_send_command(hw, &desc, abilities, abilities_size, | ||
1077 | cmd_details); | ||
1078 | |||
1079 | if (hw->aq.asq_last_status == I40E_AQ_RC_EIO) | ||
1080 | status = I40E_ERR_UNKNOWN_PHY; | ||
1081 | |||
1082 | return status; | ||
1083 | } | ||
1084 | |||
1085 | /** | ||
1040 | * i40e_aq_clear_pxe_mode | 1086 | * i40e_aq_clear_pxe_mode |
1041 | * @hw: pointer to the hw struct | 1087 | * @hw: pointer to the hw struct |
1042 | * @cmd_details: pointer to command details structure or NULL | 1088 | * @cmd_details: pointer to command details structure or NULL |
@@ -1163,6 +1209,35 @@ aq_get_link_info_exit: | |||
1163 | } | 1209 | } |
1164 | 1210 | ||
1165 | /** | 1211 | /** |
1212 | * i40e_update_link_info | ||
1213 | * @hw: pointer to the hw struct | ||
1214 | * @enable_lse: enable/disable LinkStatusEvent reporting | ||
1215 | * | ||
1216 | * Returns the link status of the adapter | ||
1217 | **/ | ||
1218 | i40e_status i40e_update_link_info(struct i40e_hw *hw, bool enable_lse) | ||
1219 | { | ||
1220 | struct i40e_aq_get_phy_abilities_resp abilities; | ||
1221 | i40e_status status; | ||
1222 | |||
1223 | status = i40e_aq_get_link_info(hw, enable_lse, NULL, NULL); | ||
1224 | if (status) | ||
1225 | return status; | ||
1226 | |||
1227 | status = i40e_aq_get_phy_capabilities(hw, false, false, | ||
1228 | &abilities, NULL); | ||
1229 | if (status) | ||
1230 | return status; | ||
1231 | |||
1232 | if (abilities.abilities & I40E_AQ_PHY_AN_ENABLED) | ||
1233 | hw->phy.link_info.an_enabled = true; | ||
1234 | else | ||
1235 | hw->phy.link_info.an_enabled = false; | ||
1236 | |||
1237 | return status; | ||
1238 | } | ||
1239 | |||
1240 | /** | ||
1166 | * i40e_aq_add_vsi | 1241 | * i40e_aq_add_vsi |
1167 | * @hw: pointer to the hw struct | 1242 | * @hw: pointer to the hw struct |
1168 | * @vsi_ctx: pointer to a vsi context struct | 1243 | * @vsi_ctx: pointer to a vsi context struct |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index ac90d5f40652..71eff1676778 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -5292,7 +5292,7 @@ static void i40e_handle_link_event(struct i40e_pf *pf, | |||
5292 | * then see if the status changed while processing the | 5292 | * then see if the status changed while processing the |
5293 | * initial event. | 5293 | * initial event. |
5294 | */ | 5294 | */ |
5295 | i40e_aq_get_link_info(&pf->hw, true, NULL, NULL); | 5295 | i40e_update_link_info(&pf->hw, true); |
5296 | i40e_link_event(pf); | 5296 | i40e_link_event(pf); |
5297 | } | 5297 | } |
5298 | 5298 | ||
@@ -8337,7 +8337,7 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit) | |||
8337 | i40e_config_rss(pf); | 8337 | i40e_config_rss(pf); |
8338 | 8338 | ||
8339 | /* fill in link information and enable LSE reporting */ | 8339 | /* fill in link information and enable LSE reporting */ |
8340 | i40e_aq_get_link_info(&pf->hw, true, NULL, NULL); | 8340 | i40e_update_link_info(&pf->hw, true); |
8341 | i40e_link_event(pf); | 8341 | i40e_link_event(pf); |
8342 | 8342 | ||
8343 | /* Initialize user-specific link properties */ | 8343 | /* Initialize user-specific link properties */ |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h index 77c515d026be..679087867bd2 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h +++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h | |||
@@ -82,6 +82,7 @@ i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw, | |||
82 | i40e_status i40e_aq_get_link_info(struct i40e_hw *hw, | 82 | i40e_status i40e_aq_get_link_info(struct i40e_hw *hw, |
83 | bool enable_lse, struct i40e_link_status *link, | 83 | bool enable_lse, struct i40e_link_status *link, |
84 | struct i40e_asq_cmd_details *cmd_details); | 84 | struct i40e_asq_cmd_details *cmd_details); |
85 | i40e_status i40e_update_link_info(struct i40e_hw *hw, bool enable_lse); | ||
85 | i40e_status i40e_aq_set_local_advt_reg(struct i40e_hw *hw, | 86 | i40e_status i40e_aq_set_local_advt_reg(struct i40e_hw *hw, |
86 | u64 advt_reg, | 87 | u64 advt_reg, |
87 | struct i40e_asq_cmd_details *cmd_details); | 88 | struct i40e_asq_cmd_details *cmd_details); |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h index 11dd2dcfb592..f1c58ab8f60d 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_type.h +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h | |||
@@ -166,6 +166,7 @@ struct i40e_link_status { | |||
166 | u8 an_info; | 166 | u8 an_info; |
167 | u8 ext_info; | 167 | u8 ext_info; |
168 | u8 loopback; | 168 | u8 loopback; |
169 | bool an_enabled; | ||
169 | /* is Link Status Event notification to SW enabled */ | 170 | /* is Link Status Event notification to SW enabled */ |
170 | bool lse_enable; | 171 | bool lse_enable; |
171 | u16 max_frame_size; | 172 | u16 max_frame_size; |
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h index 23cd18b66b71..5b6e955cfc66 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_type.h +++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h | |||
@@ -166,6 +166,7 @@ struct i40e_link_status { | |||
166 | u8 an_info; | 166 | u8 an_info; |
167 | u8 ext_info; | 167 | u8 ext_info; |
168 | u8 loopback; | 168 | u8 loopback; |
169 | bool an_enabled; | ||
169 | /* is Link Status Event notification to SW enabled */ | 170 | /* is Link Status Event notification to SW enabled */ |
170 | bool lse_enable; | 171 | bool lse_enable; |
171 | u16 max_frame_size; | 172 | u16 max_frame_size; |