1 /* QLogic qed NIC Driver
2 * Copyright (c) 2015 QLogic Corporation
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
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>
28 #include "qed_dev_api.h"
32 static const char version[] =
33 "QLogic QL4xxx 40G/100G Ethernet Driver qed " DRV_MODULE_VERSION "\n";
35 MODULE_DESCRIPTION("QLogic 25G/40G/50G/100G Core Module");
36 MODULE_LICENSE("GPL");
37 MODULE_VERSION(DRV_MODULE_VERSION);
39 #define FW_FILE_VERSION \
40 __stringify(FW_MAJOR_VERSION) "." \
41 __stringify(FW_MINOR_VERSION) "." \
42 __stringify(FW_REVISION_VERSION) "." \
43 __stringify(FW_ENGINEERING_VERSION)
45 #define QED_FW_FILE_NAME \
46 "qed/qed_init_values_zipped-" FW_FILE_VERSION ".bin"
48 static int __init qed_init(void)
50 pr_notice("qed_init called\n");
52 pr_info("%s", version);
57 static void __exit qed_cleanup(void)
59 pr_notice("qed_cleanup called\n");
62 module_init(qed_init);
63 module_exit(qed_cleanup);
65 /* Check if the DMA controller on the machine can properly handle the DMA
66 * addressing required by the device.
68 static int qed_set_coherency_mask(struct qed_dev *cdev)
70 struct device *dev = &cdev->pdev->dev;
72 if (dma_set_mask(dev, DMA_BIT_MASK(64)) == 0) {
73 if (dma_set_coherent_mask(dev, DMA_BIT_MASK(64)) != 0) {
75 "Can't request 64-bit consistent allocations\n");
78 } else if (dma_set_mask(dev, DMA_BIT_MASK(32)) != 0) {
79 DP_NOTICE(cdev, "Can't request 64b/32b DMA addresses\n");
86 static void qed_free_pci(struct qed_dev *cdev)
88 struct pci_dev *pdev = cdev->pdev;
91 iounmap(cdev->doorbells);
93 iounmap(cdev->regview);
94 if (atomic_read(&pdev->enable_cnt) == 1)
95 pci_release_regions(pdev);
97 pci_disable_device(pdev);
100 /* Performs PCI initializations as well as initializing PCI-related parameters
101 * in the device structrue. Returns 0 in case of success.
103 static int qed_init_pci(struct qed_dev *cdev,
104 struct pci_dev *pdev)
110 rc = pci_enable_device(pdev);
112 DP_NOTICE(cdev, "Cannot enable PCI device\n");
116 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
117 DP_NOTICE(cdev, "No memory region found in bar #0\n");
122 if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM)) {
123 DP_NOTICE(cdev, "No memory region found in bar #2\n");
128 if (atomic_read(&pdev->enable_cnt) == 1) {
129 rc = pci_request_regions(pdev, "qed");
132 "Failed to request PCI memory resources\n");
135 pci_set_master(pdev);
136 pci_save_state(pdev);
139 if (!pci_is_pcie(pdev)) {
140 DP_NOTICE(cdev, "The bus is not PCI Express\n");
145 cdev->pci_params.pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
146 if (cdev->pci_params.pm_cap == 0)
147 DP_NOTICE(cdev, "Cannot find power management capability\n");
149 rc = qed_set_coherency_mask(cdev);
153 cdev->pci_params.mem_start = pci_resource_start(pdev, 0);
154 cdev->pci_params.mem_end = pci_resource_end(pdev, 0);
155 cdev->pci_params.irq = pdev->irq;
157 cdev->regview = pci_ioremap_bar(pdev, 0);
158 if (!cdev->regview) {
159 DP_NOTICE(cdev, "Cannot map register space, aborting\n");
164 cdev->db_phys_addr = pci_resource_start(cdev->pdev, 2);
165 cdev->db_size = pci_resource_len(cdev->pdev, 2);
166 cdev->doorbells = ioremap_wc(cdev->db_phys_addr, cdev->db_size);
167 if (!cdev->doorbells) {
168 DP_NOTICE(cdev, "Cannot map doorbell space\n");
175 pci_release_regions(pdev);
177 pci_disable_device(pdev);
182 int qed_fill_dev_info(struct qed_dev *cdev,
183 struct qed_dev_info *dev_info)
185 memset(dev_info, 0, sizeof(struct qed_dev_info));
187 dev_info->num_hwfns = cdev->num_hwfns;
188 dev_info->pci_mem_start = cdev->pci_params.mem_start;
189 dev_info->pci_mem_end = cdev->pci_params.mem_end;
190 dev_info->pci_irq = cdev->pci_params.irq;
191 dev_info->is_mf = IS_MF(&cdev->hwfns[0]);
192 ether_addr_copy(dev_info->hw_mac, cdev->hwfns[0].hw_info.hw_mac_addr);
194 dev_info->fw_major = FW_MAJOR_VERSION;
195 dev_info->fw_minor = FW_MINOR_VERSION;
196 dev_info->fw_rev = FW_REVISION_VERSION;
197 dev_info->fw_eng = FW_ENGINEERING_VERSION;
198 dev_info->mf_mode = cdev->mf_mode;
200 qed_mcp_get_mfw_ver(cdev, &dev_info->mfw_rev);
205 static void qed_free_cdev(struct qed_dev *cdev)
210 static struct qed_dev *qed_alloc_cdev(struct pci_dev *pdev)
212 struct qed_dev *cdev;
214 cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
218 qed_init_struct(cdev);
223 /* Sets the requested power state */
224 static int qed_set_power_state(struct qed_dev *cdev,
230 DP_VERBOSE(cdev, NETIF_MSG_DRV, "Omitting Power state change\n");
235 static struct qed_dev *qed_probe(struct pci_dev *pdev,
236 enum qed_protocol protocol,
240 struct qed_dev *cdev;
243 cdev = qed_alloc_cdev(pdev);
247 cdev->protocol = protocol;
249 qed_init_dp(cdev, dp_module, dp_level);
251 rc = qed_init_pci(cdev, pdev);
253 DP_ERR(cdev, "init pci failed\n");
256 DP_INFO(cdev, "PCI init completed successfully\n");
258 rc = qed_hw_prepare(cdev, QED_PCI_DEFAULT);
260 DP_ERR(cdev, "hw prepare failed\n");
264 DP_INFO(cdev, "qed_probe completed successffuly\n");
276 static void qed_remove(struct qed_dev *cdev)
285 qed_set_power_state(cdev, PCI_D3hot);
290 static void qed_disable_msix(struct qed_dev *cdev)
292 if (cdev->int_params.out.int_mode == QED_INT_MODE_MSIX) {
293 pci_disable_msix(cdev->pdev);
294 kfree(cdev->int_params.msix_table);
295 } else if (cdev->int_params.out.int_mode == QED_INT_MODE_MSI) {
296 pci_disable_msi(cdev->pdev);
299 memset(&cdev->int_params.out, 0, sizeof(struct qed_int_param));
302 static int qed_enable_msix(struct qed_dev *cdev,
303 struct qed_int_params *int_params)
307 cnt = int_params->in.num_vectors;
309 for (i = 0; i < cnt; i++)
310 int_params->msix_table[i].entry = i;
312 rc = pci_enable_msix_range(cdev->pdev, int_params->msix_table,
313 int_params->in.min_msix_cnt, cnt);
314 if (rc < cnt && rc >= int_params->in.min_msix_cnt &&
315 (rc % cdev->num_hwfns)) {
316 pci_disable_msix(cdev->pdev);
318 /* If fastpath is initialized, we need at least one interrupt
319 * per hwfn [and the slow path interrupts]. New requested number
320 * should be a multiple of the number of hwfns.
322 cnt = (rc / cdev->num_hwfns) * cdev->num_hwfns;
324 "Trying to enable MSI-X with less vectors (%d out of %d)\n",
325 cnt, int_params->in.num_vectors);
326 rc = pci_enable_msix_exact(cdev->pdev,
327 int_params->msix_table, cnt);
333 /* MSI-x configuration was achieved */
334 int_params->out.int_mode = QED_INT_MODE_MSIX;
335 int_params->out.num_vectors = rc;
339 "Failed to enable MSI-X [Requested %d vectors][rc %d]\n",
346 /* This function outputs the int mode and the number of enabled msix vector */
347 static int qed_set_int_mode(struct qed_dev *cdev, bool force_mode)
349 struct qed_int_params *int_params = &cdev->int_params;
350 struct msix_entry *tbl;
353 switch (int_params->in.int_mode) {
354 case QED_INT_MODE_MSIX:
355 /* Allocate MSIX table */
356 cnt = int_params->in.num_vectors;
357 int_params->msix_table = kcalloc(cnt, sizeof(*tbl), GFP_KERNEL);
358 if (!int_params->msix_table) {
364 rc = qed_enable_msix(cdev, int_params);
368 DP_NOTICE(cdev, "Failed to enable MSI-X\n");
369 kfree(int_params->msix_table);
374 case QED_INT_MODE_MSI:
375 rc = pci_enable_msi(cdev->pdev);
377 int_params->out.int_mode = QED_INT_MODE_MSI;
381 DP_NOTICE(cdev, "Failed to enable MSI\n");
386 case QED_INT_MODE_INTA:
387 int_params->out.int_mode = QED_INT_MODE_INTA;
391 DP_NOTICE(cdev, "Unknown int_mode value %d\n",
392 int_params->in.int_mode);
397 cdev->int_coalescing_mode = QED_COAL_MODE_ENABLE;
402 static void qed_simd_handler_config(struct qed_dev *cdev, void *token,
403 int index, void(*handler)(void *))
405 struct qed_hwfn *hwfn = &cdev->hwfns[index % cdev->num_hwfns];
406 int relative_idx = index / cdev->num_hwfns;
408 hwfn->simd_proto_handler[relative_idx].func = handler;
409 hwfn->simd_proto_handler[relative_idx].token = token;
412 static void qed_simd_handler_clean(struct qed_dev *cdev, int index)
414 struct qed_hwfn *hwfn = &cdev->hwfns[index % cdev->num_hwfns];
415 int relative_idx = index / cdev->num_hwfns;
417 memset(&hwfn->simd_proto_handler[relative_idx], 0,
418 sizeof(struct qed_simd_fp_handler));
421 static irqreturn_t qed_msix_sp_int(int irq, void *tasklet)
423 tasklet_schedule((struct tasklet_struct *)tasklet);
427 static irqreturn_t qed_single_int(int irq, void *dev_instance)
429 struct qed_dev *cdev = (struct qed_dev *)dev_instance;
430 struct qed_hwfn *hwfn;
431 irqreturn_t rc = IRQ_NONE;
435 for (i = 0; i < cdev->num_hwfns; i++) {
436 status = qed_int_igu_read_sisr_reg(&cdev->hwfns[i]);
441 hwfn = &cdev->hwfns[i];
443 /* Slowpath interrupt */
444 if (unlikely(status & 0x1)) {
445 tasklet_schedule(hwfn->sp_dpc);
450 /* Fastpath interrupts */
451 for (j = 0; j < 64; j++) {
452 if ((0x2ULL << j) & status) {
453 hwfn->simd_proto_handler[j].func(
454 hwfn->simd_proto_handler[j].token);
455 status &= ~(0x2ULL << j);
460 if (unlikely(status))
461 DP_VERBOSE(hwfn, NETIF_MSG_INTR,
462 "got an unknown interrupt status 0x%llx\n",
469 static int qed_slowpath_irq_req(struct qed_dev *cdev)
473 if (cdev->int_params.out.int_mode == QED_INT_MODE_MSIX) {
474 /* Request all the slowpath MSI-X vectors */
475 for (i = 0; i < cdev->num_hwfns; i++) {
476 snprintf(cdev->hwfns[i].name, NAME_SIZE,
477 "sp-%d-%02x:%02x.%02x",
478 i, cdev->pdev->bus->number,
479 PCI_SLOT(cdev->pdev->devfn),
480 cdev->hwfns[i].abs_pf_id);
482 rc = request_irq(cdev->int_params.msix_table[i].vector,
485 cdev->hwfns[i].sp_dpc);
489 DP_VERBOSE(&cdev->hwfns[i],
490 (NETIF_MSG_INTR | QED_MSG_SP),
491 "Requested slowpath MSI-X\n");
494 if (i != cdev->num_hwfns) {
495 /* Free already request MSI-X vectors */
496 for (i--; i >= 0; i--) {
498 cdev->int_params.msix_table[i].vector;
499 synchronize_irq(vec);
500 free_irq(cdev->int_params.msix_table[i].vector,
501 cdev->hwfns[i].sp_dpc);
505 unsigned long flags = 0;
507 snprintf(cdev->name, NAME_SIZE, "%02x:%02x.%02x",
508 cdev->pdev->bus->number, PCI_SLOT(cdev->pdev->devfn),
509 PCI_FUNC(cdev->pdev->devfn));
511 if (cdev->int_params.out.int_mode == QED_INT_MODE_INTA)
512 flags |= IRQF_SHARED;
514 rc = request_irq(cdev->pdev->irq, qed_single_int,
515 flags, cdev->name, cdev);
521 static void qed_slowpath_irq_free(struct qed_dev *cdev)
525 if (cdev->int_params.out.int_mode == QED_INT_MODE_MSIX) {
526 for_each_hwfn(cdev, i) {
527 synchronize_irq(cdev->int_params.msix_table[i].vector);
528 free_irq(cdev->int_params.msix_table[i].vector,
529 cdev->hwfns[i].sp_dpc);
532 free_irq(cdev->pdev->irq, cdev);
536 static int qed_nic_stop(struct qed_dev *cdev)
540 rc = qed_hw_stop(cdev);
542 for (i = 0; i < cdev->num_hwfns; i++) {
543 struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
545 if (p_hwfn->b_sp_dpc_enabled) {
546 tasklet_disable(p_hwfn->sp_dpc);
547 p_hwfn->b_sp_dpc_enabled = false;
548 DP_VERBOSE(cdev, NETIF_MSG_IFDOWN,
549 "Disabled sp taskelt [hwfn %d] at %p\n",
557 static int qed_nic_reset(struct qed_dev *cdev)
561 rc = qed_hw_reset(cdev);
570 static int qed_nic_setup(struct qed_dev *cdev)
574 rc = qed_resc_alloc(cdev);
578 DP_INFO(cdev, "Allocated qed resources\n");
580 qed_resc_setup(cdev);
585 static int qed_set_int_fp(struct qed_dev *cdev, u16 cnt)
589 /* Mark the fastpath as free/used */
590 cdev->int_params.fp_initialized = cnt ? true : false;
592 if (cdev->int_params.out.int_mode != QED_INT_MODE_MSIX)
593 limit = cdev->num_hwfns * 63;
594 else if (cdev->int_params.fp_msix_cnt)
595 limit = cdev->int_params.fp_msix_cnt;
600 return min_t(int, cnt, limit);
603 static int qed_get_int_fp(struct qed_dev *cdev, struct qed_int_info *info)
605 memset(info, 0, sizeof(struct qed_int_info));
607 if (!cdev->int_params.fp_initialized) {
609 "Protocol driver requested interrupt information, but its support is not yet configured\n");
613 /* Need to expose only MSI-X information; Single IRQ is handled solely
616 if (cdev->int_params.out.int_mode == QED_INT_MODE_MSIX) {
617 int msix_base = cdev->int_params.fp_msix_base;
619 info->msix_cnt = cdev->int_params.fp_msix_cnt;
620 info->msix = &cdev->int_params.msix_table[msix_base];
626 static int qed_slowpath_setup_int(struct qed_dev *cdev,
627 enum qed_int_mode int_mode)
632 memset(&cdev->int_params, 0, sizeof(struct qed_int_params));
634 cdev->int_params.in.int_mode = int_mode;
635 for_each_hwfn(cdev, i)
636 num_vectors += qed_int_get_num_sbs(&cdev->hwfns[i], NULL) + 1;
637 cdev->int_params.in.num_vectors = num_vectors;
639 /* We want a minimum of one slowpath and one fastpath vector per hwfn */
640 cdev->int_params.in.min_msix_cnt = cdev->num_hwfns * 2;
642 rc = qed_set_int_mode(cdev, false);
644 DP_ERR(cdev, "qed_slowpath_setup_int ERR\n");
648 cdev->int_params.fp_msix_base = cdev->num_hwfns;
649 cdev->int_params.fp_msix_cnt = cdev->int_params.out.num_vectors -
655 u32 qed_unzip_data(struct qed_hwfn *p_hwfn, u32 input_len,
656 u8 *input_buf, u32 max_size, u8 *unzip_buf)
660 p_hwfn->stream->next_in = input_buf;
661 p_hwfn->stream->avail_in = input_len;
662 p_hwfn->stream->next_out = unzip_buf;
663 p_hwfn->stream->avail_out = max_size;
665 rc = zlib_inflateInit2(p_hwfn->stream, MAX_WBITS);
668 DP_VERBOSE(p_hwfn, NETIF_MSG_DRV, "zlib init failed, rc = %d\n",
673 rc = zlib_inflate(p_hwfn->stream, Z_FINISH);
674 zlib_inflateEnd(p_hwfn->stream);
676 if (rc != Z_OK && rc != Z_STREAM_END) {
677 DP_VERBOSE(p_hwfn, NETIF_MSG_DRV, "FW unzip error: %s, rc=%d\n",
678 p_hwfn->stream->msg, rc);
682 return p_hwfn->stream->total_out / 4;
685 static int qed_alloc_stream_mem(struct qed_dev *cdev)
690 for_each_hwfn(cdev, i) {
691 struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
693 p_hwfn->stream = kzalloc(sizeof(*p_hwfn->stream), GFP_KERNEL);
697 workspace = vzalloc(zlib_inflate_workspacesize());
700 p_hwfn->stream->workspace = workspace;
706 static void qed_free_stream_mem(struct qed_dev *cdev)
710 for_each_hwfn(cdev, i) {
711 struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
716 vfree(p_hwfn->stream->workspace);
717 kfree(p_hwfn->stream);
721 static void qed_update_pf_params(struct qed_dev *cdev,
722 struct qed_pf_params *params)
726 for (i = 0; i < cdev->num_hwfns; i++) {
727 struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
729 p_hwfn->pf_params = *params;
733 static int qed_slowpath_start(struct qed_dev *cdev,
734 struct qed_slowpath_params *params)
736 struct qed_mcp_drv_version drv_version;
737 const u8 *data = NULL;
738 struct qed_hwfn *hwfn;
741 rc = request_firmware(&cdev->firmware, QED_FW_FILE_NAME,
745 "Failed to find fw file - /lib/firmware/%s\n",
750 rc = qed_nic_setup(cdev);
754 rc = qed_slowpath_setup_int(cdev, params->int_mode);
758 /* Request the slowpath IRQ */
759 rc = qed_slowpath_irq_req(cdev);
763 /* Allocate stream for unzipping */
764 rc = qed_alloc_stream_mem(cdev);
766 DP_NOTICE(cdev, "Failed to allocate stream memory\n");
770 /* Start the slowpath */
771 data = cdev->firmware->data;
773 rc = qed_hw_init(cdev, true, cdev->int_params.out.int_mode,
779 "HW initialization and function start completed successfully\n");
781 hwfn = QED_LEADING_HWFN(cdev);
782 drv_version.version = (params->drv_major << 24) |
783 (params->drv_minor << 16) |
784 (params->drv_rev << 8) |
786 strlcpy(drv_version.name, params->name,
787 MCP_DRV_VER_STR_SIZE - 4);
788 rc = qed_mcp_send_drv_version(hwfn, hwfn->p_main_ptt,
791 DP_NOTICE(cdev, "Failed sending drv version command\n");
798 qed_free_stream_mem(cdev);
799 qed_slowpath_irq_free(cdev);
801 qed_disable_msix(cdev);
805 release_firmware(cdev->firmware);
810 static int qed_slowpath_stop(struct qed_dev *cdev)
815 qed_free_stream_mem(cdev);
818 qed_slowpath_irq_free(cdev);
820 qed_disable_msix(cdev);
823 release_firmware(cdev->firmware);
828 static void qed_set_id(struct qed_dev *cdev, char name[NAME_SIZE],
829 char ver_str[VER_SIZE])
833 memcpy(cdev->name, name, NAME_SIZE);
834 for_each_hwfn(cdev, i)
835 snprintf(cdev->hwfns[i].name, NAME_SIZE, "%s-%d", name, i);
837 memcpy(cdev->ver_str, ver_str, VER_SIZE);
838 cdev->drv_type = DRV_ID_DRV_TYPE_LINUX;
841 static u32 qed_sb_init(struct qed_dev *cdev,
842 struct qed_sb_info *sb_info,
844 dma_addr_t sb_phy_addr, u16 sb_id,
845 enum qed_sb_type type)
847 struct qed_hwfn *p_hwfn;
853 /* RoCE uses single engine and CMT uses two engines. When using both
854 * we force only a single engine. Storage uses only engine 0 too.
856 if (type == QED_SB_TYPE_L2_QUEUE)
857 n_hwfns = cdev->num_hwfns;
861 hwfn_index = sb_id % n_hwfns;
862 p_hwfn = &cdev->hwfns[hwfn_index];
863 rel_sb_id = sb_id / n_hwfns;
865 DP_VERBOSE(cdev, NETIF_MSG_INTR,
866 "hwfn [%d] <--[init]-- SB %04x [0x%04x upper]\n",
867 hwfn_index, rel_sb_id, sb_id);
869 rc = qed_int_sb_init(p_hwfn, p_hwfn->p_main_ptt, sb_info,
870 sb_virt_addr, sb_phy_addr, rel_sb_id);
875 static u32 qed_sb_release(struct qed_dev *cdev,
876 struct qed_sb_info *sb_info,
879 struct qed_hwfn *p_hwfn;
884 hwfn_index = sb_id % cdev->num_hwfns;
885 p_hwfn = &cdev->hwfns[hwfn_index];
886 rel_sb_id = sb_id / cdev->num_hwfns;
888 DP_VERBOSE(cdev, NETIF_MSG_INTR,
889 "hwfn [%d] <--[init]-- SB %04x [0x%04x upper]\n",
890 hwfn_index, rel_sb_id, sb_id);
892 rc = qed_int_sb_release(p_hwfn, sb_info, rel_sb_id);
897 static int qed_drain(struct qed_dev *cdev)
899 struct qed_hwfn *hwfn;
903 for_each_hwfn(cdev, i) {
904 hwfn = &cdev->hwfns[i];
905 ptt = qed_ptt_acquire(hwfn);
907 DP_NOTICE(hwfn, "Failed to drain NIG; No PTT\n");
910 rc = qed_mcp_drain(hwfn, ptt);
913 qed_ptt_release(hwfn, ptt);
919 const struct qed_common_ops qed_common_ops_pass = {
921 .remove = &qed_remove,
922 .set_power_state = &qed_set_power_state,
923 .set_id = &qed_set_id,
924 .update_pf_params = &qed_update_pf_params,
925 .slowpath_start = &qed_slowpath_start,
926 .slowpath_stop = &qed_slowpath_stop,
927 .set_fp_int = &qed_set_int_fp,
928 .get_fp_int = &qed_get_int_fp,
929 .sb_init = &qed_sb_init,
930 .sb_release = &qed_sb_release,
931 .simd_handler_config = &qed_simd_handler_config,
932 .simd_handler_clean = &qed_simd_handler_clean,
934 .update_msglvl = &qed_init_dp,
935 .chain_alloc = &qed_chain_alloc,
936 .chain_free = &qed_chain_free,
939 u32 qed_get_protocol_version(enum qed_protocol protocol)
942 case QED_PROTOCOL_ETH:
943 return QED_ETH_INTERFACE_VERSION;
948 EXPORT_SYMBOL(qed_get_protocol_version);