Lines Matching full:ocs
41 #include "ocs.h"
50 static int ocs_mgmt_firmware_write(ocs_t *ocs, char *, void *buf, uint32_t buf_len, void*, uint32_t…
51 static int ocs_mgmt_firmware_reset(ocs_t *ocs, char *, void *buf, uint32_t buf_len, void*, uint32_t…
52 static int ocs_mgmt_function_reset(ocs_t *ocs, char *, void *buf, uint32_t buf_len, void*, uint32_t…
55 static int ocs_mgmt_force_assert(ocs_t *ocs, char *, void *buf, uint32_t buf_len, void*, uint32_t);
101 static void get_chip_type(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf);
102 static void get_tgt_rscn_delay(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf);
103 static void get_tgt_rscn_period(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf);
104 static void get_inject_drop_cmd(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf);
105 static void get_inject_free_drop_cmd(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf);
106 static void get_inject_drop_data(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf);
107 static void get_inject_drop_resp(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf);
108 static void get_cmd_err_inject(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf);
109 static void get_cmd_delay_value(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf);
110 static void get_nv_wwpn(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf);
111 static void get_nv_wwnn(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf);
112 static void get_loglevel(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf);
113 static void get_node_abort_cnt(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf);
214 * @param ocs Pointer to the ocs structure.
221 ocs_mgmt_get_list(ocs_t *ocs, ocs_textbuf_t *textbuf) in ocs_mgmt_get_list() argument
227 ocs_mgmt_start_unnumbered_section(textbuf, "ocs"); in ocs_mgmt_get_list()
243 if ((ocs->mgmt_functions) && (ocs->mgmt_functions->get_list_handler)) { in ocs_mgmt_get_list()
244 ocs->mgmt_functions->get_list_handler(textbuf, ocs); in ocs_mgmt_get_list()
247 if ((ocs->tgt_mgmt_functions) && (ocs->tgt_mgmt_functions->get_list_handler)) { in ocs_mgmt_get_list()
248 ocs->tgt_mgmt_functions->get_list_handler(textbuf, &(ocs->tgt_ocs)); in ocs_mgmt_get_list()
252 if (ocs_device_lock_try(ocs) == TRUE) { in ocs_mgmt_get_list()
254 ocs_list_foreach(&ocs->domain_list, domain) { in ocs_mgmt_get_list()
259 ocs_device_unlock(ocs); in ocs_mgmt_get_list()
262 ocs_mgmt_end_unnumbered_section(textbuf, "ocs"); in ocs_mgmt_get_list()
273 * - Checks that the qualifier portion of the name begins with my qualifier (ocs).
285 * @param ocs Pointer to the ocs structure.
293 ocs_mgmt_get(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in ocs_mgmt_get() argument
300 ocs_mgmt_start_unnumbered_section(textbuf, "ocs"); in ocs_mgmt_get()
302 snprintf(qualifier, sizeof(qualifier), "/ocs"); in ocs_mgmt_get()
311 mgmt_table[i].get_handler(ocs, name, textbuf); in ocs_mgmt_get()
312 ocs_mgmt_end_unnumbered_section(textbuf, "ocs"); in ocs_mgmt_get()
318 if ((ocs->mgmt_functions) && (ocs->mgmt_functions->get_handler)) { in ocs_mgmt_get()
319 retval = ocs->mgmt_functions->get_handler(textbuf, qualifier, (char*)name, ocs); in ocs_mgmt_get()
323 if ((ocs->tgt_mgmt_functions) && (ocs->tgt_mgmt_functions->get_handler)) { in ocs_mgmt_get()
324 retval = ocs->tgt_mgmt_functions->get_handler(textbuf, qualifier, in ocs_mgmt_get()
325 (char*)name, &(ocs->tgt_ocs)); in ocs_mgmt_get()
332 ocs_device_lock(ocs); in ocs_mgmt_get()
333 ocs_list_foreach(&ocs->domain_list, domain) { in ocs_mgmt_get()
342 ocs_device_unlock(ocs); in ocs_mgmt_get()
346 ocs_mgmt_end_unnumbered_section(textbuf, "ocs"); in ocs_mgmt_get()
358 * - Checks that the qualifier portion of the name begins with my qualifier (ocs).
368 * @param ocs Pointer to the ocs structure.
376 ocs_mgmt_set(ocs_t *ocs, char *name, char *value) in ocs_mgmt_set() argument
383 snprintf(qualifier, sizeof(qualifier), "/ocs"); in ocs_mgmt_set()
393 return mgmt_table[i].set_handler(ocs, name, value); in ocs_mgmt_set()
398 if ((ocs->mgmt_functions) && (ocs->mgmt_functions->set_handler)) { in ocs_mgmt_set()
399 result = ocs->mgmt_functions->set_handler(qualifier, name, (char *)value, ocs); in ocs_mgmt_set()
403 if ((ocs->tgt_mgmt_functions) && (ocs->tgt_mgmt_functions->set_handler)) { in ocs_mgmt_set()
404 result = ocs->tgt_mgmt_functions->set_handler(qualifier, name, in ocs_mgmt_set()
405 (char *)value, &(ocs->tgt_ocs)); in ocs_mgmt_set()
411 ocs_device_lock(ocs); in ocs_mgmt_set()
412 ocs_list_foreach(&ocs->domain_list, domain) { in ocs_mgmt_set()
420 ocs_device_unlock(ocs); in ocs_mgmt_set()
434 * - Checks that the qualifier portion of the name begins with my qualifier (ocs).
444 * @param ocs Pointer to the ocs structure.
457 ocs_mgmt_exec(ocs_t *ocs, char *action, void *arg_in, in ocs_mgmt_exec() argument
465 snprintf(qualifier, sizeof(qualifier), "/ocs"); in ocs_mgmt_exec()
475 return mgmt_table[i].action_handler(ocs, action, arg_in, arg_in_length, in ocs_mgmt_exec()
483 return ocs_gen_dump(ocs); in ocs_mgmt_exec()
487 return ocs_dump_to_host(ocs, arg_out, arg_out_length); in ocs_mgmt_exec()
490 if ((ocs->mgmt_functions) && (ocs->mgmt_functions->exec_handler)) { in ocs_mgmt_exec()
491 result = ocs->mgmt_functions->exec_handler(qualifier, action, arg_in, arg_in_length, in ocs_mgmt_exec()
492 arg_out, arg_out_length, ocs); in ocs_mgmt_exec()
496 if ((ocs->tgt_mgmt_functions) && (ocs->tgt_mgmt_functions->exec_handler)) { in ocs_mgmt_exec()
497 result = ocs->tgt_mgmt_functions->exec_handler(qualifier, action, in ocs_mgmt_exec()
499 &(ocs->tgt_ocs)); in ocs_mgmt_exec()
505 ocs_device_lock(ocs); in ocs_mgmt_exec()
506 ocs_list_foreach(&ocs->domain_list, domain) { in ocs_mgmt_exec()
515 ocs_device_unlock(ocs); in ocs_mgmt_exec()
523 ocs_mgmt_get_all(ocs_t *ocs, ocs_textbuf_t *textbuf) in ocs_mgmt_get_all() argument
528 ocs_mgmt_start_unnumbered_section(textbuf, "ocs"); in ocs_mgmt_get_all()
532 mgmt_table[i].get_handler(ocs, mgmt_table[i].name, textbuf); in ocs_mgmt_get_all()
540 if ((ocs->mgmt_functions) && (ocs->mgmt_functions->get_all_handler)) { in ocs_mgmt_get_all()
541 ocs->mgmt_functions->get_all_handler(textbuf, ocs); in ocs_mgmt_get_all()
544 if ((ocs->tgt_mgmt_functions) && (ocs->tgt_mgmt_functions->get_all_handler)) { in ocs_mgmt_get_all()
545 ocs->tgt_mgmt_functions->get_all_handler(textbuf, &(ocs->tgt_ocs)); in ocs_mgmt_get_all()
548 ocs_device_lock(ocs); in ocs_mgmt_get_all()
549 ocs_list_foreach(&ocs->domain_list, domain) { in ocs_mgmt_get_all()
554 ocs_device_unlock(ocs); in ocs_mgmt_get_all()
556 ocs_mgmt_end_unnumbered_section(textbuf, "ocs"); in ocs_mgmt_get_all()
560 ocs_mgmt_firmware_reset(ocs_t *ocs, char *name, void *buf, uint32_t buf_len, void *arg_out, uint32_… in ocs_mgmt_firmware_reset() argument
567 ocs_get_bus_dev_func(ocs, &bus, &dev, &func); in ocs_mgmt_firmware_reset()
569 ocs_log_debug(ocs, "Resetting port\n"); in ocs_mgmt_firmware_reset()
570 if (ocs_hw_reset(&ocs->hw, OCS_HW_RESET_FIRMWARE)) { in ocs_mgmt_firmware_reset()
571 ocs_log_test(ocs, "failed to reset port\n"); in ocs_mgmt_firmware_reset()
574 ocs_log_debug(ocs, "successfully reset port\n"); in ocs_mgmt_firmware_reset()
603 ocs_mgmt_function_reset(ocs_t *ocs, char *name, void *buf, uint32_t buf_len, void *arg_out, uint32_… in ocs_mgmt_function_reset() argument
607 ocs_device_detach(ocs); in ocs_mgmt_function_reset()
608 rc = ocs_device_attach(ocs); in ocs_mgmt_function_reset()
614 ocs_mgmt_firmware_write(ocs_t *ocs, char *name, void *buf, uint32_t buf_len, void *arg_out, uint32_… in ocs_mgmt_firmware_write() argument
633 if (ocs_dma_alloc(ocs, &dma, FW_WRITE_BUFSIZE, 4096)) { in ocs_mgmt_firmware_write()
634 ocs_log_err(ocs, "ocs_mgmt_firmware_write: malloc failed"); in ocs_mgmt_firmware_write()
657 ocs_hw_firmware_write(&ocs->hw, &dma, xfer_size, offset, last, ocs_mgmt_fw_write_cb, &result); in ocs_mgmt_firmware_write()
662 ocs_log_err(ocs, "ocs_sem_p failed\n"); in ocs_mgmt_firmware_write()
668 ocs_log_test(ocs, "actual_write_length is %d\n", result.actual_xfer); in ocs_mgmt_firmware_write()
675 ocs_log_test(ocs, "write returned status %d\n", result.status); in ocs_mgmt_firmware_write()
697 ocs_log_test(ocs, "copy to user failed for change_status\n"); in ocs_mgmt_firmware_write()
701 ocs_dma_free(ocs, &dma); in ocs_mgmt_firmware_write()
731 ocs_t *ocs = os; in ocs_mgmt_sfp_cb() local
738 ocs_free(ocs, result, sizeof(ocs_mgmt_sfp_result_t)); in ocs_mgmt_sfp_cb()
751 ocs_mgmt_get_sfp(ocs_t *ocs, uint16_t page, void *buf, uint32_t buf_len) in ocs_mgmt_get_sfp() argument
754 …ocs_mgmt_sfp_result_t *result = ocs_malloc(ocs, sizeof(ocs_mgmt_sfp_result_t), OCS_M_ZERO | OCS_M… in ocs_mgmt_get_sfp()
757 ocs_lock_init(ocs, &(result->cb_lock), "get_sfp"); in ocs_mgmt_get_sfp()
760 ocs_hw_get_sfp(&ocs->hw, page, ocs_mgmt_sfp_cb, result); in ocs_mgmt_get_sfp()
768 ocs_log_err(ocs, "ocs_sem_p failed\n"); in ocs_mgmt_get_sfp()
778 ocs_log_test(ocs, "read_transceiver_data returned status %d\n", in ocs_mgmt_get_sfp()
789 ocs_free(ocs, result, sizeof(ocs_mgmt_sfp_result_t)); in ocs_mgmt_get_sfp()
794 ocs_mgmt_force_assert(ocs_t *ocs, char *name, void *buf, uint32_t buf_len, void *arg_out, uint32_t … in ocs_mgmt_force_assert() argument
800 get_nodes_count(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_nodes_count() argument
802 ocs_xport_t *xport = ocs->xport; in get_nodes_count()
808 get_driver_version(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_driver_version() argument
810 ocs_mgmt_emit_string(textbuf, MGMT_MODE_RD, "driver_version", ocs->driver_version); in get_driver_version()
814 get_desc(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_desc() argument
816 ocs_mgmt_emit_string(textbuf, MGMT_MODE_RD, "desc", ocs->desc); in get_desc()
820 get_fw_rev(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_fw_rev() argument
822 ocs_mgmt_emit_string(textbuf, MGMT_MODE_RD, "fw_rev", ocs_hw_get_ptr(&ocs->hw, OCS_HW_FW_REV)); in get_fw_rev()
826 get_fw_rev2(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_fw_rev2() argument
828 ocs_mgmt_emit_string(textbuf, MGMT_MODE_RD, "fw_rev2", ocs_hw_get_ptr(&ocs->hw, OCS_HW_FW_REV2)); in get_fw_rev2()
832 get_ipl(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_ipl() argument
834 ocs_mgmt_emit_string(textbuf, MGMT_MODE_RD, "ipl", ocs_hw_get_ptr(&ocs->hw, OCS_HW_IPL)); in get_ipl()
838 get_hw_rev1(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_hw_rev1() argument
842 ocs_hw_get(&ocs->hw, OCS_HW_HW_REV1, &value); in get_hw_rev1()
848 get_hw_rev2(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_hw_rev2() argument
852 ocs_hw_get(&ocs->hw, OCS_HW_HW_REV2, &value); in get_hw_rev2()
858 get_hw_rev3(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_hw_rev3() argument
861 ocs_hw_get(&ocs->hw, OCS_HW_HW_REV3, &value); in get_hw_rev3()
867 get_wwnn(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_wwnn() argument
871 wwnn = ocs_hw_get_ptr(&ocs->hw, OCS_HW_WWN_NODE); in get_wwnn()
877 get_wwpn(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_wwpn() argument
881 wwpn = ocs_hw_get_ptr(&ocs->hw, OCS_HW_WWN_PORT); in get_wwpn()
887 get_fcid(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_fcid() argument
890 if (ocs->domain && ocs->domain->attached) { in get_fcid()
892 ocs->domain->sport->fc_id); in get_fcid()
900 get_sn(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_sn() argument
906 pserial = ocs_scsi_get_property_ptr(ocs, OCS_SCSI_SERIALNUMBER); in get_sn()
916 get_pn(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_pn() argument
922 pserial = ocs_scsi_get_property_ptr(ocs, OCS_SCSI_PARTNUMBER); in get_pn()
929 ocs_mgmt_emit_string(textbuf, MGMT_MODE_RD, "pn", ocs->model); in get_pn()
934 get_sli4_intf_reg(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_sli4_intf_reg() argument
938 ocs_config_read32(ocs, SLI4_INTF_REG)); in get_sli4_intf_reg()
942 get_phy_port_num(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_phy_port_num() argument
946 phy_port = ocs_scsi_get_property_ptr(ocs, OCS_SCSI_PORTNUM); in get_phy_port_num()
954 get_asic_id(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_asic_id() argument
958 ocs_config_read32(ocs, SLI4_ASIC_ID_REG)); in get_asic_id()
962 get_chip_type(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_chip_type() argument
972 family = (ocs_config_read32(ocs, SLI4_INTF_REG) & 0x00000f00) >> 8; in get_chip_type()
973 asic_id = ocs_config_read32(ocs, SLI4_ASIC_ID_REG); in get_chip_type()
977 rev_id = ocs_config_read32(ocs, SLI4_PCI_CLASS_REVISION) & 0xff; in get_chip_type()
1058 get_pci_vendor(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_pci_vendor() argument
1061 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "pci_vendor", "0x%04x", ocs->pci_vendor); in get_pci_vendor()
1065 get_pci_device(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_pci_device() argument
1068 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "pci_device", "0x%04x", ocs->pci_device); in get_pci_device()
1072 get_pci_subsystem_vendor(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_pci_subsystem_vendor() argument
1075 …ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "pci_subsystem_vendor", "0x%04x", ocs->pci_subsystem_vend… in get_pci_subsystem_vendor()
1079 get_pci_subsystem_device(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_pci_subsystem_device() argument
1082 …ocs_mgmt_emit_int(textbuf, MGMT_MODE_RD, "pci_subsystem_device", "0x%04x", ocs->pci_subsystem_devi… in get_pci_subsystem_device()
1086 get_tgt_rscn_delay(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_tgt_rscn_delay() argument
1088 …ocs_mgmt_emit_int(textbuf, MGMT_MODE_RW, "tgt_rscn_delay", "%ld", (unsigned long)ocs->tgt_rscn_del… in get_tgt_rscn_delay()
1092 get_tgt_rscn_period(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_tgt_rscn_period() argument
1094 …ocs_mgmt_emit_int(textbuf, MGMT_MODE_RW, "tgt_rscn_period", "%ld", (unsigned long)ocs->tgt_rscn_pe… in get_tgt_rscn_period()
1098 get_inject_drop_cmd(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_inject_drop_cmd() argument
1101 (ocs->err_injection == INJECT_DROP_CMD ? 1:0)); in get_inject_drop_cmd()
1105 get_inject_free_drop_cmd(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_inject_free_drop_cmd() argument
1108 (ocs->err_injection == INJECT_FREE_DROPPED ? 1:0)); in get_inject_free_drop_cmd()
1112 get_inject_drop_data(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_inject_drop_data() argument
1115 (ocs->err_injection == INJECT_DROP_DATA ? 1:0)); in get_inject_drop_data()
1119 get_inject_drop_resp(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_inject_drop_resp() argument
1122 (ocs->err_injection == INJECT_DROP_RESP ? 1:0)); in get_inject_drop_resp()
1126 get_cmd_err_inject(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_cmd_err_inject() argument
1128 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RW, "cmd_err_inject", "0x%02x", ocs->cmd_err_inject); in get_cmd_err_inject()
1132 get_cmd_delay_value(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_cmd_delay_value() argument
1134 …ocs_mgmt_emit_int(textbuf, MGMT_MODE_RW, "cmd_delay_value", "%ld", (unsigned long)ocs->delay_value… in get_cmd_delay_value()
1138 get_businfo(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_businfo() argument
1140 ocs_mgmt_emit_string(textbuf, MGMT_MODE_RD, "businfo", ocs->businfo); in get_businfo()
1144 get_sfp_a0(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_sfp_a0() argument
1151 page_data = ocs_malloc(ocs, SFP_PAGE_SIZE, OCS_M_ZERO | OCS_M_NOWAIT); in get_sfp_a0()
1156 buf = ocs_malloc(ocs, (SFP_PAGE_SIZE * 3) + 1, OCS_M_ZERO | OCS_M_NOWAIT); in get_sfp_a0()
1158 ocs_free(ocs, page_data, SFP_PAGE_SIZE); in get_sfp_a0()
1162 bytes_read = ocs_mgmt_get_sfp(ocs, 0xa0, page_data, SFP_PAGE_SIZE); in get_sfp_a0()
1182 ocs_free(ocs, page_data, SFP_PAGE_SIZE); in get_sfp_a0()
1183 ocs_free(ocs, buf, (3 * SFP_PAGE_SIZE) + 1); in get_sfp_a0()
1187 get_sfp_a2(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_sfp_a2() argument
1194 page_data = ocs_malloc(ocs, SFP_PAGE_SIZE, OCS_M_ZERO | OCS_M_NOWAIT); in get_sfp_a2()
1199 buf = ocs_malloc(ocs, (SFP_PAGE_SIZE * 3) + 1, OCS_M_ZERO | OCS_M_NOWAIT); in get_sfp_a2()
1201 ocs_free(ocs, page_data, SFP_PAGE_SIZE); in get_sfp_a2()
1205 bytes_read = ocs_mgmt_get_sfp(ocs, 0xa2, page_data, SFP_PAGE_SIZE); in get_sfp_a2()
1225 ocs_free(ocs, page_data, SFP_PAGE_SIZE); in get_sfp_a2()
1226 ocs_free(ocs, buf, (3 * SFP_PAGE_SIZE) + 1); in get_sfp_a2()
1230 get_debug_mq_dump(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_debug_mq_dump() argument
1238 get_debug_cq_dump(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_debug_cq_dump() argument
1246 get_debug_wq_dump(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_debug_wq_dump() argument
1253 get_debug_eq_dump(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_debug_eq_dump() argument
1260 get_logmask(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_logmask() argument
1263 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RW, "logmask", "0x%02x", ocs->logmask); in get_logmask()
1268 get_loglevel(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_loglevel() argument
1276 get_current_speed(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_current_speed() argument
1280 ocs_hw_get(&(ocs->hw), OCS_HW_LINK_SPEED, &value); in get_current_speed()
1286 get_configured_speed(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_configured_speed() argument
1290 ocs_hw_get(&(ocs->hw), OCS_HW_LINK_CONFIG_SPEED, &value); in get_configured_speed()
1300 get_current_topology(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_current_topology() argument
1304 ocs_hw_get(&(ocs->hw), OCS_HW_TOPOLOGY, &value); in get_current_topology()
1310 get_configured_topology(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_configured_topology() argument
1314 ocs_hw_get(&(ocs->hw), OCS_HW_CONFIG_TOPOLOGY, &value); in get_configured_topology()
1320 get_current_link_state(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_current_link_state() argument
1324 if (ocs_xport_status(ocs->xport, OCS_XPORT_PORT_STATUS, &value) == 0) { in get_current_link_state()
1334 get_configured_link_state(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_configured_link_state() argument
1338 if (ocs_xport_status(ocs->xport, OCS_XPORT_CONFIG_PORT_STATUS, &value) == 0) { in get_configured_link_state()
1420 * @param ocs Pointer to the ocs structure.
1427 get_linkcfg(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_linkcfg() argument
1432 ocs_hw_get(&ocs->hw, OCS_HW_LINKCFG, &value); in get_linkcfg()
1441 * @param ocs Pointer to the ocs structure.
1448 get_req_wwnn(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_req_wwnn() argument
1450 ocs_xport_t *xport = ocs->xport; in get_req_wwnn()
1458 * @param ocs Pointer to the ocs structure.
1465 get_req_wwpn(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_req_wwpn() argument
1467 ocs_xport_t *xport = ocs->xport; in get_req_wwpn()
1475 * @param ocs Pointer to the ocs structure.
1482 get_nodedb_mask(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_nodedb_mask() argument
1484 ocs_mgmt_emit_int(textbuf, MGMT_MODE_RW, "nodedb_mask", "0x%08x", ocs->nodedb_mask); in get_nodedb_mask()
1490 * @param ocs Pointer to the ocs structure.
1498 set_req_wwnn(ocs_t *ocs, char *name, char *value) in set_req_wwnn() argument
1507 ocs_log_test(ocs, "Invalid WWNN: %s\n", value); in set_req_wwnn()
1511 rc = ocs_xport_control(ocs->xport, OCS_XPORT_WWNN_SET, wwnn); in set_req_wwnn()
1514 ocs_log_test(ocs, "OCS_XPORT_WWNN_SET failed: %d\n", rc); in set_req_wwnn()
1518 rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE); in set_req_wwnn()
1520 ocs_log_test(ocs, "port offline failed : %d\n", rc); in set_req_wwnn()
1523 rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_ONLINE); in set_req_wwnn()
1525 ocs_log_test(ocs, "port online failed : %d\n", rc); in set_req_wwnn()
1534 * @param ocs Pointer to the ocs structure.
1542 set_req_wwpn(ocs_t *ocs, char *name, char *value) in set_req_wwpn() argument
1551 ocs_log_test(ocs, "Invalid WWPN: %s\n", value); in set_req_wwpn()
1555 rc = ocs_xport_control(ocs->xport, OCS_XPORT_WWPN_SET, wwpn); in set_req_wwpn()
1558 ocs_log_test(ocs, "OCS_XPORT_WWPN_SET failed: %d\n", rc); in set_req_wwpn()
1562 rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE); in set_req_wwpn()
1564 ocs_log_test(ocs, "port offline failed : %d\n", rc); in set_req_wwpn()
1567 rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_ONLINE); in set_req_wwpn()
1569 ocs_log_test(ocs, "port online failed : %d\n", rc); in set_req_wwpn()
1578 * @param ocs Pointer to the ocs structure.
1585 set_nodedb_mask(ocs_t *ocs, char *name, char *value) in set_nodedb_mask() argument
1587 ocs->nodedb_mask = ocs_strtoul(value, 0, 0); in set_nodedb_mask()
1594 * @param ocs Pointer to the ocs structure.
1601 set_linkcfg(ocs_t *ocs, char *name, char *value) in set_linkcfg() argument
1613 status = ocs_hw_port_control(&ocs->hw, OCS_HW_PORT_SET_LINK_CONFIG, in set_linkcfg()
1616 ocs_log_test(ocs, "ocs_hw_set_linkcfg failed\n"); in set_linkcfg()
1621 ocs_log_err(ocs, "ocs_sem_p failed\n"); in set_linkcfg()
1626 ocs_log_test(ocs, "failed to set linkcfg from HW status=%d\n", in set_linkcfg()
1653 set_debug_mq_dump(ocs_t *ocs, char *name, char *value) in set_debug_mq_dump() argument
1671 set_debug_cq_dump(ocs_t *ocs, char *name, char *value) in set_debug_cq_dump() argument
1689 set_debug_wq_dump(ocs_t *ocs, char *name, char *value) in set_debug_wq_dump() argument
1707 set_debug_eq_dump(ocs_t *ocs, char *name, char *value) in set_debug_eq_dump() argument
1725 set_logmask(ocs_t *ocs, char *name, char *value) in set_logmask() argument
1728 ocs->logmask = ocs_strtoul(value, NULL, 0); in set_logmask()
1734 set_loglevel(ocs_t *ocs, char *name, char *value) in set_loglevel() argument
1743 set_configured_speed(ocs_t *ocs, char *name, char *value) in set_configured_speed() argument
1754 ocs_log_test(ocs, "unsupported speed %d\n", spd); in set_configured_speed()
1758 ocs_log_debug(ocs, "Taking port offline\n"); in set_configured_speed()
1759 xport_rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE); in set_configured_speed()
1761 ocs_log_test(ocs, "Port offline failed\n"); in set_configured_speed()
1764 ocs_log_debug(ocs, "Setting port to speed %d\n", spd); in set_configured_speed()
1765 hw_rc = ocs_hw_set(&ocs->hw, OCS_HW_LINK_SPEED, spd); in set_configured_speed()
1767 ocs_log_test(ocs, "Speed set failed\n"); in set_configured_speed()
1774 ocs_log_debug(ocs, "Bringing port online\n"); in set_configured_speed()
1775 xport_rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_ONLINE); in set_configured_speed()
1785 set_configured_topology(ocs_t *ocs, char *name, char *value) in set_configured_topology() argument
1797 ocs_log_debug(ocs, "Taking port offline\n"); in set_configured_topology()
1798 xport_rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE); in set_configured_topology()
1800 ocs_log_test(ocs, "Port offline failed\n"); in set_configured_topology()
1803 ocs_log_debug(ocs, "Setting port to topology %d\n", topo); in set_configured_topology()
1804 hw_rc = ocs_hw_set(&ocs->hw, OCS_HW_TOPOLOGY, topo); in set_configured_topology()
1806 ocs_log_test(ocs, "Topology set failed\n"); in set_configured_topology()
1810 hw_rc = ocs_hw_set_persistent_topology(&ocs->hw, topo, OCS_CMD_NOWAIT); in set_configured_topology()
1812 ocs_log_err(ocs, "Set persistent topology feature failed: %d\n", hw_rc); in set_configured_topology()
1818 ocs_log_debug(ocs, "Bringing port online\n"); in set_configured_topology()
1819 xport_rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_ONLINE); in set_configured_topology()
1829 set_configured_link_state(ocs_t *ocs, char *name, char *value) in set_configured_link_state() argument
1835 ocs_log_debug(ocs, "Setting port to %s\n", value); in set_configured_link_state()
1836 xport_rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE); in set_configured_link_state()
1838 ocs_log_test(ocs, "Setting port to offline failed\n"); in set_configured_link_state()
1842 ocs_log_debug(ocs, "Setting port to %s\n", value); in set_configured_link_state()
1843 xport_rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_ONLINE); in set_configured_link_state()
1845 ocs_log_test(ocs, "Setting port to online failed\n"); in set_configured_link_state()
1849 ocs_log_test(ocs, "Unsupported link state \"%s\"\n", value); in set_configured_link_state()
1876 get_port_protocol(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_port_protocol() argument
1885 ocs_get_bus_dev_func(ocs, &bus, &dev, &func); in get_port_protocol()
1887 …if(ocs_hw_get_port_protocol(&ocs->hw, func, ocs_mgmt_get_port_protocol_cb, &result) == OCS_HW_RTN_… in get_port_protocol()
1890 ocs_log_err(ocs, "ocs_sem_p failed\n"); in get_port_protocol()
1908 ocs_log_test(ocs, "getting port profile status 0x%x\n", result.status); in get_port_protocol()
1937 * @param ocs Pointer to the ocs structure.
1944 set_port_protocol(ocs_t *ocs, char *name, char *value) in set_port_protocol() argument
1953 ocs_get_bus_dev_func(ocs, &bus, &dev, &func); in set_port_protocol()
1967 rc = ocs_hw_set_port_protocol(&ocs->hw, new_protocol, func, in set_port_protocol()
1972 ocs_log_err(ocs, "ocs_sem_p failed\n"); in set_port_protocol()
1980 ocs_log_test(ocs, "setting active profile status 0x%x\n", in set_port_protocol()
2013 * @param ocs Pointer to the ocs structure.
2020 get_profile_list(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_profile_list() argument
2026 …if(ocs_hw_get_profile_list(&ocs->hw, ocs_mgmt_get_profile_list_cb, &result) == OCS_HW_RTN_SUCCESS)… in get_profile_list()
2029 ocs_log_err(ocs, "ocs_sem_p failed\n"); in get_profile_list()
2040 result_buf = ocs_malloc(ocs, BUFFER_SIZE, OCS_M_ZERO); in get_profile_list()
2054 ocs_free(ocs, result_buf, BUFFER_SIZE); in get_profile_list()
2055 ocs_free(ocs, result.list, sizeof(ocs_hw_profile_list_t)); in get_profile_list()
2057 ocs_log_test(ocs, "getting profile list status 0x%x\n", result.status); in get_profile_list()
2089 * @param ocs Pointer to the ocs structure.
2096 get_active_profile(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_active_profile() argument
2103 …if(ocs_hw_get_active_profile(&ocs->hw, ocs_mgmt_get_active_profile_cb, &result) == OCS_HW_RTN_SUCC… in get_active_profile()
2106 ocs_log_err(ocs, "ocs_sem_p failed\n"); in get_active_profile()
2113 ocs_log_test(ocs, "getting active profile status 0x%x\n", result.status); in get_active_profile()
2141 * @param ocs Pointer to the ocs structure.
2148 set_active_profile(ocs_t *ocs, char *name, char *value) in set_active_profile() argument
2158 rc = ocs_hw_set_active_profile(&ocs->hw, ocs_mgmt_set_active_profile_cb, new_profile, &result); in set_active_profile()
2162 ocs_log_err(ocs, "ocs_sem_p failed\n"); in set_active_profile()
2170 ocs_log_test(ocs, "setting active profile status 0x%x\n", result.status); in set_active_profile()
2206 * @param ocs Pointer to the ocs structure.
2213 get_nv_wwpn(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_nv_wwpn() argument
2220 if(ocs_hw_get_nvparms(&ocs->hw, ocs_mgmt_get_nvparms_cb, &result) == OCS_HW_RTN_SUCCESS) { in get_nv_wwpn()
2223 ocs_log_err(ocs, "ocs_sem_p failed\n"); in get_nv_wwpn()
2234 ocs_log_test(ocs, "getting wwpn status 0x%x\n", result.status); in get_nv_wwpn()
2244 * @param ocs Pointer to the ocs structure.
2251 get_nv_wwnn(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_nv_wwnn() argument
2258 if(ocs_hw_get_nvparms(&ocs->hw, ocs_mgmt_get_nvparms_cb, &result) == OCS_HW_RTN_SUCCESS) { in get_nv_wwnn()
2261 ocs_log_err(ocs, "ocs_sem_p failed\n"); in get_nv_wwnn()
2272 ocs_log_test(ocs, "getting wwnn status 0x%x\n", result.status); in get_nv_wwnn()
2281 * @param ocs Pointer to the ocs structure.
2288 get_node_abort_cnt(ocs_t *ocs, char *name, ocs_textbuf_t *textbuf) in get_node_abort_cnt() argument
2295 if (ocs_device_lock_try(ocs) != TRUE) { in get_node_abort_cnt()
2301 ocs_list_foreach(&ocs->domain_list, domain) { in get_node_abort_cnt()
2304 ocs_device_unlock(ocs); in get_node_abort_cnt()
2313 ocs_device_unlock(ocs); in get_node_abort_cnt()
2328 ocs_device_unlock(ocs); in get_node_abort_cnt()
2353 * @param ocs Pointer to the ocs structure.
2360 set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) in set_nv_wwn() argument
2377 rc = ocs_hw_get_nvparms(&ocs->hw, ocs_mgmt_get_nvparms_cb, &result); in set_nv_wwn()
2382 ocs_log_err(ocs, "ocs_sem_p failed\n"); in set_nv_wwn()
2386 ocs_log_test(ocs, "getting nvparms status 0x%x\n", result.status); in set_nv_wwn()
2411 ocs_log_test(ocs, "can't parse WWPN %s\n", wwpn_p); in set_nv_wwn()
2422 ocs_log_test(ocs, "can't parse WWNN %s\n", wwnn_p); in set_nv_wwn()
2442 rc = ocs_hw_set_nvparms(&ocs->hw, ocs_mgmt_set_nvparms_cb, new_wwpn, in set_nv_wwn()
2448 ocs_log_err(ocs, "ocs_sem_p failed\n"); in set_nv_wwn()
2452 ocs_log_test(ocs, "setting wwn status 0x%x\n", result.status); in set_nv_wwn()
2461 set_tgt_rscn_delay(ocs_t *ocs, char *name, char *value) in set_tgt_rscn_delay() argument
2463 ocs->tgt_rscn_delay_msec = ocs_strtoul(value, NULL, 0) * 1000; in set_tgt_rscn_delay()
2464 ocs_log_debug(ocs, "mgmt set: %s %s\n", name, value); in set_tgt_rscn_delay()
2469 set_tgt_rscn_period(ocs_t *ocs, char *name, char *value) in set_tgt_rscn_period() argument
2471 ocs->tgt_rscn_period_msec = ocs_strtoul(value, NULL, 0) * 1000; in set_tgt_rscn_period()
2472 ocs_log_debug(ocs, "mgmt set: %s %s\n", name, value); in set_tgt_rscn_period()
2477 set_inject_drop_cmd(ocs_t *ocs, char *name, char *value) in set_inject_drop_cmd() argument
2479 ocs->err_injection = (ocs_strtoul(value, NULL, 0) == 0 ? NO_ERR_INJECT : INJECT_DROP_CMD); in set_inject_drop_cmd()
2480 ocs_log_debug(ocs, "mgmt set: %s %s\n", name, value); in set_inject_drop_cmd()
2485 set_inject_free_drop_cmd(ocs_t *ocs, char *name, char *value) in set_inject_free_drop_cmd() argument
2487 ocs->err_injection = (ocs_strtoul(value, NULL, 0) == 0 ? NO_ERR_INJECT : INJECT_FREE_DROPPED); in set_inject_free_drop_cmd()
2488 ocs_log_debug(ocs, "mgmt set: %s %s\n", name, value); in set_inject_free_drop_cmd()
2493 set_inject_drop_data(ocs_t *ocs, char *name, char *value) in set_inject_drop_data() argument
2495 ocs->err_injection = (ocs_strtoul(value, NULL, 0) == 0 ? NO_ERR_INJECT : INJECT_DROP_DATA); in set_inject_drop_data()
2496 ocs_log_debug(ocs, "mgmt set: %s %s\n", name, value); in set_inject_drop_data()
2501 set_inject_drop_resp(ocs_t *ocs, char *name, char *value) in set_inject_drop_resp() argument
2503 ocs->err_injection = (ocs_strtoul(value, NULL, 0) == 0 ? NO_ERR_INJECT : INJECT_DROP_RESP); in set_inject_drop_resp()
2504 ocs_log_debug(ocs, "mgmt set: %s %s\n", name, value); in set_inject_drop_resp()
2509 set_cmd_err_inject(ocs_t *ocs, char *name, char *value) in set_cmd_err_inject() argument
2511 ocs->cmd_err_inject = ocs_strtoul(value, NULL, 0); in set_cmd_err_inject()
2512 ocs_log_debug(ocs, "mgmt set: %s %s\n", name, value); in set_cmd_err_inject()
2517 set_cmd_delay_value(ocs_t *ocs, char *name, char *value) in set_cmd_delay_value() argument
2519 ocs->delay_value_msec = ocs_strtoul(value, NULL, 0); in set_cmd_delay_value()
2520 ocs->err_injection = (ocs->delay_value_msec == 0 ? NO_ERR_INJECT : INJECT_DELAY_CMD); in set_cmd_delay_value()
2521 ocs_log_debug(ocs, "mgmt set: %s %s\n", name, value); in set_cmd_delay_value()