emlxs_dump.c (8f23e9fa) emlxs_dump.c (a3170057)
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

--- 33 unchanged lines hidden (view full) ---

42{
43 emlxs_port_t *port = &PPORT;
44 uint32_t cmd_size;
45 uint32_t rsp_size;
46 menlo_cmd_t *cmd_buf = NULL;
47 menlo_rsp_t *rsp_buf = NULL;
48 uint32_t rval = 0;
49
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

--- 33 unchanged lines hidden (view full) ---

42{
43 emlxs_port_t *port = &PPORT;
44 uint32_t cmd_size;
45 uint32_t rsp_size;
46 menlo_cmd_t *cmd_buf = NULL;
47 menlo_rsp_t *rsp_buf = NULL;
48 uint32_t rval = 0;
49
50 if (hba->model_info.device_id != PCI_DEVICE_ID_HORNET) {
50 if (hba->model_info.vendor_id != PCI_VENDOR_ID_EMULEX ||
51 hba->model_info.device_id != PCI_DEVICE_ID_HORNET) {
51 return (DFC_INVALID_ADAPTER);
52 }
53
54 cmd_size = sizeof (menlo_set_cmd_t);
55 cmd_buf = (menlo_cmd_t *)kmem_zalloc(cmd_size, KM_SLEEP);
56
57 rsp_size = 4;
58 rsp_buf = (menlo_rsp_t *)kmem_zalloc(rsp_size, KM_SLEEP);

--- 46 unchanged lines hidden (view full) ---

105{
106 emlxs_port_t *port = &PPORT;
107 uint32_t cmd_size;
108 uint32_t rsp_size;
109 menlo_cmd_t *cmd_buf = NULL;
110 menlo_rsp_t *rsp_buf = NULL;
111 uint32_t rval = 0;
112
52 return (DFC_INVALID_ADAPTER);
53 }
54
55 cmd_size = sizeof (menlo_set_cmd_t);
56 cmd_buf = (menlo_cmd_t *)kmem_zalloc(cmd_size, KM_SLEEP);
57
58 rsp_size = 4;
59 rsp_buf = (menlo_rsp_t *)kmem_zalloc(rsp_size, KM_SLEEP);

--- 46 unchanged lines hidden (view full) ---

106{
107 emlxs_port_t *port = &PPORT;
108 uint32_t cmd_size;
109 uint32_t rsp_size;
110 menlo_cmd_t *cmd_buf = NULL;
111 menlo_rsp_t *rsp_buf = NULL;
112 uint32_t rval = 0;
113
113 if (hba->model_info.device_id != PCI_DEVICE_ID_HORNET) {
114 if (hba->model_info.vendor_id != PCI_VENDOR_ID_EMULEX ||
115 hba->model_info.device_id != PCI_DEVICE_ID_HORNET) {
114 return (DFC_INVALID_ADAPTER);
115 }
116
117 cmd_size = sizeof (menlo_reset_cmd_t);
118 cmd_buf = (menlo_cmd_t *)kmem_zalloc(cmd_size, KM_SLEEP);
119
120 rsp_size = 4;
121 rsp_buf = (menlo_rsp_t *)kmem_zalloc(rsp_size, KM_SLEEP);

--- 44 unchanged lines hidden (view full) ---

166 menlo_get_config_rsp_t *rsp_buf,
167 uint32_t rsp_size)
168{
169 emlxs_port_t *port = &PPORT;
170 uint32_t cmd_size;
171 menlo_cmd_t *cmd_buf = NULL;
172 uint32_t rval = 0;
173
116 return (DFC_INVALID_ADAPTER);
117 }
118
119 cmd_size = sizeof (menlo_reset_cmd_t);
120 cmd_buf = (menlo_cmd_t *)kmem_zalloc(cmd_size, KM_SLEEP);
121
122 rsp_size = 4;
123 rsp_buf = (menlo_rsp_t *)kmem_zalloc(rsp_size, KM_SLEEP);

--- 44 unchanged lines hidden (view full) ---

168 menlo_get_config_rsp_t *rsp_buf,
169 uint32_t rsp_size)
170{
171 emlxs_port_t *port = &PPORT;
172 uint32_t cmd_size;
173 menlo_cmd_t *cmd_buf = NULL;
174 uint32_t rval = 0;
175
174 if (hba->model_info.device_id != PCI_DEVICE_ID_HORNET) {
176 if (hba->model_info.vendor_id != PCI_VENDOR_ID_EMULEX ||
177 hba->model_info.device_id != PCI_DEVICE_ID_HORNET) {
175 return (DFC_INVALID_ADAPTER);
176 }
177
178 cmd_size = sizeof (menlo_get_cmd_t);
179 cmd_buf = (menlo_cmd_t *)kmem_zalloc(cmd_size, KM_SLEEP);
180
181 rsp_size = sizeof (menlo_get_config_rsp_t);
182

--- 41 unchanged lines hidden (view full) ---

224 menlo_rsp_t *rsp_buf,
225 uint32_t rsp_size)
226{
227 emlxs_port_t *port = &PPORT;
228 uint32_t cmd_size;
229 menlo_cmd_t *cmd_buf = NULL;
230 uint32_t rval = 0;
231
178 return (DFC_INVALID_ADAPTER);
179 }
180
181 cmd_size = sizeof (menlo_get_cmd_t);
182 cmd_buf = (menlo_cmd_t *)kmem_zalloc(cmd_size, KM_SLEEP);
183
184 rsp_size = sizeof (menlo_get_config_rsp_t);
185

--- 41 unchanged lines hidden (view full) ---

227 menlo_rsp_t *rsp_buf,
228 uint32_t rsp_size)
229{
230 emlxs_port_t *port = &PPORT;
231 uint32_t cmd_size;
232 menlo_cmd_t *cmd_buf = NULL;
233 uint32_t rval = 0;
234
232 if (hba->model_info.device_id != PCI_DEVICE_ID_HORNET) {
235 if (hba->model_info.vendor_id != PCI_VENDOR_ID_EMULEX ||
236 hba->model_info.device_id != PCI_DEVICE_ID_HORNET) {
233 return (DFC_INVALID_ADAPTER);
234 }
235
236 cmd_size = sizeof (menlo_get_cmd_t);
237 cmd_buf = (menlo_cmd_t *)kmem_zalloc(cmd_size, KM_SLEEP);
238
239 cmd_buf->code = MENLO_CMD_GET_LOG_CONFIG;
240 cmd_buf->get.context = 0;

--- 39 unchanged lines hidden (view full) ---

280 menlo_rsp_t *rsp_buf,
281 uint32_t rsp_size)
282{
283 emlxs_port_t *port = &PPORT;
284 uint32_t cmd_size;
285 menlo_cmd_t *cmd_buf = NULL;
286 uint32_t rval = 0;
287
237 return (DFC_INVALID_ADAPTER);
238 }
239
240 cmd_size = sizeof (menlo_get_cmd_t);
241 cmd_buf = (menlo_cmd_t *)kmem_zalloc(cmd_size, KM_SLEEP);
242
243 cmd_buf->code = MENLO_CMD_GET_LOG_CONFIG;
244 cmd_buf->get.context = 0;

--- 39 unchanged lines hidden (view full) ---

284 menlo_rsp_t *rsp_buf,
285 uint32_t rsp_size)
286{
287 emlxs_port_t *port = &PPORT;
288 uint32_t cmd_size;
289 menlo_cmd_t *cmd_buf = NULL;
290 uint32_t rval = 0;
291
288 if (hba->model_info.device_id != PCI_DEVICE_ID_HORNET) {
292 if (hba->model_info.vendor_id != PCI_VENDOR_ID_EMULEX ||
293 hba->model_info.device_id != PCI_DEVICE_ID_HORNET) {
289 return (DFC_INVALID_ADAPTER);
290 }
291
292 cmd_size = sizeof (menlo_get_cmd_t);
293 cmd_buf = (menlo_cmd_t *)kmem_zalloc(cmd_size, KM_SLEEP);
294
295 cmd_buf->code = MENLO_CMD_GET_LOG_DATA;
296 cmd_buf->get.context = id;

--- 38 unchanged lines hidden (view full) ---

335 menlo_rsp_t *rsp_buf,
336 uint32_t rsp_size)
337{
338 emlxs_port_t *port = &PPORT;
339 uint32_t cmd_size;
340 menlo_cmd_t *cmd_buf = NULL;
341 uint32_t rval = 0;
342
294 return (DFC_INVALID_ADAPTER);
295 }
296
297 cmd_size = sizeof (menlo_get_cmd_t);
298 cmd_buf = (menlo_cmd_t *)kmem_zalloc(cmd_size, KM_SLEEP);
299
300 cmd_buf->code = MENLO_CMD_GET_LOG_DATA;
301 cmd_buf->get.context = id;

--- 38 unchanged lines hidden (view full) ---

340 menlo_rsp_t *rsp_buf,
341 uint32_t rsp_size)
342{
343 emlxs_port_t *port = &PPORT;
344 uint32_t cmd_size;
345 menlo_cmd_t *cmd_buf = NULL;
346 uint32_t rval = 0;
347
343 if (hba->model_info.device_id != PCI_DEVICE_ID_HORNET) {
348 if (hba->model_info.vendor_id != PCI_VENDOR_ID_EMULEX ||
349 hba->model_info.device_id != PCI_DEVICE_ID_HORNET) {
344 return (DFC_INVALID_ADAPTER);
345 }
346
347 cmd_size = sizeof (menlo_get_cmd_t);
348 cmd_buf = (menlo_cmd_t *)kmem_zalloc(cmd_size, KM_SLEEP);
349
350 cmd_buf->code = MENLO_CMD_GET_PANIC_LOG;
351 cmd_buf->get.context = 0;

--- 1865 unchanged lines hidden (view full) ---

2217 if ((*fpTxtFile = emlxs_fopen(hba, EMLXS_TXT_FILE)) == NULL) {
2218 return (1);
2219 }
2220 }
2221
2222 if (fpCeeFile) {
2223 *fpCeeFile = NULL;
2224
350 return (DFC_INVALID_ADAPTER);
351 }
352
353 cmd_size = sizeof (menlo_get_cmd_t);
354 cmd_buf = (menlo_cmd_t *)kmem_zalloc(cmd_size, KM_SLEEP);
355
356 cmd_buf->code = MENLO_CMD_GET_PANIC_LOG;
357 cmd_buf->get.context = 0;

--- 1865 unchanged lines hidden (view full) ---

2223 if ((*fpTxtFile = emlxs_fopen(hba, EMLXS_TXT_FILE)) == NULL) {
2224 return (1);
2225 }
2226 }
2227
2228 if (fpCeeFile) {
2229 *fpCeeFile = NULL;
2230
2225 if ((hba->model_info.device_id == PCI_DEVICE_ID_HORNET) ||
2231 if ((hba->model_info.vendor_id == PCI_VENDOR_ID_EMULEX &&
2232 hba->model_info.device_id == PCI_DEVICE_ID_HORNET) ||
2226 (hba->model_info.chip == EMLXS_BE2_CHIP) ||
2227 (hba->model_info.chip == EMLXS_BE3_CHIP)) {
2228 if ((*fpCeeFile =
2229 emlxs_fopen(hba, EMLXS_CEE_FILE)) == NULL) {
2230 emlxs_fdelete(*fpTxtFile);
2231 return (1);
2232 }
2233 }

--- 38 unchanged lines hidden (view full) ---

2272
2273 if (fpTxtFile) {
2274 /* Write a suitable string to the Dump TXT File */
2275 (void) emlxs_fprintf(fpTxtFile, "Dump File End\n");
2276 emlxs_fflush(fpTxtFile);
2277 }
2278
2279 if (fpCeeFile) {
2233 (hba->model_info.chip == EMLXS_BE2_CHIP) ||
2234 (hba->model_info.chip == EMLXS_BE3_CHIP)) {
2235 if ((*fpCeeFile =
2236 emlxs_fopen(hba, EMLXS_CEE_FILE)) == NULL) {
2237 emlxs_fdelete(*fpTxtFile);
2238 return (1);
2239 }
2240 }

--- 38 unchanged lines hidden (view full) ---

2279
2280 if (fpTxtFile) {
2281 /* Write a suitable string to the Dump TXT File */
2282 (void) emlxs_fprintf(fpTxtFile, "Dump File End\n");
2283 emlxs_fflush(fpTxtFile);
2284 }
2285
2286 if (fpCeeFile) {
2280 if (hba->model_info.device_id == PCI_DEVICE_ID_HORNET) {
2287 if (hba->model_info.vendor_id == PCI_VENDOR_ID_EMULEX &&
2288 hba->model_info.device_id == PCI_DEVICE_ID_HORNET) {
2281 (void) emlxs_fprintf(fpCeeFile, "Dump File End\n");
2282 }
2283
2284 emlxs_fflush(fpCeeFile);
2285 }
2286
2287 /* Write the single-byte Dump Termination SID to the DMP File */
2288 if (fpDmpFile) {

--- 968 unchanged lines hidden (view full) ---

3257 char *pLogString;
3258
3259 /* Get Panic Log Command vars */
3260 uint32_t PlBufSize;
3261 menlo_rsp_t *pPlBuf = NULL;
3262 uint32_t PanicLogEntryCount;
3263 uint32_t PanicLogEntrySize;
3264
2289 (void) emlxs_fprintf(fpCeeFile, "Dump File End\n");
2290 }
2291
2292 emlxs_fflush(fpCeeFile);
2293 }
2294
2295 /* Write the single-byte Dump Termination SID to the DMP File */
2296 if (fpDmpFile) {

--- 968 unchanged lines hidden (view full) ---

3265 char *pLogString;
3266
3267 /* Get Panic Log Command vars */
3268 uint32_t PlBufSize;
3269 menlo_rsp_t *pPlBuf = NULL;
3270 uint32_t PanicLogEntryCount;
3271 uint32_t PanicLogEntrySize;
3272
3265 if (hba->model_info.device_id != PCI_DEVICE_ID_HORNET) {
3273 if (hba->model_info.vendor_id != PCI_VENDOR_ID_EMULEX ||
3274 hba->model_info.device_id != PCI_DEVICE_ID_HORNET) {
3266 return (DFC_INVALID_ADAPTER);
3267 }
3268
3269 /* First, issue a GetConfig command, which gives us */
3270 /* the Log Config and Panic Log sizes */
3271
3272 RmStatus =
3273 emlxs_menlo_get_cfg(hba, pGcBuf, sizeof (menlo_get_config_rsp_t));

--- 984 unchanged lines hidden ---
3275 return (DFC_INVALID_ADAPTER);
3276 }
3277
3278 /* First, issue a GetConfig command, which gives us */
3279 /* the Log Config and Panic Log sizes */
3280
3281 RmStatus =
3282 emlxs_menlo_get_cfg(hba, pGcBuf, sizeof (menlo_get_config_rsp_t));

--- 984 unchanged lines hidden ---