forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/scsi/lpfc/lpfc_bsg.h
....@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4
- * Copyright (C) 2017-2018 Broadcom. All Rights Reserved. The term *
4
+ * Copyright (C) 2017-2019 Broadcom. All Rights Reserved. The term *
55 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. *
66 * Copyright (C) 2010-2015 Emulex. All rights reserved. *
77 * EMULEX and SLI are trademarks of Emulex. *
....@@ -38,6 +38,11 @@
3838 #define LPFC_BSG_VENDOR_DIAG_MODE_END 10
3939 #define LPFC_BSG_VENDOR_LINK_DIAG_TEST 11
4040 #define LPFC_BSG_VENDOR_FORCED_LINK_SPEED 14
41
+#define LPFC_BSG_VENDOR_RAS_GET_LWPD 16
42
+#define LPFC_BSG_VENDOR_RAS_GET_FWLOG 17
43
+#define LPFC_BSG_VENDOR_RAS_GET_CONFIG 18
44
+#define LPFC_BSG_VENDOR_RAS_SET_CONFIG 19
45
+#define LPFC_BSG_VENDOR_GET_TRUNK_INFO 20
4146
4247 struct set_ct_event {
4348 uint32_t command;
....@@ -63,6 +68,7 @@
6368 };
6469
6570
71
+#define DISABLE_LOOP_BACK 0x0 /* disables loop back */
6672 #define INTERNAL_LOOP_BACK 0x1 /* adapter short cuts the loop internally */
6773 #define EXTERNAL_LOOP_BACK 0x2 /* requires an external loopback plug */
6874
....@@ -70,6 +76,7 @@
7076 uint32_t command;
7177 uint32_t type;
7278 uint32_t timeout;
79
+ uint32_t physical_link;
7380 };
7481
7582 struct sli4_link_diag {
....@@ -218,6 +225,10 @@
218225 uint32_t reserved5;
219226 };
220227
228
+#define LPFC_CSF_BOOT_DEV 0x1D
229
+#define LPFC_CSF_QUERY 0
230
+#define LPFC_CSF_SAVE 1
231
+
221232 struct lpfc_sli_config_emb0_subsys {
222233 struct lpfc_sli_config_hdr sli_config_hdr;
223234 #define LPFC_MBX_SLI_CONFIG_MAX_MSE 19
....@@ -236,6 +247,15 @@
236247 #define FCOE_OPCODE_ADD_FCF 0x09
237248 #define FCOE_OPCODE_SET_DPORT_MODE 0x27
238249 #define FCOE_OPCODE_GET_DPORT_RESULTS 0x28
250
+ uint32_t timeout; /* comn_set_feature timeout */
251
+ uint32_t request_length; /* comn_set_feature request len */
252
+ uint32_t version; /* comn_set_feature version */
253
+ uint32_t csf_feature; /* comn_set_feature feature */
254
+ uint32_t word69; /* comn_set_feature parameter len */
255
+ uint32_t word70; /* comn_set_feature parameter val0 */
256
+#define lpfc_emb0_subcmnd_csf_p0_SHIFT 0
257
+#define lpfc_emb0_subcmnd_csf_p0_MASK 0x3
258
+#define lpfc_emb0_subcmnd_csf_p0_WORD word70
239259 };
240260
241261 struct lpfc_sli_config_emb1_subsys {
....@@ -254,6 +274,7 @@
254274 #define COMN_OPCODE_WRITE_OBJECT 0xAC
255275 #define COMN_OPCODE_READ_OBJECT_LIST 0xAD
256276 #define COMN_OPCODE_DELETE_OBJECT 0xAE
277
+#define COMN_OPCODE_SET_FEATURES 0xBF
257278 #define COMN_OPCODE_GET_CNTL_ADDL_ATTRIBUTES 0x79
258279 #define COMN_OPCODE_GET_CNTL_ATTRIBUTES 0x20
259280 uint32_t timeout;
....@@ -296,6 +317,75 @@
296317 uint8_t supported;
297318 };
298319
320
+struct lpfc_bsg_ras_req {
321
+ uint32_t command;
322
+};
323
+
324
+struct lpfc_bsg_get_fwlog_req {
325
+ uint32_t command;
326
+ uint32_t read_size;
327
+ uint32_t read_offset;
328
+};
329
+
330
+struct lpfc_bsg_get_ras_lwpd {
331
+ uint32_t offset;
332
+ uint32_t wrap_count;
333
+};
334
+
335
+struct lpfc_bsg_set_ras_config_req {
336
+ uint32_t command;
337
+ uint8_t action;
338
+#define LPFC_RASACTION_STOP_LOGGING 0x00
339
+#define LPFC_RASACTION_START_LOGGING 0x01
340
+ uint8_t log_level;
341
+};
342
+
343
+struct lpfc_bsg_get_ras_config_reply {
344
+ uint8_t state;
345
+#define LPFC_RASLOG_STATE_STOPPED 0x00
346
+#define LPFC_RASLOG_STATE_RUNNING 0x01
347
+ uint8_t log_level;
348
+ uint32_t log_buff_sz;
349
+};
350
+
351
+struct lpfc_trunk_info {
352
+ uint32_t word0;
353
+#define lpfc_trunk_info_link_status_SHIFT 0
354
+#define lpfc_trunk_info_link_status_MASK 1
355
+#define lpfc_trunk_info_link_status_WORD word0
356
+#define lpfc_trunk_info_trunk_active0_SHIFT 8
357
+#define lpfc_trunk_info_trunk_active0_MASK 1
358
+#define lpfc_trunk_info_trunk_active0_WORD word0
359
+#define lpfc_trunk_info_trunk_active1_SHIFT 9
360
+#define lpfc_trunk_info_trunk_active1_MASK 1
361
+#define lpfc_trunk_info_trunk_active1_WORD word0
362
+#define lpfc_trunk_info_trunk_active2_SHIFT 10
363
+#define lpfc_trunk_info_trunk_active2_MASK 1
364
+#define lpfc_trunk_info_trunk_active2_WORD word0
365
+#define lpfc_trunk_info_trunk_active3_SHIFT 11
366
+#define lpfc_trunk_info_trunk_active3_MASK 1
367
+#define lpfc_trunk_info_trunk_active3_WORD word0
368
+#define lpfc_trunk_info_trunk_config0_SHIFT 12
369
+#define lpfc_trunk_info_trunk_config0_MASK 1
370
+#define lpfc_trunk_info_trunk_config0_WORD word0
371
+#define lpfc_trunk_info_trunk_config1_SHIFT 13
372
+#define lpfc_trunk_info_trunk_config1_MASK 1
373
+#define lpfc_trunk_info_trunk_config1_WORD word0
374
+#define lpfc_trunk_info_trunk_config2_SHIFT 14
375
+#define lpfc_trunk_info_trunk_config2_MASK 1
376
+#define lpfc_trunk_info_trunk_config2_WORD word0
377
+#define lpfc_trunk_info_trunk_config3_SHIFT 15
378
+#define lpfc_trunk_info_trunk_config3_MASK 1
379
+#define lpfc_trunk_info_trunk_config3_WORD word0
380
+ uint16_t port_speed;
381
+ uint16_t logical_speed;
382
+ uint32_t reserved3;
383
+};
384
+
385
+struct get_trunk_info_req {
386
+ uint32_t command;
387
+};
388
+
299389 /* driver only */
300390 #define SLI_CONFIG_NOT_HANDLED 0
301391 #define SLI_CONFIG_HANDLED 1