Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[platform/kernel/linux-starfive.git] / drivers / scsi / qla2xxx / qla_def.h
index b6434c7..e8f69c4 100644 (file)
@@ -726,6 +726,11 @@ typedef struct srb {
         * code.
         */
        void (*put_fn)(struct kref *kref);
+
+       /*
+        * Report completion for asynchronous commands.
+        */
+       void (*async_done)(struct srb *sp, int res);
 } srb_t;
 
 #define GET_CMD_SP(sp) (sp->u.scmd.cmd)
@@ -2666,25 +2671,28 @@ struct event_arg {
 /*
  * Fibre channel port/lun states.
  */
-#define FCS_UNCONFIGURED       1
-#define FCS_DEVICE_DEAD                2
-#define FCS_DEVICE_LOST                3
-#define FCS_ONLINE             4
+enum {
+       FCS_UNKNOWN,
+       FCS_UNCONFIGURED,
+       FCS_DEVICE_DEAD,
+       FCS_DEVICE_LOST,
+       FCS_ONLINE,
+};
 
 extern const char *const port_state_str[5];
 
-static const char * const port_dstate_str[] = {
-       "DELETED",
-       "GNN_ID",
-       "GNL",
-       "LOGIN_PEND",
-       "LOGIN_FAILED",
-       "GPDB",
-       "UPD_FCPORT",
-       "LOGIN_COMPLETE",
-       "ADISC",
-       "DELETE_PEND",
-       "LOGIN_AUTH_PEND",
+static const char *const port_dstate_str[] = {
+       [DSC_DELETED]           = "DELETED",
+       [DSC_GNN_ID]            = "GNN_ID",
+       [DSC_GNL]               = "GNL",
+       [DSC_LOGIN_PEND]        = "LOGIN_PEND",
+       [DSC_LOGIN_FAILED]      = "LOGIN_FAILED",
+       [DSC_GPDB]              = "GPDB",
+       [DSC_UPD_FCPORT]        = "UPD_FCPORT",
+       [DSC_LOGIN_COMPLETE]    = "LOGIN_COMPLETE",
+       [DSC_ADISC]             = "ADISC",
+       [DSC_DELETE_PEND]       = "DELETE_PEND",
+       [DSC_LOGIN_AUTH_PEND]   = "LOGIN_AUTH_PEND",
 };
 
 /*
@@ -2886,7 +2894,11 @@ struct ct_fdmi2_hba_attributes {
 #define FDMI_PORT_SPEED_8GB            0x10
 #define FDMI_PORT_SPEED_16GB           0x20
 #define FDMI_PORT_SPEED_32GB           0x40
-#define FDMI_PORT_SPEED_64GB           0x80
+#define FDMI_PORT_SPEED_20GB           0x80
+#define FDMI_PORT_SPEED_40GB           0x100
+#define FDMI_PORT_SPEED_128GB          0x200
+#define FDMI_PORT_SPEED_64GB           0x400
+#define FDMI_PORT_SPEED_256GB          0x800
 #define FDMI_PORT_SPEED_UNKNOWN                0x8000
 
 #define FC_CLASS_2     0x04
@@ -4262,8 +4274,10 @@ struct qla_hw_data {
 #define QLA_ABTS_WAIT_ENABLED(_sp) \
        (QLA_NVME_IOS(_sp) && QLA_ABTS_FW_ENABLED(_sp->fcport->vha->hw))
 
-#define IS_PI_UNINIT_CAPABLE(ha)       (IS_QLA83XX(ha) || IS_QLA27XX(ha))
-#define IS_PI_IPGUARD_CAPABLE(ha)      (IS_QLA83XX(ha) || IS_QLA27XX(ha))
+#define IS_PI_UNINIT_CAPABLE(ha)       (IS_QLA83XX(ha) || IS_QLA27XX(ha) || \
+                                        IS_QLA28XX(ha))
+#define IS_PI_IPGUARD_CAPABLE(ha)      (IS_QLA83XX(ha) || IS_QLA27XX(ha) || \
+                                        IS_QLA28XX(ha))
 #define IS_PI_DIFB_DIX0_CAPABLE(ha)    (0)
 #define IS_PI_SPLIT_DET_CAPABLE_HBA(ha)        (IS_QLA83XX(ha) || IS_QLA27XX(ha) || \
                                        IS_QLA28XX(ha))
@@ -4610,6 +4624,7 @@ struct qla_hw_data {
        struct workqueue_struct *wq;
        struct work_struct heartbeat_work;
        struct qlfc_fw fw_buf;
+       unsigned long last_heartbeat_run_jiffies;
 
        /* FCP_CMND priority support */
        struct qla_fcp_prio_cfg *fcp_prio_cfg;
@@ -4906,7 +4921,6 @@ typedef struct scsi_qla_host {
 
        /* list of commands waiting on workqueue */
        struct list_head        qla_cmd_list;
-       struct list_head        qla_sess_op_cmd_list;
        struct list_head        unknown_atio_list;
        spinlock_t              cmd_list_lock;
        struct delayed_work     unknown_atio_work;
@@ -5191,8 +5205,6 @@ struct secure_flash_update_block_pk {
 
 #define        QLA_DSDS_PER_IOCB       37
 
-#define CMD_SP(Cmnd)           ((Cmnd)->SCp.ptr)
-
 #define QLA_SG_ALL     1024
 
 enum nexus_wait_type {
@@ -5427,4 +5439,8 @@ struct ql_vnd_tgt_stats_resp {
 #include "qla_gbl.h"
 #include "qla_dbg.h"
 #include "qla_inline.h"
+
+#define IS_SESSION_DELETED(_fcport) (_fcport->disc_state == DSC_DELETE_PEND || \
+                                     _fcport->disc_state == DSC_DELETED)
+
 #endif