.. | .. |
---|
508 | 508 | } |
---|
509 | 509 | |
---|
510 | 510 | /** |
---|
| 511 | + * i40e_set_hw_flags - set HW flags |
---|
| 512 | + * @hw: pointer to the hardware structure |
---|
| 513 | + **/ |
---|
| 514 | +static void i40e_set_hw_flags(struct i40e_hw *hw) |
---|
| 515 | +{ |
---|
| 516 | + struct i40e_adminq_info *aq = &hw->aq; |
---|
| 517 | + |
---|
| 518 | + hw->flags = 0; |
---|
| 519 | + |
---|
| 520 | + switch (hw->mac.type) { |
---|
| 521 | + case I40E_MAC_XL710: |
---|
| 522 | + if (aq->api_maj_ver > 1 || |
---|
| 523 | + (aq->api_maj_ver == 1 && |
---|
| 524 | + aq->api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710)) { |
---|
| 525 | + hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE; |
---|
| 526 | + hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE; |
---|
| 527 | + /* The ability to RX (not drop) 802.1ad frames */ |
---|
| 528 | + hw->flags |= I40E_HW_FLAG_802_1AD_CAPABLE; |
---|
| 529 | + } |
---|
| 530 | + break; |
---|
| 531 | + case I40E_MAC_X722: |
---|
| 532 | + hw->flags |= I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE | |
---|
| 533 | + I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK; |
---|
| 534 | + |
---|
| 535 | + if (aq->api_maj_ver > 1 || |
---|
| 536 | + (aq->api_maj_ver == 1 && |
---|
| 537 | + aq->api_min_ver >= I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722)) |
---|
| 538 | + hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE; |
---|
| 539 | + |
---|
| 540 | + if (aq->api_maj_ver > 1 || |
---|
| 541 | + (aq->api_maj_ver == 1 && |
---|
| 542 | + aq->api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_X722)) |
---|
| 543 | + hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE; |
---|
| 544 | + |
---|
| 545 | + if (aq->api_maj_ver > 1 || |
---|
| 546 | + (aq->api_maj_ver == 1 && |
---|
| 547 | + aq->api_min_ver >= I40E_MINOR_VER_FW_REQUEST_FEC_X722)) |
---|
| 548 | + hw->flags |= I40E_HW_FLAG_X722_FEC_REQUEST_CAPABLE; |
---|
| 549 | + |
---|
| 550 | + fallthrough; |
---|
| 551 | + default: |
---|
| 552 | + break; |
---|
| 553 | + } |
---|
| 554 | + |
---|
| 555 | + /* Newer versions of firmware require lock when reading the NVM */ |
---|
| 556 | + if (aq->api_maj_ver > 1 || |
---|
| 557 | + (aq->api_maj_ver == 1 && |
---|
| 558 | + aq->api_min_ver >= 5)) |
---|
| 559 | + hw->flags |= I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK; |
---|
| 560 | + |
---|
| 561 | + if (aq->api_maj_ver > 1 || |
---|
| 562 | + (aq->api_maj_ver == 1 && |
---|
| 563 | + aq->api_min_ver >= 8)) { |
---|
| 564 | + hw->flags |= I40E_HW_FLAG_FW_LLDP_PERSISTENT; |
---|
| 565 | + hw->flags |= I40E_HW_FLAG_DROP_MODE; |
---|
| 566 | + } |
---|
| 567 | + |
---|
| 568 | + if (aq->api_maj_ver > 1 || |
---|
| 569 | + (aq->api_maj_ver == 1 && |
---|
| 570 | + aq->api_min_ver >= 9)) |
---|
| 571 | + hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_EXTENDED; |
---|
| 572 | +} |
---|
| 573 | + |
---|
| 574 | +/** |
---|
511 | 575 | * i40e_init_adminq - main initialization routine for Admin Queue |
---|
512 | 576 | * @hw: pointer to the hardware structure |
---|
513 | 577 | * |
---|
.. | .. |
---|
571 | 635 | if (ret_code != I40E_SUCCESS) |
---|
572 | 636 | goto init_adminq_free_arq; |
---|
573 | 637 | |
---|
| 638 | + /* Some features were introduced in different FW API version |
---|
| 639 | + * for different MAC type. |
---|
| 640 | + */ |
---|
| 641 | + i40e_set_hw_flags(hw); |
---|
| 642 | + |
---|
574 | 643 | /* get the NVM version info */ |
---|
575 | 644 | i40e_read_nvm_word(hw, I40E_SR_NVM_DEV_STARTER_VERSION, |
---|
576 | 645 | &hw->nvm.version); |
---|
.. | .. |
---|
588 | 657 | hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR && |
---|
589 | 658 | hw->aq.api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710) { |
---|
590 | 659 | hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE; |
---|
| 660 | + hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE; |
---|
591 | 661 | } |
---|
592 | | - |
---|
593 | | - /* Newer versions of firmware require lock when reading the NVM */ |
---|
594 | | - if (hw->aq.api_maj_ver > 1 || |
---|
595 | | - (hw->aq.api_maj_ver == 1 && |
---|
596 | | - hw->aq.api_min_ver >= 5)) |
---|
597 | | - hw->flags |= I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK; |
---|
| 662 | + if (hw->mac.type == I40E_MAC_X722 && |
---|
| 663 | + hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR && |
---|
| 664 | + hw->aq.api_min_ver >= I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722) { |
---|
| 665 | + hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE; |
---|
| 666 | + } |
---|
598 | 667 | |
---|
599 | 668 | /* The ability to RX (not drop) 802.1ad frames was added in API 1.7 */ |
---|
600 | 669 | if (hw->aq.api_maj_ver > 1 || |
---|
.. | .. |
---|
631 | 700 | * i40e_shutdown_adminq - shutdown routine for the Admin Queue |
---|
632 | 701 | * @hw: pointer to the hardware structure |
---|
633 | 702 | **/ |
---|
634 | | -i40e_status i40e_shutdown_adminq(struct i40e_hw *hw) |
---|
| 703 | +void i40e_shutdown_adminq(struct i40e_hw *hw) |
---|
635 | 704 | { |
---|
636 | | - i40e_status ret_code = 0; |
---|
637 | | - |
---|
638 | 705 | if (i40e_check_asq_alive(hw)) |
---|
639 | 706 | i40e_aq_queue_shutdown(hw, true); |
---|
640 | 707 | |
---|
.. | .. |
---|
643 | 710 | |
---|
644 | 711 | if (hw->nvm_buff.va) |
---|
645 | 712 | i40e_free_virt_mem(hw, &hw->nvm_buff); |
---|
646 | | - |
---|
647 | | - return ret_code; |
---|
648 | 713 | } |
---|
649 | 714 | |
---|
650 | 715 | /** |
---|
.. | .. |
---|
664 | 729 | desc = I40E_ADMINQ_DESC(*asq, ntc); |
---|
665 | 730 | details = I40E_ADMINQ_DETAILS(*asq, ntc); |
---|
666 | 731 | while (rd32(hw, hw->aq.asq.head) != ntc) { |
---|
667 | | - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, |
---|
| 732 | + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, |
---|
668 | 733 | "ntc %d head %d.\n", ntc, rd32(hw, hw->aq.asq.head)); |
---|
669 | 734 | |
---|
670 | 735 | if (details->callback) { |
---|
.. | .. |
---|
743 | 808 | if (val >= hw->aq.num_asq_entries) { |
---|
744 | 809 | i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, |
---|
745 | 810 | "AQTX: head overrun at %d\n", val); |
---|
746 | | - status = I40E_ERR_QUEUE_EMPTY; |
---|
| 811 | + status = I40E_ERR_ADMIN_QUEUE_FULL; |
---|
747 | 812 | goto asq_send_command_error; |
---|
748 | 813 | } |
---|
749 | 814 | |
---|
.. | .. |
---|
824 | 889 | } |
---|
825 | 890 | |
---|
826 | 891 | /* bump the tail */ |
---|
827 | | - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: desc and buffer:\n"); |
---|
| 892 | + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, "AQTX: desc and buffer:\n"); |
---|
828 | 893 | i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc_on_ring, |
---|
829 | 894 | buff, buff_size); |
---|
830 | 895 | (hw->aq.asq.next_to_use)++; |
---|
.. | .. |
---|
875 | 940 | hw->aq.asq_last_status = (enum i40e_admin_queue_err)retval; |
---|
876 | 941 | } |
---|
877 | 942 | |
---|
878 | | - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, |
---|
| 943 | + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, |
---|
879 | 944 | "AQTX: desc and buffer writeback:\n"); |
---|
880 | 945 | i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff, buff_size); |
---|
881 | 946 | |
---|
.. | .. |
---|
984 | 1049 | memcpy(e->msg_buf, hw->aq.arq.r.arq_bi[desc_idx].va, |
---|
985 | 1050 | e->msg_len); |
---|
986 | 1051 | |
---|
987 | | - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQRX: desc and buffer:\n"); |
---|
| 1052 | + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, "AQRX: desc and buffer:\n"); |
---|
988 | 1053 | i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf, |
---|
989 | 1054 | hw->aq.arq_buf_size); |
---|
990 | 1055 | |
---|