void
 lpfc_update_vport_wwn(struct lpfc_vport *vport)
 {
-       uint8_t vvvl = vport->fc_sparam.cmn.valid_vendor_ver_level;
-       u32 *fawwpn_key = (u32 *)&vport->fc_sparam.un.vendorVersion[0];
+       struct lpfc_hba *phba = vport->phba;
 
        /*
         * If the name is empty or there exists a soft name
         */
        if (vport->fc_portname.u.wwn[0] != 0 &&
                memcmp(&vport->fc_portname, &vport->fc_sparam.portName,
-                       sizeof(struct lpfc_name)))
+                      sizeof(struct lpfc_name))) {
                vport->vport_flag |= FAWWPN_PARAM_CHG;
 
-       if (vport->fc_portname.u.wwn[0] == 0 ||
-           (vvvl == 1 && cpu_to_be32(*fawwpn_key) == FAPWWN_KEY_VENDOR) ||
-           vport->vport_flag & FAWWPN_SET) {
-               memcpy(&vport->fc_portname, &vport->fc_sparam.portName,
-                       sizeof(struct lpfc_name));
-               vport->vport_flag &= ~FAWWPN_SET;
-               if (vvvl == 1 && cpu_to_be32(*fawwpn_key) == FAPWWN_KEY_VENDOR)
-                       vport->vport_flag |= FAWWPN_SET;
+               if (phba->sli_rev == LPFC_SLI_REV4 &&
+                   vport->port_type == LPFC_PHYSICAL_PORT &&
+                   phba->sli4_hba.fawwpn_flag & LPFC_FAWWPN_FABRIC) {
+                       lpfc_printf_log(phba, KERN_INFO,
+                                       LOG_SLI | LOG_DISCOVERY | LOG_ELS,
+                                       "2701 FA-PWWN change WWPN from %llx to "
+                                       "%llx: vflag x%x fawwpn_flag x%x\n",
+                                       wwn_to_u64(vport->fc_portname.u.wwn),
+                                       wwn_to_u64
+                                          (vport->fc_sparam.portName.u.wwn),
+                                       vport->vport_flag,
+                                       phba->sli4_hba.fawwpn_flag);
+                       memcpy(&vport->fc_portname, &vport->fc_sparam.portName,
+                              sizeof(struct lpfc_name));
+               }
        }
+
+       if (vport->fc_portname.u.wwn[0] == 0)
+               memcpy(&vport->fc_portname, &vport->fc_sparam.portName,
+                      sizeof(struct lpfc_name));
        else
                memcpy(&vport->fc_sparam.portName, &vport->fc_portname,
-                       sizeof(struct lpfc_name));
+                      sizeof(struct lpfc_name));
 }
 
 /**
        case LPFC_SLI_EVENT_TYPE_MISCONF_FAWWN:
                /* Misconfigured WWN. Reports that the SLI Port is configured
                 * to use FA-WWN, but the attached device doesn’t support it.
-                * No driver action is required.
                 * Event Data1 - N.A, Event Data2 - N.A
+                * This event only happens on the physical port.
                 */
-               lpfc_log_msg(phba, KERN_WARNING, LOG_SLI,
-                            "2699 Misconfigured FA-WWN - Attached device does "
-                            "not support FA-WWN\n");
+               lpfc_log_msg(phba, KERN_WARNING, LOG_SLI | LOG_DISCOVERY,
+                            "2699 Misconfigured FA-PWWN - Attached device "
+                            "does not support FA-PWWN\n");
+               phba->sli4_hba.fawwpn_flag &= ~LPFC_FAWWPN_FABRIC;
+               memset(phba->pport->fc_portname.u.wwn, 0,
+                      sizeof(struct lpfc_name));
                break;
        case LPFC_SLI_EVENT_TYPE_EEPROM_FAILURE:
                /* EEPROM failure. No driver action is required */
        rc = lpfc_sli4_read_config(phba);
        if (unlikely(rc))
                goto out_free_bsmbx;
+
+       if (phba->sli4_hba.fawwpn_flag & LPFC_FAWWPN_CONFIG) {
+               /* Right now the link is down, if FA-PWWN is configured the
+                * firmware will try FLOGI before the driver gets a link up.
+                * If it fails, the driver should get a MISCONFIGURED async
+                * event which will clear this flag. The only notification
+                * the driver gets is if it fails, if it succeeds there is no
+                * notification given. Assume success.
+                */
+               phba->sli4_hba.fawwpn_flag |= LPFC_FAWWPN_FABRIC;
+       }
+
        rc = lpfc_mem_alloc_active_rrq_pool_s4(phba);
        if (unlikely(rc))
                goto out_free_bsmbx;
        struct lpfc_rsrc_desc_fcfcoe *desc;
        char *pdesc_0;
        uint16_t forced_link_speed;
-       uint32_t if_type, qmin;
+       uint32_t if_type, qmin, fawwpn;
        int length, i, rc = 0, rc2;
 
        pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
                        phba->sli4_hba.bbscn_params.word0 = rd_config->word8;
                }
 
+               fawwpn = bf_get(lpfc_mbx_rd_conf_fawwpn, rd_config);
+
+               if (fawwpn) {
+                       lpfc_printf_log(phba, KERN_INFO,
+                                       LOG_INIT | LOG_DISCOVERY,
+                                       "2702 READ_CONFIG: FA-PWWN is "
+                                       "configured on\n");
+                       phba->sli4_hba.fawwpn_flag |= LPFC_FAWWPN_CONFIG;
+               } else {
+                       phba->sli4_hba.fawwpn_flag = 0;
+               }
+
                phba->sli4_hba.conf_trunk =
                        bf_get(lpfc_mbx_rd_conf_trunk, rd_config);
                phba->sli4_hba.extents_in_use =
                        bf_get(lpfc_mbx_rd_conf_extnts_inuse, rd_config);
+
                phba->sli4_hba.max_cfg_param.max_xri =
                        bf_get(lpfc_mbx_rd_conf_xri_count, rd_config);
                /* Reduce resource usage in kdump environment */