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 28 #ifndef _EMLXS_FCIO_H 29 #define _EMLXS_FCIO_H 30 31 #ifdef __cplusplus 32 extern "C" { 33 #endif 34 35 /* 36 * FCIO_REV: 1 - Initial implementation 2 - Added EMLXS_GET_FCIO_REV support 37 */ 38 #define FCIO_REV 2 39 40 41 /* Emulex ULP Diag Codes */ 42 #define EMLXS_DIAG ('E'<< 8) 43 44 #define EMLXS_DIAG_BIU (EMLXS_DIAG | 100) 45 #define EMLXS_DIAG_POST (EMLXS_DIAG | 101) 46 #define EMLXS_DIAG_ECHO (EMLXS_DIAG | 102) 47 48 #define EMLXS_PARM_GET_NUM (EMLXS_DIAG | 200) 49 #define EMLXS_PARM_GET_LIST (EMLXS_DIAG | 201) 50 #define EMLXS_PARM_GET (EMLXS_DIAG | 202) 51 #define EMLXS_PARM_SET (EMLXS_DIAG | 203) 52 #define EMLXS_GET_BOOT_REV (EMLXS_DIAG | 204) 53 #define EMLXS_DOWNLOAD_BOOT (EMLXS_DIAG | 205) 54 #define EMLXS_DOWNLOAD_CFL (EMLXS_DIAG | 206) 55 #define EMLXS_VPD_GET (EMLXS_DIAG | 207) 56 #define EMLXS_GET_FCIO_REV (EMLXS_DIAG | 208) 57 #define EMLXS_SET_BOOT_STATE_old (EMLXS_DIAG | 209) 58 #define EMLXS_GET_BOOT_STATE_old (EMLXS_DIAG | 210) 59 #define EMLXS_DFC_COMMAND (EMLXS_DIAG | 211) 60 #define EMLXS_SET_BOOT_STATE (EMLXS_DIAG | 212) 61 #define EMLXS_GET_BOOT_STATE (EMLXS_DIAG | 213) 62 #define EMLXS_GET_DFC_REV (EMLXS_DIAG | 214) 63 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 75 76 /* Emulex specific error codes */ 77 #define EMLXS_ERRNO_START 0x100 78 #define EMLXS_TEST_FAILED (EMLXS_ERRNO_START + 0) /* Diagnostic */ 79 /* test fail */ 80 #define EMLXS_IMAGE_BAD (EMLXS_ERRNO_START + 1) /* Image has */ 81 /* bad data */ 82 #define EMLXS_IMAGE_INCOMPATIBLE (EMLXS_ERRNO_START + 2) /* Image not */ 83 /* compatible */ 84 /* with H/W */ 85 #define EMLXS_IMAGE_FAILED (EMLXS_ERRNO_START + 3) /* Image */ 86 /* download */ 87 /* failed */ 88 #define EMLXS_OFFLINE_FAILED (EMLXS_ERRNO_START + 4) /* Unable to */ 89 /* take HBA */ 90 /* offline */ 91 #define EMLXS_NO_BOOT_CODE (EMLXS_ERRNO_START + 5) /* No boot */ 92 /* code image */ 93 #define EMLXS_ERRNO_END (EMLXS_ERRNO_START + 5) 94 95 96 typedef struct emlxs_parm 97 { 98 char label[32]; 99 uint32_t min; 100 uint32_t max; 101 uint32_t def; 102 uint32_t current; 103 uint32_t flags; 104 char help[128]; 105 } emlxs_parm_t; 106 107 /* emlxs_parm_t flags */ 108 #define PARM_DYNAMIC 0x00000001 /* Reboot not required */ 109 #define PARM_BOOLEAN 0x00000002 110 #define PARM_HEX 0x00000004 111 112 /* PARM_DYNAMIC subtypes */ 113 #define PARM_DYNAMIC_RESET (PARM_DYNAMIC | 0x00000010) /* Hard reset */ 114 /* required */ 115 #define PARM_DYNAMIC_LINK (PARM_DYNAMIC | 0x00000020) /* Link reset */ 116 /* required */ 117 118 typedef struct emlxs_vpd_desc 119 { 120 char id[80]; 121 char part_num[32]; 122 char eng_change[32]; 123 char manufacturer[80]; 124 char serial_num[32]; 125 char model[32]; 126 char model_desc[80]; 127 char port_num[4]; 128 char prog_types[80]; 129 } emlxs_vpd_desc_t; 130 131 typedef struct emlxs_log_req 132 { 133 uint32_t first; /* First msg id requested */ 134 uint32_t count; /* Maximum number of messages */ 135 /* capable of receiving */ 136 /* This value can be set to zero */ 137 /* to receive just log stats */ 138 } emlxs_log_req_t; 139 140 141 typedef struct emlxs_log_resp 142 { 143 uint32_t first; /* Actual starting msg id in resp buffer */ 144 /* This represents the first available */ 145 /* msg id >= first id requested */ 146 uint32_t last; /* Current last msg id in log file */ 147 uint32_t count; /* Total number of messages in resp buffer */ 148 /* This value will be <= the max count */ 149 /* requested */ 150 151 /* If count > 0, then the response buffer */ 152 /* will immediately follow this structure */ 153 /* The response buffer will be an array of */ 154 /* string buffers MAX_MSG_LENGTH in size */ 155 #define MAX_LOG_MSG_LENGTH 160 156 } emlxs_log_resp_t; 157 158 #ifdef __cplusplus 159 } 160 #endif 161 162 #endif /* _EMLXS_FCIO_H */ 163