blob: 9993a471d668cea9ce8e491def02bc2d3531cff6 [file] [log] [blame]
Greg Rose10ca1322010-01-09 02:25:10 +00001/*******************************************************************************
2
3 Intel 10 Gigabit PCI Express Linux driver
Mark Rustad4e862812014-07-22 06:50:52 +00004 Copyright(c) 1999 - 2014 Intel Corporation.
Greg Rose10ca1322010-01-09 02:25:10 +00005
6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License,
8 version 2, as published by the Free Software Foundation.
9
10 This program is distributed in the hope it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 more details.
14
15 You should have received a copy of the GNU General Public License along with
16 this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18
19 The full GNU General Public License is included in this distribution in
20 the file called "COPYING".
21
22 Contact Information:
Jacob Kellerb89aae72014-02-22 01:23:50 +000023 Linux NICS <linux.nics@intel.com>
Greg Rose10ca1322010-01-09 02:25:10 +000024 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28
29#include <linux/pci.h>
30#include <linux/delay.h>
Mark Rustadb12babd2014-01-14 18:53:16 -080031#include "ixgbe.h"
Greg Rose10ca1322010-01-09 02:25:10 +000032#include "ixgbe_mbx.h"
33
34/**
35 * ixgbe_read_mbx - Reads a message from the mailbox
36 * @hw: pointer to the HW structure
37 * @msg: The message buffer
38 * @size: Length of buffer
39 * @mbx_id: id of mailbox to read
40 *
Joe Perchesbfb90352011-08-17 06:58:04 -070041 * returns SUCCESS if it successfully read message from buffer
Greg Rose10ca1322010-01-09 02:25:10 +000042 **/
43s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
44{
45 struct ixgbe_mbx_info *mbx = &hw->mbx;
Greg Rose10ca1322010-01-09 02:25:10 +000046
47 /* limit read to size of mailbox */
48 if (size > mbx->size)
49 size = mbx->size;
50
Mark Rustade90dd262014-07-22 06:51:08 +000051 if (!mbx->ops.read)
52 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +000053
Mark Rustade90dd262014-07-22 06:51:08 +000054 return mbx->ops.read(hw, msg, size, mbx_id);
Greg Rose10ca1322010-01-09 02:25:10 +000055}
56
57/**
58 * ixgbe_write_mbx - Write a message to the mailbox
59 * @hw: pointer to the HW structure
60 * @msg: The message buffer
61 * @size: Length of buffer
62 * @mbx_id: id of mailbox to write
63 *
64 * returns SUCCESS if it successfully copied message into the buffer
65 **/
66s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
67{
68 struct ixgbe_mbx_info *mbx = &hw->mbx;
Greg Rose10ca1322010-01-09 02:25:10 +000069
70 if (size > mbx->size)
Mark Rustad4e862812014-07-22 06:50:52 +000071 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +000072
Mark Rustad4e862812014-07-22 06:50:52 +000073 if (!mbx->ops.write)
74 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +000075
Mark Rustad4e862812014-07-22 06:50:52 +000076 return mbx->ops.write(hw, msg, size, mbx_id);
Greg Rose10ca1322010-01-09 02:25:10 +000077}
78
79/**
80 * ixgbe_check_for_msg - checks to see if someone sent us mail
81 * @hw: pointer to the HW structure
82 * @mbx_id: id of mailbox to check
83 *
84 * returns SUCCESS if the Status bit was found or else ERR_MBX
85 **/
86s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id)
87{
88 struct ixgbe_mbx_info *mbx = &hw->mbx;
Greg Rose10ca1322010-01-09 02:25:10 +000089
Mark Rustade90dd262014-07-22 06:51:08 +000090 if (!mbx->ops.check_for_msg)
91 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +000092
Mark Rustade90dd262014-07-22 06:51:08 +000093 return mbx->ops.check_for_msg(hw, mbx_id);
Greg Rose10ca1322010-01-09 02:25:10 +000094}
95
96/**
97 * ixgbe_check_for_ack - checks to see if someone sent us ACK
98 * @hw: pointer to the HW structure
99 * @mbx_id: id of mailbox to check
100 *
101 * returns SUCCESS if the Status bit was found or else ERR_MBX
102 **/
103s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id)
104{
105 struct ixgbe_mbx_info *mbx = &hw->mbx;
Greg Rose10ca1322010-01-09 02:25:10 +0000106
Mark Rustade90dd262014-07-22 06:51:08 +0000107 if (!mbx->ops.check_for_ack)
108 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +0000109
Mark Rustade90dd262014-07-22 06:51:08 +0000110 return mbx->ops.check_for_ack(hw, mbx_id);
Greg Rose10ca1322010-01-09 02:25:10 +0000111}
112
113/**
114 * ixgbe_check_for_rst - checks to see if other side has reset
115 * @hw: pointer to the HW structure
116 * @mbx_id: id of mailbox to check
117 *
118 * returns SUCCESS if the Status bit was found or else ERR_MBX
119 **/
120s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id)
121{
122 struct ixgbe_mbx_info *mbx = &hw->mbx;
Greg Rose10ca1322010-01-09 02:25:10 +0000123
Mark Rustade90dd262014-07-22 06:51:08 +0000124 if (!mbx->ops.check_for_rst)
125 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +0000126
Mark Rustade90dd262014-07-22 06:51:08 +0000127 return mbx->ops.check_for_rst(hw, mbx_id);
Greg Rose10ca1322010-01-09 02:25:10 +0000128}
129
130/**
131 * ixgbe_poll_for_msg - Wait for message notification
132 * @hw: pointer to the HW structure
133 * @mbx_id: id of mailbox to write
134 *
135 * returns SUCCESS if it successfully received a message notification
136 **/
137static s32 ixgbe_poll_for_msg(struct ixgbe_hw *hw, u16 mbx_id)
138{
139 struct ixgbe_mbx_info *mbx = &hw->mbx;
140 int countdown = mbx->timeout;
141
142 if (!countdown || !mbx->ops.check_for_msg)
Mark Rustade90dd262014-07-22 06:51:08 +0000143 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +0000144
Mark Rustade90dd262014-07-22 06:51:08 +0000145 while (mbx->ops.check_for_msg(hw, mbx_id)) {
Greg Rose10ca1322010-01-09 02:25:10 +0000146 countdown--;
147 if (!countdown)
Mark Rustade90dd262014-07-22 06:51:08 +0000148 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +0000149 udelay(mbx->usec_delay);
150 }
151
Mark Rustade90dd262014-07-22 06:51:08 +0000152 return 0;
Greg Rose10ca1322010-01-09 02:25:10 +0000153}
154
155/**
156 * ixgbe_poll_for_ack - Wait for message acknowledgement
157 * @hw: pointer to the HW structure
158 * @mbx_id: id of mailbox to write
159 *
160 * returns SUCCESS if it successfully received a message acknowledgement
161 **/
162static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id)
163{
164 struct ixgbe_mbx_info *mbx = &hw->mbx;
165 int countdown = mbx->timeout;
166
167 if (!countdown || !mbx->ops.check_for_ack)
Mark Rustade90dd262014-07-22 06:51:08 +0000168 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +0000169
Mark Rustade90dd262014-07-22 06:51:08 +0000170 while (mbx->ops.check_for_ack(hw, mbx_id)) {
Greg Rose10ca1322010-01-09 02:25:10 +0000171 countdown--;
172 if (!countdown)
Mark Rustade90dd262014-07-22 06:51:08 +0000173 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +0000174 udelay(mbx->usec_delay);
175 }
176
Mark Rustade90dd262014-07-22 06:51:08 +0000177 return 0;
Greg Rose10ca1322010-01-09 02:25:10 +0000178}
179
180/**
181 * ixgbe_read_posted_mbx - Wait for message notification and receive message
182 * @hw: pointer to the HW structure
183 * @msg: The message buffer
184 * @size: Length of buffer
185 * @mbx_id: id of mailbox to write
186 *
187 * returns SUCCESS if it successfully received a message notification and
188 * copied it into the receive buffer.
189 **/
Emil Tantilov5d5b7c32010-10-12 22:20:59 +0000190static s32 ixgbe_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size,
191 u16 mbx_id)
Greg Rose10ca1322010-01-09 02:25:10 +0000192{
193 struct ixgbe_mbx_info *mbx = &hw->mbx;
Mark Rustade90dd262014-07-22 06:51:08 +0000194 s32 ret_val;
Greg Rose10ca1322010-01-09 02:25:10 +0000195
196 if (!mbx->ops.read)
Mark Rustade90dd262014-07-22 06:51:08 +0000197 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +0000198
199 ret_val = ixgbe_poll_for_msg(hw, mbx_id);
Mark Rustade90dd262014-07-22 06:51:08 +0000200 if (ret_val)
201 return ret_val;
Greg Rose10ca1322010-01-09 02:25:10 +0000202
Mark Rustade90dd262014-07-22 06:51:08 +0000203 /* if ack received read message */
204 return mbx->ops.read(hw, msg, size, mbx_id);
Greg Rose10ca1322010-01-09 02:25:10 +0000205}
206
207/**
208 * ixgbe_write_posted_mbx - Write a message to the mailbox, wait for ack
209 * @hw: pointer to the HW structure
210 * @msg: The message buffer
211 * @size: Length of buffer
212 * @mbx_id: id of mailbox to write
213 *
214 * returns SUCCESS if it successfully copied message into the buffer and
215 * received an ack to that message within delay * timeout period
216 **/
Emil Tantilov5d5b7c32010-10-12 22:20:59 +0000217static s32 ixgbe_write_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size,
Jacob Kellere7cf7452014-04-09 06:03:10 +0000218 u16 mbx_id)
Greg Rose10ca1322010-01-09 02:25:10 +0000219{
220 struct ixgbe_mbx_info *mbx = &hw->mbx;
Mark Rustade90dd262014-07-22 06:51:08 +0000221 s32 ret_val;
Greg Rose10ca1322010-01-09 02:25:10 +0000222
223 /* exit if either we can't write or there isn't a defined timeout */
224 if (!mbx->ops.write || !mbx->timeout)
Mark Rustade90dd262014-07-22 06:51:08 +0000225 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +0000226
227 /* send msg */
228 ret_val = mbx->ops.write(hw, msg, size, mbx_id);
Mark Rustade90dd262014-07-22 06:51:08 +0000229 if (ret_val)
230 return ret_val;
Greg Rose10ca1322010-01-09 02:25:10 +0000231
232 /* if msg sent wait until we receive an ack */
Mark Rustade90dd262014-07-22 06:51:08 +0000233 return ixgbe_poll_for_ack(hw, mbx_id);
Greg Rose10ca1322010-01-09 02:25:10 +0000234}
235
Greg Rose10ca1322010-01-09 02:25:10 +0000236static s32 ixgbe_check_for_bit_pf(struct ixgbe_hw *hw, u32 mask, s32 index)
237{
238 u32 mbvficr = IXGBE_READ_REG(hw, IXGBE_MBVFICR(index));
Greg Rose10ca1322010-01-09 02:25:10 +0000239
240 if (mbvficr & mask) {
Greg Rose10ca1322010-01-09 02:25:10 +0000241 IXGBE_WRITE_REG(hw, IXGBE_MBVFICR(index), mask);
Mark Rustade90dd262014-07-22 06:51:08 +0000242 return 0;
Greg Rose10ca1322010-01-09 02:25:10 +0000243 }
244
Mark Rustade90dd262014-07-22 06:51:08 +0000245 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +0000246}
247
248/**
249 * ixgbe_check_for_msg_pf - checks to see if the VF has sent mail
250 * @hw: pointer to the HW structure
251 * @vf_number: the VF index
252 *
253 * returns SUCCESS if the VF has set the Status bit or else ERR_MBX
254 **/
255static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_number)
256{
Greg Rose10ca1322010-01-09 02:25:10 +0000257 s32 index = IXGBE_MBVFICR_INDEX(vf_number);
258 u32 vf_bit = vf_number % 16;
259
260 if (!ixgbe_check_for_bit_pf(hw, IXGBE_MBVFICR_VFREQ_VF1 << vf_bit,
Jacob Kellere7cf7452014-04-09 06:03:10 +0000261 index)) {
Greg Rose10ca1322010-01-09 02:25:10 +0000262 hw->mbx.stats.reqs++;
Mark Rustade90dd262014-07-22 06:51:08 +0000263 return 0;
Greg Rose10ca1322010-01-09 02:25:10 +0000264 }
265
Mark Rustade90dd262014-07-22 06:51:08 +0000266 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +0000267}
268
269/**
270 * ixgbe_check_for_ack_pf - checks to see if the VF has ACKed
271 * @hw: pointer to the HW structure
272 * @vf_number: the VF index
273 *
274 * returns SUCCESS if the VF has set the Status bit or else ERR_MBX
275 **/
276static s32 ixgbe_check_for_ack_pf(struct ixgbe_hw *hw, u16 vf_number)
277{
Greg Rose10ca1322010-01-09 02:25:10 +0000278 s32 index = IXGBE_MBVFICR_INDEX(vf_number);
279 u32 vf_bit = vf_number % 16;
280
281 if (!ixgbe_check_for_bit_pf(hw, IXGBE_MBVFICR_VFACK_VF1 << vf_bit,
Jacob Kellere7cf7452014-04-09 06:03:10 +0000282 index)) {
Greg Rose10ca1322010-01-09 02:25:10 +0000283 hw->mbx.stats.acks++;
Mark Rustade90dd262014-07-22 06:51:08 +0000284 return 0;
Greg Rose10ca1322010-01-09 02:25:10 +0000285 }
286
Mark Rustade90dd262014-07-22 06:51:08 +0000287 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +0000288}
289
290/**
291 * ixgbe_check_for_rst_pf - checks to see if the VF has reset
292 * @hw: pointer to the HW structure
293 * @vf_number: the VF index
294 *
295 * returns SUCCESS if the VF has set the Status bit or else ERR_MBX
296 **/
297static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number)
298{
299 u32 reg_offset = (vf_number < 32) ? 0 : 1;
300 u32 vf_shift = vf_number % 32;
301 u32 vflre = 0;
Greg Rose10ca1322010-01-09 02:25:10 +0000302
Don Skidmoreb93a2222010-11-16 19:27:17 -0800303 switch (hw->mac.type) {
304 case ixgbe_mac_82599EB:
Greg Rose10ca1322010-01-09 02:25:10 +0000305 vflre = IXGBE_READ_REG(hw, IXGBE_VFLRE(reg_offset));
Don Skidmoreb93a2222010-11-16 19:27:17 -0800306 break;
Greg Rose3377eba792010-12-07 08:16:45 +0000307 case ixgbe_mac_X540:
Don Skidmore9a75a1a2014-11-07 03:53:35 +0000308 case ixgbe_mac_X550:
309 case ixgbe_mac_X550EM_x:
Greg Rose3377eba792010-12-07 08:16:45 +0000310 vflre = IXGBE_READ_REG(hw, IXGBE_VFLREC(reg_offset));
311 break;
Don Skidmoreb93a2222010-11-16 19:27:17 -0800312 default:
313 break;
314 }
Greg Rose10ca1322010-01-09 02:25:10 +0000315
316 if (vflre & (1 << vf_shift)) {
Greg Rose10ca1322010-01-09 02:25:10 +0000317 IXGBE_WRITE_REG(hw, IXGBE_VFLREC(reg_offset), (1 << vf_shift));
318 hw->mbx.stats.rsts++;
Mark Rustade90dd262014-07-22 06:51:08 +0000319 return 0;
Greg Rose10ca1322010-01-09 02:25:10 +0000320 }
321
Mark Rustade90dd262014-07-22 06:51:08 +0000322 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +0000323}
324
325/**
326 * ixgbe_obtain_mbx_lock_pf - obtain mailbox lock
327 * @hw: pointer to the HW structure
328 * @vf_number: the VF index
329 *
330 * return SUCCESS if we obtained the mailbox lock
331 **/
332static s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_number)
333{
Greg Rose10ca1322010-01-09 02:25:10 +0000334 u32 p2v_mailbox;
335
336 /* Take ownership of the buffer */
337 IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_PFU);
338
339 /* reserve mailbox for vf use */
340 p2v_mailbox = IXGBE_READ_REG(hw, IXGBE_PFMAILBOX(vf_number));
341 if (p2v_mailbox & IXGBE_PFMAILBOX_PFU)
Mark Rustade90dd262014-07-22 06:51:08 +0000342 return 0;
Greg Rose10ca1322010-01-09 02:25:10 +0000343
Mark Rustade90dd262014-07-22 06:51:08 +0000344 return IXGBE_ERR_MBX;
Greg Rose10ca1322010-01-09 02:25:10 +0000345}
346
347/**
348 * ixgbe_write_mbx_pf - Places a message in the mailbox
349 * @hw: pointer to the HW structure
350 * @msg: The message buffer
351 * @size: Length of buffer
352 * @vf_number: the VF index
353 *
354 * returns SUCCESS if it successfully copied message into the buffer
355 **/
356static s32 ixgbe_write_mbx_pf(struct ixgbe_hw *hw, u32 *msg, u16 size,
Jacob Kellere7cf7452014-04-09 06:03:10 +0000357 u16 vf_number)
Greg Rose10ca1322010-01-09 02:25:10 +0000358{
359 s32 ret_val;
360 u16 i;
361
362 /* lock the mailbox to prevent pf/vf race condition */
363 ret_val = ixgbe_obtain_mbx_lock_pf(hw, vf_number);
364 if (ret_val)
Mark Rustade90dd262014-07-22 06:51:08 +0000365 return ret_val;
Greg Rose10ca1322010-01-09 02:25:10 +0000366
367 /* flush msg and acks as we are overwriting the message buffer */
368 ixgbe_check_for_msg_pf(hw, vf_number);
369 ixgbe_check_for_ack_pf(hw, vf_number);
370
371 /* copy the caller specified message to the mailbox memory buffer */
372 for (i = 0; i < size; i++)
373 IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_number), i, msg[i]);
374
375 /* Interrupt VF to tell it a message has been sent and release buffer*/
376 IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_STS);
377
378 /* update stats */
379 hw->mbx.stats.msgs_tx++;
380
Mark Rustade90dd262014-07-22 06:51:08 +0000381 return 0;
Greg Rose10ca1322010-01-09 02:25:10 +0000382}
383
384/**
385 * ixgbe_read_mbx_pf - Read a message from the mailbox
386 * @hw: pointer to the HW structure
387 * @msg: The message buffer
388 * @size: Length of buffer
389 * @vf_number: the VF index
390 *
391 * This function copies a message from the mailbox buffer to the caller's
392 * memory buffer. The presumption is that the caller knows that there was
393 * a message due to a VF request so no polling for message is needed.
394 **/
395static s32 ixgbe_read_mbx_pf(struct ixgbe_hw *hw, u32 *msg, u16 size,
Jacob Kellere7cf7452014-04-09 06:03:10 +0000396 u16 vf_number)
Greg Rose10ca1322010-01-09 02:25:10 +0000397{
398 s32 ret_val;
399 u16 i;
400
401 /* lock the mailbox to prevent pf/vf race condition */
402 ret_val = ixgbe_obtain_mbx_lock_pf(hw, vf_number);
403 if (ret_val)
Mark Rustade90dd262014-07-22 06:51:08 +0000404 return ret_val;
Greg Rose10ca1322010-01-09 02:25:10 +0000405
406 /* copy the message to the mailbox memory buffer */
407 for (i = 0; i < size; i++)
408 msg[i] = IXGBE_READ_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_number), i);
409
410 /* Acknowledge the message and release buffer */
411 IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_number), IXGBE_PFMAILBOX_ACK);
412
413 /* update stats */
414 hw->mbx.stats.msgs_rx++;
415
Mark Rustade90dd262014-07-22 06:51:08 +0000416 return 0;
Greg Rose10ca1322010-01-09 02:25:10 +0000417}
418
Don Skidmore8fecce62011-01-28 02:28:36 +0000419#ifdef CONFIG_PCI_IOV
Greg Rose10ca1322010-01-09 02:25:10 +0000420/**
421 * ixgbe_init_mbx_params_pf - set initial values for pf mailbox
422 * @hw: pointer to the HW structure
423 *
424 * Initializes the hw->mbx struct to correct values for pf mailbox
425 */
426void ixgbe_init_mbx_params_pf(struct ixgbe_hw *hw)
427{
428 struct ixgbe_mbx_info *mbx = &hw->mbx;
429
Emil Tantilovd7c8a292011-03-03 09:25:02 +0000430 if (hw->mac.type != ixgbe_mac_82599EB &&
Don Skidmore9a75a1a2014-11-07 03:53:35 +0000431 hw->mac.type != ixgbe_mac_X550 &&
432 hw->mac.type != ixgbe_mac_X550EM_x &&
Emil Tantilovd7c8a292011-03-03 09:25:02 +0000433 hw->mac.type != ixgbe_mac_X540)
434 return;
Greg Rose10ca1322010-01-09 02:25:10 +0000435
Emil Tantilovd7c8a292011-03-03 09:25:02 +0000436 mbx->timeout = 0;
Andy Gospodarek5217e872011-03-08 14:26:00 -0800437 mbx->usec_delay = 0;
Greg Rose10ca1322010-01-09 02:25:10 +0000438
Emil Tantilovd7c8a292011-03-03 09:25:02 +0000439 mbx->stats.msgs_tx = 0;
440 mbx->stats.msgs_rx = 0;
441 mbx->stats.reqs = 0;
442 mbx->stats.acks = 0;
443 mbx->stats.rsts = 0;
444
445 mbx->size = IXGBE_VFMAILBOX_SIZE;
Greg Rose10ca1322010-01-09 02:25:10 +0000446}
Don Skidmore8fecce62011-01-28 02:28:36 +0000447#endif /* CONFIG_PCI_IOV */
Greg Rose10ca1322010-01-09 02:25:10 +0000448
Don Skidmorea391f1d2010-11-16 19:27:15 -0800449struct ixgbe_mbx_operations mbx_ops_generic = {
Greg Rose10ca1322010-01-09 02:25:10 +0000450 .read = ixgbe_read_mbx_pf,
451 .write = ixgbe_write_mbx_pf,
452 .read_posted = ixgbe_read_posted_mbx,
453 .write_posted = ixgbe_write_posted_mbx,
454 .check_for_msg = ixgbe_check_for_msg_pf,
455 .check_for_ack = ixgbe_check_for_ack_pf,
456 .check_for_rst = ixgbe_check_for_rst_pf,
457};
458