net/ice/base: add dedicate MAC type for E810

Add a new MAC type ICE_MAC_E810 to distinguish E810 devices from other
devices. MAC types for all other devices will be ICE_MAC_GENERIC till
there's a need to distinguish further between devices.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
This commit is contained in:
Qi Zhang 2020-03-23 15:17:37 +08:00 committed by Ferruh Yigit
parent 6cad4aa1a5
commit 486d29fda5
2 changed files with 29 additions and 14 deletions

View File

@ -20,24 +20,38 @@
*/
static enum ice_status ice_set_mac_type(struct ice_hw *hw)
{
enum ice_status status = ICE_SUCCESS;
ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
if (hw->vendor_id == ICE_INTEL_VENDOR_ID) {
switch (hw->device_id) {
default:
hw->mac_type = ICE_MAC_GENERIC;
break;
}
} else {
status = ICE_ERR_DEVICE_NOT_SUPPORTED;
if (hw->vendor_id != ICE_INTEL_VENDOR_ID)
return ICE_ERR_DEVICE_NOT_SUPPORTED;
switch (hw->device_id) {
case ICE_DEV_ID_E810C_BACKPLANE:
case ICE_DEV_ID_E810C_QSFP:
case ICE_DEV_ID_E810C_SFP:
case ICE_DEV_ID_E810_XXV_BACKPLANE:
case ICE_DEV_ID_E810_XXV_QSFP:
case ICE_DEV_ID_E810_XXV_SFP:
hw->mac_type = ICE_MAC_E810;
break;
case ICE_DEV_ID_E822C_10G_BASE_T:
case ICE_DEV_ID_E822C_BACKPLANE:
case ICE_DEV_ID_E822C_QSFP:
case ICE_DEV_ID_E822C_SFP:
case ICE_DEV_ID_E822C_SGMII:
case ICE_DEV_ID_E822L_10G_BASE_T:
case ICE_DEV_ID_E822L_BACKPLANE:
case ICE_DEV_ID_E822L_SFP:
case ICE_DEV_ID_E822L_SGMII:
hw->mac_type = ICE_MAC_GENERIC;
break;
default:
hw->mac_type = ICE_MAC_UNKNOWN;
break;
}
ice_debug(hw, ICE_DBG_INIT, "found mac_type: %d, status: %d\n",
hw->mac_type, status);
return status;
ice_debug(hw, ICE_DBG_INIT, "mac_type: %d\n", hw->mac_type);
return ICE_SUCCESS;
}
/**

View File

@ -205,6 +205,7 @@ enum ice_set_fc_aq_failures {
/* MAC types */
enum ice_mac_type {
ICE_MAC_UNKNOWN = 0,
ICE_MAC_E810,
ICE_MAC_GENERIC,
};