提交 7d41f85c 编写于 作者: A Anirudh Venkataramanan 提交者: Zheng Zengkai

ice: Align macro names to the specification

stable inclusion
from stable-v5.10.106
commit 875967aff5a654e78539339899c54a76c212ef5d
bugzilla: https://gitee.com/openeuler/kernel/issues/I573US

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=875967aff5a654e78539339899c54a76c212ef5d

--------------------------------

[ Upstream commit d6730a87 ]

For get PHY abilities AQ, the specification defines "report modes"
as "with media", "without media" and "active configuration". For
clarity, rename macros to align with the specification.
Signed-off-by: NAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 6f8ee996
...@@ -870,11 +870,11 @@ struct ice_aqc_get_phy_caps { ...@@ -870,11 +870,11 @@ struct ice_aqc_get_phy_caps {
* 01b - Report topology capabilities * 01b - Report topology capabilities
* 10b - Report SW configured * 10b - Report SW configured
*/ */
#define ICE_AQC_REPORT_MODE_S 1 #define ICE_AQC_REPORT_MODE_S 1
#define ICE_AQC_REPORT_MODE_M (3 << ICE_AQC_REPORT_MODE_S) #define ICE_AQC_REPORT_MODE_M (3 << ICE_AQC_REPORT_MODE_S)
#define ICE_AQC_REPORT_NVM_CAP 0 #define ICE_AQC_REPORT_TOPO_CAP_NO_MEDIA 0
#define ICE_AQC_REPORT_TOPO_CAP BIT(1) #define ICE_AQC_REPORT_TOPO_CAP_MEDIA BIT(1)
#define ICE_AQC_REPORT_SW_CFG BIT(2) #define ICE_AQC_REPORT_ACTIVE_CFG BIT(2)
__le32 reserved1; __le32 reserved1;
__le32 addr_high; __le32 addr_high;
__le32 addr_low; __le32 addr_low;
......
...@@ -193,7 +193,7 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, ...@@ -193,7 +193,7 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode,
ice_debug(hw, ICE_DBG_LINK, " module_type[2] = 0x%x\n", ice_debug(hw, ICE_DBG_LINK, " module_type[2] = 0x%x\n",
pcaps->module_type[2]); pcaps->module_type[2]);
if (!status && report_mode == ICE_AQC_REPORT_TOPO_CAP) { if (!status && report_mode == ICE_AQC_REPORT_TOPO_CAP_MEDIA) {
pi->phy.phy_type_low = le64_to_cpu(pcaps->phy_type_low); pi->phy.phy_type_low = le64_to_cpu(pcaps->phy_type_low);
pi->phy.phy_type_high = le64_to_cpu(pcaps->phy_type_high); pi->phy.phy_type_high = le64_to_cpu(pcaps->phy_type_high);
memcpy(pi->phy.link_info.module_type, &pcaps->module_type, memcpy(pi->phy.link_info.module_type, &pcaps->module_type,
...@@ -924,7 +924,8 @@ enum ice_status ice_init_hw(struct ice_hw *hw) ...@@ -924,7 +924,8 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
/* Initialize port_info struct with PHY capabilities */ /* Initialize port_info struct with PHY capabilities */
status = ice_aq_get_phy_caps(hw->port_info, false, status = ice_aq_get_phy_caps(hw->port_info, false,
ICE_AQC_REPORT_TOPO_CAP, pcaps, NULL); ICE_AQC_REPORT_TOPO_CAP_MEDIA, pcaps,
NULL);
devm_kfree(ice_hw_to_dev(hw), pcaps); devm_kfree(ice_hw_to_dev(hw), pcaps);
if (status) if (status)
goto err_unroll_sched; goto err_unroll_sched;
...@@ -2682,7 +2683,7 @@ enum ice_status ice_update_link_info(struct ice_port_info *pi) ...@@ -2682,7 +2683,7 @@ enum ice_status ice_update_link_info(struct ice_port_info *pi)
if (!pcaps) if (!pcaps)
return ICE_ERR_NO_MEMORY; return ICE_ERR_NO_MEMORY;
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP, status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP_MEDIA,
pcaps, NULL); pcaps, NULL);
devm_kfree(ice_hw_to_dev(hw), pcaps); devm_kfree(ice_hw_to_dev(hw), pcaps);
...@@ -2842,8 +2843,8 @@ ice_set_fc(struct ice_port_info *pi, u8 *aq_failures, bool ena_auto_link_update) ...@@ -2842,8 +2843,8 @@ ice_set_fc(struct ice_port_info *pi, u8 *aq_failures, bool ena_auto_link_update)
return ICE_ERR_NO_MEMORY; return ICE_ERR_NO_MEMORY;
/* Get the current PHY config */ /* Get the current PHY config */
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_SW_CFG, pcaps, status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_ACTIVE_CFG,
NULL); pcaps, NULL);
if (status) { if (status) {
*aq_failures = ICE_SET_FC_AQ_FAIL_GET; *aq_failures = ICE_SET_FC_AQ_FAIL_GET;
goto out; goto out;
...@@ -2989,7 +2990,7 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg, ...@@ -2989,7 +2990,7 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg,
if (!pcaps) if (!pcaps)
return ICE_ERR_NO_MEMORY; return ICE_ERR_NO_MEMORY;
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP, pcaps, status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP_MEDIA, pcaps,
NULL); NULL);
if (status) if (status)
goto out; goto out;
......
...@@ -1081,7 +1081,7 @@ ice_get_fecparam(struct net_device *netdev, struct ethtool_fecparam *fecparam) ...@@ -1081,7 +1081,7 @@ ice_get_fecparam(struct net_device *netdev, struct ethtool_fecparam *fecparam)
if (!caps) if (!caps)
return -ENOMEM; return -ENOMEM;
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP, status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP_MEDIA,
caps, NULL); caps, NULL);
if (status) { if (status) {
err = -EAGAIN; err = -EAGAIN;
...@@ -1976,7 +1976,7 @@ ice_get_link_ksettings(struct net_device *netdev, ...@@ -1976,7 +1976,7 @@ ice_get_link_ksettings(struct net_device *netdev,
return -ENOMEM; return -ENOMEM;
status = ice_aq_get_phy_caps(vsi->port_info, false, status = ice_aq_get_phy_caps(vsi->port_info, false,
ICE_AQC_REPORT_SW_CFG, caps, NULL); ICE_AQC_REPORT_ACTIVE_CFG, caps, NULL);
if (status) { if (status) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -2013,7 +2013,7 @@ ice_get_link_ksettings(struct net_device *netdev, ...@@ -2013,7 +2013,7 @@ ice_get_link_ksettings(struct net_device *netdev,
ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS); ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS);
status = ice_aq_get_phy_caps(vsi->port_info, false, status = ice_aq_get_phy_caps(vsi->port_info, false,
ICE_AQC_REPORT_TOPO_CAP, caps, NULL); ICE_AQC_REPORT_TOPO_CAP_MEDIA, caps, NULL);
if (status) { if (status) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -2225,7 +2225,7 @@ ice_set_link_ksettings(struct net_device *netdev, ...@@ -2225,7 +2225,7 @@ ice_set_link_ksettings(struct net_device *netdev,
return -ENOMEM; return -ENOMEM;
/* Get the PHY capabilities based on media */ /* Get the PHY capabilities based on media */
status = ice_aq_get_phy_caps(p, false, ICE_AQC_REPORT_TOPO_CAP, status = ice_aq_get_phy_caps(p, false, ICE_AQC_REPORT_TOPO_CAP_MEDIA,
abilities, NULL); abilities, NULL);
if (status) { if (status) {
err = -EAGAIN; err = -EAGAIN;
...@@ -2958,7 +2958,7 @@ ice_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause) ...@@ -2958,7 +2958,7 @@ ice_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)
return; return;
/* Get current PHY config */ /* Get current PHY config */
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_SW_CFG, pcaps, status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_ACTIVE_CFG, pcaps,
NULL); NULL);
if (status) if (status)
goto out; goto out;
...@@ -3025,7 +3025,7 @@ ice_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause) ...@@ -3025,7 +3025,7 @@ ice_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)
return -ENOMEM; return -ENOMEM;
/* Get current PHY config */ /* Get current PHY config */
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_SW_CFG, pcaps, status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_ACTIVE_CFG, pcaps,
NULL); NULL);
if (status) { if (status) {
kfree(pcaps); kfree(pcaps);
......
...@@ -726,7 +726,7 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup) ...@@ -726,7 +726,7 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup)
} }
status = ice_aq_get_phy_caps(vsi->port_info, false, status = ice_aq_get_phy_caps(vsi->port_info, false,
ICE_AQC_REPORT_SW_CFG, caps, NULL); ICE_AQC_REPORT_ACTIVE_CFG, caps, NULL);
if (status) if (status)
netdev_info(vsi->netdev, "Get phy capability failed.\n"); netdev_info(vsi->netdev, "Get phy capability failed.\n");
...@@ -1645,7 +1645,7 @@ static int ice_force_phys_link_state(struct ice_vsi *vsi, bool link_up) ...@@ -1645,7 +1645,7 @@ static int ice_force_phys_link_state(struct ice_vsi *vsi, bool link_up)
if (!pcaps) if (!pcaps)
return -ENOMEM; return -ENOMEM;
retcode = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_SW_CFG, pcaps, retcode = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_ACTIVE_CFG, pcaps,
NULL); NULL);
if (retcode) { if (retcode) {
dev_err(dev, "Failed to get phy capabilities, VSI %d error %d\n", dev_err(dev, "Failed to get phy capabilities, VSI %d error %d\n",
...@@ -1705,7 +1705,7 @@ static int ice_init_nvm_phy_type(struct ice_port_info *pi) ...@@ -1705,7 +1705,7 @@ static int ice_init_nvm_phy_type(struct ice_port_info *pi)
if (!pcaps) if (!pcaps)
return -ENOMEM; return -ENOMEM;
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_NVM_CAP, pcaps, status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP_NO_MEDIA, pcaps,
NULL); NULL);
if (status) { if (status) {
...@@ -1821,7 +1821,7 @@ static int ice_init_phy_user_cfg(struct ice_port_info *pi) ...@@ -1821,7 +1821,7 @@ static int ice_init_phy_user_cfg(struct ice_port_info *pi)
if (!pcaps) if (!pcaps)
return -ENOMEM; return -ENOMEM;
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP, pcaps, status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP_MEDIA, pcaps,
NULL); NULL);
if (status) { if (status) {
dev_err(ice_pf_to_dev(pf), "Get PHY capability failed.\n"); dev_err(ice_pf_to_dev(pf), "Get PHY capability failed.\n");
...@@ -1900,7 +1900,7 @@ static int ice_configure_phy(struct ice_vsi *vsi) ...@@ -1900,7 +1900,7 @@ static int ice_configure_phy(struct ice_vsi *vsi)
return -ENOMEM; return -ENOMEM;
/* Get current PHY config */ /* Get current PHY config */
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_SW_CFG, pcaps, status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_ACTIVE_CFG, pcaps,
NULL); NULL);
if (status) { if (status) {
dev_err(dev, "Failed to get PHY configuration, VSI %d error %s\n", dev_err(dev, "Failed to get PHY configuration, VSI %d error %s\n",
...@@ -1918,7 +1918,7 @@ static int ice_configure_phy(struct ice_vsi *vsi) ...@@ -1918,7 +1918,7 @@ static int ice_configure_phy(struct ice_vsi *vsi)
/* Use PHY topology as baseline for configuration */ /* Use PHY topology as baseline for configuration */
memset(pcaps, 0, sizeof(*pcaps)); memset(pcaps, 0, sizeof(*pcaps));
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP, pcaps, status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP_MEDIA, pcaps,
NULL); NULL);
if (status) { if (status) {
dev_err(dev, "Failed to get PHY topology, VSI %d error %s\n", dev_err(dev, "Failed to get PHY topology, VSI %d error %s\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册