{
        /* check that the app is allow/known to the driver */
 
-       if (appid.app_vid == EDIF_APP_ID) {
-               ql_dbg(ql_dbg_edif + ql_dbg_verbose, vha, 0x911d, "%s app id ok\n", __func__);
-               return true;
+       if (appid.app_vid != EDIF_APP_ID) {
+               ql_dbg(ql_dbg_edif, vha, 0x911d, "%s app id not ok (%x)",
+                   __func__, appid.app_vid);
+               return false;
+       }
+
+       if (appid.version != EDIF_VERSION1) {
+               ql_dbg(ql_dbg_edif, vha, 0x911d, "%s app version is not ok (%x)",
+                   __func__, appid.version);
+               return false;
        }
-       ql_dbg(ql_dbg_edif, vha, 0x911d, "%s app id not ok (%x)",
-           __func__, appid.app_vid);
 
-       return false;
+       return true;
 }
 
 static void
        appreply.host_support_edif = vha->hw->flags.edif_enabled;
        appreply.edif_enode_active = vha->pur_cinfo.enode_flags;
        appreply.edif_edb_active = vha->e_dbell.db_flags;
+       appreply.version = EDIF_VERSION1;
 
        bsg_job->reply_len = sizeof(struct fc_bsg_reply);
 
        portid.b.area   = appplogiok.u.d_id.b.area;
        portid.b.al_pa  = appplogiok.u.d_id.b.al_pa;
 
+       appplogireply.version = EDIF_VERSION1;
        switch (appplogiok.type) {
        case PL_TYPE_WWPN:
                fcport = qla2x00_find_fcport_by_wwpn(vha,
        } else {
                struct fc_port  *fcport = NULL, *tf;
 
+               app_reply->version = EDIF_VERSION1;
+
                list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) {
                        if (!(fcport->flags & FCF_FCSP_DEVICE))
                                continue;
                        if (tdid.b24 != 0 && tdid.b24 != fcport->d_id.b24)
                                continue;
 
-                       app_reply->ports[pcnt].rekey_count =
-                               fcport->edif.rekey_cnt;
-
                        if (fcport->scan_state != QLA_FCPORT_FOUND)
                                continue;
 
 
                        rval = 0;
 
+                       app_reply->ports[pcnt].version = EDIF_VERSION1;
                        app_reply->ports[pcnt].remote_type =
                                VND_CMD_RTYPE_UNKNOWN;
                        if (fcport->port_type & (FCT_NVME_TARGET | FCT_TARGET))
        } else {
                struct fc_port  *fcport = NULL, *tf;
 
+               app_reply->version = EDIF_VERSION1;
+
                list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) {
                        if (fcport->edif.enable) {
                                if (pcnt > app_req.num_ports)
                edbnode->u.sa_aen.port_id = fcport->d_id;
                edbnode->u.sa_aen.status =  data;
                edbnode->u.sa_aen.key_type =  data2;
+               edbnode->u.sa_aen.version = EDIF_VERSION1;
                break;
        default:
                ql_dbg(ql_dbg_edif, vha, 0x09102,
        port_id_t d_id;
        struct qla_bsg_auth_els_request *p =
            (struct qla_bsg_auth_els_request *)bsg_job->request;
+       struct qla_bsg_auth_els_reply *rpl =
+           (struct qla_bsg_auth_els_reply *)bsg_job->reply;
+
+       rpl->version = EDIF_VERSION1;
 
        d_id.b.al_pa = bsg_request->rqst_data.h_els.port_id[2];
        d_id.b.area = bsg_request->rqst_data.h_els.port_id[1];
 
 #ifndef __QLA_EDIF_BSG_H
 #define __QLA_EDIF_BSG_H
 
+#define EDIF_VERSION1 1
+
 /* BSG Vendor specific commands */
 #define        ELS_MAX_PAYLOAD         2112
 #ifndef        WWN_SIZE
 #define WWN_SIZE               8
 #endif
-#define        VND_CMD_APP_RESERVED_SIZE       32
-
+#define VND_CMD_APP_RESERVED_SIZE      28
+#define VND_CMD_PAD_SIZE                3
 enum auth_els_sub_cmd {
        SEND_ELS = 0,
        SEND_ELS_REPLY,
 #define BSG_CTL_FLAG_LS_ACC     1
 #define BSG_CTL_FLAG_LS_RJT     2
 #define BSG_CTL_FLAG_TRM        3
-       uint8_t         extra_rsvd[3];
+       uint8_t         version;
+       uint8_t         pad[2];
+       uint8_t         reserved[VND_CMD_APP_RESERVED_SIZE];
 } __packed;
 
 struct qla_bsg_auth_els_request {
 struct qla_bsg_auth_els_reply {
        struct fc_bsg_reply r;
        uint32_t rx_xchg_address;
+       uint8_t version;
+       uint8_t pad[VND_CMD_PAD_SIZE];
+       uint8_t reserved[VND_CMD_APP_RESERVED_SIZE];
 };
 
 struct app_id {
        int             app_vid;
-       uint8_t         app_key[32];
+       uint8_t         version;
+       uint8_t         pad[VND_CMD_PAD_SIZE];
+       uint8_t         reserved[VND_CMD_APP_RESERVED_SIZE];
 } __packed;
 
 struct app_start_reply {
        uint32_t        host_support_edif;
        uint32_t        edif_enode_active;
        uint32_t        edif_edb_active;
-       uint32_t        reserved[VND_CMD_APP_RESERVED_SIZE];
+       uint8_t         version;
+       uint8_t         pad[VND_CMD_PAD_SIZE];
+       uint8_t         reserved[VND_CMD_APP_RESERVED_SIZE];
 } __packed;
 
 struct app_start {
        struct app_id   app_info;
-       uint32_t        prli_to;
-       uint32_t        key_shred;
        uint8_t         app_start_flags;
-       uint8_t         reserved[VND_CMD_APP_RESERVED_SIZE - 1];
+       uint8_t         version;
+       uint8_t         pad[2];
+       uint8_t         reserved[VND_CMD_APP_RESERVED_SIZE];
 } __packed;
 
 struct app_stop {
        struct app_id   app_info;
-       char            buf[16];
+       uint8_t         version;
+       uint8_t         pad[VND_CMD_PAD_SIZE];
+       uint8_t         reserved[VND_CMD_APP_RESERVED_SIZE];
 } __packed;
 
 struct app_plogi_reply {
        uint32_t        prli_status;
-       uint8_t         reserved[VND_CMD_APP_RESERVED_SIZE];
-} __packed;
-
-#define        RECFG_TIME      1
-#define        RECFG_BYTES     2
-
-struct app_rekey_cfg {
-       struct app_id app_info;
-       uint8_t  rekey_mode;
-       port_id_t d_id;
-       uint8_t  force;
-       union {
-               int64_t bytes;
-               int64_t time;
-       } rky_units;
-
+       uint8_t         version;
+       uint8_t         pad[VND_CMD_PAD_SIZE];
        uint8_t         reserved[VND_CMD_APP_RESERVED_SIZE];
 } __packed;
 
        struct app_id app_info;
        uint8_t  num_ports;
        port_id_t remote_pid;
-       uint8_t  reserved[VND_CMD_APP_RESERVED_SIZE];
+       uint8_t         version;
+       uint8_t         pad[VND_CMD_PAD_SIZE];
+       uint8_t         reserved[VND_CMD_APP_RESERVED_SIZE];
 } __packed;
 
 struct app_pinfo {
 #define        VND_CMD_RTYPE_INITIATOR         2
        uint8_t remote_state;
        uint8_t auth_state;
-       uint8_t rekey_mode;
-       int64_t rekey_count;
-       int64_t rekey_config_value;
-       int64_t rekey_consumed_value;
-
+       uint8_t version;
+       uint8_t pad[VND_CMD_PAD_SIZE];
        uint8_t reserved[VND_CMD_APP_RESERVED_SIZE];
 } __packed;
 
 
 struct app_pinfo_reply {
        uint8_t         port_count;
+       uint8_t         version;
+       uint8_t         pad[VND_CMD_PAD_SIZE];
        uint8_t         reserved[VND_CMD_APP_RESERVED_SIZE];
        struct app_pinfo ports[];
 } __packed;
 struct app_sinfo_req {
        struct app_id   app_info;
        uint8_t         num_ports;
+       uint8_t         version;
+       uint8_t         pad[VND_CMD_PAD_SIZE];
        uint8_t         reserved[VND_CMD_APP_RESERVED_SIZE];
 } __packed;
 
 
 struct app_stats_reply {
        uint8_t         elem_count;
+       uint8_t         version;
+       uint8_t         pad[VND_CMD_PAD_SIZE];
+       uint8_t         reserved[VND_CMD_APP_RESERVED_SIZE];
        struct app_sinfo elem[];
 } __packed;
 
        uint8_t         node_name[WWN_SIZE];
        uint8_t         port_name[WWN_SIZE];
        port_id_t       port_id;
+       uint8_t         version;
+       uint8_t         pad[VND_CMD_PAD_SIZE];
+       uint8_t         reserved2[VND_CMD_APP_RESERVED_SIZE];
 } __packed;
 
-// used for edif mgmt bsg interface
 #define        QL_VND_SC_UNDEF         0
 #define        QL_VND_SC_SA_UPDATE     1
 #define        QL_VND_SC_APP_START     2
 #define        QL_VND_SC_REKEY_CONFIG  6
 #define        QL_VND_SC_GET_FCINFO    7
 #define        QL_VND_SC_GET_STATS     8
+#define QL_VND_SC_AEN_COMPLETE  9
+
 
 /* Application interface data structure for rtn data */
 #define        EXT_DEF_EVENT_DATA_SIZE 64
        port_id_t port_id;
        uint32_t key_type;      /* Tx (1) or RX (2) */
        uint32_t status;        /* 0 succes,  1 failed, 2 timeout , 3 error */
-       uint8_t         reserved[16];
+       uint8_t version;
+       uint8_t pad[VND_CMD_PAD_SIZE];
+       uint8_t reserved[VND_CMD_APP_RESERVED_SIZE];
 } __packed;
 
 #define        QL_VND_SA_STAT_SUCCESS  0
                uint8_t  wwpn[WWN_SIZE];
                port_id_t d_id;
        } u;
-       uint32_t reserved[VND_CMD_APP_RESERVED_SIZE];
+       uint8_t version;
+       uint8_t pad[VND_CMD_PAD_SIZE];
+       uint8_t reserved[VND_CMD_APP_RESERVED_SIZE];
+} __packed;
+
+struct aen_complete_cmd {
+       struct app_id app_info;
+       port_id_t   port_id;
+       uint32_t    event_code;
+       uint8_t     version;
+       uint8_t     pad[VND_CMD_PAD_SIZE];
+       uint8_t     reserved[VND_CMD_APP_RESERVED_SIZE];
 } __packed;
 
 #define RX_DELAY_DELETE_TIMEOUT 20