diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_def.h')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index e8948b679f5b..a1ca590ba447 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -1551,6 +1551,9 @@ typedef struct fc_port { | |||
1551 | 1551 | ||
1552 | unsigned long last_queue_full; | 1552 | unsigned long last_queue_full; |
1553 | unsigned long last_ramp_up; | 1553 | unsigned long last_ramp_up; |
1554 | |||
1555 | struct list_head vp_fcport; | ||
1556 | uint16_t vp_idx; | ||
1554 | } fc_port_t; | 1557 | } fc_port_t; |
1555 | 1558 | ||
1556 | /* | 1559 | /* |
@@ -1999,6 +2002,36 @@ struct gid_list_info { | |||
1999 | }; | 2002 | }; |
2000 | #define GID_LIST_SIZE (sizeof(struct gid_list_info) * MAX_FIBRE_DEVICES) | 2003 | #define GID_LIST_SIZE (sizeof(struct gid_list_info) * MAX_FIBRE_DEVICES) |
2001 | 2004 | ||
2005 | /* NPIV */ | ||
2006 | typedef struct vport_info { | ||
2007 | uint8_t port_name[WWN_SIZE]; | ||
2008 | uint8_t node_name[WWN_SIZE]; | ||
2009 | int vp_id; | ||
2010 | uint16_t loop_id; | ||
2011 | unsigned long host_no; | ||
2012 | uint8_t port_id[3]; | ||
2013 | int loop_state; | ||
2014 | } vport_info_t; | ||
2015 | |||
2016 | typedef struct vport_params { | ||
2017 | uint8_t port_name[WWN_SIZE]; | ||
2018 | uint8_t node_name[WWN_SIZE]; | ||
2019 | uint32_t options; | ||
2020 | #define VP_OPTS_RETRY_ENABLE BIT_0 | ||
2021 | #define VP_OPTS_VP_DISABLE BIT_1 | ||
2022 | } vport_params_t; | ||
2023 | |||
2024 | /* NPIV - return codes of VP create and modify */ | ||
2025 | #define VP_RET_CODE_OK 0 | ||
2026 | #define VP_RET_CODE_FATAL 1 | ||
2027 | #define VP_RET_CODE_WRONG_ID 2 | ||
2028 | #define VP_RET_CODE_WWPN 3 | ||
2029 | #define VP_RET_CODE_RESOURCES 4 | ||
2030 | #define VP_RET_CODE_NO_MEM 5 | ||
2031 | #define VP_RET_CODE_NOT_FOUND 6 | ||
2032 | |||
2033 | #define to_qla_parent(x) (((x)->parent) ? (x)->parent : (x)) | ||
2034 | |||
2002 | /* | 2035 | /* |
2003 | * ISP operations | 2036 | * ISP operations |
2004 | */ | 2037 | */ |
@@ -2073,6 +2106,16 @@ struct qla_msix_entry { | |||
2073 | uint16_t msix_entry; | 2106 | uint16_t msix_entry; |
2074 | }; | 2107 | }; |
2075 | 2108 | ||
2109 | #define WATCH_INTERVAL 1 /* number of seconds */ | ||
2110 | |||
2111 | /* NPIV */ | ||
2112 | #define MAX_MULTI_ID_LOOP 126 | ||
2113 | #define MAX_MULTI_ID_FABRIC 64 | ||
2114 | #define MAX_NUM_VPORT_LOOP (MAX_MULTI_ID_LOOP - 1) | ||
2115 | #define MAX_NUM_VPORT_FABRIC (MAX_MULTI_ID_FABRIC - 1) | ||
2116 | #define MAX_NUM_VHBA_LOOP (MAX_MULTI_ID_LOOP - 1) | ||
2117 | #define MAX_NUM_VHBA_FABRIC (MAX_MULTI_ID_FABRIC - 1) | ||
2118 | |||
2076 | /* | 2119 | /* |
2077 | * Linux Host Adapter structure | 2120 | * Linux Host Adapter structure |
2078 | */ | 2121 | */ |
@@ -2108,6 +2151,8 @@ typedef struct scsi_qla_host { | |||
2108 | uint32_t msix_enabled :1; | 2151 | uint32_t msix_enabled :1; |
2109 | uint32_t disable_serdes :1; | 2152 | uint32_t disable_serdes :1; |
2110 | uint32_t gpsc_supported :1; | 2153 | uint32_t gpsc_supported :1; |
2154 | uint32_t vsan_enabled :1; | ||
2155 | uint32_t npiv_supported :1; | ||
2111 | } flags; | 2156 | } flags; |
2112 | 2157 | ||
2113 | atomic_t loop_state; | 2158 | atomic_t loop_state; |
@@ -2147,6 +2192,7 @@ typedef struct scsi_qla_host { | |||
2147 | #define BEACON_BLINK_NEEDED 25 | 2192 | #define BEACON_BLINK_NEEDED 25 |
2148 | #define REGISTER_FDMI_NEEDED 26 | 2193 | #define REGISTER_FDMI_NEEDED 26 |
2149 | #define FCPORT_UPDATE_NEEDED 27 | 2194 | #define FCPORT_UPDATE_NEEDED 27 |
2195 | #define VP_DPC_NEEDED 28 /* wake up for VP dpc handling */ | ||
2150 | 2196 | ||
2151 | uint32_t device_flags; | 2197 | uint32_t device_flags; |
2152 | #define DFLG_LOCAL_DEVICES BIT_0 | 2198 | #define DFLG_LOCAL_DEVICES BIT_0 |
@@ -2237,6 +2283,11 @@ typedef struct scsi_qla_host { | |||
2237 | 2283 | ||
2238 | /* ISP configuration data. */ | 2284 | /* ISP configuration data. */ |
2239 | uint16_t loop_id; /* Host adapter loop id */ | 2285 | uint16_t loop_id; /* Host adapter loop id */ |
2286 | uint16_t switch_cap; | ||
2287 | #define FLOGI_SEQ_DEL BIT_8 | ||
2288 | #define FLOGI_MID_SUPPORT BIT_10 | ||
2289 | #define FLOGI_VSAN_SUPPORT BIT_12 | ||
2290 | #define FLOGI_SP_SUPPORT BIT_13 | ||
2240 | uint16_t fb_rev; | 2291 | uint16_t fb_rev; |
2241 | 2292 | ||
2242 | port_id_t d_id; /* Host adapter port id */ | 2293 | port_id_t d_id; /* Host adapter port id */ |
@@ -2344,6 +2395,7 @@ typedef struct scsi_qla_host { | |||
2344 | #define MBX_UPDATE_FLASH_ACTIVE 3 | 2395 | #define MBX_UPDATE_FLASH_ACTIVE 3 |
2345 | 2396 | ||
2346 | struct semaphore mbx_cmd_sem; /* Serialialize mbx access */ | 2397 | struct semaphore mbx_cmd_sem; /* Serialialize mbx access */ |
2398 | struct semaphore vport_sem; /* Virtual port synchronization */ | ||
2347 | struct semaphore mbx_intr_sem; /* Used for completion notification */ | 2399 | struct semaphore mbx_intr_sem; /* Used for completion notification */ |
2348 | 2400 | ||
2349 | uint32_t mbx_flags; | 2401 | uint32_t mbx_flags; |
@@ -2428,6 +2480,37 @@ typedef struct scsi_qla_host { | |||
2428 | struct fc_host_statistics fc_host_stat; | 2480 | struct fc_host_statistics fc_host_stat; |
2429 | 2481 | ||
2430 | struct qla_msix_entry msix_entries[QLA_MSIX_ENTRIES]; | 2482 | struct qla_msix_entry msix_entries[QLA_MSIX_ENTRIES]; |
2483 | |||
2484 | struct list_head vp_list; /* list of VP */ | ||
2485 | struct fc_vport *fc_vport; /* holds fc_vport * for each vport */ | ||
2486 | uint8_t vp_idx_map[16]; | ||
2487 | uint16_t num_vhosts; /* number of vports created */ | ||
2488 | uint16_t num_vsans; /* number of vsan created */ | ||
2489 | uint16_t vp_idx; /* vport ID */ | ||
2490 | |||
2491 | struct scsi_qla_host *parent; /* holds pport */ | ||
2492 | unsigned long vp_flags; | ||
2493 | struct list_head vp_fcports; /* list of fcports */ | ||
2494 | #define VP_IDX_ACQUIRED 0 /* bit no 0 */ | ||
2495 | #define VP_CREATE_NEEDED 1 | ||
2496 | #define VP_BIND_NEEDED 2 | ||
2497 | #define VP_DELETE_NEEDED 3 | ||
2498 | #define VP_SCR_NEEDED 4 /* State Change Request registration */ | ||
2499 | atomic_t vp_state; | ||
2500 | #define VP_OFFLINE 0 | ||
2501 | #define VP_ACTIVE 1 | ||
2502 | #define VP_FAILED 2 | ||
2503 | // #define VP_DISABLE 3 | ||
2504 | uint16_t vp_err_state; | ||
2505 | uint16_t vp_prev_err_state; | ||
2506 | #define VP_ERR_UNKWN 0 | ||
2507 | #define VP_ERR_PORTDWN 1 | ||
2508 | #define VP_ERR_FAB_UNSUPPORTED 2 | ||
2509 | #define VP_ERR_FAB_NORESOURCES 3 | ||
2510 | #define VP_ERR_FAB_LOGOUT 4 | ||
2511 | #define VP_ERR_ADAP_NORESOURCES 5 | ||
2512 | int max_npiv_vports; /* 63 or 125 per topoloty */ | ||
2513 | int cur_vport_count; | ||
2431 | } scsi_qla_host_t; | 2514 | } scsi_qla_host_t; |
2432 | 2515 | ||
2433 | 2516 | ||