* i40e_init_shared_code - Initialize the shared code * @hw: pointer to hardware structure * * This assigns the MAC type and PHY code and inits the NVM. * Does not touch the hardware. This function must be called prior to any * other function in the shared code. The i40e_hw structure should be * memset to 0 prior to calling this function. The following fields in * hw structure should be fil
| 989 | * subsystem_vendor_id, and revision_id |
| 990 | **/ |
| 991 | enum i40e_status_code i40e_init_shared_code(struct i40e_hw *hw) |
| 992 | { |
| 993 | enum i40e_status_code status = I40E_SUCCESS; |
| 994 | u32 port, ari, func_rid; |
| 995 | |
| 996 | DEBUGFUNC("i40e_init_shared_code"); |
| 997 | |
| 998 | i40e_set_mac_type(hw); |
| 999 | |
| 1000 | switch (hw->mac.type) { |
| 1001 | case I40E_MAC_XL710: |
| 1002 | case I40E_MAC_X722: |
| 1003 | break; |
| 1004 | default: |
| 1005 | return I40E_ERR_DEVICE_NOT_SUPPORTED; |
| 1006 | } |
| 1007 | |
| 1008 | hw->phy.get_link_info = true; |
| 1009 | |
| 1010 | /* Determine port number and PF number*/ |
| 1011 | port = (rd32(hw, I40E_PFGEN_PORTNUM) & I40E_PFGEN_PORTNUM_PORT_NUM_MASK) |
| 1012 | >> I40E_PFGEN_PORTNUM_PORT_NUM_SHIFT; |
| 1013 | hw->port = (u8)port; |
| 1014 | ari = (rd32(hw, I40E_GLPCI_CAPSUP) & I40E_GLPCI_CAPSUP_ARI_EN_MASK) >> |
| 1015 | I40E_GLPCI_CAPSUP_ARI_EN_SHIFT; |
| 1016 | func_rid = rd32(hw, I40E_PF_FUNC_RID); |
| 1017 | if (ari) |
| 1018 | hw->pf_id = (u8)(func_rid & 0xff); |
| 1019 | else |
| 1020 | hw->pf_id = (u8)(func_rid & 0x7); |
| 1021 | |
| 1022 | /* NVMUpdate features structure initialization */ |
| 1023 | hw->nvmupd_features.major = I40E_NVMUPD_FEATURES_API_VER_MAJOR; |
| 1024 | hw->nvmupd_features.minor = I40E_NVMUPD_FEATURES_API_VER_MINOR; |
| 1025 | hw->nvmupd_features.size = sizeof(hw->nvmupd_features); |
| 1026 | i40e_memset(hw->nvmupd_features.features, 0x0, |
| 1027 | I40E_NVMUPD_FEATURES_API_FEATURES_ARRAY_LEN * |
| 1028 | sizeof(*hw->nvmupd_features.features), |
| 1029 | I40E_NONDMA_MEM); |
| 1030 | |
| 1031 | /* No features supported at the moment */ |
| 1032 | hw->nvmupd_features.features[0] = 0; |
| 1033 | |
| 1034 | status = i40e_init_nvm(hw); |
| 1035 | return status; |
| 1036 | } |
| 1037 | |
| 1038 | /** |
| 1039 | * i40e_aq_mac_address_read - Retrieve the MAC addresses |
no test coverage detected