~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/scsi/lpfc/lpfc_hw4.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
170
170
#define LPFC_PCI_FUNC3          3
171
171
#define LPFC_PCI_FUNC4          4
172
172
 
 
173
/* SLI4 interface type-2 control register offsets */
 
174
#define LPFC_CTL_PORT_SEM_OFFSET        0x400
 
175
#define LPFC_CTL_PORT_STA_OFFSET        0x404
 
176
#define LPFC_CTL_PORT_CTL_OFFSET        0x408
 
177
#define LPFC_CTL_PORT_ER1_OFFSET        0x40C
 
178
#define LPFC_CTL_PORT_ER2_OFFSET        0x410
 
179
#define LPFC_CTL_PDEV_CTL_OFFSET        0x414
 
180
 
 
181
/* Some SLI4 interface type-2 PDEV_CTL register bits */
 
182
#define LPFC_CTL_PDEV_CTL_DRST          0x00000001
 
183
#define LPFC_CTL_PDEV_CTL_FRST          0x00000002
 
184
#define LPFC_CTL_PDEV_CTL_DD            0x00000004
 
185
#define LPFC_CTL_PDEV_CTL_LC            0x00000008
 
186
#define LPFC_CTL_PDEV_CTL_FRL_ALL       0x00
 
187
#define LPFC_CTL_PDEV_CTL_FRL_FC_FCOE   0x10
 
188
#define LPFC_CTL_PDEV_CTL_FRL_NIC       0x20
 
189
 
 
190
#define LPFC_FW_DUMP_REQUEST    (LPFC_CTL_PDEV_CTL_DD | LPFC_CTL_PDEV_CTL_FRST)
 
191
 
173
192
/* Active interrupt test count */
174
193
#define LPFC_ACT_INTR_CNT       4
175
194
 
210
229
 
211
230
struct lpfc_sli4_flags {
212
231
        uint32_t word0;
213
 
#define lpfc_fip_flag_SHIFT 0
214
 
#define lpfc_fip_flag_MASK 0x00000001
215
 
#define lpfc_fip_flag_WORD word0
 
232
#define lpfc_idx_rsrc_rdy_SHIFT         0
 
233
#define lpfc_idx_rsrc_rdy_MASK          0x00000001
 
234
#define lpfc_idx_rsrc_rdy_WORD          word0
 
235
#define LPFC_IDX_RSRC_RDY               1
 
236
#define lpfc_xri_rsrc_rdy_SHIFT         1
 
237
#define lpfc_xri_rsrc_rdy_MASK          0x00000001
 
238
#define lpfc_xri_rsrc_rdy_WORD          word0
 
239
#define LPFC_XRI_RSRC_RDY               1
 
240
#define lpfc_rpi_rsrc_rdy_SHIFT         2
 
241
#define lpfc_rpi_rsrc_rdy_MASK          0x00000001
 
242
#define lpfc_rpi_rsrc_rdy_WORD          word0
 
243
#define LPFC_RPI_RSRC_RDY               1
 
244
#define lpfc_vpi_rsrc_rdy_SHIFT         3
 
245
#define lpfc_vpi_rsrc_rdy_MASK          0x00000001
 
246
#define lpfc_vpi_rsrc_rdy_WORD          word0
 
247
#define LPFC_VPI_RSRC_RDY               1
 
248
#define lpfc_vfi_rsrc_rdy_SHIFT         4
 
249
#define lpfc_vfi_rsrc_rdy_MASK          0x00000001
 
250
#define lpfc_vfi_rsrc_rdy_WORD          word0
 
251
#define LPFC_VFI_RSRC_RDY               1
216
252
};
217
253
 
218
 
struct sli4_bls_acc {
 
254
struct sli4_bls_rsp {
219
255
        uint32_t word0_rsvd;      /* Word0 must be reserved */
220
256
        uint32_t word1;
221
257
#define lpfc_abts_orig_SHIFT      0
231
267
#define lpfc_abts_oxid_MASK       0x0000FFFF
232
268
#define lpfc_abts_oxid_WORD       word2
233
269
        uint32_t word3;
 
270
#define lpfc_vndr_code_SHIFT    0
 
271
#define lpfc_vndr_code_MASK     0x000000FF
 
272
#define lpfc_vndr_code_WORD     word3
 
273
#define lpfc_rsn_expln_SHIFT    8
 
274
#define lpfc_rsn_expln_MASK     0x000000FF
 
275
#define lpfc_rsn_expln_WORD     word3
 
276
#define lpfc_rsn_code_SHIFT     16
 
277
#define lpfc_rsn_code_MASK      0x000000FF
 
278
#define lpfc_rsn_code_WORD      word3
 
279
 
234
280
        uint32_t word4;
235
281
        uint32_t word5_rsvd;    /* Word5 must be reserved */
236
282
};
711
757
union lpfc_sli4_cfg_shdr {
712
758
        struct {
713
759
                uint32_t word6;
714
 
#define lpfc_mbox_hdr_opcode_SHIFT              0
715
 
#define lpfc_mbox_hdr_opcode_MASK               0x000000FF
716
 
#define lpfc_mbox_hdr_opcode_WORD               word6
717
 
#define lpfc_mbox_hdr_subsystem_SHIFT           8
718
 
#define lpfc_mbox_hdr_subsystem_MASK            0x000000FF
719
 
#define lpfc_mbox_hdr_subsystem_WORD            word6
720
 
#define lpfc_mbox_hdr_port_number_SHIFT         16
721
 
#define lpfc_mbox_hdr_port_number_MASK          0x000000FF
722
 
#define lpfc_mbox_hdr_port_number_WORD          word6
723
 
#define lpfc_mbox_hdr_domain_SHIFT              24
724
 
#define lpfc_mbox_hdr_domain_MASK               0x000000FF
725
 
#define lpfc_mbox_hdr_domain_WORD               word6
 
760
#define lpfc_mbox_hdr_opcode_SHIFT      0
 
761
#define lpfc_mbox_hdr_opcode_MASK       0x000000FF
 
762
#define lpfc_mbox_hdr_opcode_WORD       word6
 
763
#define lpfc_mbox_hdr_subsystem_SHIFT   8
 
764
#define lpfc_mbox_hdr_subsystem_MASK    0x000000FF
 
765
#define lpfc_mbox_hdr_subsystem_WORD    word6
 
766
#define lpfc_mbox_hdr_port_number_SHIFT 16
 
767
#define lpfc_mbox_hdr_port_number_MASK  0x000000FF
 
768
#define lpfc_mbox_hdr_port_number_WORD  word6
 
769
#define lpfc_mbox_hdr_domain_SHIFT      24
 
770
#define lpfc_mbox_hdr_domain_MASK       0x000000FF
 
771
#define lpfc_mbox_hdr_domain_WORD       word6
726
772
                uint32_t timeout;
727
773
                uint32_t request_length;
728
 
                uint32_t reserved9;
 
774
                uint32_t word9;
 
775
#define lpfc_mbox_hdr_version_SHIFT     0
 
776
#define lpfc_mbox_hdr_version_MASK      0x000000FF
 
777
#define lpfc_mbox_hdr_version_WORD      word9
 
778
#define lpfc_mbox_hdr_pf_num_SHIFT      16
 
779
#define lpfc_mbox_hdr_pf_num_MASK       0x000000FF
 
780
#define lpfc_mbox_hdr_pf_num_WORD       word9
 
781
#define lpfc_mbox_hdr_vh_num_SHIFT      24
 
782
#define lpfc_mbox_hdr_vh_num_MASK       0x000000FF
 
783
#define lpfc_mbox_hdr_vh_num_WORD       word9
 
784
#define LPFC_Q_CREATE_VERSION_2 2
 
785
#define LPFC_Q_CREATE_VERSION_1 1
 
786
#define LPFC_Q_CREATE_VERSION_0 0
729
787
        } request;
730
788
        struct {
731
789
                uint32_t word6;
750
808
        } response;
751
809
};
752
810
 
753
 
/* Mailbox structures */
 
811
/* Mailbox Header structures.
 
812
 * struct mbox_header is defined for first generation SLI4_CFG mailbox
 
813
 * calls deployed for BE-based ports.
 
814
 *
 
815
 * struct sli4_mbox_header is defined for second generation SLI4
 
816
 * ports that don't deploy the SLI4_CFG mechanism.
 
817
 */
754
818
struct mbox_header {
755
819
        struct lpfc_sli4_cfg_mhdr cfg_mhdr;
756
820
        union  lpfc_sli4_cfg_shdr cfg_shdr;
757
821
};
758
822
 
 
823
#define LPFC_EXTENT_LOCAL               0
 
824
#define LPFC_TIMEOUT_DEFAULT            0
 
825
#define LPFC_EXTENT_VERSION_DEFAULT     0
 
826
 
759
827
/* Subsystem Definitions */
760
828
#define LPFC_MBOX_SUBSYSTEM_COMMON      0x1
761
829
#define LPFC_MBOX_SUBSYSTEM_FCOE        0xC
778
846
#define LPFC_MBOX_OPCODE_QUERY_FW_CFG           0x3A
779
847
#define LPFC_MBOX_OPCODE_FUNCTION_RESET         0x3D
780
848
#define LPFC_MBOX_OPCODE_MQ_CREATE_EXT          0x5A
 
849
#define LPFC_MBOX_OPCODE_GET_RSRC_EXTENT_INFO   0x9A
 
850
#define LPFC_MBOX_OPCODE_GET_ALLOC_RSRC_EXTENT  0x9B
 
851
#define LPFC_MBOX_OPCODE_ALLOC_RSRC_EXTENT      0x9C
 
852
#define LPFC_MBOX_OPCODE_DEALLOC_RSRC_EXTENT    0x9D
 
853
#define LPFC_MBOX_OPCODE_GET_FUNCTION_CONFIG    0xA0
 
854
#define LPFC_MBOX_OPCODE_GET_PROFILE_CONFIG     0xA4
 
855
#define LPFC_MBOX_OPCODE_WRITE_OBJECT           0xAC
 
856
#define LPFC_MBOX_OPCODE_GET_SLI4_PARAMETERS    0xB5
781
857
 
782
858
/* FCoE Opcodes */
783
859
#define LPFC_MBOX_OPCODE_FCOE_WQ_CREATE                 0x01
791
867
#define LPFC_MBOX_OPCODE_FCOE_DELETE_FCF                0x0A
792
868
#define LPFC_MBOX_OPCODE_FCOE_POST_HDR_TEMPLATE         0x0B
793
869
#define LPFC_MBOX_OPCODE_FCOE_REDISCOVER_FCF            0x10
 
870
#define LPFC_MBOX_OPCODE_FCOE_LINK_DIAG_STATE           0x22
 
871
#define LPFC_MBOX_OPCODE_FCOE_LINK_DIAG_LOOPBACK        0x23
794
872
 
795
873
/* Mailbox command structures */
796
874
struct eq_context {
916
994
#define LPFC_CQ_CNT_512         0x1
917
995
#define LPFC_CQ_CNT_1024        0x2
918
996
        uint32_t word1;
919
 
#define lpfc_cq_eq_id_SHIFT             22
 
997
#define lpfc_cq_eq_id_SHIFT             22      /* Version 0 Only */
920
998
#define lpfc_cq_eq_id_MASK              0x000000FF
921
999
#define lpfc_cq_eq_id_WORD              word1
 
1000
#define lpfc_cq_eq_id_2_SHIFT           0       /* Version 2 Only */
 
1001
#define lpfc_cq_eq_id_2_MASK            0x0000FFFF
 
1002
#define lpfc_cq_eq_id_2_WORD            word1
922
1003
        uint32_t reserved0;
923
1004
        uint32_t reserved1;
924
1005
};
928
1009
        union {
929
1010
                struct {
930
1011
                        uint32_t word0;
 
1012
#define lpfc_mbx_cq_create_page_size_SHIFT      16      /* Version 2 Only */
 
1013
#define lpfc_mbx_cq_create_page_size_MASK       0x000000FF
 
1014
#define lpfc_mbx_cq_create_page_size_WORD       word0
931
1015
#define lpfc_mbx_cq_create_num_pages_SHIFT      0
932
1016
#define lpfc_mbx_cq_create_num_pages_MASK       0x0000FFFF
933
1017
#define lpfc_mbx_cq_create_num_pages_WORD       word0
968
1052
struct lpfc_mbx_wq_create {
969
1053
        struct mbox_header header;
970
1054
        union {
971
 
                struct {
 
1055
                struct {        /* Version 0 Request */
972
1056
                        uint32_t word0;
973
1057
#define lpfc_mbx_wq_create_num_pages_SHIFT      0
974
1058
#define lpfc_mbx_wq_create_num_pages_MASK       0x0000FFFF
978
1062
#define lpfc_mbx_wq_create_cq_id_WORD           word0
979
1063
                        struct dma_address page[LPFC_MAX_WQ_PAGE];
980
1064
                } request;
 
1065
                struct {        /* Version 1 Request */
 
1066
                        uint32_t word0; /* Word 0 is the same as in v0 */
 
1067
                        uint32_t word1;
 
1068
#define lpfc_mbx_wq_create_page_size_SHIFT      0
 
1069
#define lpfc_mbx_wq_create_page_size_MASK       0x000000FF
 
1070
#define lpfc_mbx_wq_create_page_size_WORD       word1
 
1071
#define lpfc_mbx_wq_create_wqe_size_SHIFT       8
 
1072
#define lpfc_mbx_wq_create_wqe_size_MASK        0x0000000F
 
1073
#define lpfc_mbx_wq_create_wqe_size_WORD        word1
 
1074
#define LPFC_WQ_WQE_SIZE_64     0x5
 
1075
#define LPFC_WQ_WQE_SIZE_128    0x6
 
1076
#define lpfc_mbx_wq_create_wqe_count_SHIFT      16
 
1077
#define lpfc_mbx_wq_create_wqe_count_MASK       0x0000FFFF
 
1078
#define lpfc_mbx_wq_create_wqe_count_WORD       word1
 
1079
                        uint32_t word2;
 
1080
                        struct dma_address page[LPFC_MAX_WQ_PAGE-1];
 
1081
                } request_1;
981
1082
                struct {
982
1083
                        uint32_t word0;
983
1084
#define lpfc_mbx_wq_create_q_id_SHIFT   0
1006
1107
#define LPFC_DATA_BUF_SIZE 2048
1007
1108
struct rq_context {
1008
1109
        uint32_t word0;
1009
 
#define lpfc_rq_context_rq_size_SHIFT   16
1010
 
#define lpfc_rq_context_rq_size_MASK    0x0000000F
1011
 
#define lpfc_rq_context_rq_size_WORD    word0
 
1110
#define lpfc_rq_context_rqe_count_SHIFT 16      /* Version 0 Only */
 
1111
#define lpfc_rq_context_rqe_count_MASK  0x0000000F
 
1112
#define lpfc_rq_context_rqe_count_WORD  word0
1012
1113
#define LPFC_RQ_RING_SIZE_512           9       /* 512 entries */
1013
1114
#define LPFC_RQ_RING_SIZE_1024          10      /* 1024 entries */
1014
1115
#define LPFC_RQ_RING_SIZE_2048          11      /* 2048 entries */
1015
1116
#define LPFC_RQ_RING_SIZE_4096          12      /* 4096 entries */
 
1117
#define lpfc_rq_context_rqe_count_1_SHIFT       16      /* Version 1 Only */
 
1118
#define lpfc_rq_context_rqe_count_1_MASK        0x0000FFFF
 
1119
#define lpfc_rq_context_rqe_count_1_WORD        word0
 
1120
#define lpfc_rq_context_rqe_size_SHIFT  8               /* Version 1 Only */
 
1121
#define lpfc_rq_context_rqe_size_MASK   0x0000000F
 
1122
#define lpfc_rq_context_rqe_size_WORD   word0
 
1123
#define LPFC_RQE_SIZE_8         2
 
1124
#define LPFC_RQE_SIZE_16        3
 
1125
#define LPFC_RQE_SIZE_32        4
 
1126
#define LPFC_RQE_SIZE_64        5
 
1127
#define LPFC_RQE_SIZE_128       6
 
1128
#define lpfc_rq_context_page_size_SHIFT 0               /* Version 1 Only */
 
1129
#define lpfc_rq_context_page_size_MASK  0x000000FF
 
1130
#define lpfc_rq_context_page_size_WORD  word0
1016
1131
        uint32_t reserved1;
1017
1132
        uint32_t word2;
1018
1133
#define lpfc_rq_context_cq_id_SHIFT     16
1021
1136
#define lpfc_rq_context_buf_size_SHIFT  0
1022
1137
#define lpfc_rq_context_buf_size_MASK   0x0000FFFF
1023
1138
#define lpfc_rq_context_buf_size_WORD   word2
1024
 
        uint32_t reserved3;
 
1139
        uint32_t buffer_size;                           /* Version 1 Only */
1025
1140
};
1026
1141
 
1027
1142
struct lpfc_mbx_rq_create {
1061
1176
 
1062
1177
struct mq_context {
1063
1178
        uint32_t word0;
1064
 
#define lpfc_mq_context_cq_id_SHIFT     22
 
1179
#define lpfc_mq_context_cq_id_SHIFT     22      /* Version 0 Only */
1065
1180
#define lpfc_mq_context_cq_id_MASK      0x000003FF
1066
1181
#define lpfc_mq_context_cq_id_WORD      word0
1067
 
#define lpfc_mq_context_count_SHIFT     16
1068
 
#define lpfc_mq_context_count_MASK      0x0000000F
1069
 
#define lpfc_mq_context_count_WORD      word0
1070
 
#define LPFC_MQ_CNT_16          0x5
1071
 
#define LPFC_MQ_CNT_32          0x6
1072
 
#define LPFC_MQ_CNT_64          0x7
1073
 
#define LPFC_MQ_CNT_128         0x8
 
1182
#define lpfc_mq_context_ring_size_SHIFT 16
 
1183
#define lpfc_mq_context_ring_size_MASK  0x0000000F
 
1184
#define lpfc_mq_context_ring_size_WORD  word0
 
1185
#define LPFC_MQ_RING_SIZE_16            0x5
 
1186
#define LPFC_MQ_RING_SIZE_32            0x6
 
1187
#define LPFC_MQ_RING_SIZE_64            0x7
 
1188
#define LPFC_MQ_RING_SIZE_128           0x8
1074
1189
        uint32_t word1;
1075
1190
#define lpfc_mq_context_valid_SHIFT     31
1076
1191
#define lpfc_mq_context_valid_MASK      0x00000001
1104
1219
        union {
1105
1220
                struct {
1106
1221
                        uint32_t word0;
1107
 
#define lpfc_mbx_mq_create_ext_num_pages_SHIFT          0
1108
 
#define lpfc_mbx_mq_create_ext_num_pages_MASK           0x0000FFFF
1109
 
#define lpfc_mbx_mq_create_ext_num_pages_WORD           word0
 
1222
#define lpfc_mbx_mq_create_ext_num_pages_SHIFT  0
 
1223
#define lpfc_mbx_mq_create_ext_num_pages_MASK   0x0000FFFF
 
1224
#define lpfc_mbx_mq_create_ext_num_pages_WORD   word0
 
1225
#define lpfc_mbx_mq_create_ext_cq_id_SHIFT      16      /* Version 1 Only */
 
1226
#define lpfc_mbx_mq_create_ext_cq_id_MASK       0x0000FFFF
 
1227
#define lpfc_mbx_mq_create_ext_cq_id_WORD       word0
1110
1228
                        uint32_t async_evt_bmap;
1111
1229
#define lpfc_mbx_mq_create_ext_async_evt_link_SHIFT     LPFC_TRAILER_CODE_LINK
1112
1230
#define lpfc_mbx_mq_create_ext_async_evt_link_MASK      0x00000001
1153
1271
        } u;
1154
1272
};
1155
1273
 
 
1274
/* Start Gen 2 SLI4 Mailbox definitions: */
 
1275
 
 
1276
/* Define allocate-ready Gen 2 SLI4 FCoE Resource Extent Types. */
 
1277
#define LPFC_RSC_TYPE_FCOE_VFI  0x20
 
1278
#define LPFC_RSC_TYPE_FCOE_VPI  0x21
 
1279
#define LPFC_RSC_TYPE_FCOE_RPI  0x22
 
1280
#define LPFC_RSC_TYPE_FCOE_XRI  0x23
 
1281
 
 
1282
struct lpfc_mbx_get_rsrc_extent_info {
 
1283
        struct mbox_header header;
 
1284
        union {
 
1285
                struct {
 
1286
                        uint32_t word4;
 
1287
#define lpfc_mbx_get_rsrc_extent_info_type_SHIFT        0
 
1288
#define lpfc_mbx_get_rsrc_extent_info_type_MASK         0x0000FFFF
 
1289
#define lpfc_mbx_get_rsrc_extent_info_type_WORD         word4
 
1290
                } req;
 
1291
                struct {
 
1292
                        uint32_t word4;
 
1293
#define lpfc_mbx_get_rsrc_extent_info_cnt_SHIFT         0
 
1294
#define lpfc_mbx_get_rsrc_extent_info_cnt_MASK          0x0000FFFF
 
1295
#define lpfc_mbx_get_rsrc_extent_info_cnt_WORD          word4
 
1296
#define lpfc_mbx_get_rsrc_extent_info_size_SHIFT        16
 
1297
#define lpfc_mbx_get_rsrc_extent_info_size_MASK         0x0000FFFF
 
1298
#define lpfc_mbx_get_rsrc_extent_info_size_WORD         word4
 
1299
                } rsp;
 
1300
        } u;
 
1301
};
 
1302
 
 
1303
struct lpfc_id_range {
 
1304
        uint32_t word5;
 
1305
#define lpfc_mbx_rsrc_id_word4_0_SHIFT  0
 
1306
#define lpfc_mbx_rsrc_id_word4_0_MASK   0x0000FFFF
 
1307
#define lpfc_mbx_rsrc_id_word4_0_WORD   word5
 
1308
#define lpfc_mbx_rsrc_id_word4_1_SHIFT  16
 
1309
#define lpfc_mbx_rsrc_id_word4_1_MASK   0x0000FFFF
 
1310
#define lpfc_mbx_rsrc_id_word4_1_WORD   word5
 
1311
};
 
1312
 
 
1313
struct lpfc_mbx_set_link_diag_state {
 
1314
        struct mbox_header header;
 
1315
        union {
 
1316
                struct {
 
1317
                        uint32_t word0;
 
1318
#define lpfc_mbx_set_diag_state_diag_SHIFT      0
 
1319
#define lpfc_mbx_set_diag_state_diag_MASK       0x00000001
 
1320
#define lpfc_mbx_set_diag_state_diag_WORD       word0
 
1321
#define lpfc_mbx_set_diag_state_link_num_SHIFT  16
 
1322
#define lpfc_mbx_set_diag_state_link_num_MASK   0x0000003F
 
1323
#define lpfc_mbx_set_diag_state_link_num_WORD   word0
 
1324
#define lpfc_mbx_set_diag_state_link_type_SHIFT 22
 
1325
#define lpfc_mbx_set_diag_state_link_type_MASK  0x00000003
 
1326
#define lpfc_mbx_set_diag_state_link_type_WORD  word0
 
1327
                } req;
 
1328
                struct {
 
1329
                        uint32_t word0;
 
1330
                } rsp;
 
1331
        } u;
 
1332
};
 
1333
 
 
1334
struct lpfc_mbx_set_link_diag_loopback {
 
1335
        struct mbox_header header;
 
1336
        union {
 
1337
                struct {
 
1338
                        uint32_t word0;
 
1339
#define lpfc_mbx_set_diag_lpbk_type_SHIFT       0
 
1340
#define lpfc_mbx_set_diag_lpbk_type_MASK        0x00000001
 
1341
#define lpfc_mbx_set_diag_lpbk_type_WORD        word0
 
1342
#define LPFC_DIAG_LOOPBACK_TYPE_DISABLE         0x0
 
1343
#define LPFC_DIAG_LOOPBACK_TYPE_INTERNAL        0x1
 
1344
#define LPFC_DIAG_LOOPBACK_TYPE_EXTERNAL        0x2
 
1345
#define lpfc_mbx_set_diag_lpbk_link_num_SHIFT   16
 
1346
#define lpfc_mbx_set_diag_lpbk_link_num_MASK    0x0000003F
 
1347
#define lpfc_mbx_set_diag_lpbk_link_num_WORD    word0
 
1348
#define lpfc_mbx_set_diag_lpbk_link_type_SHIFT  22
 
1349
#define lpfc_mbx_set_diag_lpbk_link_type_MASK   0x00000003
 
1350
#define lpfc_mbx_set_diag_lpbk_link_type_WORD   word0
 
1351
                } req;
 
1352
                struct {
 
1353
                        uint32_t word0;
 
1354
                } rsp;
 
1355
        } u;
 
1356
};
 
1357
 
 
1358
struct lpfc_mbx_run_link_diag_test {
 
1359
        struct mbox_header header;
 
1360
        union {
 
1361
                struct {
 
1362
                        uint32_t word0;
 
1363
#define lpfc_mbx_run_diag_test_link_num_SHIFT   16
 
1364
#define lpfc_mbx_run_diag_test_link_num_MASK    0x0000003F
 
1365
#define lpfc_mbx_run_diag_test_link_num_WORD    word0
 
1366
#define lpfc_mbx_run_diag_test_link_type_SHIFT  22
 
1367
#define lpfc_mbx_run_diag_test_link_type_MASK   0x00000003
 
1368
#define lpfc_mbx_run_diag_test_link_type_WORD   word0
 
1369
                        uint32_t word1;
 
1370
#define lpfc_mbx_run_diag_test_test_id_SHIFT    0
 
1371
#define lpfc_mbx_run_diag_test_test_id_MASK     0x0000FFFF
 
1372
#define lpfc_mbx_run_diag_test_test_id_WORD     word1
 
1373
#define lpfc_mbx_run_diag_test_loops_SHIFT      16
 
1374
#define lpfc_mbx_run_diag_test_loops_MASK       0x0000FFFF
 
1375
#define lpfc_mbx_run_diag_test_loops_WORD       word1
 
1376
                        uint32_t word2;
 
1377
#define lpfc_mbx_run_diag_test_test_ver_SHIFT   0
 
1378
#define lpfc_mbx_run_diag_test_test_ver_MASK    0x0000FFFF
 
1379
#define lpfc_mbx_run_diag_test_test_ver_WORD    word2
 
1380
#define lpfc_mbx_run_diag_test_err_act_SHIFT    16
 
1381
#define lpfc_mbx_run_diag_test_err_act_MASK     0x000000FF
 
1382
#define lpfc_mbx_run_diag_test_err_act_WORD     word2
 
1383
                } req;
 
1384
                struct {
 
1385
                        uint32_t word0;
 
1386
                } rsp;
 
1387
        } u;
 
1388
};
 
1389
 
 
1390
/*
 
1391
 * struct lpfc_mbx_alloc_rsrc_extents:
 
1392
 * A mbox is generically 256 bytes long. An SLI4_CONFIG mailbox requires
 
1393
 * 6 words of header + 4 words of shared subcommand header +
 
1394
 * 1 words of Extent-Opcode-specific header = 11 words or 44 bytes total.
 
1395
 *
 
1396
 * An embedded version of SLI4_CONFIG therefore has 256 - 44 = 212 bytes
 
1397
 * for extents payload.
 
1398
 *
 
1399
 * 212/2 (bytes per extent) = 106 extents.
 
1400
 * 106/2 (extents per word) = 53 words.
 
1401
 * lpfc_id_range id is statically size to 53.
 
1402
 *
 
1403
 * This mailbox definition is used for ALLOC or GET_ALLOCATED
 
1404
 * extent ranges.  For ALLOC, the type and cnt are required.
 
1405
 * For GET_ALLOCATED, only the type is required.
 
1406
 */
 
1407
struct lpfc_mbx_alloc_rsrc_extents {
 
1408
        struct mbox_header header;
 
1409
        union {
 
1410
                struct {
 
1411
                        uint32_t word4;
 
1412
#define lpfc_mbx_alloc_rsrc_extents_type_SHIFT  0
 
1413
#define lpfc_mbx_alloc_rsrc_extents_type_MASK   0x0000FFFF
 
1414
#define lpfc_mbx_alloc_rsrc_extents_type_WORD   word4
 
1415
#define lpfc_mbx_alloc_rsrc_extents_cnt_SHIFT   16
 
1416
#define lpfc_mbx_alloc_rsrc_extents_cnt_MASK    0x0000FFFF
 
1417
#define lpfc_mbx_alloc_rsrc_extents_cnt_WORD    word4
 
1418
                } req;
 
1419
                struct {
 
1420
                        uint32_t word4;
 
1421
#define lpfc_mbx_rsrc_cnt_SHIFT 0
 
1422
#define lpfc_mbx_rsrc_cnt_MASK  0x0000FFFF
 
1423
#define lpfc_mbx_rsrc_cnt_WORD  word4
 
1424
                        struct lpfc_id_range id[53];
 
1425
                } rsp;
 
1426
        } u;
 
1427
};
 
1428
 
 
1429
/*
 
1430
 * This is the non-embedded version of ALLOC or GET RSRC_EXTENTS. Word4 in this
 
1431
 * structure shares the same SHIFT/MASK/WORD defines provided in the
 
1432
 * mbx_alloc_rsrc_extents and mbx_get_alloc_rsrc_extents, word4, provided in
 
1433
 * the structures defined above.  This non-embedded structure provides for the
 
1434
 * maximum number of extents supported by the port.
 
1435
 */
 
1436
struct lpfc_mbx_nembed_rsrc_extent {
 
1437
        union  lpfc_sli4_cfg_shdr cfg_shdr;
 
1438
        uint32_t word4;
 
1439
        struct lpfc_id_range id;
 
1440
};
 
1441
 
 
1442
struct lpfc_mbx_dealloc_rsrc_extents {
 
1443
        struct mbox_header header;
 
1444
        struct {
 
1445
                uint32_t word4;
 
1446
#define lpfc_mbx_dealloc_rsrc_extents_type_SHIFT        0
 
1447
#define lpfc_mbx_dealloc_rsrc_extents_type_MASK         0x0000FFFF
 
1448
#define lpfc_mbx_dealloc_rsrc_extents_type_WORD         word4
 
1449
        } req;
 
1450
 
 
1451
};
 
1452
 
 
1453
/* Start SLI4 FCoE specific mbox structures. */
 
1454
 
1156
1455
struct lpfc_mbx_post_hdr_tmpl {
1157
1456
        struct mbox_header header;
1158
1457
        uint32_t word10;
1172
1471
 
1173
1472
        uint32_t word2;
1174
1473
#define lpfc_sli4_sge_offset_SHIFT      0 /* Offset of buffer - Not used*/
1175
 
#define lpfc_sli4_sge_offset_MASK       0x00FFFFFF
 
1474
#define lpfc_sli4_sge_offset_MASK       0x1FFFFFFF
1176
1475
#define lpfc_sli4_sge_offset_WORD       word2
1177
1476
#define lpfc_sli4_sge_last_SHIFT        31 /* Last SEG in the SGL sets
1178
1477
                                                this  flag !! */
1716
2015
 
1717
2016
struct lpfc_mbx_read_config {
1718
2017
        uint32_t word1;
1719
 
#define lpfc_mbx_rd_conf_max_bbc_SHIFT          0
1720
 
#define lpfc_mbx_rd_conf_max_bbc_MASK           0x000000FF
1721
 
#define lpfc_mbx_rd_conf_max_bbc_WORD           word1
1722
 
#define lpfc_mbx_rd_conf_init_bbc_SHIFT         8
1723
 
#define lpfc_mbx_rd_conf_init_bbc_MASK          0x000000FF
1724
 
#define lpfc_mbx_rd_conf_init_bbc_WORD          word1
 
2018
#define lpfc_mbx_rd_conf_extnts_inuse_SHIFT     31
 
2019
#define lpfc_mbx_rd_conf_extnts_inuse_MASK      0x00000001
 
2020
#define lpfc_mbx_rd_conf_extnts_inuse_WORD      word1
1725
2021
        uint32_t word2;
1726
 
#define lpfc_mbx_rd_conf_nport_did_SHIFT        0
1727
 
#define lpfc_mbx_rd_conf_nport_did_MASK         0x00FFFFFF
1728
 
#define lpfc_mbx_rd_conf_nport_did_WORD         word2
1729
2022
#define lpfc_mbx_rd_conf_topology_SHIFT         24
1730
2023
#define lpfc_mbx_rd_conf_topology_MASK          0x000000FF
1731
2024
#define lpfc_mbx_rd_conf_topology_WORD          word2
1732
 
        uint32_t word3;
1733
 
#define lpfc_mbx_rd_conf_ao_SHIFT               0
1734
 
#define lpfc_mbx_rd_conf_ao_MASK                0x00000001
1735
 
#define lpfc_mbx_rd_conf_ao_WORD                word3
1736
 
#define lpfc_mbx_rd_conf_bb_scn_SHIFT           8
1737
 
#define lpfc_mbx_rd_conf_bb_scn_MASK            0x0000000F
1738
 
#define lpfc_mbx_rd_conf_bb_scn_WORD            word3
1739
 
#define lpfc_mbx_rd_conf_cbb_scn_SHIFT          12
1740
 
#define lpfc_mbx_rd_conf_cbb_scn_MASK           0x0000000F
1741
 
#define lpfc_mbx_rd_conf_cbb_scn_WORD           word3
1742
 
#define lpfc_mbx_rd_conf_mc_SHIFT               29
1743
 
#define lpfc_mbx_rd_conf_mc_MASK                0x00000001
1744
 
#define lpfc_mbx_rd_conf_mc_WORD                word3
 
2025
        uint32_t rsvd_3;
1745
2026
        uint32_t word4;
1746
2027
#define lpfc_mbx_rd_conf_e_d_tov_SHIFT          0
1747
2028
#define lpfc_mbx_rd_conf_e_d_tov_MASK           0x0000FFFF
1748
2029
#define lpfc_mbx_rd_conf_e_d_tov_WORD           word4
1749
 
        uint32_t word5;
1750
 
#define lpfc_mbx_rd_conf_lp_tov_SHIFT           0
1751
 
#define lpfc_mbx_rd_conf_lp_tov_MASK            0x0000FFFF
1752
 
#define lpfc_mbx_rd_conf_lp_tov_WORD            word5
 
2030
        uint32_t rsvd_5;
1753
2031
        uint32_t word6;
1754
2032
#define lpfc_mbx_rd_conf_r_a_tov_SHIFT          0
1755
2033
#define lpfc_mbx_rd_conf_r_a_tov_MASK           0x0000FFFF
1756
2034
#define lpfc_mbx_rd_conf_r_a_tov_WORD           word6
1757
 
        uint32_t word7;
1758
 
#define lpfc_mbx_rd_conf_r_t_tov_SHIFT          0
1759
 
#define lpfc_mbx_rd_conf_r_t_tov_MASK           0x000000FF
1760
 
#define lpfc_mbx_rd_conf_r_t_tov_WORD           word7
1761
 
        uint32_t word8;
1762
 
#define lpfc_mbx_rd_conf_al_tov_SHIFT           0
1763
 
#define lpfc_mbx_rd_conf_al_tov_MASK            0x0000000F
1764
 
#define lpfc_mbx_rd_conf_al_tov_WORD            word8
 
2035
        uint32_t rsvd_7;
 
2036
        uint32_t rsvd_8;
1765
2037
        uint32_t word9;
1766
2038
#define lpfc_mbx_rd_conf_lmt_SHIFT              0
1767
2039
#define lpfc_mbx_rd_conf_lmt_MASK               0x0000FFFF
1768
2040
#define lpfc_mbx_rd_conf_lmt_WORD               word9
1769
 
        uint32_t word10;
1770
 
#define lpfc_mbx_rd_conf_max_alpa_SHIFT         0
1771
 
#define lpfc_mbx_rd_conf_max_alpa_MASK          0x000000FF
1772
 
#define lpfc_mbx_rd_conf_max_alpa_WORD          word10
1773
 
        uint32_t word11_rsvd;
 
2041
        uint32_t rsvd_10;
 
2042
        uint32_t rsvd_11;
1774
2043
        uint32_t word12;
1775
2044
#define lpfc_mbx_rd_conf_xri_base_SHIFT         0
1776
2045
#define lpfc_mbx_rd_conf_xri_base_MASK          0x0000FFFF
1800
2069
#define lpfc_mbx_rd_conf_vfi_count_MASK         0x0000FFFF
1801
2070
#define lpfc_mbx_rd_conf_vfi_count_WORD         word15
1802
2071
        uint32_t word16;
1803
 
#define lpfc_mbx_rd_conf_fcfi_base_SHIFT        0
1804
 
#define lpfc_mbx_rd_conf_fcfi_base_MASK         0x0000FFFF
1805
 
#define lpfc_mbx_rd_conf_fcfi_base_WORD         word16
1806
2072
#define lpfc_mbx_rd_conf_fcfi_count_SHIFT       16
1807
2073
#define lpfc_mbx_rd_conf_fcfi_count_MASK        0x0000FFFF
1808
2074
#define lpfc_mbx_rd_conf_fcfi_count_WORD        word16
1852
2118
#define lpfc_mbx_rq_ftr_rq_ifip_SHIFT           7
1853
2119
#define lpfc_mbx_rq_ftr_rq_ifip_MASK            0x00000001
1854
2120
#define lpfc_mbx_rq_ftr_rq_ifip_WORD            word2
 
2121
#define lpfc_mbx_rq_ftr_rq_perfh_SHIFT          11
 
2122
#define lpfc_mbx_rq_ftr_rq_perfh_MASK           0x00000001
 
2123
#define lpfc_mbx_rq_ftr_rq_perfh_WORD           word2
1855
2124
        uint32_t word3;
1856
2125
#define lpfc_mbx_rq_ftr_rsp_iaab_SHIFT          0
1857
2126
#define lpfc_mbx_rq_ftr_rsp_iaab_MASK           0x00000001
1877
2146
#define lpfc_mbx_rq_ftr_rsp_ifip_SHIFT          7
1878
2147
#define lpfc_mbx_rq_ftr_rsp_ifip_MASK           0x00000001
1879
2148
#define lpfc_mbx_rq_ftr_rsp_ifip_WORD           word3
 
2149
#define lpfc_mbx_rq_ftr_rsp_perfh_SHIFT         11
 
2150
#define lpfc_mbx_rq_ftr_rsp_perfh_MASK          0x00000001
 
2151
#define lpfc_mbx_rq_ftr_rsp_perfh_WORD          word3
1880
2152
};
1881
2153
 
1882
2154
struct lpfc_mbx_supp_pages {
1935
2207
#define LPFC_SLI4_PARAMETERS            2
1936
2208
};
1937
2209
 
1938
 
struct lpfc_mbx_sli4_params {
 
2210
struct lpfc_mbx_pc_sli4_params {
1939
2211
        uint32_t word1;
1940
2212
#define qs_SHIFT                                0
1941
2213
#define qs_MASK                                 0x00000001
2050
2322
#define sgl_pp_align_WORD                       word12
2051
2323
        uint32_t rsvd_13_63[51];
2052
2324
};
 
2325
#define SLI4_PAGE_ALIGN(addr) (((addr)+((SLI4_PAGE_SIZE)-1)) \
 
2326
                               &(~((SLI4_PAGE_SIZE)-1)))
 
2327
 
 
2328
struct lpfc_sli4_parameters {
 
2329
        uint32_t word0;
 
2330
#define cfg_prot_type_SHIFT                     0
 
2331
#define cfg_prot_type_MASK                      0x000000FF
 
2332
#define cfg_prot_type_WORD                      word0
 
2333
        uint32_t word1;
 
2334
#define cfg_ft_SHIFT                            0
 
2335
#define cfg_ft_MASK                             0x00000001
 
2336
#define cfg_ft_WORD                             word1
 
2337
#define cfg_sli_rev_SHIFT                       4
 
2338
#define cfg_sli_rev_MASK                        0x0000000f
 
2339
#define cfg_sli_rev_WORD                        word1
 
2340
#define cfg_sli_family_SHIFT                    8
 
2341
#define cfg_sli_family_MASK                     0x0000000f
 
2342
#define cfg_sli_family_WORD                     word1
 
2343
#define cfg_if_type_SHIFT                       12
 
2344
#define cfg_if_type_MASK                        0x0000000f
 
2345
#define cfg_if_type_WORD                        word1
 
2346
#define cfg_sli_hint_1_SHIFT                    16
 
2347
#define cfg_sli_hint_1_MASK                     0x000000ff
 
2348
#define cfg_sli_hint_1_WORD                     word1
 
2349
#define cfg_sli_hint_2_SHIFT                    24
 
2350
#define cfg_sli_hint_2_MASK                     0x0000001f
 
2351
#define cfg_sli_hint_2_WORD                     word1
 
2352
        uint32_t word2;
 
2353
        uint32_t word3;
 
2354
        uint32_t word4;
 
2355
#define cfg_cqv_SHIFT                           14
 
2356
#define cfg_cqv_MASK                            0x00000003
 
2357
#define cfg_cqv_WORD                            word4
 
2358
        uint32_t word5;
 
2359
        uint32_t word6;
 
2360
#define cfg_mqv_SHIFT                           14
 
2361
#define cfg_mqv_MASK                            0x00000003
 
2362
#define cfg_mqv_WORD                            word6
 
2363
        uint32_t word7;
 
2364
        uint32_t word8;
 
2365
#define cfg_wqv_SHIFT                           14
 
2366
#define cfg_wqv_MASK                            0x00000003
 
2367
#define cfg_wqv_WORD                            word8
 
2368
        uint32_t word9;
 
2369
        uint32_t word10;
 
2370
#define cfg_rqv_SHIFT                           14
 
2371
#define cfg_rqv_MASK                            0x00000003
 
2372
#define cfg_rqv_WORD                            word10
 
2373
        uint32_t word11;
 
2374
#define cfg_rq_db_window_SHIFT                  28
 
2375
#define cfg_rq_db_window_MASK                   0x0000000f
 
2376
#define cfg_rq_db_window_WORD                   word11
 
2377
        uint32_t word12;
 
2378
#define cfg_fcoe_SHIFT                          0
 
2379
#define cfg_fcoe_MASK                           0x00000001
 
2380
#define cfg_fcoe_WORD                           word12
 
2381
#define cfg_ext_SHIFT                           1
 
2382
#define cfg_ext_MASK                            0x00000001
 
2383
#define cfg_ext_WORD                            word12
 
2384
#define cfg_hdrr_SHIFT                          2
 
2385
#define cfg_hdrr_MASK                           0x00000001
 
2386
#define cfg_hdrr_WORD                           word12
 
2387
#define cfg_phwq_SHIFT                          15
 
2388
#define cfg_phwq_MASK                           0x00000001
 
2389
#define cfg_phwq_WORD                           word12
 
2390
#define cfg_loopbk_scope_SHIFT                  28
 
2391
#define cfg_loopbk_scope_MASK                   0x0000000f
 
2392
#define cfg_loopbk_scope_WORD                   word12
 
2393
        uint32_t sge_supp_len;
 
2394
        uint32_t word14;
 
2395
#define cfg_sgl_page_cnt_SHIFT                  0
 
2396
#define cfg_sgl_page_cnt_MASK                   0x0000000f
 
2397
#define cfg_sgl_page_cnt_WORD                   word14
 
2398
#define cfg_sgl_page_size_SHIFT                 8
 
2399
#define cfg_sgl_page_size_MASK                  0x000000ff
 
2400
#define cfg_sgl_page_size_WORD                  word14
 
2401
#define cfg_sgl_pp_align_SHIFT                  16
 
2402
#define cfg_sgl_pp_align_MASK                   0x000000ff
 
2403
#define cfg_sgl_pp_align_WORD                   word14
 
2404
        uint32_t word15;
 
2405
        uint32_t word16;
 
2406
        uint32_t word17;
 
2407
        uint32_t word18;
 
2408
        uint32_t word19;
 
2409
};
 
2410
 
 
2411
struct lpfc_mbx_get_sli4_parameters {
 
2412
        struct mbox_header header;
 
2413
        struct lpfc_sli4_parameters sli4_parameters;
 
2414
};
 
2415
 
 
2416
struct lpfc_rscr_desc_generic {
 
2417
#define LPFC_RSRC_DESC_WSIZE                    18
 
2418
        uint32_t desc[LPFC_RSRC_DESC_WSIZE];
 
2419
};
 
2420
 
 
2421
struct lpfc_rsrc_desc_pcie {
 
2422
        uint32_t word0;
 
2423
#define lpfc_rsrc_desc_pcie_type_SHIFT          0
 
2424
#define lpfc_rsrc_desc_pcie_type_MASK           0x000000ff
 
2425
#define lpfc_rsrc_desc_pcie_type_WORD           word0
 
2426
#define LPFC_RSRC_DESC_TYPE_PCIE                0x40
 
2427
        uint32_t word1;
 
2428
#define lpfc_rsrc_desc_pcie_pfnum_SHIFT         0
 
2429
#define lpfc_rsrc_desc_pcie_pfnum_MASK          0x000000ff
 
2430
#define lpfc_rsrc_desc_pcie_pfnum_WORD          word1
 
2431
        uint32_t reserved;
 
2432
        uint32_t word3;
 
2433
#define lpfc_rsrc_desc_pcie_sriov_sta_SHIFT     0
 
2434
#define lpfc_rsrc_desc_pcie_sriov_sta_MASK      0x000000ff
 
2435
#define lpfc_rsrc_desc_pcie_sriov_sta_WORD      word3
 
2436
#define lpfc_rsrc_desc_pcie_pf_sta_SHIFT        8
 
2437
#define lpfc_rsrc_desc_pcie_pf_sta_MASK         0x000000ff
 
2438
#define lpfc_rsrc_desc_pcie_pf_sta_WORD         word3
 
2439
#define lpfc_rsrc_desc_pcie_pf_type_SHIFT       16
 
2440
#define lpfc_rsrc_desc_pcie_pf_type_MASK        0x000000ff
 
2441
#define lpfc_rsrc_desc_pcie_pf_type_WORD        word3
 
2442
        uint32_t word4;
 
2443
#define lpfc_rsrc_desc_pcie_nr_virtfn_SHIFT     0
 
2444
#define lpfc_rsrc_desc_pcie_nr_virtfn_MASK      0x0000ffff
 
2445
#define lpfc_rsrc_desc_pcie_nr_virtfn_WORD      word4
 
2446
};
 
2447
 
 
2448
struct lpfc_rsrc_desc_fcfcoe {
 
2449
        uint32_t word0;
 
2450
#define lpfc_rsrc_desc_fcfcoe_type_SHIFT        0
 
2451
#define lpfc_rsrc_desc_fcfcoe_type_MASK         0x000000ff
 
2452
#define lpfc_rsrc_desc_fcfcoe_type_WORD         word0
 
2453
#define LPFC_RSRC_DESC_TYPE_FCFCOE              0x43
 
2454
        uint32_t word1;
 
2455
#define lpfc_rsrc_desc_fcfcoe_vfnum_SHIFT       0
 
2456
#define lpfc_rsrc_desc_fcfcoe_vfnum_MASK        0x000000ff
 
2457
#define lpfc_rsrc_desc_fcfcoe_vfnum_WORD        word1
 
2458
#define lpfc_rsrc_desc_fcfcoe_pfnum_SHIFT       16
 
2459
#define lpfc_rsrc_desc_fcfcoe_pfnum_MASK        0x000007ff
 
2460
#define lpfc_rsrc_desc_fcfcoe_pfnum_WORD        word1
 
2461
        uint32_t word2;
 
2462
#define lpfc_rsrc_desc_fcfcoe_rpi_cnt_SHIFT     0
 
2463
#define lpfc_rsrc_desc_fcfcoe_rpi_cnt_MASK      0x0000ffff
 
2464
#define lpfc_rsrc_desc_fcfcoe_rpi_cnt_WORD      word2
 
2465
#define lpfc_rsrc_desc_fcfcoe_xri_cnt_SHIFT     16
 
2466
#define lpfc_rsrc_desc_fcfcoe_xri_cnt_MASK      0x0000ffff
 
2467
#define lpfc_rsrc_desc_fcfcoe_xri_cnt_WORD      word2
 
2468
        uint32_t word3;
 
2469
#define lpfc_rsrc_desc_fcfcoe_wq_cnt_SHIFT      0
 
2470
#define lpfc_rsrc_desc_fcfcoe_wq_cnt_MASK       0x0000ffff
 
2471
#define lpfc_rsrc_desc_fcfcoe_wq_cnt_WORD       word3
 
2472
#define lpfc_rsrc_desc_fcfcoe_rq_cnt_SHIFT      16
 
2473
#define lpfc_rsrc_desc_fcfcoe_rq_cnt_MASK       0x0000ffff
 
2474
#define lpfc_rsrc_desc_fcfcoe_rq_cnt_WORD       word3
 
2475
        uint32_t word4;
 
2476
#define lpfc_rsrc_desc_fcfcoe_cq_cnt_SHIFT      0
 
2477
#define lpfc_rsrc_desc_fcfcoe_cq_cnt_MASK       0x0000ffff
 
2478
#define lpfc_rsrc_desc_fcfcoe_cq_cnt_WORD       word4
 
2479
#define lpfc_rsrc_desc_fcfcoe_vpi_cnt_SHIFT     16
 
2480
#define lpfc_rsrc_desc_fcfcoe_vpi_cnt_MASK      0x0000ffff
 
2481
#define lpfc_rsrc_desc_fcfcoe_vpi_cnt_WORD      word4
 
2482
        uint32_t word5;
 
2483
#define lpfc_rsrc_desc_fcfcoe_fcfi_cnt_SHIFT    0
 
2484
#define lpfc_rsrc_desc_fcfcoe_fcfi_cnt_MASK     0x0000ffff
 
2485
#define lpfc_rsrc_desc_fcfcoe_fcfi_cnt_WORD     word5
 
2486
#define lpfc_rsrc_desc_fcfcoe_vfi_cnt_SHIFT     16
 
2487
#define lpfc_rsrc_desc_fcfcoe_vfi_cnt_MASK      0x0000ffff
 
2488
#define lpfc_rsrc_desc_fcfcoe_vfi_cnt_WORD      word5
 
2489
        uint32_t word6;
 
2490
        uint32_t word7;
 
2491
        uint32_t word8;
 
2492
        uint32_t word9;
 
2493
        uint32_t word10;
 
2494
        uint32_t word11;
 
2495
        uint32_t word12;
 
2496
        uint32_t word13;
 
2497
#define lpfc_rsrc_desc_fcfcoe_lnk_nr_SHIFT      0
 
2498
#define lpfc_rsrc_desc_fcfcoe_lnk_nr_MASK       0x0000003f
 
2499
#define lpfc_rsrc_desc_fcfcoe_lnk_nr_WORD       word13
 
2500
#define lpfc_rsrc_desc_fcfcoe_lnk_tp_SHIFT      6
 
2501
#define lpfc_rsrc_desc_fcfcoe_lnk_tp_MASK       0x00000003
 
2502
#define lpfc_rsrc_desc_fcfcoe_lnk_tp_WORD       word13
 
2503
#define lpfc_rsrc_desc_fcfcoe_lmc_SHIFT         8
 
2504
#define lpfc_rsrc_desc_fcfcoe_lmc_MASK          0x00000001
 
2505
#define lpfc_rsrc_desc_fcfcoe_lmc_WORD          word13
 
2506
#define lpfc_rsrc_desc_fcfcoe_lld_SHIFT         9
 
2507
#define lpfc_rsrc_desc_fcfcoe_lld_MASK          0x00000001
 
2508
#define lpfc_rsrc_desc_fcfcoe_lld_WORD          word13
 
2509
#define lpfc_rsrc_desc_fcfcoe_eq_cnt_SHIFT      16
 
2510
#define lpfc_rsrc_desc_fcfcoe_eq_cnt_MASK       0x0000ffff
 
2511
#define lpfc_rsrc_desc_fcfcoe_eq_cnt_WORD       word13
 
2512
};
 
2513
 
 
2514
struct lpfc_func_cfg {
 
2515
#define LPFC_RSRC_DESC_MAX_NUM                  2
 
2516
        uint32_t rsrc_desc_count;
 
2517
        struct lpfc_rscr_desc_generic desc[LPFC_RSRC_DESC_MAX_NUM];
 
2518
};
 
2519
 
 
2520
struct lpfc_mbx_get_func_cfg {
 
2521
        struct mbox_header header;
 
2522
#define LPFC_CFG_TYPE_PERSISTENT_OVERRIDE       0x0
 
2523
#define LPFC_CFG_TYPE_FACTURY_DEFAULT           0x1
 
2524
#define LPFC_CFG_TYPE_CURRENT_ACTIVE            0x2
 
2525
        struct lpfc_func_cfg func_cfg;
 
2526
};
 
2527
 
 
2528
struct lpfc_prof_cfg {
 
2529
#define LPFC_RSRC_DESC_MAX_NUM                  2
 
2530
        uint32_t rsrc_desc_count;
 
2531
        struct lpfc_rscr_desc_generic desc[LPFC_RSRC_DESC_MAX_NUM];
 
2532
};
 
2533
 
 
2534
struct lpfc_mbx_get_prof_cfg {
 
2535
        struct mbox_header header;
 
2536
#define LPFC_CFG_TYPE_PERSISTENT_OVERRIDE       0x0
 
2537
#define LPFC_CFG_TYPE_FACTURY_DEFAULT           0x1
 
2538
#define LPFC_CFG_TYPE_CURRENT_ACTIVE            0x2
 
2539
        union {
 
2540
                struct {
 
2541
                        uint32_t word10;
 
2542
#define lpfc_mbx_get_prof_cfg_prof_id_SHIFT     0
 
2543
#define lpfc_mbx_get_prof_cfg_prof_id_MASK      0x000000ff
 
2544
#define lpfc_mbx_get_prof_cfg_prof_id_WORD      word10
 
2545
#define lpfc_mbx_get_prof_cfg_prof_tp_SHIFT     8
 
2546
#define lpfc_mbx_get_prof_cfg_prof_tp_MASK      0x00000003
 
2547
#define lpfc_mbx_get_prof_cfg_prof_tp_WORD      word10
 
2548
                } request;
 
2549
                struct {
 
2550
                        struct lpfc_prof_cfg prof_cfg;
 
2551
                } response;
 
2552
        } u;
 
2553
};
2053
2554
 
2054
2555
/* Mailbox Completion Queue Error Messages */
2055
2556
#define MB_CQE_STATUS_SUCCESS                   0x0
2059
2560
#define MB_CEQ_STATUS_QUEUE_FLUSHING            0x4
2060
2561
#define MB_CQE_STATUS_DMA_FAILED                0x5
2061
2562
 
 
2563
#define LPFC_MBX_WR_CONFIG_MAX_BDE              8
 
2564
struct lpfc_mbx_wr_object {
 
2565
        struct mbox_header header;
 
2566
        union {
 
2567
                struct {
 
2568
                        uint32_t word4;
 
2569
#define lpfc_wr_object_eof_SHIFT                31
 
2570
#define lpfc_wr_object_eof_MASK                 0x00000001
 
2571
#define lpfc_wr_object_eof_WORD                 word4
 
2572
#define lpfc_wr_object_write_length_SHIFT       0
 
2573
#define lpfc_wr_object_write_length_MASK        0x00FFFFFF
 
2574
#define lpfc_wr_object_write_length_WORD        word4
 
2575
                        uint32_t write_offset;
 
2576
                        uint32_t object_name[26];
 
2577
                        uint32_t bde_count;
 
2578
                        struct ulp_bde64 bde[LPFC_MBX_WR_CONFIG_MAX_BDE];
 
2579
                } request;
 
2580
                struct {
 
2581
                        uint32_t actual_write_length;
 
2582
                } response;
 
2583
        } u;
 
2584
};
 
2585
 
2062
2586
/* mailbox queue entry structure */
2063
2587
struct lpfc_mqe {
2064
2588
        uint32_t word0;
2094
2618
                struct lpfc_mbx_cq_destroy cq_destroy;
2095
2619
                struct lpfc_mbx_wq_destroy wq_destroy;
2096
2620
                struct lpfc_mbx_rq_destroy rq_destroy;
 
2621
                struct lpfc_mbx_get_rsrc_extent_info rsrc_extent_info;
 
2622
                struct lpfc_mbx_alloc_rsrc_extents alloc_rsrc_extents;
 
2623
                struct lpfc_mbx_dealloc_rsrc_extents dealloc_rsrc_extents;
2097
2624
                struct lpfc_mbx_post_sgl_pages post_sgl_pages;
2098
2625
                struct lpfc_mbx_nembed_cmd nembed_cmd;
2099
2626
                struct lpfc_mbx_read_rev read_rev;
2103
2630
                struct lpfc_mbx_post_hdr_tmpl hdr_tmpl;
2104
2631
                struct lpfc_mbx_query_fw_cfg query_fw_cfg;
2105
2632
                struct lpfc_mbx_supp_pages supp_pages;
2106
 
                struct lpfc_mbx_sli4_params sli4_params;
 
2633
                struct lpfc_mbx_pc_sli4_params sli4_params;
 
2634
                struct lpfc_mbx_get_sli4_parameters get_sli4_parameters;
 
2635
                struct lpfc_mbx_set_link_diag_state link_diag_state;
 
2636
                struct lpfc_mbx_set_link_diag_loopback link_diag_loopback;
 
2637
                struct lpfc_mbx_run_link_diag_test link_diag_test;
 
2638
                struct lpfc_mbx_get_func_cfg get_func_cfg;
 
2639
                struct lpfc_mbx_get_prof_cfg get_prof_cfg;
2107
2640
                struct lpfc_mbx_nop nop;
 
2641
                struct lpfc_mbx_wr_object wr_object;
2108
2642
        } un;
2109
2643
};
2110
2644
 
2310
2844
#define SGL_ALIGN_SZ 64
2311
2845
#define SGL_PAGE_SIZE 4096
2312
2846
/* align SGL addr on a size boundary - adjust address up */
2313
 
#define NO_XRI  ((uint16_t)-1)
 
2847
#define NO_XRI  0xffff
2314
2848
 
2315
2849
struct wqe_common {
2316
2850
        uint32_t word6;
2350
2884
#define wqe_reqtag_SHIFT      0
2351
2885
#define wqe_reqtag_MASK       0x0000FFFF
2352
2886
#define wqe_reqtag_WORD       word9
 
2887
#define wqe_temp_rpi_SHIFT    16
 
2888
#define wqe_temp_rpi_MASK     0x0000FFFF
 
2889
#define wqe_temp_rpi_WORD     word9
2353
2890
#define wqe_rcvoxid_SHIFT     16
2354
2891
#define wqe_rcvoxid_MASK      0x0000FFFF
2355
2892
#define wqe_rcvoxid_WORD      word9
2381
2918
#define wqe_wqes_SHIFT        15
2382
2919
#define wqe_wqes_MASK         0x00000001
2383
2920
#define wqe_wqes_WORD         word10
 
2921
/* Note that this field overlaps above fields */
 
2922
#define wqe_wqid_SHIFT        1
 
2923
#define wqe_wqid_MASK         0x00007fff
 
2924
#define wqe_wqid_WORD         word10
2384
2925
#define wqe_pri_SHIFT         16
2385
2926
#define wqe_pri_MASK          0x00000007
2386
2927
#define wqe_pri_WORD          word10
2476
3017
        uint32_t rsvd4;
2477
3018
        struct wqe_did wqe_dest;
2478
3019
        struct wqe_common wqe_com; /* words 6-11 */
2479
 
        uint32_t rsvd_12_15[4];
 
3020
        uint32_t word12;
 
3021
#define wqe_rsp_temp_rpi_SHIFT    0
 
3022
#define wqe_rsp_temp_rpi_MASK     0x0000FFFF
 
3023
#define wqe_rsp_temp_rpi_WORD     word12
 
3024
        uint32_t rsvd_13_15[3];
2480
3025
};
2481
3026
 
2482
3027
struct xmit_bls_rsp64_wqe {
2599
3144
        uint32_t total_xfer_len;
2600
3145
        uint32_t initial_xfer_len;
2601
3146
        struct wqe_common wqe_com;     /* words 6-11 */
2602
 
        uint32_t rsvd_12_15[4];         /* word 12-15 */
 
3147
        uint32_t rsrvd12;
 
3148
        struct ulp_bde64 ph_bde;       /* words 13-15 */
2603
3149
};
2604
3150
 
2605
3151
struct fcp_iread64_wqe {
2608
3154
        uint32_t total_xfer_len;       /* word 4 */
2609
3155
        uint32_t rsrvd5;               /* word 5 */
2610
3156
        struct wqe_common wqe_com;     /* words 6-11 */
2611
 
        uint32_t rsvd_12_15[4];         /* word 12-15 */
 
3157
        uint32_t rsrvd12;
 
3158
        struct ulp_bde64 ph_bde;       /* words 13-15 */
2612
3159
};
2613
3160
 
2614
3161
struct fcp_icmnd64_wqe {
2637
3184
        struct gen_req64_wqe gen_req;
2638
3185
};
2639
3186
 
 
3187
#define LPFC_GROUP_OJECT_MAGIC_NUM              0xfeaa0001
 
3188
#define LPFC_FILE_TYPE_GROUP                    0xf7
 
3189
#define LPFC_FILE_ID_GROUP                      0xa2
 
3190
struct lpfc_grp_hdr {
 
3191
        uint32_t size;
 
3192
        uint32_t magic_number;
 
3193
        uint32_t word2;
 
3194
#define lpfc_grp_hdr_file_type_SHIFT    24
 
3195
#define lpfc_grp_hdr_file_type_MASK     0x000000FF
 
3196
#define lpfc_grp_hdr_file_type_WORD     word2
 
3197
#define lpfc_grp_hdr_id_SHIFT           16
 
3198
#define lpfc_grp_hdr_id_MASK            0x000000FF
 
3199
#define lpfc_grp_hdr_id_WORD            word2
 
3200
        uint8_t rev_name[128];
 
3201
};
 
3202
 
2640
3203
#define FCP_COMMAND 0x0
2641
3204
#define FCP_COMMAND_DATA_OUT 0x1
2642
3205
#define ELS_COMMAND_NON_FIP 0xC
2643
3206
#define ELS_COMMAND_FIP 0xD
2644
3207
#define OTHER_COMMAND 0x8
2645
3208
 
 
3209
#define LPFC_FW_DUMP    1
 
3210
#define LPFC_FW_RESET   2
 
3211
#define LPFC_DV_RESET   3