Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_ioctl.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2015, Emulex
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *
31  */
32 
33 #include "ocs.h"
34 #include "ocs_os.h"
35 #include "ocs_ioctl.h"
36 #include "ocs_ioctl_xport.h"
37 #include "ocs_vpd.h"
38 #include "ocs_gendump.h"
39 #include "ocs_elxu.h"
40 
41 #if defined(OCS_ENABLE_ECD_HELPER)
42 static int ocs_process_ecd_helper (ocs_t *ocs, ocs_ioctl_ecd_helper_t *req);
43 #endif
44 
45 /**
46  * @brief ocs driver ioctl method
47  *
48  * Called from ocs_ioctl
49  *
50  * @param ocs pointer to ocs structure
51  * @param cmd ioctl command to execute
52  * @param arg ioctl command specitic data
53  *
54  * @return returns 0 for success, a negative error code value for failure.
55  */
56 int32_t
57 ocs_device_ioctl(ocs_t *ocs, unsigned int cmd, unsigned long arg)
58 {
59  int rc = 0;
60 
61  switch(cmd) {
62 
63  case OCS_IOCTL_CMD_TEST: {
64  ocs_ioctl_test_t *buf;
65 
66  buf = (ocs_ioctl_test_t *)ocs_ioctl_preprocess(ocs, (void *)arg, sizeof(*buf));
67  if (buf == NULL) {
68  ocs_log_test(ocs, "copy from user failed\n");
69  return -EFAULT;
70  }
71 
72  ocs_log_debug(ocs, "CMD_TEST: %s\n", buf->string);
73  buf->string[0] ++;
74 
75  rc = ocs_ioctl_postprocess(ocs, (void *)arg, buf, sizeof(*buf));
76  if (rc) {
77  ocs_log_test(ocs, "Error: copy to user failed: %d\n", rc);
78  return -EFAULT;
79  }
80 
81  break;
82  }
85 
86  mcmd = (ocs_ioctl_elxu_mbox_t *)ocs_ioctl_preprocess(ocs, (void *)arg, sizeof(*mcmd));
87  if (mcmd == NULL) {
88  ocs_log_test(ocs, "Error: copy from user failed\n");
89  return -EFAULT;
90  }
91 
92  rc = ocs_elxu(ocs, mcmd);
93 
94  /* copy response back */
95  if (rc == 0) {
96  if (ocs_ioctl_postprocess(ocs, (void *)arg, mcmd, sizeof(*mcmd))) {
97  ocs_log_test(ocs, "Error: copy to user failed\n");
98  return -EFAULT;
99  }
100  } else {
101  ocs_ioctl_free(ocs, mcmd, sizeof(*mcmd));
102  }
103 
104  break;
105 
106  }
109  uint8_t *pserial, *pvpd;
110  uint32_t len;
111  uint32_t vpd_len;
112 
113  if (ocs_hal_get(&ocs->hal, OCS_HAL_VPD_LEN, &vpd_len)) {
114  ocs_log_test(ocs, "Can't get VPD length\n");
115  return -EFAULT;
116  }
117 
118  info = (ocs_ioctl_driver_info_t *)ocs_ioctl_preprocess(ocs, (void *)arg, sizeof(*info));
119  if (info == NULL) {
120  ocs_log_test(ocs, "Error: copy from user failed\n");
121  return -EFAULT;
122  }
123 
124  info->pci_vendor = ocs->pci_vendor;
125  info->pci_device = ocs->pci_device;
126  ocs_strncpy(info->businfo, ocs->businfo, sizeof(info->businfo));
127 
128  ocs_strncpy(info->desc, ocs->desc, sizeof(info->desc));
129  ocs_strncpy(info->fw_rev, ocs_hal_get_ptr(&ocs->hal, OCS_HAL_FW_REV), sizeof(info->fw_rev));
130 
131  ocs_info_get_xport_address(ocs, info);
132 
133  /* fetch serial number from VPD */
134  pvpd = ocs_hal_get_ptr(&ocs->hal, OCS_HAL_VPD);
135  if (pvpd) {
136  pserial = ocs_find_vpd(pvpd, vpd_len, "SN");
137  if (pserial) {
138  len = *pserial ++;
139  if (len > sizeof(info->serialnum)) {
140  len = sizeof(info->serialnum);
141  }
142  ocs_memcpy(info->serialnum, pserial, len);
143  }
144  }
145 
146  info->sli_intf = ocs_config_read32(ocs, SLI4_INTF_REG);
147 
148  if (ocs_ioctl_postprocess(ocs, (void*) arg, info, sizeof(*info))) {
149  ocs_log_test(ocs, "Error: copy to user failed\n");
150  return -EFAULT;
151  }
152 
153  break;
154  }
156  ocs_ioctl_action_t *req;
157  char action_name[128];
158 
159  req = (ocs_ioctl_action_t *)ocs_ioctl_preprocess(ocs, (void *)arg, sizeof(*req));
160  if (req == NULL) {
161  ocs_log_test(ocs, "Error: copy from user failed\n");
162  return -EFAULT;
163  }
164 
165  if (ocs_copy_from_user(action_name, req->name, sizeof(action_name))) {
166  ocs_log_test(ocs, "Error: copy req.name from user failed\n");
167  ocs_ioctl_free(ocs, req, sizeof(*req));
168  return -EFAULT;
169  }
170 
171  /* Notes: handlers must do their own user space copy in's and out's */
172  req->result = ocs_mgmt_exec(ocs, action_name, req->arg_in, req->arg_in_length,
173  req->arg_out, req->arg_out_length);
174 
175  if (ocs_ioctl_postprocess(ocs, (void*) arg, req, sizeof(*req))) {
176  ocs_log_err(ocs, "Error: (%d) ocs_copy_to_user failed\n", __LINE__);
177  return -EFAULT;
178  }
179 
180  break;
181  }
182 
185  ocs_textbuf_t textbuf;
186 
187  req = (ocs_ioctl_mgmt_buffer_t *)ocs_ioctl_preprocess(ocs, (void *)arg, sizeof(*req));
188  if (req == NULL) {
189  ocs_log_test(ocs, "Error: ocs_copy from user failed\n");
190  return -EFAULT;
191  }
192 
193  /* Build a text buffer */
194  if (ocs_textbuf_alloc(ocs, &textbuf, req->user_buffer_len)) {
195  ocs_log_err(ocs, "Error: ocs_textbuf_alloc failed\n");
196  ocs_ioctl_free(ocs, req, sizeof(*req));
197  return -EFAULT;
198  }
199 
200  ocs_mgmt_get_list(ocs, &textbuf);
201 
202  if (ocs_textbuf_get_written(&textbuf)) {
203  if (ocs_copy_to_user(req->user_buffer, ocs_textbuf_get_buffer(&textbuf), ocs_textbuf_get_written(&textbuf))) {
204  ocs_log_test(ocs, "Error: (%d) ocs_copy_to_user failed\n", __LINE__);
205  }
206  }
207  req->bytes_written = ocs_textbuf_get_written(&textbuf);
208 
209  if (ocs_ioctl_postprocess(ocs, (void*) arg, req, sizeof(*req))) {
210  ocs_log_test(ocs, "Error: (%d) ocs_copy_to_user failed\n", __LINE__);
211  ocs_textbuf_free(ocs, &textbuf);
212  return -EFAULT;
213  }
214 
215  ocs_textbuf_free(ocs, &textbuf);
216 
217  break;
218  }
219 
222  ocs_textbuf_t textbuf;
223  int32_t n;
224  uint32_t idx;
225  uint32_t copied = 0;
226 
227  req = (ocs_ioctl_mgmt_buffer_t *)ocs_ioctl_preprocess(ocs, (void *)arg, sizeof(*req));
228  if (req == NULL) {
229  ocs_log_test(ocs, "Error: ocs_copy from user failed\n");
230  return -EFAULT;
231  }
232 
233  /* Build a text buffer */
234  if (ocs_textbuf_alloc(ocs, &textbuf, req->user_buffer_len)) {
235  ocs_log_err(ocs, "Error: ocs_textbuf_alloc failed\n");
236  ocs_ioctl_free(ocs, req, sizeof(*req));
237  return -EFAULT;
238  }
239 
240  ocs_mgmt_get_all(ocs, &textbuf);
241 
242  for (idx = 0; (n = ocs_textbuf_ext_get_written(&textbuf, idx)) > 0; idx++) {
243  if (ocs_copy_to_user(req->user_buffer + copied,
244  ocs_textbuf_ext_get_buffer(&textbuf, idx), n)) {
245  ocs_log_test(ocs, "Error: (%d) ocs_copy_to_user failed\n", __LINE__);
246  break;
247  }
248  copied += n;
249  }
250  req->bytes_written = copied;
251 
252  if (ocs_ioctl_postprocess(ocs, (void*) arg, req, sizeof(*req))) {
253  ocs_log_test(ocs, "Error: (%d) ocs_copy_to_user failed\n", __LINE__);
254  ocs_textbuf_free(ocs, &textbuf);
255  return -EFAULT;
256  }
257 
258  ocs_textbuf_free(ocs, &textbuf);
259 
260  break;
261  }
262 
263  case OCS_IOCTL_CMD_MGMT_GET: {
264  ocs_ioctl_cmd_get_t *req;
265  ocs_textbuf_t textbuf;
266  char name[OCS_MGMT_MAX_NAME];
267 
268  req = (ocs_ioctl_cmd_get_t *)ocs_ioctl_preprocess(ocs, (void *)arg, sizeof(ocs_ioctl_cmd_get_t));
269  if (req == NULL) {
270  ocs_log_test(ocs, "copy from user failed\n");
271  return -EFAULT;
272  }
273 
274  /* Copy the name value in from user space */
275  if (ocs_copy_from_user(name, req->name, OCS_MGMT_MAX_NAME)) {
276  ocs_log_test(ocs, "ocs_copy_from_user failed\n");
277  ocs_ioctl_free(ocs, req, sizeof(ocs_ioctl_cmd_get_t));
278  return -EFAULT;
279  }
280 
281  /* Build a text buffer */
282  if (ocs_textbuf_alloc(ocs, &textbuf, req->value_length)) {
283  ocs_log_err(ocs, "Error: ocs_textbuf_alloc failed\n");
284  ocs_ioctl_free(ocs, req, sizeof(ocs_ioctl_cmd_get_t));
285  return -EFAULT;
286  }
287 
288  rc = ocs_mgmt_get(ocs, name, &textbuf);
289  if (rc) {
290  ocs_log_err(ocs, "ocs_mgmt_get %s failed with %d status\n", name, rc);
291  req->status = rc;
292  if (rc == -EBUSY)
293  ocs_log_err(ocs, "Device is busy in other operations");
294 
295  } else if (ocs_textbuf_get_written(&textbuf)) {
296  if (ocs_copy_to_user(req->value, ocs_textbuf_get_buffer(&textbuf), ocs_textbuf_get_written(&textbuf))) {
297  ocs_log_test(ocs, "Error: (%d) ocs_copy_to_user failed\n", __LINE__);
298  }
299  }
300  req->value_length = ocs_textbuf_get_written(&textbuf);
301 
302  ocs_ioctl_postprocess(ocs, (void *)arg, req, sizeof(ocs_ioctl_cmd_get_t));
303 
304  ocs_textbuf_free(ocs, &textbuf);
305 
306  break;
307  }
308 
309  case OCS_IOCTL_CMD_MGMT_SET: {
310  ocs_ioctl_cmd_set_t *req;
311  char name[OCS_MGMT_MAX_NAME];
312  char value[OCS_MGMT_MAX_VALUE];
313 
314  req = ocs_ioctl_preprocess(ocs, (void *)arg, sizeof(*req));
315  if (req == NULL) {
316  ocs_log_test(ocs, "Error: copy from user failed\n");
317  return -EFAULT;
318  }
319 
320  // Copy the name in from user space
321  if (ocs_copy_from_user(name, req->name, OCS_MGMT_MAX_NAME)) {
322  ocs_log_test(ocs, "Error: copy from user failed\n");
323  ocs_ioctl_free(ocs, req, sizeof(*req));
324  return -EFAULT;
325  }
326 
327  // Copy the value in from user space
328  if (ocs_copy_from_user(value, req->value, OCS_MGMT_MAX_VALUE)) {
329  ocs_log_test(ocs, "Error: copy from user failed\n");
330  ocs_ioctl_free(ocs, req, sizeof(*req));
331  return -EFAULT;
332  }
333 
334  req->result = ocs_mgmt_set(ocs, name, value);
335  if (req->result) {
336  ocs_log_err(ocs, "ocs_mgmt_set failed(%d) to set mgmt cmd: %s\n", req->result, name);
337  if (req->result == -EBUSY)
338  ocs_log_err(ocs, "Device is busy in other operations");
339  }
340 
341  if (ocs_ioctl_postprocess(ocs, (void*) arg, req, sizeof(*req))) {
342  ocs_log_test(ocs, "Error: (%d) copy_to_user failed\n", __LINE__);
343  return -EFAULT;
344  }
345 
346  break;
347  }
348 
350  ocs_ioctl_ddump_t *req;
351  ocs_textbuf_t textbuf;
352  int x;
353 
354  req = (ocs_ioctl_ddump_t *)ocs_ioctl_preprocess(ocs, (void *)arg, sizeof(*req));
355  if (req == NULL) {
356  ocs_log_test(ocs, "Error: ocs_copy from user failed\n");
357  return -EFAULT;
358  }
359 
360  switch (req->args.action) {
361  case OCS_IOCTL_DDUMP_GET:
363  uint32_t remaining;
364  uint32_t written;
365  uint32_t idx;
366  int32_t n;
367  ocs_textbuf_t *ptbuf = NULL;
368  uint32_t flags = 0;
369 
370  ocs_log_debug(ocs, "%sdriver dump, max buffer size %d\n",
371  (req->args.action == OCS_IOCTL_DDUMP_GET_SAVED) ? "saved " : "",
372  req->user_buffer_len);
373 
374  if (req->args.action == OCS_IOCTL_DDUMP_GET_SAVED) {
375  if (ocs_textbuf_initialized(&ocs->ddump_saved)) {
376  ptbuf = &ocs->ddump_saved;
377  }
378  } else {
379 
380  if (ocs_textbuf_alloc(ocs, &textbuf, req->user_buffer_len)) {
381  ocs_log_err(ocs, "Error: ocs_textbuf_alloc failed\n");
382  ocs_ioctl_free(ocs, req, sizeof(*req));
383  return -EFAULT;
384  }
385 
386  /* translate IOCTL ddump flags to ddump flags */
388  flags |= OCS_DDUMP_FLAGS_WQES;
389  }
391  flags |= OCS_DDUMP_FLAGS_CQES;
392  }
394  flags |= OCS_DDUMP_FLAGS_MQES;
395  }
397  flags |= OCS_DDUMP_FLAGS_RQES;
398  }
400  flags |= OCS_DDUMP_FLAGS_EQES;
401  }
402 
403  /* Try 3 times to get the dump */
404  for(x=0; x<3; x++) {
405  if (ocs_ddump(ocs, &textbuf, flags, req->args.q_entries) != 0) {
406  ocs_textbuf_reset(&textbuf);
407  } else {
408  /* Success */
409  x = 0;
410  break;
411  }
412  }
413  if (x != 0 ) {
414  /* Retries failed */
415  ocs_log_test(ocs, "ocs_ddump failed\n");
416  } else {
417  ptbuf = &textbuf;
418  }
419  }
420 
421  written = 0;
422  if (ptbuf != NULL) {
423  /* Process each textbuf segment */
424  remaining = req->user_buffer_len;
425  for (idx = 0; remaining; idx++) {
426  n = ocs_textbuf_ext_get_written(ptbuf, idx);
427  if (n < 0) {
428  break;
429  }
430  if ((uint32_t)n >= remaining) {
431  n = (int32_t)remaining;
432  }
433  if (ocs_copy_to_user(req->user_buffer + written,
434  ocs_textbuf_ext_get_buffer(ptbuf, idx), n)) {
435  ocs_log_test(ocs, "Error: (%d) ocs_copy_to_user failed\n", __LINE__);
436  }
437  written += n;
438  remaining -= (uint32_t)n;
439  }
440  }
441  req->bytes_written = written;
442  if (ptbuf == &textbuf) {
443  ocs_textbuf_free(ocs, &textbuf);
444  }
445  break;
446  }
449  break;
450  default:
451  ocs_log_err(ocs, "Error: ocs_textbuf_alloc failed\n");
452  break;
453  }
454 
455  if (ocs_ioctl_postprocess(ocs, (void*) arg, req, sizeof(*req))) {
456  ocs_log_test(ocs, "Error: (%d) ocs_copy_to_user failed\n", __LINE__);
457  return -EFAULT;
458  }
459 
460  break;
461  }
462 
463 
464 
465 #if defined(OCS_ENABLE_ECD_HELPER)
468 
469  req = (ocs_ioctl_ecd_helper_t *)ocs_ioctl_preprocess(ocs, (void *)arg, sizeof(*req));
470  if (req == NULL) {
471  ocs_log_test(ocs, "Error: copy from user failed\n");
472  return -EFAULT;
473  }
474 
475  req->status = ocs_process_ecd_helper(ocs, req);
476 
477  if (ocs_ioctl_postprocess(ocs, (void*) arg, req, sizeof(*req))) {
478  ocs_log_test(ocs, "Error: copy to user failed\n");
479  return -EFAULT;
480  }
481 
482  break;
483  }
484 #endif
485 
486 #if defined(OCS_INCLUDE_WORKLOAD)
487  case OCS_IOCTL_CMD_SCSI_CMD: {
489 
490  cmd = (ocs_ioctl_scsi_cmd_t *)ocs_ioctl_preprocess(ocs, (void *)arg, sizeof(*cmd));
491  if (cmd == NULL) {
492  ocs_log_test(ocs, "Error: OCS_IOCTL_CMD_SCSI_CMD: copy from user space failed\n");
493  return -EFAULT;
494  }
495 
496  rc = ocs_workload_run(ocs, cmd);
497 
498  if (ocs_ioctl_postprocess(ocs, (void*)arg, cmd, sizeof(*cmd))) {
499  ocs_log_test(ocs, "Error: OCS_IOCTL_CMD_SCSI_CMD: copy to user space failed\n");
500  return -EFAULT;
501  }
502 
503  break;
504  }
505 
506 #if defined(OCS_INCLUDE_FC)
509 
510  /* Fetch command */
511  cmd = ocs_ioctl_preprocess(ocs, (void *)arg, sizeof(*cmd));
512 
513  /* Process command */
514  ocs_workload_send_frame(ocs, cmd);
515 
516  /* Free command */
517  if (ocs_ioctl_postprocess(ocs, NULL, cmd, sizeof(*cmd))) {
518  ocs_log_test(ocs, "Error: OCS_IOCTL_CMD_SCSI_CMD: copy to user space failed\n");
519  return -EFAULT;
520  }
521 
522  break;
523  }
524 #endif
525 #endif
526 
527  default:
528  rc = ocs_device_ioctl_xport(ocs, cmd, arg);
529  break;
530  }
531 
532  return rc;
533 }
534 
535 /**
536  * @brief perform requested Elx CoreDump helper function
537  *
538  * The Elx CoreDump facility used for BE3 diagnostics uses the OCS_IOCTL_CMD_ECD_HELPER
539  * ioctl function to execute requested "help" functions
540  *
541  * @param ocs pointer to ocs structure
542  * @param req pointer to helper function request
543  *
544  * @return returns 0 for success, a negative error code value for failure.
545  */
546 
547 #if defined(OCS_ENABLE_ECD_HELPER)
548 static int
549 ocs_process_ecd_helper (ocs_t *ocs, ocs_ioctl_ecd_helper_t *req)
550 {
551  int32_t rc = 0;
552  uint8_t v8;
553  uint16_t v16;
554  uint32_t v32;
555  void *pmem = NULL;
556 
557  /* Check the BAR read/write commands for valid bar */
558  switch(req->cmd) {
565  if (req->bar >= PCI_MAX_BAR) {
566  ocs_log_test(ocs, "Error: bar %d out of range\n", req->bar);
567  return -EFAULT;
568  }
569  if (ocs->ocs_os.reg[req->bar] == NULL) {
570  ocs_log_test(ocs, "Error: bar %d not defined\n", req->bar);
571  return -EFAULT;
572  }
573  pmem = ocs->ocs_os.reg[req->bar] + req->offset;
574  break;
575  default:
576  break;
577  }
578  switch(req->cmd) {
580  rc = pci_read_config_byte(ocs->ocs_os.pdev, req->offset, &v8);
581  if (rc == 0)
582  req->data = v8;
583  break;
585  rc = pci_read_config_word(ocs->ocs_os.pdev, req->offset, &v16);
586  if (rc == 0)
587  req->data = v16;
588  break;
590  rc = pci_read_config_dword(ocs->ocs_os.pdev, req->offset, &v32);
591  if (rc == 0)
592  req->data = v32;
593  break;
595  rc = pci_write_config_byte(ocs->ocs_os.pdev, req->offset, req->data);
596  break;
598  rc = pci_write_config_word(ocs->ocs_os.pdev, req->offset, req->data);
599  break;
601  rc = pci_write_config_dword(ocs->ocs_os.pdev, req->offset, req->data);
602  break;
604  req->data = readb(pmem);
605  break;
607  req->data = readw(pmem);
608  break;
610  req->data = readl(pmem);
611  break;
613  writeb(req->data, pmem);
614  break;
616  writew(req->data, pmem);
617  break;
619  writel(req->data, pmem);
620  break;
621  }
622  return rc;
623 }
624 #endif
#define OCS_IOCTL_CMD_ELXU_MBOX
Definition: ocs_ioctl.h:483
int ocs_ddump(ocs_t *ocs, ocs_textbuf_t *textbuf, uint32_t flags, uint32_t qentries)
Initiate ddump.
Definition: ocs_ddump.c:656
#define OCS_DDUMP_FLAGS_WQES
Definition: ocs_ddump.h:38
int32_t ocs_device_ioctl(ocs_t *ocs, unsigned int cmd, unsigned long arg)
ocs driver ioctl method
Definition: ocs_ioctl.c:57
ocs_ecd_helper_cmd_t cmd
Definition: ocs_ioctl.h:220
uint32_t arg_in_length
Definition: ocs_ioctl.h:358
int ocs_mgmt_get(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf)
Return the value of a management item.
Definition: ocs_mgmt.c:351
int32_t ocs_textbuf_ext_get_written(ocs_textbuf_t *textbuf, uint32_t idx)
Definition: ocs_textbuf.c:84
#define OCS_IOCTL_CMD_MGMT_SET
Definition: ocs_ioctl.h:492
#define OCS_IOCTL_DDUMP_FLAGS_CQES
Definition: ocs_ioctl.h:310
#define OCS_IOCTL_CMD_MGMT_GET
Definition: ocs_ioctl.h:490
ocs_ioctl_ddump_arg_t args
Definition: ocs_ioctl.h:326
int32_t ocs_elxu(ocs_t *ocs, ocs_ioctl_elxu_mbox_t *mcmd)
Definition: ocs_elxu.c:167
int ocs_mgmt_set(ocs_t *ocs, char *name, char *value)
Set the value of a mgmt item.
Definition: ocs_mgmt.c:452
void ocs_info_get_xport_address(ocs_t *ocs, ocs_ioctl_driver_info_t *info)
Retrieve transport port address.
Definition: ocs_ioctl_fc.c:56
#define OCS_IOCTL_DDUMP_FLAGS_RQES
Definition: ocs_ioctl.h:312
int32_t ocs_device_ioctl_xport(ocs_t *ocs, unsigned int cmd, unsigned long arg)
Perform transport specific ioctl operation.
Definition: ocs_ioctl_fc.c:76
int ocs_mgmt_exec(ocs_t *ocs, char *action, void *arg_in, uint32_t arg_in_length, void *arg_out, uint32_t arg_out_length)
Perform a management action.
Definition: ocs_mgmt.c:538
int32_t ocs_textbuf_get_written(ocs_textbuf_t *textbuf)
Definition: ocs_textbuf.c:54
uint8_t * ocs_textbuf_get_buffer(ocs_textbuf_t *textbuf)
Definition: ocs_textbuf.c:42
const char * name
Definition: ocs_ddump.h:54
#define OCS_DDUMP_FLAGS_RQES
Definition: ocs_ddump.h:41
static uint8_t * ocs_find_vpd(uint8_t *vpddata, uint32_t vpddata_length, const char *key)
find a VPD entry
Definition: ocs_vpd.h:123
IOCTL_CMD_IOCTL_ELXU_MBOX ioctl structure.
Definition: ocs_ioctl.h:89
void ocs_textbuf_free(ocs_t *ocs, ocs_textbuf_t *textbuf)
Definition: ocs_textbuf.c:213
#define OCS_IOCTL_CMD_GET_DDUMP
Definition: ocs_ioctl.h:489
#define OCS_IOCTL_CMD_DRIVER_INFO
Definition: ocs_ioctl.h:485
#define OCS_IOCTL_CMD_ECD_HELPER
Definition: ocs_ioctl.h:486
OCS test ioctl.
Definition: ocs_ioctl.h:50
uint8_t * name
Definition: ocs_ioctl.h:356
uint32_t bytes_written
Definition: ocs_ioctl.h:329
#define OCS_DDUMP_FLAGS_EQES
Definition: ocs_ddump.h:42
void ocs_mgmt_get_list(ocs_t *ocs, ocs_textbuf_t *textbuf)
Get a list of options supported by the driver.
Definition: ocs_mgmt.c:277
char string[32]
Definition: ocs_ioctl.h:51
int32_t ocs_clear_saved_ddump(ocs_t *ocs)
Clear saved ddump.
Definition: ocs_ddump.c:937
uint8_t * user_buffer
Definition: ocs_ioctl.h:327
void ocs_mgmt_get_all(ocs_t *ocs, ocs_textbuf_t *textbuf)
Definition: ocs_mgmt.c:632
#define OCS_IOCTL_DDUMP_FLAGS_MQES
Definition: ocs_ioctl.h:311
ocs_hal_rtn_e ocs_hal_get(ocs_hal_t *hal, ocs_hal_property_e prop, uint32_t *value)
Definition: ocs_hal.c:1840
#define OCS_MGMT_MAX_VALUE
Definition: ocs_mgmt.h:45
#define OCS_IOCTL_DDUMP_FLAGS_EQES
Definition: ocs_ioctl.h:313
uint8_t * ocs_textbuf_ext_get_buffer(ocs_textbuf_t *textbuf, uint32_t idx)
Definition: ocs_textbuf.c:66
#define OCS_IOCTL_CMD_MGMT_GET_ALL
Definition: ocs_ioctl.h:491
#define OCS_IOCTL_CMD_MGMT_EXEC
Definition: ocs_ioctl.h:494
OCS_CTL_CMD_GET_DDUMP ioctl structure.
Definition: ocs_ioctl.h:325
#define OCS_MGMT_MAX_NAME
Definition: ocs_mgmt.h:44
#define OCS_IOCTL_CMD_TEST
Definition: ocs_ioctl.h:482
#define SLI4_INTF_REG
SLI_INTF - SLI Interface Definition Register.
Definition: sli4.h:101
#define OCS_IOCTL_CMD_SCSI_CMD
Definition: ocs_ioctl.h:484
DRIVER_INFO ioctl structure.
Definition: ocs_ioctl.h:60
ocs_ddump_action_t action
Definition: ocs_ioctl.h:316
OCS_CTL_CMD_GET_STATUS, OCS_CTL_CMD_GET_CONFIG.
Definition: ocs_ioctl.h:336
OCS_IOCTL_CMD_ECD_HELPER ioctl structure.
Definition: ocs_ioctl.h:219
void ocs_textbuf_reset(ocs_textbuf_t *textbuf)
Definition: ocs_textbuf.c:406
ocs_t * ocs
Definition: ocs_io.c:64
#define OCS_IOCTL_DDUMP_FLAGS_WQES
Definition: ocs_ioctl.h:309
uint32_t user_buffer_len
Definition: ocs_ioctl.h:328
int32_t ocs_textbuf_alloc(ocs_t *ocs, ocs_textbuf_t *textbuf, uint32_t length)
Definition: ocs_textbuf.c:105
void * ocs_hal_get_ptr(ocs_hal_t *hal, ocs_hal_property_e prop)
Definition: ocs_hal.c:2175
uint32_t ocs_textbuf_initialized(ocs_textbuf_t *textbuf)
Definition: ocs_textbuf.c:94
#define OCS_DDUMP_FLAGS_CQES
Definition: ocs_ddump.h:39
uint32_t value_length
Definition: ocs_ioctl.h:345
#define OCS_IOCTL_CMD_SEND_FRAME
Definition: ocs_ioctl.h:498
uint32_t arg_out_length
Definition: ocs_ioctl.h:360
#define OCS_DDUMP_FLAGS_MQES
Definition: ocs_ddump.h:40
#define OCS_IOCTL_CMD_MGMT_LIST
Definition: ocs_ioctl.h:493