Print this page
3014 Intel X540 Support (fix lint)

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ixgbe/ixgbe_mbx.c
          +++ new/usr/src/uts/common/io/ixgbe/ixgbe_mbx.c
↓ open down ↓ 421 lines elided ↑ open up ↑
 422  422          UNREFERENCED_1PARAMETER(mbx_id);
 423  423  
 424  424          DEBUGFUNC("ixgbe_write_mbx_vf");
 425  425  
 426  426          /* lock the mailbox to prevent pf/vf race condition */
 427  427          ret_val = ixgbe_obtain_mbx_lock_vf(hw);
 428  428          if (ret_val)
 429  429                  goto out_no_write;
 430  430  
 431  431          /* flush msg and acks as we are overwriting the message buffer */
 432      -        ixgbe_check_for_msg_vf(hw, 0);
 433      -        ixgbe_check_for_ack_vf(hw, 0);
      432 +        ret_val = ixgbe_check_for_msg_vf(hw, 0);
      433 +        if (ret_val)
      434 +                goto out_no_write;
      435 +        ret_val = ixgbe_check_for_ack_vf(hw, 0);
      436 +        if (ret_val)
      437 +                goto out_no_write;
 434  438  
 435  439          /* copy the caller specified message to the mailbox memory buffer */
 436  440          for (i = 0; i < size; i++)
 437  441                  IXGBE_WRITE_REG_ARRAY(hw, IXGBE_VFMBMEM, i, msg[i]);
 438  442  
 439  443          /* update stats */
 440  444          hw->mbx.stats.msgs_tx++;
 441  445  
 442  446          /* Drop VFU and interrupt the PF to tell it a message has been sent */
 443  447          IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_REQ);
↓ open down ↓ 209 lines elided ↑ open up ↑
 653  657          u16 i;
 654  658  
 655  659          DEBUGFUNC("ixgbe_write_mbx_pf");
 656  660  
 657  661          /* lock the mailbox to prevent pf/vf race condition */
 658  662          ret_val = ixgbe_obtain_mbx_lock_pf(hw, vf_number);
 659  663          if (ret_val)
 660  664                  goto out_no_write;
 661  665  
 662  666          /* flush msg and acks as we are overwriting the message buffer */
 663      -        ixgbe_check_for_msg_pf(hw, vf_number);
 664      -        ixgbe_check_for_ack_pf(hw, vf_number);
      667 +        ret_val = ixgbe_check_for_msg_vf(hw, 0);
      668 +        if (ret_val)
      669 +                goto out_no_write;
      670 +        ret_val = ixgbe_check_for_ack_vf(hw, 0);
      671 +        if (ret_val)
      672 +                goto out_no_write;
 665  673  
 666  674          /* copy the caller specified message to the mailbox memory buffer */
 667  675          for (i = 0; i < size; i++)
 668  676                  IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_number), i, msg[i]);
 669  677  
 670  678          /* Interrupt VF to tell it a message has been sent and release buffer*/
 671  679          IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_STS);
 672  680  
 673  681          /* update stats */
 674  682          hw->mbx.stats.msgs_tx++;
↓ open down ↓ 77 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX