1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22 /* 23 * Copyright 2009 Emulex. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _EMLXS_FCIO_H 28 #define _EMLXS_FCIO_H 29 30 #ifdef __cplusplus 31 extern "C" { 32 #endif 33 34 /* 35 * FCIO_REV: 1 - Initial implementation 2 - Added EMLXS_GET_FCIO_REV support 36 */ 37 #define FCIO_REV 2 38 39 40 /* Emulex ULP Diag Codes */ 41 #define EMLXS_DIAG ('E'<< 8) 42 43 #define EMLXS_DIAG_BIU (EMLXS_DIAG | 100) 44 #define EMLXS_DIAG_POST (EMLXS_DIAG | 101) 45 #define EMLXS_DIAG_ECHO (EMLXS_DIAG | 102) 46 47 #define EMLXS_PARM_GET_NUM (EMLXS_DIAG | 200) 48 #define EMLXS_PARM_GET_LIST (EMLXS_DIAG | 201) 49 #define EMLXS_PARM_GET (EMLXS_DIAG | 202) 50 #define EMLXS_PARM_SET (EMLXS_DIAG | 203) 51 #define EMLXS_GET_BOOT_REV (EMLXS_DIAG | 204) 52 #define EMLXS_DOWNLOAD_BOOT (EMLXS_DIAG | 205) 53 #define EMLXS_DOWNLOAD_CFL (EMLXS_DIAG | 206) 54 #define EMLXS_VPD_GET (EMLXS_DIAG | 207) 55 #define EMLXS_GET_FCIO_REV (EMLXS_DIAG | 208) 56 #define EMLXS_SET_BOOT_STATE_old (EMLXS_DIAG | 209) 57 #define EMLXS_GET_BOOT_STATE_old (EMLXS_DIAG | 210) 58 #define EMLXS_DFC_COMMAND (EMLXS_DIAG | 211) 59 #define EMLXS_SET_BOOT_STATE (EMLXS_DIAG | 212) 60 #define EMLXS_GET_BOOT_STATE (EMLXS_DIAG | 213) 61 #define EMLXS_GET_DFC_REV (EMLXS_DIAG | 214) 62 63 #define EMLXS_BAR_IO (EMLXS_DIAG | 253) 64 #define EMLXS_TEST_CODE (EMLXS_DIAG | 254) 65 #define EMLXS_HW_ERROR_TEST (EMLXS_DIAG | 255) 66 67 #define EMLXS_LOG_GET (EMLXS_DIAG | 300) 68 69 70 /* DUMP file ids */ 71 #define EMLXS_TXT_FILE_ID 1 72 #define EMLXS_DMP_FILE_ID 2 73 #define EMLXS_CEE_FILE_ID 3 74 #define EMLXS_FAT_FILE_ID 4 75 76 77 /* Emulex specific error codes */ 78 #define EMLXS_ERRNO_START 0x100 79 #define EMLXS_TEST_FAILED (EMLXS_ERRNO_START + 0) /* Diagnostic */ 80 /* test fail */ 81 #define EMLXS_IMAGE_BAD (EMLXS_ERRNO_START + 1) /* Image has */ 82 /* bad data */ 83 #define EMLXS_IMAGE_INCOMPATIBLE (EMLXS_ERRNO_START + 2) /* Image not */ 84 /* compatible */ 85 /* with H/W */ 86 #define EMLXS_IMAGE_FAILED (EMLXS_ERRNO_START + 3) /* Image */ 87 /* download */ 88 /* failed */ 89 #define EMLXS_OFFLINE_FAILED (EMLXS_ERRNO_START + 4) /* Unable to */ 90 /* take HBA */ 91 /* offline */ 92 #define EMLXS_NO_BOOT_CODE (EMLXS_ERRNO_START + 5) /* No boot */ 93 /* code image */ 94 #define EMLXS_ERRNO_END (EMLXS_ERRNO_START + 5) 95 96 97 typedef struct emlxs_parm 98 { 99 char label[32]; 100 uint32_t min; 101 uint32_t max; 102 uint32_t def; 103 uint32_t current; 104 uint32_t flags; 105 char help[128]; 106 } emlxs_parm_t; 107 108 /* emlxs_parm_t flags */ 109 #define PARM_DYNAMIC 0x00000001 /* Reboot not required */ 110 #define PARM_BOOLEAN 0x00000002 111 #define PARM_HEX 0x00000004 112 113 /* PARM_DYNAMIC subtypes */ 114 #define PARM_DYNAMIC_RESET (PARM_DYNAMIC | 0x00000010) /* Hard reset */ 115 /* required */ 116 #define PARM_DYNAMIC_LINK (PARM_DYNAMIC | 0x00000020) /* Link reset */ 117 /* required */ 118 119 typedef struct emlxs_vpd_desc 120 { 121 char id[80]; 122 char part_num[32]; 123 char eng_change[32]; 124 char manufacturer[80]; 125 char serial_num[32]; 126 char model[32]; 127 char model_desc[80]; 128 char port_num[4]; 129 char prog_types[80]; 130 } emlxs_vpd_desc_t; 131 132 typedef struct emlxs_log_req 133 { 134 uint32_t first; /* First msg id requested */ 135 uint32_t count; /* Maximum number of messages */ 136 /* capable of receiving */ 137 /* This value can be set to zero */ 138 /* to receive just log stats */ 139 } emlxs_log_req_t; 140 141 142 typedef struct emlxs_log_resp 143 { 144 uint32_t first; /* Actual starting msg id in resp buffer */ 145 /* This represents the first available */ 146 /* msg id >= first id requested */ 147 uint32_t last; /* Current last msg id in log file */ 148 uint32_t count; /* Total number of messages in resp buffer */ 149 /* This value will be <= the max count */ 150 /* requested */ 151 152 /* If count > 0, then the response buffer */ 153 /* will immediately follow this structure */ 154 /* The response buffer will be an array of */ 155 /* string buffers MAX_MSG_LENGTH in size */ 156 #define MAX_LOG_MSG_LENGTH 160 157 } emlxs_log_resp_t; 158 159 #ifdef __cplusplus 160 } 161 #endif 162 163 #endif /* _EMLXS_FCIO_H */ 164