blob: 1b758bdec58792b072c62a5c39c9c4536600fed7 [file] [log] [blame]
Yuval Mintzfe56b9e2015-10-26 11:02:25 +02001/* QLogic qed NIC Driver
2 * Copyright (c) 2015 QLogic Corporation
3 *
4 * This software is available under the terms of the GNU General Public License
5 * (GPL) Version 2, available from the file COPYING in the main directory of
6 * this source tree.
7 */
8
9#include <linux/stddef.h>
10#include <linux/pci.h>
11#include <linux/kernel.h>
12#include <linux/slab.h>
13#include <linux/version.h>
14#include <linux/delay.h>
15#include <asm/byteorder.h>
16#include <linux/dma-mapping.h>
17#include <linux/string.h>
18#include <linux/module.h>
19#include <linux/interrupt.h>
20#include <linux/workqueue.h>
21#include <linux/ethtool.h>
22#include <linux/etherdevice.h>
23#include <linux/vmalloc.h>
24#include <linux/qed/qed_if.h>
25
26#include "qed.h"
27#include "qed_sp.h"
28#include "qed_dev_api.h"
29#include "qed_mcp.h"
30#include "qed_hw.h"
Sudarsana Reddy Kalluru03dc76c2016-04-28 20:20:52 -040031#include "qed_selftest.h"
Yuval Mintzfe56b9e2015-10-26 11:02:25 +020032
Yuval Mintz5abd7e922016-02-24 16:52:50 +020033static char version[] =
34 "QLogic FastLinQ 4xxxx Core Module qed " DRV_MODULE_VERSION "\n";
Yuval Mintzfe56b9e2015-10-26 11:02:25 +020035
Yuval Mintz5abd7e922016-02-24 16:52:50 +020036MODULE_DESCRIPTION("QLogic FastLinQ 4xxxx Core Module");
Yuval Mintzfe56b9e2015-10-26 11:02:25 +020037MODULE_LICENSE("GPL");
38MODULE_VERSION(DRV_MODULE_VERSION);
39
40#define FW_FILE_VERSION \
41 __stringify(FW_MAJOR_VERSION) "." \
42 __stringify(FW_MINOR_VERSION) "." \
43 __stringify(FW_REVISION_VERSION) "." \
44 __stringify(FW_ENGINEERING_VERSION)
45
46#define QED_FW_FILE_NAME \
47 "qed/qed_init_values_zipped-" FW_FILE_VERSION ".bin"
48
Yuval Mintzd43d3f02016-02-24 16:52:48 +020049MODULE_FIRMWARE(QED_FW_FILE_NAME);
50
Yuval Mintzfe56b9e2015-10-26 11:02:25 +020051static int __init qed_init(void)
52{
53 pr_notice("qed_init called\n");
54
55 pr_info("%s", version);
56
57 return 0;
58}
59
60static void __exit qed_cleanup(void)
61{
62 pr_notice("qed_cleanup called\n");
63}
64
65module_init(qed_init);
66module_exit(qed_cleanup);
67
68/* Check if the DMA controller on the machine can properly handle the DMA
69 * addressing required by the device.
70*/
71static int qed_set_coherency_mask(struct qed_dev *cdev)
72{
73 struct device *dev = &cdev->pdev->dev;
74
75 if (dma_set_mask(dev, DMA_BIT_MASK(64)) == 0) {
76 if (dma_set_coherent_mask(dev, DMA_BIT_MASK(64)) != 0) {
77 DP_NOTICE(cdev,
78 "Can't request 64-bit consistent allocations\n");
79 return -EIO;
80 }
81 } else if (dma_set_mask(dev, DMA_BIT_MASK(32)) != 0) {
82 DP_NOTICE(cdev, "Can't request 64b/32b DMA addresses\n");
83 return -EIO;
84 }
85
86 return 0;
87}
88
89static void qed_free_pci(struct qed_dev *cdev)
90{
91 struct pci_dev *pdev = cdev->pdev;
92
93 if (cdev->doorbells)
94 iounmap(cdev->doorbells);
95 if (cdev->regview)
96 iounmap(cdev->regview);
97 if (atomic_read(&pdev->enable_cnt) == 1)
98 pci_release_regions(pdev);
99
100 pci_disable_device(pdev);
101}
102
Yuval Mintz0dfaba62016-02-24 16:52:49 +0200103#define PCI_REVISION_ID_ERROR_VAL 0xff
104
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200105/* Performs PCI initializations as well as initializing PCI-related parameters
106 * in the device structrue. Returns 0 in case of success.
107 */
108static int qed_init_pci(struct qed_dev *cdev,
109 struct pci_dev *pdev)
110{
Yuval Mintz0dfaba62016-02-24 16:52:49 +0200111 u8 rev_id;
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200112 int rc;
113
114 cdev->pdev = pdev;
115
116 rc = pci_enable_device(pdev);
117 if (rc) {
118 DP_NOTICE(cdev, "Cannot enable PCI device\n");
119 goto err0;
120 }
121
122 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
123 DP_NOTICE(cdev, "No memory region found in bar #0\n");
124 rc = -EIO;
125 goto err1;
126 }
127
128 if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM)) {
129 DP_NOTICE(cdev, "No memory region found in bar #2\n");
130 rc = -EIO;
131 goto err1;
132 }
133
134 if (atomic_read(&pdev->enable_cnt) == 1) {
135 rc = pci_request_regions(pdev, "qed");
136 if (rc) {
137 DP_NOTICE(cdev,
138 "Failed to request PCI memory resources\n");
139 goto err1;
140 }
141 pci_set_master(pdev);
142 pci_save_state(pdev);
143 }
144
Yuval Mintz0dfaba62016-02-24 16:52:49 +0200145 pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id);
146 if (rev_id == PCI_REVISION_ID_ERROR_VAL) {
147 DP_NOTICE(cdev,
148 "Detected PCI device error [rev_id 0x%x]. Probably due to prior indication. Aborting.\n",
149 rev_id);
150 rc = -ENODEV;
151 goto err2;
152 }
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200153 if (!pci_is_pcie(pdev)) {
154 DP_NOTICE(cdev, "The bus is not PCI Express\n");
155 rc = -EIO;
156 goto err2;
157 }
158
159 cdev->pci_params.pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
160 if (cdev->pci_params.pm_cap == 0)
161 DP_NOTICE(cdev, "Cannot find power management capability\n");
162
163 rc = qed_set_coherency_mask(cdev);
164 if (rc)
165 goto err2;
166
167 cdev->pci_params.mem_start = pci_resource_start(pdev, 0);
168 cdev->pci_params.mem_end = pci_resource_end(pdev, 0);
169 cdev->pci_params.irq = pdev->irq;
170
171 cdev->regview = pci_ioremap_bar(pdev, 0);
172 if (!cdev->regview) {
173 DP_NOTICE(cdev, "Cannot map register space, aborting\n");
174 rc = -ENOMEM;
175 goto err2;
176 }
177
178 cdev->db_phys_addr = pci_resource_start(cdev->pdev, 2);
179 cdev->db_size = pci_resource_len(cdev->pdev, 2);
180 cdev->doorbells = ioremap_wc(cdev->db_phys_addr, cdev->db_size);
181 if (!cdev->doorbells) {
182 DP_NOTICE(cdev, "Cannot map doorbell space\n");
183 return -ENOMEM;
184 }
185
186 return 0;
187
188err2:
189 pci_release_regions(pdev);
190err1:
191 pci_disable_device(pdev);
192err0:
193 return rc;
194}
195
196int qed_fill_dev_info(struct qed_dev *cdev,
197 struct qed_dev_info *dev_info)
198{
Manish Chopracee4d262015-10-26 11:02:28 +0200199 struct qed_ptt *ptt;
200
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200201 memset(dev_info, 0, sizeof(struct qed_dev_info));
202
203 dev_info->num_hwfns = cdev->num_hwfns;
204 dev_info->pci_mem_start = cdev->pci_params.mem_start;
205 dev_info->pci_mem_end = cdev->pci_params.mem_end;
206 dev_info->pci_irq = cdev->pci_params.irq;
Yuval Mintzfc48b7a2016-02-15 13:22:35 -0500207 dev_info->is_mf_default = IS_MF_DEFAULT(&cdev->hwfns[0]);
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200208 ether_addr_copy(dev_info->hw_mac, cdev->hwfns[0].hw_info.hw_mac_addr);
209
210 dev_info->fw_major = FW_MAJOR_VERSION;
211 dev_info->fw_minor = FW_MINOR_VERSION;
212 dev_info->fw_rev = FW_REVISION_VERSION;
213 dev_info->fw_eng = FW_ENGINEERING_VERSION;
214 dev_info->mf_mode = cdev->mf_mode;
215
216 qed_mcp_get_mfw_ver(cdev, &dev_info->mfw_rev);
217
Manish Chopracee4d262015-10-26 11:02:28 +0200218 ptt = qed_ptt_acquire(QED_LEADING_HWFN(cdev));
219 if (ptt) {
220 qed_mcp_get_flash_size(QED_LEADING_HWFN(cdev), ptt,
221 &dev_info->flash_size);
222
223 qed_ptt_release(QED_LEADING_HWFN(cdev), ptt);
224 }
225
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200226 return 0;
227}
228
229static void qed_free_cdev(struct qed_dev *cdev)
230{
231 kfree((void *)cdev);
232}
233
234static struct qed_dev *qed_alloc_cdev(struct pci_dev *pdev)
235{
236 struct qed_dev *cdev;
237
238 cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
239 if (!cdev)
240 return cdev;
241
242 qed_init_struct(cdev);
243
244 return cdev;
245}
246
247/* Sets the requested power state */
248static int qed_set_power_state(struct qed_dev *cdev,
249 pci_power_t state)
250{
251 if (!cdev)
252 return -ENODEV;
253
254 DP_VERBOSE(cdev, NETIF_MSG_DRV, "Omitting Power state change\n");
255 return 0;
256}
257
258/* probing */
259static struct qed_dev *qed_probe(struct pci_dev *pdev,
260 enum qed_protocol protocol,
261 u32 dp_module,
262 u8 dp_level)
263{
264 struct qed_dev *cdev;
265 int rc;
266
267 cdev = qed_alloc_cdev(pdev);
268 if (!cdev)
269 goto err0;
270
271 cdev->protocol = protocol;
272
273 qed_init_dp(cdev, dp_module, dp_level);
274
275 rc = qed_init_pci(cdev, pdev);
276 if (rc) {
277 DP_ERR(cdev, "init pci failed\n");
278 goto err1;
279 }
280 DP_INFO(cdev, "PCI init completed successfully\n");
281
282 rc = qed_hw_prepare(cdev, QED_PCI_DEFAULT);
283 if (rc) {
284 DP_ERR(cdev, "hw prepare failed\n");
285 goto err2;
286 }
287
288 DP_INFO(cdev, "qed_probe completed successffuly\n");
289
290 return cdev;
291
292err2:
293 qed_free_pci(cdev);
294err1:
295 qed_free_cdev(cdev);
296err0:
297 return NULL;
298}
299
300static void qed_remove(struct qed_dev *cdev)
301{
302 if (!cdev)
303 return;
304
305 qed_hw_remove(cdev);
306
307 qed_free_pci(cdev);
308
309 qed_set_power_state(cdev, PCI_D3hot);
310
311 qed_free_cdev(cdev);
312}
313
314static void qed_disable_msix(struct qed_dev *cdev)
315{
316 if (cdev->int_params.out.int_mode == QED_INT_MODE_MSIX) {
317 pci_disable_msix(cdev->pdev);
318 kfree(cdev->int_params.msix_table);
319 } else if (cdev->int_params.out.int_mode == QED_INT_MODE_MSI) {
320 pci_disable_msi(cdev->pdev);
321 }
322
323 memset(&cdev->int_params.out, 0, sizeof(struct qed_int_param));
324}
325
326static int qed_enable_msix(struct qed_dev *cdev,
327 struct qed_int_params *int_params)
328{
329 int i, rc, cnt;
330
331 cnt = int_params->in.num_vectors;
332
333 for (i = 0; i < cnt; i++)
334 int_params->msix_table[i].entry = i;
335
336 rc = pci_enable_msix_range(cdev->pdev, int_params->msix_table,
337 int_params->in.min_msix_cnt, cnt);
338 if (rc < cnt && rc >= int_params->in.min_msix_cnt &&
339 (rc % cdev->num_hwfns)) {
340 pci_disable_msix(cdev->pdev);
341
342 /* If fastpath is initialized, we need at least one interrupt
343 * per hwfn [and the slow path interrupts]. New requested number
344 * should be a multiple of the number of hwfns.
345 */
346 cnt = (rc / cdev->num_hwfns) * cdev->num_hwfns;
347 DP_NOTICE(cdev,
348 "Trying to enable MSI-X with less vectors (%d out of %d)\n",
349 cnt, int_params->in.num_vectors);
350 rc = pci_enable_msix_exact(cdev->pdev,
351 int_params->msix_table, cnt);
352 if (!rc)
353 rc = cnt;
354 }
355
356 if (rc > 0) {
357 /* MSI-x configuration was achieved */
358 int_params->out.int_mode = QED_INT_MODE_MSIX;
359 int_params->out.num_vectors = rc;
360 rc = 0;
361 } else {
362 DP_NOTICE(cdev,
363 "Failed to enable MSI-X [Requested %d vectors][rc %d]\n",
364 cnt, rc);
365 }
366
367 return rc;
368}
369
370/* This function outputs the int mode and the number of enabled msix vector */
371static int qed_set_int_mode(struct qed_dev *cdev, bool force_mode)
372{
373 struct qed_int_params *int_params = &cdev->int_params;
374 struct msix_entry *tbl;
375 int rc = 0, cnt;
376
377 switch (int_params->in.int_mode) {
378 case QED_INT_MODE_MSIX:
379 /* Allocate MSIX table */
380 cnt = int_params->in.num_vectors;
381 int_params->msix_table = kcalloc(cnt, sizeof(*tbl), GFP_KERNEL);
382 if (!int_params->msix_table) {
383 rc = -ENOMEM;
384 goto out;
385 }
386
387 /* Enable MSIX */
388 rc = qed_enable_msix(cdev, int_params);
389 if (!rc)
390 goto out;
391
392 DP_NOTICE(cdev, "Failed to enable MSI-X\n");
393 kfree(int_params->msix_table);
394 if (force_mode)
395 goto out;
396 /* Fallthrough */
397
398 case QED_INT_MODE_MSI:
399 rc = pci_enable_msi(cdev->pdev);
400 if (!rc) {
401 int_params->out.int_mode = QED_INT_MODE_MSI;
402 goto out;
403 }
404
405 DP_NOTICE(cdev, "Failed to enable MSI\n");
406 if (force_mode)
407 goto out;
408 /* Fallthrough */
409
410 case QED_INT_MODE_INTA:
411 int_params->out.int_mode = QED_INT_MODE_INTA;
412 rc = 0;
413 goto out;
414 default:
415 DP_NOTICE(cdev, "Unknown int_mode value %d\n",
416 int_params->in.int_mode);
417 rc = -EINVAL;
418 }
419
420out:
421 cdev->int_coalescing_mode = QED_COAL_MODE_ENABLE;
422
423 return rc;
424}
425
426static void qed_simd_handler_config(struct qed_dev *cdev, void *token,
427 int index, void(*handler)(void *))
428{
429 struct qed_hwfn *hwfn = &cdev->hwfns[index % cdev->num_hwfns];
430 int relative_idx = index / cdev->num_hwfns;
431
432 hwfn->simd_proto_handler[relative_idx].func = handler;
433 hwfn->simd_proto_handler[relative_idx].token = token;
434}
435
436static void qed_simd_handler_clean(struct qed_dev *cdev, int index)
437{
438 struct qed_hwfn *hwfn = &cdev->hwfns[index % cdev->num_hwfns];
439 int relative_idx = index / cdev->num_hwfns;
440
441 memset(&hwfn->simd_proto_handler[relative_idx], 0,
442 sizeof(struct qed_simd_fp_handler));
443}
444
445static irqreturn_t qed_msix_sp_int(int irq, void *tasklet)
446{
447 tasklet_schedule((struct tasklet_struct *)tasklet);
448 return IRQ_HANDLED;
449}
450
451static irqreturn_t qed_single_int(int irq, void *dev_instance)
452{
453 struct qed_dev *cdev = (struct qed_dev *)dev_instance;
454 struct qed_hwfn *hwfn;
455 irqreturn_t rc = IRQ_NONE;
456 u64 status;
457 int i, j;
458
459 for (i = 0; i < cdev->num_hwfns; i++) {
460 status = qed_int_igu_read_sisr_reg(&cdev->hwfns[i]);
461
462 if (!status)
463 continue;
464
465 hwfn = &cdev->hwfns[i];
466
467 /* Slowpath interrupt */
468 if (unlikely(status & 0x1)) {
469 tasklet_schedule(hwfn->sp_dpc);
470 status &= ~0x1;
471 rc = IRQ_HANDLED;
472 }
473
474 /* Fastpath interrupts */
475 for (j = 0; j < 64; j++) {
476 if ((0x2ULL << j) & status) {
477 hwfn->simd_proto_handler[j].func(
478 hwfn->simd_proto_handler[j].token);
479 status &= ~(0x2ULL << j);
480 rc = IRQ_HANDLED;
481 }
482 }
483
484 if (unlikely(status))
485 DP_VERBOSE(hwfn, NETIF_MSG_INTR,
486 "got an unknown interrupt status 0x%llx\n",
487 status);
488 }
489
490 return rc;
491}
492
Sudarsana Kalluru8f16bc92015-12-07 06:25:59 -0500493int qed_slowpath_irq_req(struct qed_hwfn *hwfn)
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200494{
Sudarsana Kalluru8f16bc92015-12-07 06:25:59 -0500495 struct qed_dev *cdev = hwfn->cdev;
496 int rc = 0;
497 u8 id;
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200498
499 if (cdev->int_params.out.int_mode == QED_INT_MODE_MSIX) {
Sudarsana Kalluru8f16bc92015-12-07 06:25:59 -0500500 id = hwfn->my_id;
501 snprintf(hwfn->name, NAME_SIZE, "sp-%d-%02x:%02x.%02x",
502 id, cdev->pdev->bus->number,
503 PCI_SLOT(cdev->pdev->devfn), hwfn->abs_pf_id);
504 rc = request_irq(cdev->int_params.msix_table[id].vector,
505 qed_msix_sp_int, 0, hwfn->name, hwfn->sp_dpc);
506 if (!rc)
507 DP_VERBOSE(hwfn, (NETIF_MSG_INTR | QED_MSG_SP),
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200508 "Requested slowpath MSI-X\n");
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200509 } else {
510 unsigned long flags = 0;
511
512 snprintf(cdev->name, NAME_SIZE, "%02x:%02x.%02x",
513 cdev->pdev->bus->number, PCI_SLOT(cdev->pdev->devfn),
514 PCI_FUNC(cdev->pdev->devfn));
515
516 if (cdev->int_params.out.int_mode == QED_INT_MODE_INTA)
517 flags |= IRQF_SHARED;
518
519 rc = request_irq(cdev->pdev->irq, qed_single_int,
520 flags, cdev->name, cdev);
521 }
522
523 return rc;
524}
525
526static void qed_slowpath_irq_free(struct qed_dev *cdev)
527{
528 int i;
529
530 if (cdev->int_params.out.int_mode == QED_INT_MODE_MSIX) {
531 for_each_hwfn(cdev, i) {
Sudarsana Kalluru8f16bc92015-12-07 06:25:59 -0500532 if (!cdev->hwfns[i].b_int_requested)
533 break;
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200534 synchronize_irq(cdev->int_params.msix_table[i].vector);
535 free_irq(cdev->int_params.msix_table[i].vector,
536 cdev->hwfns[i].sp_dpc);
537 }
538 } else {
Sudarsana Kalluru8f16bc92015-12-07 06:25:59 -0500539 if (QED_LEADING_HWFN(cdev)->b_int_requested)
540 free_irq(cdev->pdev->irq, cdev);
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200541 }
Sudarsana Kalluru8f16bc92015-12-07 06:25:59 -0500542 qed_int_disable_post_isr_release(cdev);
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200543}
544
545static int qed_nic_stop(struct qed_dev *cdev)
546{
547 int i, rc;
548
549 rc = qed_hw_stop(cdev);
550
551 for (i = 0; i < cdev->num_hwfns; i++) {
552 struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
553
554 if (p_hwfn->b_sp_dpc_enabled) {
555 tasklet_disable(p_hwfn->sp_dpc);
556 p_hwfn->b_sp_dpc_enabled = false;
557 DP_VERBOSE(cdev, NETIF_MSG_IFDOWN,
558 "Disabled sp taskelt [hwfn %d] at %p\n",
559 i, p_hwfn->sp_dpc);
560 }
561 }
562
563 return rc;
564}
565
566static int qed_nic_reset(struct qed_dev *cdev)
567{
568 int rc;
569
570 rc = qed_hw_reset(cdev);
571 if (rc)
572 return rc;
573
574 qed_resc_free(cdev);
575
576 return 0;
577}
578
579static int qed_nic_setup(struct qed_dev *cdev)
580{
581 int rc;
582
583 rc = qed_resc_alloc(cdev);
584 if (rc)
585 return rc;
586
587 DP_INFO(cdev, "Allocated qed resources\n");
588
589 qed_resc_setup(cdev);
590
591 return rc;
592}
593
594static int qed_set_int_fp(struct qed_dev *cdev, u16 cnt)
595{
596 int limit = 0;
597
598 /* Mark the fastpath as free/used */
599 cdev->int_params.fp_initialized = cnt ? true : false;
600
601 if (cdev->int_params.out.int_mode != QED_INT_MODE_MSIX)
602 limit = cdev->num_hwfns * 63;
603 else if (cdev->int_params.fp_msix_cnt)
604 limit = cdev->int_params.fp_msix_cnt;
605
606 if (!limit)
607 return -ENOMEM;
608
609 return min_t(int, cnt, limit);
610}
611
612static int qed_get_int_fp(struct qed_dev *cdev, struct qed_int_info *info)
613{
614 memset(info, 0, sizeof(struct qed_int_info));
615
616 if (!cdev->int_params.fp_initialized) {
617 DP_INFO(cdev,
618 "Protocol driver requested interrupt information, but its support is not yet configured\n");
619 return -EINVAL;
620 }
621
622 /* Need to expose only MSI-X information; Single IRQ is handled solely
623 * by qed.
624 */
625 if (cdev->int_params.out.int_mode == QED_INT_MODE_MSIX) {
626 int msix_base = cdev->int_params.fp_msix_base;
627
628 info->msix_cnt = cdev->int_params.fp_msix_cnt;
629 info->msix = &cdev->int_params.msix_table[msix_base];
630 }
631
632 return 0;
633}
634
635static int qed_slowpath_setup_int(struct qed_dev *cdev,
636 enum qed_int_mode int_mode)
637{
Yuval Mintz4ac801b2016-02-28 12:26:52 +0200638 struct qed_sb_cnt_info sb_cnt_info;
639 int rc;
640 int i;
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200641 memset(&cdev->int_params, 0, sizeof(struct qed_int_params));
642
643 cdev->int_params.in.int_mode = int_mode;
Yuval Mintz4ac801b2016-02-28 12:26:52 +0200644 for_each_hwfn(cdev, i) {
645 memset(&sb_cnt_info, 0, sizeof(sb_cnt_info));
646 qed_int_get_num_sbs(&cdev->hwfns[i], &sb_cnt_info);
647 cdev->int_params.in.num_vectors += sb_cnt_info.sb_cnt;
648 cdev->int_params.in.num_vectors++; /* slowpath */
649 }
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200650
651 /* We want a minimum of one slowpath and one fastpath vector per hwfn */
652 cdev->int_params.in.min_msix_cnt = cdev->num_hwfns * 2;
653
654 rc = qed_set_int_mode(cdev, false);
655 if (rc) {
656 DP_ERR(cdev, "qed_slowpath_setup_int ERR\n");
657 return rc;
658 }
659
660 cdev->int_params.fp_msix_base = cdev->num_hwfns;
661 cdev->int_params.fp_msix_cnt = cdev->int_params.out.num_vectors -
662 cdev->num_hwfns;
663
664 return 0;
665}
666
667u32 qed_unzip_data(struct qed_hwfn *p_hwfn, u32 input_len,
668 u8 *input_buf, u32 max_size, u8 *unzip_buf)
669{
670 int rc;
671
672 p_hwfn->stream->next_in = input_buf;
673 p_hwfn->stream->avail_in = input_len;
674 p_hwfn->stream->next_out = unzip_buf;
675 p_hwfn->stream->avail_out = max_size;
676
677 rc = zlib_inflateInit2(p_hwfn->stream, MAX_WBITS);
678
679 if (rc != Z_OK) {
680 DP_VERBOSE(p_hwfn, NETIF_MSG_DRV, "zlib init failed, rc = %d\n",
681 rc);
682 return 0;
683 }
684
685 rc = zlib_inflate(p_hwfn->stream, Z_FINISH);
686 zlib_inflateEnd(p_hwfn->stream);
687
688 if (rc != Z_OK && rc != Z_STREAM_END) {
689 DP_VERBOSE(p_hwfn, NETIF_MSG_DRV, "FW unzip error: %s, rc=%d\n",
690 p_hwfn->stream->msg, rc);
691 return 0;
692 }
693
694 return p_hwfn->stream->total_out / 4;
695}
696
697static int qed_alloc_stream_mem(struct qed_dev *cdev)
698{
699 int i;
700 void *workspace;
701
702 for_each_hwfn(cdev, i) {
703 struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
704
705 p_hwfn->stream = kzalloc(sizeof(*p_hwfn->stream), GFP_KERNEL);
706 if (!p_hwfn->stream)
707 return -ENOMEM;
708
709 workspace = vzalloc(zlib_inflate_workspacesize());
710 if (!workspace)
711 return -ENOMEM;
712 p_hwfn->stream->workspace = workspace;
713 }
714
715 return 0;
716}
717
718static void qed_free_stream_mem(struct qed_dev *cdev)
719{
720 int i;
721
722 for_each_hwfn(cdev, i) {
723 struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
724
725 if (!p_hwfn->stream)
726 return;
727
728 vfree(p_hwfn->stream->workspace);
729 kfree(p_hwfn->stream);
730 }
731}
732
733static void qed_update_pf_params(struct qed_dev *cdev,
734 struct qed_pf_params *params)
735{
736 int i;
737
738 for (i = 0; i < cdev->num_hwfns; i++) {
739 struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
740
741 p_hwfn->pf_params = *params;
742 }
743}
744
745static int qed_slowpath_start(struct qed_dev *cdev,
746 struct qed_slowpath_params *params)
747{
Manish Choprab18e1702016-04-14 01:38:30 -0400748 struct qed_tunn_start_params tunn_info;
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200749 struct qed_mcp_drv_version drv_version;
750 const u8 *data = NULL;
751 struct qed_hwfn *hwfn;
752 int rc;
753
754 rc = request_firmware(&cdev->firmware, QED_FW_FILE_NAME,
755 &cdev->pdev->dev);
756 if (rc) {
757 DP_NOTICE(cdev,
758 "Failed to find fw file - /lib/firmware/%s\n",
759 QED_FW_FILE_NAME);
760 goto err;
761 }
762
763 rc = qed_nic_setup(cdev);
764 if (rc)
765 goto err;
766
767 rc = qed_slowpath_setup_int(cdev, params->int_mode);
768 if (rc)
769 goto err1;
770
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200771 /* Allocate stream for unzipping */
772 rc = qed_alloc_stream_mem(cdev);
773 if (rc) {
774 DP_NOTICE(cdev, "Failed to allocate stream memory\n");
Sudarsana Kalluru8f16bc92015-12-07 06:25:59 -0500775 goto err2;
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200776 }
777
778 /* Start the slowpath */
779 data = cdev->firmware->data;
780
Manish Choprab18e1702016-04-14 01:38:30 -0400781 memset(&tunn_info, 0, sizeof(tunn_info));
Manish Chopra9a109dd2016-04-14 01:38:31 -0400782 tunn_info.tunn_mode |= 1 << QED_MODE_VXLAN_TUNN |
Manish Chopraf7985862016-04-14 01:38:32 -0400783 1 << QED_MODE_L2GRE_TUNN |
784 1 << QED_MODE_IPGRE_TUNN |
Manish Chopra9a109dd2016-04-14 01:38:31 -0400785 1 << QED_MODE_L2GENEVE_TUNN |
786 1 << QED_MODE_IPGENEVE_TUNN;
787
Manish Choprab18e1702016-04-14 01:38:30 -0400788 tunn_info.tunn_clss_vxlan = QED_TUNN_CLSS_MAC_VLAN;
Manish Chopraf7985862016-04-14 01:38:32 -0400789 tunn_info.tunn_clss_l2gre = QED_TUNN_CLSS_MAC_VLAN;
790 tunn_info.tunn_clss_ipgre = QED_TUNN_CLSS_MAC_VLAN;
Manish Choprab18e1702016-04-14 01:38:30 -0400791
792 rc = qed_hw_init(cdev, &tunn_info, true,
793 cdev->int_params.out.int_mode,
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200794 true, data);
795 if (rc)
Yuval Mintz8c925c42016-03-02 20:26:03 +0200796 goto err2;
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200797
798 DP_INFO(cdev,
799 "HW initialization and function start completed successfully\n");
800
801 hwfn = QED_LEADING_HWFN(cdev);
802 drv_version.version = (params->drv_major << 24) |
803 (params->drv_minor << 16) |
804 (params->drv_rev << 8) |
805 (params->drv_eng);
806 strlcpy(drv_version.name, params->name,
807 MCP_DRV_VER_STR_SIZE - 4);
808 rc = qed_mcp_send_drv_version(hwfn, hwfn->p_main_ptt,
809 &drv_version);
810 if (rc) {
811 DP_NOTICE(cdev, "Failed sending drv version command\n");
812 return rc;
813 }
814
Yuval Mintz8c925c42016-03-02 20:26:03 +0200815 qed_reset_vport_stats(cdev);
816
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200817 return 0;
818
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200819err2:
Yuval Mintz8c925c42016-03-02 20:26:03 +0200820 qed_hw_timers_stop_all(cdev);
821 qed_slowpath_irq_free(cdev);
822 qed_free_stream_mem(cdev);
Yuval Mintzfe56b9e2015-10-26 11:02:25 +0200823 qed_disable_msix(cdev);
824err1:
825 qed_resc_free(cdev);
826err:
827 release_firmware(cdev->firmware);
828
829 return rc;
830}
831
832static int qed_slowpath_stop(struct qed_dev *cdev)
833{
834 if (!cdev)
835 return -ENODEV;
836
837 qed_free_stream_mem(cdev);
838
839 qed_nic_stop(cdev);
840 qed_slowpath_irq_free(cdev);
841
842 qed_disable_msix(cdev);
843 qed_nic_reset(cdev);
844
845 release_firmware(cdev->firmware);
846
847 return 0;
848}
849
850static void qed_set_id(struct qed_dev *cdev, char name[NAME_SIZE],
851 char ver_str[VER_SIZE])
852{
853 int i;
854
855 memcpy(cdev->name, name, NAME_SIZE);
856 for_each_hwfn(cdev, i)
857 snprintf(cdev->hwfns[i].name, NAME_SIZE, "%s-%d", name, i);
858
859 memcpy(cdev->ver_str, ver_str, VER_SIZE);
860 cdev->drv_type = DRV_ID_DRV_TYPE_LINUX;
861}
862
863static u32 qed_sb_init(struct qed_dev *cdev,
864 struct qed_sb_info *sb_info,
865 void *sb_virt_addr,
866 dma_addr_t sb_phy_addr, u16 sb_id,
867 enum qed_sb_type type)
868{
869 struct qed_hwfn *p_hwfn;
870 int hwfn_index;
871 u16 rel_sb_id;
872 u8 n_hwfns;
873 u32 rc;
874
875 /* RoCE uses single engine and CMT uses two engines. When using both
876 * we force only a single engine. Storage uses only engine 0 too.
877 */
878 if (type == QED_SB_TYPE_L2_QUEUE)
879 n_hwfns = cdev->num_hwfns;
880 else
881 n_hwfns = 1;
882
883 hwfn_index = sb_id % n_hwfns;
884 p_hwfn = &cdev->hwfns[hwfn_index];
885 rel_sb_id = sb_id / n_hwfns;
886
887 DP_VERBOSE(cdev, NETIF_MSG_INTR,
888 "hwfn [%d] <--[init]-- SB %04x [0x%04x upper]\n",
889 hwfn_index, rel_sb_id, sb_id);
890
891 rc = qed_int_sb_init(p_hwfn, p_hwfn->p_main_ptt, sb_info,
892 sb_virt_addr, sb_phy_addr, rel_sb_id);
893
894 return rc;
895}
896
897static u32 qed_sb_release(struct qed_dev *cdev,
898 struct qed_sb_info *sb_info,
899 u16 sb_id)
900{
901 struct qed_hwfn *p_hwfn;
902 int hwfn_index;
903 u16 rel_sb_id;
904 u32 rc;
905
906 hwfn_index = sb_id % cdev->num_hwfns;
907 p_hwfn = &cdev->hwfns[hwfn_index];
908 rel_sb_id = sb_id / cdev->num_hwfns;
909
910 DP_VERBOSE(cdev, NETIF_MSG_INTR,
911 "hwfn [%d] <--[init]-- SB %04x [0x%04x upper]\n",
912 hwfn_index, rel_sb_id, sb_id);
913
914 rc = qed_int_sb_release(p_hwfn, sb_info, rel_sb_id);
915
916 return rc;
917}
918
Yuval Mintzfe7cd2b2016-04-22 08:41:03 +0300919static bool qed_can_link_change(struct qed_dev *cdev)
920{
921 return true;
922}
923
Yuval Mintzcc875c22015-10-26 11:02:31 +0200924static int qed_set_link(struct qed_dev *cdev,
925 struct qed_link_params *params)
926{
927 struct qed_hwfn *hwfn;
928 struct qed_mcp_link_params *link_params;
929 struct qed_ptt *ptt;
930 int rc;
931
932 if (!cdev)
933 return -ENODEV;
934
935 /* The link should be set only once per PF */
936 hwfn = &cdev->hwfns[0];
937
938 ptt = qed_ptt_acquire(hwfn);
939 if (!ptt)
940 return -EBUSY;
941
942 link_params = qed_mcp_get_link_params(hwfn);
943 if (params->override_flags & QED_LINK_OVERRIDE_SPEED_AUTONEG)
944 link_params->speed.autoneg = params->autoneg;
945 if (params->override_flags & QED_LINK_OVERRIDE_SPEED_ADV_SPEEDS) {
946 link_params->speed.advertised_speeds = 0;
947 if ((params->adv_speeds & SUPPORTED_1000baseT_Half) ||
948 (params->adv_speeds & SUPPORTED_1000baseT_Full))
949 link_params->speed.advertised_speeds |=
950 NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_1G;
951 if (params->adv_speeds & SUPPORTED_10000baseKR_Full)
952 link_params->speed.advertised_speeds |=
953 NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_10G;
954 if (params->adv_speeds & SUPPORTED_40000baseLR4_Full)
955 link_params->speed.advertised_speeds |=
956 NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_40G;
957 if (params->adv_speeds & 0)
958 link_params->speed.advertised_speeds |=
959 NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_50G;
960 if (params->adv_speeds & 0)
961 link_params->speed.advertised_speeds |=
962 NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_100G;
963 }
964 if (params->override_flags & QED_LINK_OVERRIDE_SPEED_FORCED_SPEED)
965 link_params->speed.forced_speed = params->forced_speed;
Sudarsana Reddy Kallurua43f2352016-04-22 08:41:04 +0300966 if (params->override_flags & QED_LINK_OVERRIDE_PAUSE_CONFIG) {
967 if (params->pause_config & QED_LINK_PAUSE_AUTONEG_ENABLE)
968 link_params->pause.autoneg = true;
969 else
970 link_params->pause.autoneg = false;
971 if (params->pause_config & QED_LINK_PAUSE_RX_ENABLE)
972 link_params->pause.forced_rx = true;
973 else
974 link_params->pause.forced_rx = false;
975 if (params->pause_config & QED_LINK_PAUSE_TX_ENABLE)
976 link_params->pause.forced_tx = true;
977 else
978 link_params->pause.forced_tx = false;
979 }
Sudarsana Reddy Kalluru03dc76c2016-04-28 20:20:52 -0400980 if (params->override_flags & QED_LINK_OVERRIDE_LOOPBACK_MODE) {
981 switch (params->loopback_mode) {
982 case QED_LINK_LOOPBACK_INT_PHY:
983 link_params->loopback_mode = PMM_LOOPBACK_INT_PHY;
984 break;
985 case QED_LINK_LOOPBACK_EXT_PHY:
986 link_params->loopback_mode = PMM_LOOPBACK_EXT_PHY;
987 break;
988 case QED_LINK_LOOPBACK_EXT:
989 link_params->loopback_mode = PMM_LOOPBACK_EXT;
990 break;
991 case QED_LINK_LOOPBACK_MAC:
992 link_params->loopback_mode = PMM_LOOPBACK_MAC;
993 break;
994 default:
995 link_params->loopback_mode = PMM_LOOPBACK_NONE;
996 break;
997 }
998 }
Yuval Mintzcc875c22015-10-26 11:02:31 +0200999
1000 rc = qed_mcp_set_link(hwfn, ptt, params->link_up);
1001
1002 qed_ptt_release(hwfn, ptt);
1003
1004 return rc;
1005}
1006
1007static int qed_get_port_type(u32 media_type)
1008{
1009 int port_type;
1010
1011 switch (media_type) {
1012 case MEDIA_SFPP_10G_FIBER:
1013 case MEDIA_SFP_1G_FIBER:
1014 case MEDIA_XFP_FIBER:
1015 case MEDIA_KR:
1016 port_type = PORT_FIBRE;
1017 break;
1018 case MEDIA_DA_TWINAX:
1019 port_type = PORT_DA;
1020 break;
1021 case MEDIA_BASE_T:
1022 port_type = PORT_TP;
1023 break;
1024 case MEDIA_NOT_PRESENT:
1025 port_type = PORT_NONE;
1026 break;
1027 case MEDIA_UNSPECIFIED:
1028 default:
1029 port_type = PORT_OTHER;
1030 break;
1031 }
1032 return port_type;
1033}
1034
1035static void qed_fill_link(struct qed_hwfn *hwfn,
1036 struct qed_link_output *if_link)
1037{
1038 struct qed_mcp_link_params params;
1039 struct qed_mcp_link_state link;
1040 struct qed_mcp_link_capabilities link_caps;
1041 u32 media_type;
1042
1043 memset(if_link, 0, sizeof(*if_link));
1044
1045 /* Prepare source inputs */
1046 memcpy(&params, qed_mcp_get_link_params(hwfn), sizeof(params));
1047 memcpy(&link, qed_mcp_get_link_state(hwfn), sizeof(link));
1048 memcpy(&link_caps, qed_mcp_get_link_capabilities(hwfn),
1049 sizeof(link_caps));
1050
1051 /* Set the link parameters to pass to protocol driver */
1052 if (link.link_up)
1053 if_link->link_up = true;
1054
1055 /* TODO - at the moment assume supported and advertised speed equal */
1056 if_link->supported_caps = SUPPORTED_FIBRE;
1057 if (params.speed.autoneg)
1058 if_link->supported_caps |= SUPPORTED_Autoneg;
1059 if (params.pause.autoneg ||
1060 (params.pause.forced_rx && params.pause.forced_tx))
1061 if_link->supported_caps |= SUPPORTED_Asym_Pause;
1062 if (params.pause.autoneg || params.pause.forced_rx ||
1063 params.pause.forced_tx)
1064 if_link->supported_caps |= SUPPORTED_Pause;
1065
1066 if_link->advertised_caps = if_link->supported_caps;
1067 if (params.speed.advertised_speeds &
1068 NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_1G)
1069 if_link->advertised_caps |= SUPPORTED_1000baseT_Half |
1070 SUPPORTED_1000baseT_Full;
1071 if (params.speed.advertised_speeds &
1072 NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_10G)
1073 if_link->advertised_caps |= SUPPORTED_10000baseKR_Full;
1074 if (params.speed.advertised_speeds &
1075 NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_40G)
1076 if_link->advertised_caps |= SUPPORTED_40000baseLR4_Full;
1077 if (params.speed.advertised_speeds &
1078 NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_50G)
1079 if_link->advertised_caps |= 0;
1080 if (params.speed.advertised_speeds &
1081 NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_100G)
1082 if_link->advertised_caps |= 0;
1083
1084 if (link_caps.speed_capabilities &
1085 NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_1G)
1086 if_link->supported_caps |= SUPPORTED_1000baseT_Half |
1087 SUPPORTED_1000baseT_Full;
1088 if (link_caps.speed_capabilities &
1089 NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_10G)
1090 if_link->supported_caps |= SUPPORTED_10000baseKR_Full;
1091 if (link_caps.speed_capabilities &
1092 NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_40G)
1093 if_link->supported_caps |= SUPPORTED_40000baseLR4_Full;
1094 if (link_caps.speed_capabilities &
1095 NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_50G)
1096 if_link->supported_caps |= 0;
1097 if (link_caps.speed_capabilities &
1098 NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_100G)
1099 if_link->supported_caps |= 0;
1100
1101 if (link.link_up)
1102 if_link->speed = link.speed;
1103
1104 /* TODO - fill duplex properly */
1105 if_link->duplex = DUPLEX_FULL;
1106 qed_mcp_get_media_type(hwfn->cdev, &media_type);
1107 if_link->port = qed_get_port_type(media_type);
1108
1109 if_link->autoneg = params.speed.autoneg;
1110
1111 if (params.pause.autoneg)
1112 if_link->pause_config |= QED_LINK_PAUSE_AUTONEG_ENABLE;
1113 if (params.pause.forced_rx)
1114 if_link->pause_config |= QED_LINK_PAUSE_RX_ENABLE;
1115 if (params.pause.forced_tx)
1116 if_link->pause_config |= QED_LINK_PAUSE_TX_ENABLE;
1117
1118 /* Link partner capabilities */
1119 if (link.partner_adv_speed &
1120 QED_LINK_PARTNER_SPEED_1G_HD)
1121 if_link->lp_caps |= SUPPORTED_1000baseT_Half;
1122 if (link.partner_adv_speed &
1123 QED_LINK_PARTNER_SPEED_1G_FD)
1124 if_link->lp_caps |= SUPPORTED_1000baseT_Full;
1125 if (link.partner_adv_speed &
1126 QED_LINK_PARTNER_SPEED_10G)
1127 if_link->lp_caps |= SUPPORTED_10000baseKR_Full;
1128 if (link.partner_adv_speed &
1129 QED_LINK_PARTNER_SPEED_40G)
1130 if_link->lp_caps |= SUPPORTED_40000baseLR4_Full;
1131 if (link.partner_adv_speed &
1132 QED_LINK_PARTNER_SPEED_50G)
1133 if_link->lp_caps |= 0;
1134 if (link.partner_adv_speed &
1135 QED_LINK_PARTNER_SPEED_100G)
1136 if_link->lp_caps |= 0;
1137
1138 if (link.an_complete)
1139 if_link->lp_caps |= SUPPORTED_Autoneg;
1140
1141 if (link.partner_adv_pause)
1142 if_link->lp_caps |= SUPPORTED_Pause;
1143 if (link.partner_adv_pause == QED_LINK_PARTNER_ASYMMETRIC_PAUSE ||
1144 link.partner_adv_pause == QED_LINK_PARTNER_BOTH_PAUSE)
1145 if_link->lp_caps |= SUPPORTED_Asym_Pause;
1146}
1147
1148static void qed_get_current_link(struct qed_dev *cdev,
1149 struct qed_link_output *if_link)
1150{
1151 qed_fill_link(&cdev->hwfns[0], if_link);
1152}
1153
1154void qed_link_update(struct qed_hwfn *hwfn)
1155{
1156 void *cookie = hwfn->cdev->ops_cookie;
1157 struct qed_common_cb_ops *op = hwfn->cdev->protocol_ops.common;
1158 struct qed_link_output if_link;
1159
1160 qed_fill_link(hwfn, &if_link);
1161
1162 if (IS_LEAD_HWFN(hwfn) && cookie)
1163 op->link_update(cookie, &if_link);
1164}
1165
Yuval Mintzfe56b9e2015-10-26 11:02:25 +02001166static int qed_drain(struct qed_dev *cdev)
1167{
1168 struct qed_hwfn *hwfn;
1169 struct qed_ptt *ptt;
1170 int i, rc;
1171
1172 for_each_hwfn(cdev, i) {
1173 hwfn = &cdev->hwfns[i];
1174 ptt = qed_ptt_acquire(hwfn);
1175 if (!ptt) {
1176 DP_NOTICE(hwfn, "Failed to drain NIG; No PTT\n");
1177 return -EBUSY;
1178 }
1179 rc = qed_mcp_drain(hwfn, ptt);
1180 if (rc)
1181 return rc;
1182 qed_ptt_release(hwfn, ptt);
1183 }
1184
1185 return 0;
1186}
1187
Sudarsana Kalluru91420b82015-11-30 12:25:03 +02001188static int qed_set_led(struct qed_dev *cdev, enum qed_led_mode mode)
1189{
1190 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev);
1191 struct qed_ptt *ptt;
1192 int status = 0;
1193
1194 ptt = qed_ptt_acquire(hwfn);
1195 if (!ptt)
1196 return -EAGAIN;
1197
1198 status = qed_mcp_set_led(hwfn, ptt, mode);
1199
1200 qed_ptt_release(hwfn, ptt);
1201
1202 return status;
1203}
1204
Sudarsana Reddy Kalluru03dc76c2016-04-28 20:20:52 -04001205struct qed_selftest_ops qed_selftest_ops_pass = {
1206 .selftest_memory = &qed_selftest_memory,
1207 .selftest_interrupt = &qed_selftest_interrupt,
1208 .selftest_register = &qed_selftest_register,
1209 .selftest_clock = &qed_selftest_clock,
1210};
1211
Yuval Mintzfe56b9e2015-10-26 11:02:25 +02001212const struct qed_common_ops qed_common_ops_pass = {
Sudarsana Reddy Kalluru03dc76c2016-04-28 20:20:52 -04001213 .selftest = &qed_selftest_ops_pass,
Yuval Mintzfe56b9e2015-10-26 11:02:25 +02001214 .probe = &qed_probe,
1215 .remove = &qed_remove,
1216 .set_power_state = &qed_set_power_state,
1217 .set_id = &qed_set_id,
1218 .update_pf_params = &qed_update_pf_params,
1219 .slowpath_start = &qed_slowpath_start,
1220 .slowpath_stop = &qed_slowpath_stop,
1221 .set_fp_int = &qed_set_int_fp,
1222 .get_fp_int = &qed_get_int_fp,
1223 .sb_init = &qed_sb_init,
1224 .sb_release = &qed_sb_release,
1225 .simd_handler_config = &qed_simd_handler_config,
1226 .simd_handler_clean = &qed_simd_handler_clean,
Yuval Mintzfe7cd2b2016-04-22 08:41:03 +03001227 .can_link_change = &qed_can_link_change,
Yuval Mintzcc875c22015-10-26 11:02:31 +02001228 .set_link = &qed_set_link,
1229 .get_link = &qed_get_current_link,
Yuval Mintzfe56b9e2015-10-26 11:02:25 +02001230 .drain = &qed_drain,
1231 .update_msglvl = &qed_init_dp,
1232 .chain_alloc = &qed_chain_alloc,
1233 .chain_free = &qed_chain_free,
Sudarsana Kalluru91420b82015-11-30 12:25:03 +02001234 .set_led = &qed_set_led,
Yuval Mintzfe56b9e2015-10-26 11:02:25 +02001235};