static void
hns3_parse_copper_phy_params(struct hns3_cmd_desc *desc, struct hns3_mac *mac)
{
+#define HNS3_PHY_SUPPORTED_SPEED_MASK 0x2f
+
struct hns3_phy_params_bd0_cmd *req;
+ uint32_t supported;
req = (struct hns3_phy_params_bd0_cmd *)desc[0].data;
mac->link_speed = rte_le_to_cpu_32(req->speed);
HNS3_PHY_DUPLEX_CFG_B);
mac->link_autoneg = hns3_get_bit(req->autoneg,
HNS3_PHY_AUTONEG_CFG_B);
- mac->supported_capa = rte_le_to_cpu_32(req->supported);
mac->advertising = rte_le_to_cpu_32(req->advertising);
mac->lp_advertising = rte_le_to_cpu_32(req->lp_advertising);
- mac->support_autoneg = !!(mac->supported_capa &
- HNS3_PHY_LINK_MODE_AUTONEG_BIT);
+ supported = rte_le_to_cpu_32(req->supported);
+ mac->supported_speed = supported & HNS3_PHY_SUPPORTED_SPEED_MASK;
+ mac->support_autoneg = !!(supported & HNS3_PHY_LINK_MODE_AUTONEG_BIT);
}
static int
mac->link_speed = mac_info.link_speed;
mac->link_duplex = mac_info.link_duplex;
mac->link_autoneg = mac_info.link_autoneg;
- mac->supported_capa = mac_info.supported_capa;
+ mac->supported_speed = mac_info.supported_speed;
mac->advertising = mac_info.advertising;
mac->lp_advertising = mac_info.lp_advertising;
mac->support_autoneg = mac_info.support_autoneg;
uint8_t link_autoneg : 1; /* ETH_LINK_[AUTONEG/FIXED] */
uint8_t link_status : 1; /* ETH_LINK_[DOWN/UP] */
uint32_t link_speed; /* ETH_SPEED_NUM_ */
- uint32_t supported_capa; /* supported capability for current media */
+ uint32_t supported_speed; /* supported speed for current media type */
uint32_t advertising; /* advertised capability in the local part */
/* advertised capability in the link partner */
uint32_t lp_advertising;