^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*******************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * This file is part of the Emulex Linux Device Driver for *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Fibre Channel Host Bus Adapters. *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 2017-2019 Broadcom. All Rights Reserved. The term *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (C) 2010-2015 Emulex. All rights reserved. *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * EMULEX and SLI are trademarks of Emulex. *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * www.broadcom.com *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * This program is free software; you can redistribute it and/or *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * modify it under the terms of version 2 of the GNU General *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * Public License as published by the Free Software Foundation. *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * This program is distributed in the hope that it will be useful. *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * TO BE LEGALLY INVALID. See the GNU General Public License for *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * more details, a copy of which can be found in the file COPYING *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * included with this package. *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) *******************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) /* bsg definitions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * No pointers to user data are allowed, all application buffers and sizes will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * derived through the bsg interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * These are the vendor unique structures passed in using the bsg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * FC_BSG_HST_VENDOR message code type.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define LPFC_BSG_VENDOR_SET_CT_EVENT 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define LPFC_BSG_VENDOR_GET_CT_EVENT 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #define LPFC_BSG_VENDOR_SEND_MGMT_RESP 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #define LPFC_BSG_VENDOR_DIAG_MODE 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define LPFC_BSG_VENDOR_DIAG_RUN_LOOPBACK 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #define LPFC_BSG_VENDOR_GET_MGMT_REV 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #define LPFC_BSG_VENDOR_MBOX 7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #define LPFC_BSG_VENDOR_MENLO_CMD 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #define LPFC_BSG_VENDOR_MENLO_DATA 9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #define LPFC_BSG_VENDOR_DIAG_MODE_END 10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #define LPFC_BSG_VENDOR_LINK_DIAG_TEST 11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #define LPFC_BSG_VENDOR_FORCED_LINK_SPEED 14
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #define LPFC_BSG_VENDOR_RAS_GET_LWPD 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) #define LPFC_BSG_VENDOR_RAS_GET_FWLOG 17
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #define LPFC_BSG_VENDOR_RAS_GET_CONFIG 18
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #define LPFC_BSG_VENDOR_RAS_SET_CONFIG 19
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #define LPFC_BSG_VENDOR_GET_TRUNK_INFO 20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) struct set_ct_event {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) uint32_t command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) uint32_t type_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) uint32_t ev_req_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) uint32_t ev_reg_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) struct get_ct_event {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) uint32_t command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) uint32_t ev_reg_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) uint32_t ev_req_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) struct get_ct_event_reply {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) uint32_t immed_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) uint32_t type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) struct send_mgmt_resp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) uint32_t command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) uint32_t tag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) #define DISABLE_LOOP_BACK 0x0 /* disables loop back */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) #define INTERNAL_LOOP_BACK 0x1 /* adapter short cuts the loop internally */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) #define EXTERNAL_LOOP_BACK 0x2 /* requires an external loopback plug */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) struct diag_mode_set {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) uint32_t command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) uint32_t type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) uint32_t timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) uint32_t physical_link;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) struct sli4_link_diag {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) uint32_t command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) uint32_t timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) uint32_t test_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) uint32_t loops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) uint32_t test_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) uint32_t error_action;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) struct diag_mode_test {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) uint32_t command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) struct diag_status {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) uint32_t mbox_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) uint32_t shdr_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) uint32_t shdr_add_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) #define LPFC_WWNN_TYPE 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) #define LPFC_WWPN_TYPE 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) struct get_mgmt_rev {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) uint32_t command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) #define MANAGEMENT_MAJOR_REV 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) #define MANAGEMENT_MINOR_REV 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) /* the MgmtRevInfo structure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) struct MgmtRevInfo {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) uint32_t a_Major;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) uint32_t a_Minor;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) struct get_mgmt_rev_reply {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) struct MgmtRevInfo info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) #define BSG_MBOX_SIZE 4096 /* mailbox command plus extended data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) /* BSG mailbox request header */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) struct dfc_mbox_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) uint32_t command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) uint32_t mbOffset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) uint32_t inExtWLen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) uint32_t outExtWLen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) uint32_t extMboxTag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) uint32_t extSeqNum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) /* Used for menlo command or menlo data. The xri is only used for menlo data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) struct menlo_command {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) uint32_t cmd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) uint32_t xri;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) struct menlo_response {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) uint32_t xri; /* return the xri of the iocb exchange */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) * macros and data structures for handling sli-config mailbox command
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) * pass-through support, this header file is shared between user and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) * kernel spaces, note the set of macros are duplicates from lpfc_hw4.h,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) * with macro names prefixed with bsg_, as the macros defined in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) * lpfc_hw4.h are not accessible from user space.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) /* Macros to deal with bit fields. Each bit field must have 3 #defines
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) * associated with it (_SHIFT, _MASK, and _WORD).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) * EG. For a bit field that is in the 7th bit of the "field4" field of a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) * structure and is 2 bits in size the following #defines must exist:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) * struct temp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) * uint32_t field1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) * uint32_t field2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) * uint32_t field3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) * uint32_t field4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) * #define example_bit_field_SHIFT 7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) * #define example_bit_field_MASK 0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) * #define example_bit_field_WORD field4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) * uint32_t field5;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) * };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) * Then the macros below may be used to get or set the value of that field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) * EG. To get the value of the bit field from the above example:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) * struct temp t1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) * value = bsg_bf_get(example_bit_field, &t1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) * And then to set that bit field:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) * bsg_bf_set(example_bit_field, &t1, 2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) * Or clear that bit field:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) * bsg_bf_set(example_bit_field, &t1, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) #define bsg_bf_get_le32(name, ptr) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) ((le32_to_cpu((ptr)->name##_WORD) >> name##_SHIFT) & name##_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) #define bsg_bf_get(name, ptr) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) (((ptr)->name##_WORD >> name##_SHIFT) & name##_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) #define bsg_bf_set_le32(name, ptr, value) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) ((ptr)->name##_WORD = cpu_to_le32(((((value) & \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) name##_MASK) << name##_SHIFT) | (le32_to_cpu((ptr)->name##_WORD) & \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) ~(name##_MASK << name##_SHIFT)))))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) #define bsg_bf_set(name, ptr, value) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) ((ptr)->name##_WORD = ((((value) & name##_MASK) << name##_SHIFT) | \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) ((ptr)->name##_WORD & ~(name##_MASK << name##_SHIFT))))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) * The sli_config structure specified here is based on the following
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) * restriction:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) * -- SLI_CONFIG EMB=0, carrying MSEs, will carry subcommands without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) * carrying HBD.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) * -- SLI_CONFIG EMB=1, not carrying MSE, will carry subcommands with or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) * without carrying HBDs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) struct lpfc_sli_config_mse {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) uint32_t pa_lo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) uint32_t pa_hi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) uint32_t buf_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) #define lpfc_mbox_sli_config_mse_len_SHIFT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) #define lpfc_mbox_sli_config_mse_len_MASK 0xffffff
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) #define lpfc_mbox_sli_config_mse_len_WORD buf_len
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) struct lpfc_sli_config_hbd {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) uint32_t buf_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) #define lpfc_mbox_sli_config_ecmn_hbd_len_SHIFT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) #define lpfc_mbox_sli_config_ecmn_hbd_len_MASK 0xffffff
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) #define lpfc_mbox_sli_config_ecmn_hbd_len_WORD buf_len
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) uint32_t pa_lo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) uint32_t pa_hi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) struct lpfc_sli_config_hdr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) uint32_t word1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) #define lpfc_mbox_hdr_emb_SHIFT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) #define lpfc_mbox_hdr_emb_MASK 0x00000001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) #define lpfc_mbox_hdr_emb_WORD word1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) #define lpfc_mbox_hdr_mse_cnt_SHIFT 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) #define lpfc_mbox_hdr_mse_cnt_MASK 0x0000001f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) #define lpfc_mbox_hdr_mse_cnt_WORD word1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) uint32_t payload_length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) uint32_t tag_lo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) uint32_t tag_hi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) uint32_t reserved5;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) #define LPFC_CSF_BOOT_DEV 0x1D
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) #define LPFC_CSF_QUERY 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) #define LPFC_CSF_SAVE 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) struct lpfc_sli_config_emb0_subsys {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) struct lpfc_sli_config_hdr sli_config_hdr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) #define LPFC_MBX_SLI_CONFIG_MAX_MSE 19
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) struct lpfc_sli_config_mse mse[LPFC_MBX_SLI_CONFIG_MAX_MSE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) uint32_t padding;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) uint32_t word64;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) #define lpfc_emb0_subcmnd_opcode_SHIFT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) #define lpfc_emb0_subcmnd_opcode_MASK 0xff
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) #define lpfc_emb0_subcmnd_opcode_WORD word64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) #define lpfc_emb0_subcmnd_subsys_SHIFT 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) #define lpfc_emb0_subcmnd_subsys_MASK 0xff
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) #define lpfc_emb0_subcmnd_subsys_WORD word64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) /* Subsystem FCOE (0x0C) OpCodes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) #define SLI_CONFIG_SUBSYS_FCOE 0x0C
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) #define FCOE_OPCODE_READ_FCF 0x08
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) #define FCOE_OPCODE_ADD_FCF 0x09
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) #define FCOE_OPCODE_SET_DPORT_MODE 0x27
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) #define FCOE_OPCODE_GET_DPORT_RESULTS 0x28
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) uint32_t timeout; /* comn_set_feature timeout */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) uint32_t request_length; /* comn_set_feature request len */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) uint32_t version; /* comn_set_feature version */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) uint32_t csf_feature; /* comn_set_feature feature */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) uint32_t word69; /* comn_set_feature parameter len */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) uint32_t word70; /* comn_set_feature parameter val0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) #define lpfc_emb0_subcmnd_csf_p0_SHIFT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) #define lpfc_emb0_subcmnd_csf_p0_MASK 0x3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) #define lpfc_emb0_subcmnd_csf_p0_WORD word70
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) struct lpfc_sli_config_emb1_subsys {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) struct lpfc_sli_config_hdr sli_config_hdr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) uint32_t word6;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) #define lpfc_emb1_subcmnd_opcode_SHIFT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) #define lpfc_emb1_subcmnd_opcode_MASK 0xff
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) #define lpfc_emb1_subcmnd_opcode_WORD word6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) #define lpfc_emb1_subcmnd_subsys_SHIFT 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) #define lpfc_emb1_subcmnd_subsys_MASK 0xff
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) #define lpfc_emb1_subcmnd_subsys_WORD word6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) /* Subsystem COMN (0x01) OpCodes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) #define SLI_CONFIG_SUBSYS_COMN 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) #define COMN_OPCODE_GET_PROFILE_CONFIG 0xA4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) #define COMN_OPCODE_READ_OBJECT 0xAB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) #define COMN_OPCODE_WRITE_OBJECT 0xAC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) #define COMN_OPCODE_READ_OBJECT_LIST 0xAD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) #define COMN_OPCODE_DELETE_OBJECT 0xAE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) #define COMN_OPCODE_SET_FEATURES 0xBF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) #define COMN_OPCODE_GET_CNTL_ADDL_ATTRIBUTES 0x79
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) #define COMN_OPCODE_GET_CNTL_ATTRIBUTES 0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) uint32_t timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) uint32_t request_length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) uint32_t word9;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) #define lpfc_subcmnd_version_SHIFT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) #define lpfc_subcmnd_version_MASK 0xff
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) #define lpfc_subcmnd_version_WORD word9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) uint32_t word10;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) #define lpfc_subcmnd_ask_rd_len_SHIFT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) #define lpfc_subcmnd_ask_rd_len_MASK 0xffffff
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) #define lpfc_subcmnd_ask_rd_len_WORD word10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) uint32_t rd_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) uint32_t obj_name[26];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) uint32_t hbd_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) #define LPFC_MBX_SLI_CONFIG_MAX_HBD 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) struct lpfc_sli_config_hbd hbd[LPFC_MBX_SLI_CONFIG_MAX_HBD];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) struct lpfc_sli_config_mbox {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) uint32_t word0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) #define lpfc_mqe_status_SHIFT 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) #define lpfc_mqe_status_MASK 0x0000FFFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) #define lpfc_mqe_status_WORD word0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) #define lpfc_mqe_command_SHIFT 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) #define lpfc_mqe_command_MASK 0x000000FF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) #define lpfc_mqe_command_WORD word0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) struct lpfc_sli_config_emb0_subsys sli_config_emb0_subsys;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) struct lpfc_sli_config_emb1_subsys sli_config_emb1_subsys;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) } un;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) #define LPFC_FORCED_LINK_SPEED_NOT_SUPPORTED 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) #define LPFC_FORCED_LINK_SPEED_SUPPORTED 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) struct get_forced_link_speed_support {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) uint32_t command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) struct forced_link_speed_support_reply {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) uint8_t supported;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) struct lpfc_bsg_ras_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) uint32_t command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) struct lpfc_bsg_get_fwlog_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) uint32_t command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) uint32_t read_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) uint32_t read_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) struct lpfc_bsg_get_ras_lwpd {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) uint32_t offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) uint32_t wrap_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) struct lpfc_bsg_set_ras_config_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) uint32_t command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) uint8_t action;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) #define LPFC_RASACTION_STOP_LOGGING 0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) #define LPFC_RASACTION_START_LOGGING 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) uint8_t log_level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) struct lpfc_bsg_get_ras_config_reply {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) uint8_t state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) #define LPFC_RASLOG_STATE_STOPPED 0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) #define LPFC_RASLOG_STATE_RUNNING 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) uint8_t log_level;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) uint32_t log_buff_sz;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) struct lpfc_trunk_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) uint32_t word0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) #define lpfc_trunk_info_link_status_SHIFT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) #define lpfc_trunk_info_link_status_MASK 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) #define lpfc_trunk_info_link_status_WORD word0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) #define lpfc_trunk_info_trunk_active0_SHIFT 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) #define lpfc_trunk_info_trunk_active0_MASK 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) #define lpfc_trunk_info_trunk_active0_WORD word0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) #define lpfc_trunk_info_trunk_active1_SHIFT 9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) #define lpfc_trunk_info_trunk_active1_MASK 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) #define lpfc_trunk_info_trunk_active1_WORD word0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) #define lpfc_trunk_info_trunk_active2_SHIFT 10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) #define lpfc_trunk_info_trunk_active2_MASK 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) #define lpfc_trunk_info_trunk_active2_WORD word0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) #define lpfc_trunk_info_trunk_active3_SHIFT 11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) #define lpfc_trunk_info_trunk_active3_MASK 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) #define lpfc_trunk_info_trunk_active3_WORD word0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) #define lpfc_trunk_info_trunk_config0_SHIFT 12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) #define lpfc_trunk_info_trunk_config0_MASK 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) #define lpfc_trunk_info_trunk_config0_WORD word0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) #define lpfc_trunk_info_trunk_config1_SHIFT 13
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) #define lpfc_trunk_info_trunk_config1_MASK 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) #define lpfc_trunk_info_trunk_config1_WORD word0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) #define lpfc_trunk_info_trunk_config2_SHIFT 14
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) #define lpfc_trunk_info_trunk_config2_MASK 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) #define lpfc_trunk_info_trunk_config2_WORD word0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) #define lpfc_trunk_info_trunk_config3_SHIFT 15
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) #define lpfc_trunk_info_trunk_config3_MASK 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) #define lpfc_trunk_info_trunk_config3_WORD word0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) uint16_t port_speed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) uint16_t logical_speed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) uint32_t reserved3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) struct get_trunk_info_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) uint32_t command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) /* driver only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) #define SLI_CONFIG_NOT_HANDLED 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) #define SLI_CONFIG_HANDLED 1