1 /*******************************************************************************
3 Copyright (c) 2001-2015, Intel Corporation
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
16 3. Neither the name of the Intel Corporation nor the names of its
17 contributors may be used to endorse or promote products derived from
18 this software without specific prior written permission.
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
32 ***************************************************************************/
34 #include "ixgbe_type.h"
35 #include "ixgbe_mbx.h"
38 * ixgbe_read_mbx - Reads a message from the mailbox
39 * @hw: pointer to the HW structure
40 * @msg: The message buffer
41 * @size: Length of buffer
42 * @mbx_id: id of mailbox to read
44 * returns SUCCESS if it successfully read message from buffer
46 s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
48 struct ixgbe_mbx_info *mbx = &hw->mbx;
49 s32 ret_val = IXGBE_ERR_MBX;
51 DEBUGFUNC("ixgbe_read_mbx");
53 /* limit read to size of mailbox */
58 ret_val = mbx->ops.read(hw, msg, size, mbx_id);
64 * ixgbe_write_mbx - Write a message to the mailbox
65 * @hw: pointer to the HW structure
66 * @msg: The message buffer
67 * @size: Length of buffer
68 * @mbx_id: id of mailbox to write
70 * returns SUCCESS if it successfully copied message into the buffer
72 s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
74 struct ixgbe_mbx_info *mbx = &hw->mbx;
75 s32 ret_val = IXGBE_SUCCESS;
77 DEBUGFUNC("ixgbe_write_mbx");
79 if (size > mbx->size) {
80 ret_val = IXGBE_ERR_MBX;
81 ERROR_REPORT2(IXGBE_ERROR_ARGUMENT,
82 "Invalid mailbox message size %d", size);
83 } else if (mbx->ops.write)
84 ret_val = mbx->ops.write(hw, msg, size, mbx_id);
90 * ixgbe_check_for_msg - checks to see if someone sent us mail
91 * @hw: pointer to the HW structure
92 * @mbx_id: id of mailbox to check
94 * returns SUCCESS if the Status bit was found or else ERR_MBX
96 s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id)
98 struct ixgbe_mbx_info *mbx = &hw->mbx;
99 s32 ret_val = IXGBE_ERR_MBX;
101 DEBUGFUNC("ixgbe_check_for_msg");
103 if (mbx->ops.check_for_msg)
104 ret_val = mbx->ops.check_for_msg(hw, mbx_id);
110 * ixgbe_check_for_ack - checks to see if someone sent us ACK
111 * @hw: pointer to the HW structure
112 * @mbx_id: id of mailbox to check
114 * returns SUCCESS if the Status bit was found or else ERR_MBX
116 s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id)
118 struct ixgbe_mbx_info *mbx = &hw->mbx;
119 s32 ret_val = IXGBE_ERR_MBX;
121 DEBUGFUNC("ixgbe_check_for_ack");
123 if (mbx->ops.check_for_ack)
124 ret_val = mbx->ops.check_for_ack(hw, mbx_id);
130 * ixgbe_check_for_rst - checks to see if other side has reset
131 * @hw: pointer to the HW structure
132 * @mbx_id: id of mailbox to check
134 * returns SUCCESS if the Status bit was found or else ERR_MBX
136 s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id)
138 struct ixgbe_mbx_info *mbx = &hw->mbx;
139 s32 ret_val = IXGBE_ERR_MBX;
141 DEBUGFUNC("ixgbe_check_for_rst");
143 if (mbx->ops.check_for_rst)
144 ret_val = mbx->ops.check_for_rst(hw, mbx_id);
150 * ixgbe_poll_for_msg - Wait for message notification
151 * @hw: pointer to the HW structure
152 * @mbx_id: id of mailbox to write
154 * returns SUCCESS if it successfully received a message notification
156 STATIC s32 ixgbe_poll_for_msg(struct ixgbe_hw *hw, u16 mbx_id)
158 struct ixgbe_mbx_info *mbx = &hw->mbx;
159 int countdown = mbx->timeout;
161 DEBUGFUNC("ixgbe_poll_for_msg");
163 if (!countdown || !mbx->ops.check_for_msg)
166 while (countdown && mbx->ops.check_for_msg(hw, mbx_id)) {
170 usec_delay(mbx->usec_delay);
174 ERROR_REPORT2(IXGBE_ERROR_POLLING,
175 "Polling for VF%d mailbox message timedout", mbx_id);
178 return countdown ? IXGBE_SUCCESS : IXGBE_ERR_MBX;
182 * ixgbe_poll_for_ack - Wait for message acknowledgement
183 * @hw: pointer to the HW structure
184 * @mbx_id: id of mailbox to write
186 * returns SUCCESS if it successfully received a message acknowledgement
188 STATIC s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id)
190 struct ixgbe_mbx_info *mbx = &hw->mbx;
191 int countdown = mbx->timeout;
193 DEBUGFUNC("ixgbe_poll_for_ack");
195 if (!countdown || !mbx->ops.check_for_ack)
198 while (countdown && mbx->ops.check_for_ack(hw, mbx_id)) {
202 usec_delay(mbx->usec_delay);
206 ERROR_REPORT2(IXGBE_ERROR_POLLING,
207 "Polling for VF%d mailbox ack timedout", mbx_id);
210 return countdown ? IXGBE_SUCCESS : IXGBE_ERR_MBX;
214 * ixgbe_read_posted_mbx - Wait for message notification and receive message
215 * @hw: pointer to the HW structure
216 * @msg: The message buffer
217 * @size: Length of buffer
218 * @mbx_id: id of mailbox to write
220 * returns SUCCESS if it successfully received a message notification and
221 * copied it into the receive buffer.
223 s32 ixgbe_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
225 struct ixgbe_mbx_info *mbx = &hw->mbx;
226 s32 ret_val = IXGBE_ERR_MBX;
228 DEBUGFUNC("ixgbe_read_posted_mbx");
233 ret_val = ixgbe_poll_for_msg(hw, mbx_id);
235 /* if ack received read message, otherwise we timed out */
237 ret_val = mbx->ops.read(hw, msg, size, mbx_id);
243 * ixgbe_write_posted_mbx - Write a message to the mailbox, wait for ack
244 * @hw: pointer to the HW structure
245 * @msg: The message buffer
246 * @size: Length of buffer
247 * @mbx_id: id of mailbox to write
249 * returns SUCCESS if it successfully copied message into the buffer and
250 * received an ack to that message within delay * timeout period
252 s32 ixgbe_write_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size,
255 struct ixgbe_mbx_info *mbx = &hw->mbx;
256 s32 ret_val = IXGBE_ERR_MBX;
258 DEBUGFUNC("ixgbe_write_posted_mbx");
260 /* exit if either we can't write or there isn't a defined timeout */
261 if (!mbx->ops.write || !mbx->timeout)
265 ret_val = mbx->ops.write(hw, msg, size, mbx_id);
267 /* if msg sent wait until we receive an ack */
269 ret_val = ixgbe_poll_for_ack(hw, mbx_id);
275 * ixgbe_init_mbx_ops_generic - Initialize MB function pointers
276 * @hw: pointer to the HW structure
278 * Setups up the mailbox read and write message function pointers
280 void ixgbe_init_mbx_ops_generic(struct ixgbe_hw *hw)
282 struct ixgbe_mbx_info *mbx = &hw->mbx;
284 mbx->ops.read_posted = ixgbe_read_posted_mbx;
285 mbx->ops.write_posted = ixgbe_write_posted_mbx;
289 * ixgbe_read_v2p_mailbox - read v2p mailbox
290 * @hw: pointer to the HW structure
292 * This function is used to read the v2p mailbox without losing the read to
295 STATIC u32 ixgbe_read_v2p_mailbox(struct ixgbe_hw *hw)
297 u32 v2p_mailbox = IXGBE_READ_REG(hw, IXGBE_VFMAILBOX);
299 v2p_mailbox |= hw->mbx.v2p_mailbox;
300 hw->mbx.v2p_mailbox |= v2p_mailbox & IXGBE_VFMAILBOX_R2C_BITS;
306 * ixgbe_check_for_bit_vf - Determine if a status bit was set
307 * @hw: pointer to the HW structure
308 * @mask: bitmask for bits to be tested and cleared
310 * This function is used to check for the read to clear bits within
313 STATIC s32 ixgbe_check_for_bit_vf(struct ixgbe_hw *hw, u32 mask)
315 u32 v2p_mailbox = ixgbe_read_v2p_mailbox(hw);
316 s32 ret_val = IXGBE_ERR_MBX;
318 if (v2p_mailbox & mask)
319 ret_val = IXGBE_SUCCESS;
321 hw->mbx.v2p_mailbox &= ~mask;
327 * ixgbe_check_for_msg_vf - checks to see if the PF has sent mail
328 * @hw: pointer to the HW structure
329 * @mbx_id: id of mailbox to check
331 * returns SUCCESS if the PF has set the Status bit or else ERR_MBX
333 STATIC s32 ixgbe_check_for_msg_vf(struct ixgbe_hw *hw, u16 mbx_id)
335 s32 ret_val = IXGBE_ERR_MBX;
337 UNREFERENCED_1PARAMETER(mbx_id);
338 DEBUGFUNC("ixgbe_check_for_msg_vf");
340 if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFSTS)) {
341 ret_val = IXGBE_SUCCESS;
342 hw->mbx.stats.reqs++;
349 * ixgbe_check_for_ack_vf - checks to see if the PF has ACK'd
350 * @hw: pointer to the HW structure
351 * @mbx_id: id of mailbox to check
353 * returns SUCCESS if the PF has set the ACK bit or else ERR_MBX
355 STATIC s32 ixgbe_check_for_ack_vf(struct ixgbe_hw *hw, u16 mbx_id)
357 s32 ret_val = IXGBE_ERR_MBX;
359 UNREFERENCED_1PARAMETER(mbx_id);
360 DEBUGFUNC("ixgbe_check_for_ack_vf");
362 if (!ixgbe_check_for_bit_vf(hw, IXGBE_VFMAILBOX_PFACK)) {
363 ret_val = IXGBE_SUCCESS;
364 hw->mbx.stats.acks++;
371 * ixgbe_check_for_rst_vf - checks to see if the PF has reset
372 * @hw: pointer to the HW structure
373 * @mbx_id: id of mailbox to check
375 * returns true if the PF has set the reset done bit or else false
377 STATIC s32 ixgbe_check_for_rst_vf(struct ixgbe_hw *hw, u16 mbx_id)
379 s32 ret_val = IXGBE_ERR_MBX;
381 UNREFERENCED_1PARAMETER(mbx_id);
382 DEBUGFUNC("ixgbe_check_for_rst_vf");
384 if (!ixgbe_check_for_bit_vf(hw, (IXGBE_VFMAILBOX_RSTD |
385 IXGBE_VFMAILBOX_RSTI))) {
386 ret_val = IXGBE_SUCCESS;
387 hw->mbx.stats.rsts++;
394 * ixgbe_obtain_mbx_lock_vf - obtain mailbox lock
395 * @hw: pointer to the HW structure
397 * return SUCCESS if we obtained the mailbox lock
399 STATIC s32 ixgbe_obtain_mbx_lock_vf(struct ixgbe_hw *hw)
401 s32 ret_val = IXGBE_ERR_MBX;
403 DEBUGFUNC("ixgbe_obtain_mbx_lock_vf");
405 /* Take ownership of the buffer */
406 IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_VFU);
408 /* reserve mailbox for vf use */
409 if (ixgbe_read_v2p_mailbox(hw) & IXGBE_VFMAILBOX_VFU)
410 ret_val = IXGBE_SUCCESS;
416 * ixgbe_write_mbx_vf - Write a message to the mailbox
417 * @hw: pointer to the HW structure
418 * @msg: The message buffer
419 * @size: Length of buffer
420 * @mbx_id: id of mailbox to write
422 * returns SUCCESS if it successfully copied message into the buffer
424 STATIC s32 ixgbe_write_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size,
430 UNREFERENCED_1PARAMETER(mbx_id);
432 DEBUGFUNC("ixgbe_write_mbx_vf");
434 /* lock the mailbox to prevent pf/vf race condition */
435 ret_val = ixgbe_obtain_mbx_lock_vf(hw);
439 /* flush msg and acks as we are overwriting the message buffer */
440 ixgbe_check_for_msg_vf(hw, 0);
441 ixgbe_check_for_ack_vf(hw, 0);
443 /* copy the caller specified message to the mailbox memory buffer */
444 for (i = 0; i < size; i++)
445 IXGBE_WRITE_REG_ARRAY(hw, IXGBE_VFMBMEM, i, msg[i]);
448 hw->mbx.stats.msgs_tx++;
450 /* Drop VFU and interrupt the PF to tell it a message has been sent */
451 IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_REQ);
458 * ixgbe_read_mbx_vf - Reads a message from the inbox intended for vf
459 * @hw: pointer to the HW structure
460 * @msg: The message buffer
461 * @size: Length of buffer
462 * @mbx_id: id of mailbox to read
464 * returns SUCCESS if it successfully read message from buffer
466 STATIC s32 ixgbe_read_mbx_vf(struct ixgbe_hw *hw, u32 *msg, u16 size,
469 s32 ret_val = IXGBE_SUCCESS;
472 DEBUGFUNC("ixgbe_read_mbx_vf");
473 UNREFERENCED_1PARAMETER(mbx_id);
475 /* lock the mailbox to prevent pf/vf race condition */
476 ret_val = ixgbe_obtain_mbx_lock_vf(hw);
480 /* copy the message from the mailbox memory buffer */
481 for (i = 0; i < size; i++)
482 msg[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_VFMBMEM, i);
484 /* Acknowledge receipt and release mailbox, then we're done */
485 IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_ACK);
488 hw->mbx.stats.msgs_rx++;
495 * ixgbe_init_mbx_params_vf - set initial values for vf mailbox
496 * @hw: pointer to the HW structure
498 * Initializes the hw->mbx struct to correct values for vf mailbox
500 void ixgbe_init_mbx_params_vf(struct ixgbe_hw *hw)
502 struct ixgbe_mbx_info *mbx = &hw->mbx;
504 /* start mailbox as timed out and let the reset_hw call set the timeout
505 * value to begin communications */
507 mbx->usec_delay = IXGBE_VF_MBX_INIT_DELAY;
509 mbx->size = IXGBE_VFMAILBOX_SIZE;
511 mbx->ops.read = ixgbe_read_mbx_vf;
512 mbx->ops.write = ixgbe_write_mbx_vf;
513 mbx->ops.read_posted = ixgbe_read_posted_mbx;
514 mbx->ops.write_posted = ixgbe_write_posted_mbx;
515 mbx->ops.check_for_msg = ixgbe_check_for_msg_vf;
516 mbx->ops.check_for_ack = ixgbe_check_for_ack_vf;
517 mbx->ops.check_for_rst = ixgbe_check_for_rst_vf;
519 mbx->stats.msgs_tx = 0;
520 mbx->stats.msgs_rx = 0;
526 STATIC s32 ixgbe_check_for_bit_pf(struct ixgbe_hw *hw, u32 mask, s32 index)
528 u32 mbvficr = IXGBE_READ_REG(hw, IXGBE_MBVFICR(index));
529 s32 ret_val = IXGBE_ERR_MBX;
531 if (mbvficr & mask) {
532 ret_val = IXGBE_SUCCESS;
533 IXGBE_WRITE_REG(hw, IXGBE_MBVFICR(index), mask);
540 * ixgbe_check_for_msg_pf - checks to see if the VF has sent mail
541 * @hw: pointer to the HW structure
542 * @vf_number: the VF index
544 * returns SUCCESS if the VF has set the Status bit or else ERR_MBX
546 STATIC s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_number)
548 s32 ret_val = IXGBE_ERR_MBX;
549 s32 index = IXGBE_MBVFICR_INDEX(vf_number);
550 u32 vf_bit = vf_number % 16;
552 DEBUGFUNC("ixgbe_check_for_msg_pf");
554 if (!ixgbe_check_for_bit_pf(hw, IXGBE_MBVFICR_VFREQ_VF1 << vf_bit,
556 ret_val = IXGBE_SUCCESS;
557 hw->mbx.stats.reqs++;
564 * ixgbe_check_for_ack_pf - checks to see if the VF has ACKed
565 * @hw: pointer to the HW structure
566 * @vf_number: the VF index
568 * returns SUCCESS if the VF has set the Status bit or else ERR_MBX
570 STATIC s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number)
572 s32 ret_val = IXGBE_ERR_MBX;
573 s32 index = IXGBE_MBVFICR_INDEX(vf_number);
574 u32 vf_bit = vf_number % 16;
576 DEBUGFUNC("ixgbe_check_for_ack_pf");
578 if (!ixgbe_check_for_bit_pf(hw, IXGBE_MBVFICR_VFACK_VF1 << vf_bit,
580 ret_val = IXGBE_SUCCESS;
581 hw->mbx.stats.acks++;
588 * ixgbe_check_for_rst_pf - checks to see if the VF has reset
589 * @hw: pointer to the HW structure
590 * @vf_number: the VF index
592 * returns SUCCESS if the VF has set the Status bit or else ERR_MBX
594 STATIC s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number)
596 u32 reg_offset = (vf_number < 32) ? 0 : 1;
597 u32 vf_shift = vf_number % 32;
599 s32 ret_val = IXGBE_ERR_MBX;
601 DEBUGFUNC("ixgbe_check_for_rst_pf");
603 switch (hw->mac.type) {
604 case ixgbe_mac_82599EB:
605 vflre = IXGBE_READ_REG(hw, IXGBE_VFLRE(reg_offset));
608 case ixgbe_mac_X550EM_x:
609 case ixgbe_mac_X550EM_a:
611 vflre = IXGBE_READ_REG(hw, IXGBE_VFLREC(reg_offset));
617 if (vflre & (1 << vf_shift)) {
618 ret_val = IXGBE_SUCCESS;
619 IXGBE_WRITE_REG(hw, IXGBE_VFLREC(reg_offset), (1 << vf_shift));
620 hw->mbx.stats.rsts++;
627 * ixgbe_obtain_mbx_lock_pf - obtain mailbox lock
628 * @hw: pointer to the HW structure
629 * @vf_number: the VF index
631 * return SUCCESS if we obtained the mailbox lock
633 STATIC s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_number)
635 s32 ret_val = IXGBE_ERR_MBX;
638 DEBUGFUNC("ixgbe_obtain_mbx_lock_pf");
640 /* Take ownership of the buffer */
641 IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_PFU);
643 /* reserve mailbox for vf use */
644 p2v_mailbox = IXGBE_READ_REG(hw, IXGBE_PFMAILBOX(vf_number));
645 if (p2v_mailbox & IXGBE_PFMAILBOX_PFU)
646 ret_val = IXGBE_SUCCESS;
648 ERROR_REPORT2(IXGBE_ERROR_POLLING,
649 "Failed to obtain mailbox lock for VF%d", vf_number);
656 * ixgbe_write_mbx_pf - Places a message in the mailbox
657 * @hw: pointer to the HW structure
658 * @msg: The message buffer
659 * @size: Length of buffer
660 * @vf_number: the VF index
662 * returns SUCCESS if it successfully copied message into the buffer
664 STATIC s32 ixgbe_write_mbx_pf(struct ixgbe_hw *hw, u32 *msg, u16 size,
670 DEBUGFUNC("ixgbe_write_mbx_pf");
672 /* lock the mailbox to prevent pf/vf race condition */
673 ret_val = ixgbe_obtain_mbx_lock_pf(hw, vf_number);
677 /* flush msg and acks as we are overwriting the message buffer */
678 ixgbe_check_for_msg_pf(hw, vf_number);
679 ixgbe_check_for_ack_pf(hw, vf_number);
681 /* copy the caller specified message to the mailbox memory buffer */
682 for (i = 0; i < size; i++)
683 IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_number), i, msg[i]);
685 /* Interrupt VF to tell it a message has been sent and release buffer*/
686 IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_STS);
689 hw->mbx.stats.msgs_tx++;
697 * ixgbe_read_mbx_pf - Read a message from the mailbox
698 * @hw: pointer to the HW structure
699 * @msg: The message buffer
700 * @size: Length of buffer
701 * @vf_number: the VF index
703 * This function copies a message from the mailbox buffer to the caller's
704 * memory buffer. The presumption is that the caller knows that there was
705 * a message due to a VF request so no polling for message is needed.
707 STATIC s32 ixgbe_read_mbx_pf(struct ixgbe_hw *hw, u32 *msg, u16 size,
713 DEBUGFUNC("ixgbe_read_mbx_pf");
715 /* lock the mailbox to prevent pf/vf race condition */
716 ret_val = ixgbe_obtain_mbx_lock_pf(hw, vf_number);
720 /* copy the message to the mailbox memory buffer */
721 for (i = 0; i < size; i++)
722 msg[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_number), i);
724 /* Acknowledge the message and release buffer */
725 IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_ACK);
728 hw->mbx.stats.msgs_rx++;
735 * ixgbe_init_mbx_params_pf - set initial values for pf mailbox
736 * @hw: pointer to the HW structure
738 * Initializes the hw->mbx struct to correct values for pf mailbox
740 void ixgbe_init_mbx_params_pf(struct ixgbe_hw *hw)
742 struct ixgbe_mbx_info *mbx = &hw->mbx;
744 if (hw->mac.type != ixgbe_mac_82599EB &&
745 hw->mac.type != ixgbe_mac_X550 &&
746 hw->mac.type != ixgbe_mac_X550EM_x &&
747 hw->mac.type != ixgbe_mac_X550EM_a &&
748 hw->mac.type != ixgbe_mac_X540)
754 mbx->size = IXGBE_VFMAILBOX_SIZE;
756 mbx->ops.read = ixgbe_read_mbx_pf;
757 mbx->ops.write = ixgbe_write_mbx_pf;
758 mbx->ops.read_posted = ixgbe_read_posted_mbx;
759 mbx->ops.write_posted = ixgbe_write_posted_mbx;
760 mbx->ops.check_for_msg = ixgbe_check_for_msg_pf;
761 mbx->ops.check_for_ack = ixgbe_check_for_ack_pf;
762 mbx->ops.check_for_rst = ixgbe_check_for_rst_pf;
764 mbx->stats.msgs_tx = 0;
765 mbx->stats.msgs_rx = 0;