55
55
56
56
#include "qla_settings.h"
57
57
58
+ #define MODE_DUAL (MODE_TARGET | MODE_INITIATOR)
59
+
58
60
/*
59
61
* Data bit definitions
60
62
*/
251
253
252
254
#define MAX_CMDSZ 16 /* SCSI maximum CDB size. */
253
255
#include "qla_fw.h"
256
+
257
+ struct name_list_extended {
258
+ struct get_name_list_extended * l ;
259
+ dma_addr_t ldma ;
260
+ struct list_head fcports ; /* protect by sess_list */
261
+ u32 size ;
262
+ u8 sent ;
263
+ };
254
264
/*
255
265
* Timeout timer counts in seconds
256
266
*/
@@ -309,6 +319,17 @@ struct els_logo_payload {
309
319
uint8_t wwpn [WWN_SIZE ];
310
320
};
311
321
322
+ struct ct_arg {
323
+ void * iocb ;
324
+ u16 nport_handle ;
325
+ dma_addr_t req_dma ;
326
+ dma_addr_t rsp_dma ;
327
+ u32 req_size ;
328
+ u32 rsp_size ;
329
+ void * req ;
330
+ void * rsp ;
331
+ };
332
+
312
333
/*
313
334
* SRB extensions.
314
335
*/
@@ -320,6 +341,7 @@ struct srb_iocb {
320
341
#define SRB_LOGIN_COND_PLOGI BIT_1
321
342
#define SRB_LOGIN_SKIP_PRLI BIT_2
322
343
uint16_t data [2 ];
344
+ u32 iop [2 ];
323
345
} logio ;
324
346
struct {
325
347
#define ELS_DCMD_TIMEOUT 20
@@ -372,6 +394,16 @@ struct srb_iocb {
372
394
__le16 comp_status ;
373
395
struct completion comp ;
374
396
} abt ;
397
+ struct ct_arg ctarg ;
398
+ struct {
399
+ __le16 in_mb [28 ]; /* fr fw */
400
+ __le16 out_mb [28 ]; /* to fw */
401
+ void * out , * in ;
402
+ dma_addr_t out_dma , in_dma ;
403
+ } mbx ;
404
+ struct {
405
+ struct imm_ntfy_from_isp * ntfy ;
406
+ } nack ;
375
407
} u ;
376
408
377
409
struct timer_list timer ;
@@ -392,16 +424,24 @@ struct srb_iocb {
392
424
#define SRB_FXIOCB_BCMD 11
393
425
#define SRB_ABT_CMD 12
394
426
#define SRB_ELS_DCMD 13
427
+ #define SRB_MB_IOCB 14
428
+ #define SRB_CT_PTHRU_CMD 15
429
+ #define SRB_NACK_PLOGI 16
430
+ #define SRB_NACK_PRLI 17
431
+ #define SRB_NACK_LOGO 18
395
432
396
433
typedef struct srb {
397
434
atomic_t ref_count ;
398
435
struct fc_port * fcport ;
436
+ void * vha ;
399
437
uint32_t handle ;
400
438
uint16_t flags ;
401
439
uint16_t type ;
402
440
char * name ;
403
441
int iocbs ;
404
442
struct qla_qpair * qpair ;
443
+ u32 gen1 ; /* scratch */
444
+ u32 gen2 ; /* scratch */
405
445
union {
406
446
struct srb_iocb iocb_cmd ;
407
447
struct bsg_job * bsg_job ;
@@ -2101,6 +2141,18 @@ typedef struct {
2101
2141
#define FC4_TYPE_OTHER 0x0
2102
2142
#define FC4_TYPE_UNKNOWN 0xff
2103
2143
2144
+ /* mailbox command 4G & above */
2145
+ struct mbx_24xx_entry {
2146
+ uint8_t entry_type ;
2147
+ uint8_t entry_count ;
2148
+ uint8_t sys_define1 ;
2149
+ uint8_t entry_status ;
2150
+ uint32_t handle ;
2151
+ uint16_t mb [28 ];
2152
+ };
2153
+
2154
+ #define IOCB_SIZE 64
2155
+
2104
2156
/*
2105
2157
* Fibre channel port type.
2106
2158
*/
@@ -2113,6 +2165,12 @@ typedef enum {
2113
2165
FCT_TARGET
2114
2166
} fc_port_type_t ;
2115
2167
2168
+ enum qla_sess_deletion {
2169
+ QLA_SESS_DELETION_NONE = 0 ,
2170
+ QLA_SESS_DELETION_IN_PROGRESS ,
2171
+ QLA_SESS_DELETED ,
2172
+ };
2173
+
2116
2174
enum qlt_plogi_link_t {
2117
2175
QLT_PLOGI_LINK_SAME_WWN ,
2118
2176
QLT_PLOGI_LINK_CONFLICT ,
@@ -2124,6 +2182,48 @@ struct qlt_plogi_ack_t {
2124
2182
struct imm_ntfy_from_isp iocb ;
2125
2183
port_id_t id ;
2126
2184
int ref_count ;
2185
+ void * fcport ;
2186
+ };
2187
+
2188
+ struct ct_sns_desc {
2189
+ struct ct_sns_pkt * ct_sns ;
2190
+ dma_addr_t ct_sns_dma ;
2191
+ };
2192
+
2193
+ enum discovery_state {
2194
+ DSC_DELETED ,
2195
+ DSC_GID_PN ,
2196
+ DSC_GNL ,
2197
+ DSC_LOGIN_PEND ,
2198
+ DSC_LOGIN_FAILED ,
2199
+ DSC_GPDB ,
2200
+ DSC_GPSC ,
2201
+ DSC_UPD_FCPORT ,
2202
+ DSC_LOGIN_COMPLETE ,
2203
+ DSC_DELETE_PEND ,
2204
+ };
2205
+
2206
+ enum login_state { /* FW control Target side */
2207
+ DSC_LS_LLIOCB_SENT = 2 ,
2208
+ DSC_LS_PLOGI_PEND ,
2209
+ DSC_LS_PLOGI_COMP ,
2210
+ DSC_LS_PRLI_PEND ,
2211
+ DSC_LS_PRLI_COMP ,
2212
+ DSC_LS_PORT_UNAVAIL ,
2213
+ DSC_LS_PRLO_PEND = 9 ,
2214
+ DSC_LS_LOGO_PEND ,
2215
+ };
2216
+
2217
+ enum fcport_mgt_event {
2218
+ FCME_RELOGIN = 1 ,
2219
+ FCME_RSCN ,
2220
+ FCME_GIDPN_DONE ,
2221
+ FCME_PLOGI_DONE , /* Initiator side sent LLIOCB */
2222
+ FCME_GNL_DONE ,
2223
+ FCME_GPSC_DONE ,
2224
+ FCME_GPDB_DONE ,
2225
+ FCME_GPNID_DONE ,
2226
+ FCME_DELETE_DONE ,
2127
2227
};
2128
2228
2129
2229
/*
@@ -2143,9 +2243,13 @@ typedef struct fc_port {
2143
2243
unsigned int deleted :2 ;
2144
2244
unsigned int local :1 ;
2145
2245
unsigned int logout_on_delete :1 ;
2246
+ unsigned int logo_ack_needed :1 ;
2146
2247
unsigned int keep_nport_handle :1 ;
2147
2248
unsigned int send_els_logo :1 ;
2249
+ unsigned int login_pause :1 ;
2250
+ unsigned int login_succ :1 ;
2148
2251
2252
+ struct fc_port * conflict ;
2149
2253
unsigned char logout_completed ;
2150
2254
int generation ;
2151
2255
@@ -2186,8 +2290,30 @@ typedef struct fc_port {
2186
2290
2187
2291
unsigned long retry_delay_timestamp ;
2188
2292
struct qla_tgt_sess * tgt_session ;
2293
+ struct ct_sns_desc ct_desc ;
2294
+ enum discovery_state disc_state ;
2295
+ enum login_state fw_login_state ;
2296
+ u32 login_gen , last_login_gen ;
2297
+ u32 rscn_gen , last_rscn_gen ;
2298
+ u32 chip_reset ;
2299
+ struct list_head gnl_entry ;
2300
+ struct work_struct del_work ;
2301
+ u8 iocb [IOCB_SIZE ];
2189
2302
} fc_port_t ;
2190
2303
2304
+ #define QLA_FCPORT_SCAN 1
2305
+ #define QLA_FCPORT_FOUND 2
2306
+
2307
+ struct event_arg {
2308
+ enum fcport_mgt_event event ;
2309
+ fc_port_t * fcport ;
2310
+ srb_t * sp ;
2311
+ port_id_t id ;
2312
+ u16 data [2 ], rc ;
2313
+ u8 port_name [WWN_SIZE ];
2314
+ u32 iop [2 ];
2315
+ };
2316
+
2191
2317
#include "qla_mr.h"
2192
2318
2193
2319
/*
@@ -2265,6 +2391,10 @@ static const char * const port_state_str[] = {
2265
2391
#define GFT_ID_REQ_SIZE (16 + 4)
2266
2392
#define GFT_ID_RSP_SIZE (16 + 32)
2267
2393
2394
+ #define GID_PN_CMD 0x121
2395
+ #define GID_PN_REQ_SIZE (16 + 8)
2396
+ #define GID_PN_RSP_SIZE (16 + 4)
2397
+
2268
2398
#define RFT_ID_CMD 0x217
2269
2399
#define RFT_ID_REQ_SIZE (16 + 4 + 32)
2270
2400
#define RFT_ID_RSP_SIZE 16
@@ -2590,6 +2720,10 @@ struct ct_sns_req {
2590
2720
uint8_t reserved ;
2591
2721
uint8_t port_name [3 ];
2592
2722
} gff_id ;
2723
+
2724
+ struct {
2725
+ uint8_t port_name [8 ];
2726
+ } gid_pn ;
2593
2727
} req ;
2594
2728
};
2595
2729
@@ -2669,6 +2803,10 @@ struct ct_sns_rsp {
2669
2803
struct {
2670
2804
uint8_t fc4_features [128 ];
2671
2805
} gff_id ;
2806
+ struct {
2807
+ uint8_t reserved ;
2808
+ uint8_t port_id [3 ];
2809
+ } gid_pn ;
2672
2810
} rsp ;
2673
2811
};
2674
2812
@@ -2810,11 +2948,11 @@ struct isp_operations {
2810
2948
2811
2949
uint16_t (* calc_req_entries ) (uint16_t );
2812
2950
void (* build_iocbs ) (srb_t * , cmd_entry_t * , uint16_t );
2813
- void * (* prep_ms_iocb ) (struct scsi_qla_host * , uint32_t , uint32_t );
2814
- void * (* prep_ms_fdmi_iocb ) (struct scsi_qla_host * , uint32_t ,
2951
+ void * (* prep_ms_iocb ) (struct scsi_qla_host * , struct ct_arg * );
2952
+ void * (* prep_ms_fdmi_iocb ) (struct scsi_qla_host * , uint32_t ,
2815
2953
uint32_t );
2816
2954
2817
- uint8_t * (* read_nvram ) (struct scsi_qla_host * , uint8_t * ,
2955
+ uint8_t * (* read_nvram ) (struct scsi_qla_host * , uint8_t * ,
2818
2956
uint32_t , uint32_t );
2819
2957
int (* write_nvram ) (struct scsi_qla_host * , uint8_t * , uint32_t ,
2820
2958
uint32_t );
@@ -2876,13 +3014,21 @@ enum qla_work_type {
2876
3014
QLA_EVT_AEN ,
2877
3015
QLA_EVT_IDC_ACK ,
2878
3016
QLA_EVT_ASYNC_LOGIN ,
2879
- QLA_EVT_ASYNC_LOGIN_DONE ,
2880
3017
QLA_EVT_ASYNC_LOGOUT ,
2881
3018
QLA_EVT_ASYNC_LOGOUT_DONE ,
2882
3019
QLA_EVT_ASYNC_ADISC ,
2883
3020
QLA_EVT_ASYNC_ADISC_DONE ,
2884
3021
QLA_EVT_UEVENT ,
2885
3022
QLA_EVT_AENFX ,
3023
+ QLA_EVT_GIDPN ,
3024
+ QLA_EVT_GPNID ,
3025
+ QLA_EVT_GPNID_DONE ,
3026
+ QLA_EVT_NEW_SESS ,
3027
+ QLA_EVT_GPDB ,
3028
+ QLA_EVT_GPSC ,
3029
+ QLA_EVT_UPD_FCPORT ,
3030
+ QLA_EVT_GNL ,
3031
+ QLA_EVT_NACK ,
2886
3032
};
2887
3033
2888
3034
@@ -2918,6 +3064,23 @@ struct qla_work_evt {
2918
3064
struct {
2919
3065
srb_t * sp ;
2920
3066
} iosb ;
3067
+ struct {
3068
+ port_id_t id ;
3069
+ } gpnid ;
3070
+ struct {
3071
+ port_id_t id ;
3072
+ u8 port_name [8 ];
3073
+ void * pla ;
3074
+ } new_sess ;
3075
+ struct { /*Get PDB, Get Speed, update fcport, gnl, gidpn */
3076
+ fc_port_t * fcport ;
3077
+ u8 opt ;
3078
+ } fcport ;
3079
+ struct {
3080
+ fc_port_t * fcport ;
3081
+ u8 iocb [IOCB_SIZE ];
3082
+ int type ;
3083
+ } nack ;
2921
3084
} u ;
2922
3085
};
2923
3086
@@ -3899,6 +4062,10 @@ typedef struct scsi_qla_host {
3899
4062
struct qla8044_reset_template reset_tmplt ;
3900
4063
struct qla_tgt_counters tgt_counters ;
3901
4064
uint16_t bbcr ;
4065
+ struct name_list_extended gnl ;
4066
+ /* Count of active session/fcport */
4067
+ int fcport_count ;
4068
+ wait_queue_head_t fcport_waitQ ;
3902
4069
} scsi_qla_host_t ;
3903
4070
3904
4071
struct qla27xx_image_status {
0 commit comments