X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_pmd_ixgbe%2Fixgbe%2Fixgbe_common.c;h=c31e906465882258a08deafd7de958286ead608d;hb=b01126f5fe0b1fc4a42348df89fc38898e764d80;hp=ddf61cc64e042b58e8fb9cc433e264b9d71f8f73;hpb=50379bd648cf9d8f75daed9a3f85514a9451e5e5;p=dpdk.git diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c index ddf61cc64e..c31e906465 100644 --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c @@ -4345,6 +4345,36 @@ u8 ixgbe_calculate_checksum(u8 *buffer, u32 length) return (u8) (0 - sum); } +/** + * ixgbe_get_hi_status - Get host interface command status + * @hw: pointer to the HW structure + * @return_code: reads and returns code + * + * Check if command returned with success. On success return IXGBE_SUCCESS + * else return IXGBE_ERR_HOST_INTERFACE_COMMAND. + **/ +s32 ixgbe_get_hi_status(struct ixgbe_hw *hw, u8 *ret_status) +{ + struct ixgbe_hic_hdr response; + u32 *response_val = (u32 *)&response; + + DEBUGFUNC("ixgbe_get_host_interface_status"); + + /* Read the command response */ + *response_val = IXGBE_CPU_TO_LE32(IXGBE_READ_REG(hw, IXGBE_FLEX_MNG)); + + if (ret_status) + *ret_status = response.cmd_or_resp.ret_status; + + if (response.cmd_or_resp.ret_status != FW_CEM_RESP_STATUS_SUCCESS) { + DEBUGOUT1("Host interface error=%x.\n", + response.cmd_or_resp.ret_status); + return IXGBE_ERR_HOST_INTERFACE_COMMAND; + } + + return IXGBE_SUCCESS; +} + /** * ixgbe_host_interface_command - Issue command to manageability block * @hw: pointer to the HW structure