Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ixgbe/ixgbe_mbx.c
/****************************************************************************** | /****************************************************************************** | ||||
Copyright (c) 2001-2012, Intel Corporation | Copyright (c) 2001-2014, Intel Corporation | ||||
All rights reserved. | All rights reserved. | ||||
Redistribution and use in source and binary forms, with or without | Redistribution and use in source and binary forms, with or without | ||||
Context not available. | |||||
DEBUGFUNC("ixgbe_write_mbx"); | DEBUGFUNC("ixgbe_write_mbx"); | ||||
if (size > mbx->size) | if (size > mbx->size) { | ||||
ret_val = IXGBE_ERR_MBX; | ret_val = IXGBE_ERR_MBX; | ||||
ERROR_REPORT2(IXGBE_ERROR_ARGUMENT, | |||||
else if (mbx->ops.write) | "Invalid mailbox message size %d", size); | ||||
} else if (mbx->ops.write) | |||||
ret_val = mbx->ops.write(hw, msg, size, mbx_id); | ret_val = mbx->ops.write(hw, msg, size, mbx_id); | ||||
return ret_val; | return ret_val; | ||||
Context not available. | |||||
usec_delay(mbx->usec_delay); | usec_delay(mbx->usec_delay); | ||||
} | } | ||||
if (countdown == 0) | |||||
ERROR_REPORT2(IXGBE_ERROR_POLLING, | |||||
"Polling for VF%d mailbox message timedout", mbx_id); | |||||
out: | out: | ||||
return countdown ? IXGBE_SUCCESS : IXGBE_ERR_MBX; | return countdown ? IXGBE_SUCCESS : IXGBE_ERR_MBX; | ||||
} | } | ||||
Context not available. | |||||
usec_delay(mbx->usec_delay); | usec_delay(mbx->usec_delay); | ||||
} | } | ||||
if (countdown == 0) | |||||
ERROR_REPORT2(IXGBE_ERROR_POLLING, | |||||
"Polling for VF%d mailbox ack timedout", mbx_id); | |||||
out: | out: | ||||
return countdown ? IXGBE_SUCCESS : IXGBE_ERR_MBX; | return countdown ? IXGBE_SUCCESS : IXGBE_ERR_MBX; | ||||
} | } | ||||
Context not available. | |||||
case ixgbe_mac_82599EB: | case ixgbe_mac_82599EB: | ||||
vflre = IXGBE_READ_REG(hw, IXGBE_VFLRE(reg_offset)); | vflre = IXGBE_READ_REG(hw, IXGBE_VFLRE(reg_offset)); | ||||
break; | break; | ||||
case ixgbe_mac_X550: | |||||
case ixgbe_mac_X550EM_x: | |||||
case ixgbe_mac_X550EM_a: | |||||
case ixgbe_mac_X540: | case ixgbe_mac_X540: | ||||
vflre = IXGBE_READ_REG(hw, IXGBE_VFLREC(reg_offset)); | vflre = IXGBE_READ_REG(hw, IXGBE_VFLREC(reg_offset)); | ||||
break; | break; | ||||
Context not available. | |||||
p2v_mailbox = IXGBE_READ_REG(hw, IXGBE_PFMAILBOX(vf_number)); | p2v_mailbox = IXGBE_READ_REG(hw, IXGBE_PFMAILBOX(vf_number)); | ||||
if (p2v_mailbox & IXGBE_PFMAILBOX_PFU) | if (p2v_mailbox & IXGBE_PFMAILBOX_PFU) | ||||
ret_val = IXGBE_SUCCESS; | ret_val = IXGBE_SUCCESS; | ||||
else | |||||
ERROR_REPORT2(IXGBE_ERROR_POLLING, | |||||
"Failed to obtain mailbox lock for VF%d", vf_number); | |||||
return ret_val; | return ret_val; | ||||
} | } | ||||
Context not available. | |||||
struct ixgbe_mbx_info *mbx = &hw->mbx; | struct ixgbe_mbx_info *mbx = &hw->mbx; | ||||
if (hw->mac.type != ixgbe_mac_82599EB && | if (hw->mac.type != ixgbe_mac_82599EB && | ||||
hw->mac.type != ixgbe_mac_X550 && | |||||
hw->mac.type != ixgbe_mac_X550EM_x && | |||||
hw->mac.type != ixgbe_mac_X550EM_a && | |||||
hw->mac.type != ixgbe_mac_X540) | hw->mac.type != ixgbe_mac_X540) | ||||
return; | return; | ||||
Context not available. |