Lines Matching refs:p
121 ipmi_firewall_parse_args(int argc, char ** argv, struct ipmi_function_params * p) in ipmi_firewall_parse_args() argument
126 if (!p) { in ipmi_firewall_parse_args()
137 p->channel = channel_tmp; in ipmi_firewall_parse_args()
141 if (str2int(argv[i], &(p->lun)) != 0) { in ipmi_firewall_parse_args()
148 p->force = 1; in ipmi_firewall_parse_args()
151 if (str2int(argv[i], &(p->netfn)) != 0) { in ipmi_firewall_parse_args()
158 if (str2int(argv[i], &(p->command)) != 0) { in ipmi_firewall_parse_args()
165 if (str2int(argv[i], &(p->subfn)) != 0) { in ipmi_firewall_parse_args()
175 if (p->subfn >= MAX_SUBFN) { in ipmi_firewall_parse_args()
179 if (p->command >= MAX_COMMAND) { in ipmi_firewall_parse_args()
183 if (p->netfn >= MAX_NETFN) { in ipmi_firewall_parse_args()
187 if (p->lun >= MAX_LUN) { in ipmi_firewall_parse_args()
191 if (p->netfn >= 0 && p->lun < 0) { in ipmi_firewall_parse_args()
195 if (p->command >= 0 && p->netfn < 0) { in ipmi_firewall_parse_args()
199 if (p->subfn >= 0 && p->command < 0) { in ipmi_firewall_parse_args()
270 struct ipmi_function_params * p, struct lun_netfn_support * lnfn) in _get_command_support() argument
277 if (!p || !lnfn) { in _get_command_support()
285 rqdata[0] = (unsigned char) p->channel; in _get_command_support()
286 rqdata[1] = p->netfn; in _get_command_support()
287 rqdata[2] = p->lun; in _get_command_support()
293 lprintf(LOG_ERR, "Get Command Support (LUN=%d, NetFn=%d, op=0) command failed", p->lun, p->netfn); in _get_command_support()
298 p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals)); in _get_command_support()
312 rqdata[0] = (unsigned char) p->channel; in _get_command_support()
313 rqdata[1] = 0x40 | p->netfn; in _get_command_support()
314 rqdata[2] = p->lun; in _get_command_support()
320 lprintf(LOG_ERR, "Get Command Support (LUN=%d, NetFn=%d, op=1) command failed", p->lun, p->netfn); in _get_command_support()
325 p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals)); in _get_command_support()
349 struct ipmi_function_params * p, struct lun_netfn_support * lnfn) in _get_command_configurable() argument
356 if (!p || !lnfn) { in _get_command_configurable()
364 rqdata[0] = (unsigned char) p->channel; in _get_command_configurable()
365 rqdata[1] = p->netfn; in _get_command_configurable()
366 rqdata[2] = p->lun; in _get_command_configurable()
372 …lprintf(LOG_ERR, "Get Configurable Command (LUN=%d, NetFn=%d, op=0) command failed", p->lun, p->ne… in _get_command_configurable()
377 p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals)); in _get_command_configurable()
391 rqdata[0] = (unsigned char) p->channel; in _get_command_configurable()
392 rqdata[1] = 0x40 | p->netfn; in _get_command_configurable()
393 rqdata[2] = p->lun; in _get_command_configurable()
399 …lprintf(LOG_ERR, "Get Configurable Command (LUN=%d, NetFn=%d, op=1) command failed", p->lun, p->ne… in _get_command_configurable()
404 p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals)); in _get_command_configurable()
428 struct ipmi_function_params * p, struct lun_netfn_support * lnfn) in _get_command_enables() argument
435 if (!p || !lnfn) { in _get_command_enables()
443 rqdata[0] = (unsigned char) p->channel; in _get_command_enables()
444 rqdata[1] = p->netfn; in _get_command_enables()
445 rqdata[2] = p->lun; in _get_command_enables()
451 lprintf(LOG_ERR, "Get Command Enables (LUN=%d, NetFn=%d, op=0) command failed", p->lun, p->netfn); in _get_command_enables()
456 p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals)); in _get_command_enables()
470 rqdata[0] = (unsigned char) p->channel; in _get_command_enables()
471 rqdata[1] = 0x40 | p->netfn; in _get_command_enables()
472 rqdata[2] = p->lun; in _get_command_enables()
478 lprintf(LOG_ERR, "Get Command Enables (LUN=%d, NetFn=%d, op=1) command failed", p->lun, p->netfn); in _get_command_enables()
483 p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals)); in _get_command_enables()
510 struct ipmi_function_params * p, struct lun_netfn_support * lnfn, in _set_command_enables() argument
518 if (!p || !lnfn) { in _set_command_enables()
553 rqdata[0] = (unsigned char) p->channel; in _set_command_enables()
554 rqdata[1] = p->netfn; in _set_command_enables()
555 rqdata[2] = p->lun; in _set_command_enables()
562 lprintf(LOG_ERR, "Set Command Enables (LUN=%d, NetFn=%d, op=0) command failed", p->lun, p->netfn); in _set_command_enables()
567 p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals)); in _set_command_enables()
574 rqdata[0] = (unsigned char) p->channel; in _set_command_enables()
575 rqdata[1] = 0x40 | p->netfn; in _set_command_enables()
576 rqdata[2] = p->lun; in _set_command_enables()
583 lprintf(LOG_ERR, "Set Command Enables (LUN=%d, NetFn=%d, op=1) command failed", p->lun, p->netfn); in _set_command_enables()
588 p->lun, p->netfn, val2str(rsp->ccode, completion_code_vals)); in _set_command_enables()
606 struct ipmi_function_params * p, struct command_support * cmd) in _get_subfn_support() argument
612 if (!p || !cmd) { in _get_subfn_support()
620 rqdata[0] = (unsigned char) p->channel; in _get_subfn_support()
621 rqdata[1] = p->netfn; in _get_subfn_support()
622 rqdata[2] = p->lun; in _get_subfn_support()
623 rqdata[3] = p->command; in _get_subfn_support()
629 …Sub-function Support (LUN=%d, NetFn=%d, command=%d) command failed", p->lun, p->netfn, p->command); in _get_subfn_support()
634 p->lun, p->netfn, p->command, val2str(rsp->ccode, completion_code_vals)); in _get_subfn_support()
653 struct ipmi_function_params * p, struct command_support * cmd) in _get_subfn_configurable() argument
659 if (!p || !cmd) { in _get_subfn_configurable()
667 rqdata[0] = (unsigned char) p->channel; in _get_subfn_configurable()
668 rqdata[1] = p->netfn; in _get_subfn_configurable()
669 rqdata[2] = p->lun; in _get_subfn_configurable()
670 rqdata[3] = p->command; in _get_subfn_configurable()
676 …Command Sub-function (LUN=%d, NetFn=%d, command=%d) command failed", p->lun, p->netfn, p->command); in _get_subfn_configurable()
681 p->lun, p->netfn, p->command, val2str(rsp->ccode, completion_code_vals)); in _get_subfn_configurable()
700 struct ipmi_function_params * p, struct command_support * cmd) in _get_subfn_enables() argument
706 if (!p || !cmd) { in _get_subfn_enables()
714 rqdata[0] = (unsigned char) p->channel; in _get_subfn_enables()
715 rqdata[1] = p->netfn; in _get_subfn_enables()
716 rqdata[2] = p->lun; in _get_subfn_enables()
717 rqdata[3] = p->command; in _get_subfn_enables()
723 …Sub-function Enables (LUN=%d, NetFn=%d, command=%d) command failed", p->lun, p->netfn, p->command); in _get_subfn_enables()
728 p->lun, p->netfn, p->command, val2str(rsp->ccode, completion_code_vals)); in _get_subfn_enables()
748 struct ipmi_function_params * p, struct command_support * cmd, in _set_subfn_enables() argument
756 if (!p || !cmd) { in _set_subfn_enables()
781 rqdata[0] = (unsigned char) p->channel; in _set_subfn_enables()
782 rqdata[1] = p->netfn; in _set_subfn_enables()
783 rqdata[2] = p->lun; in _set_subfn_enables()
784 rqdata[3] = p->command; in _set_subfn_enables()
791 …Sub-function Enables (LUN=%d, NetFn=%d, command=%d) command failed", p->lun, p->netfn, p->command); in _set_subfn_enables()
796 p->lun, p->netfn, p->command, val2str(rsp->ccode, completion_code_vals)); in _set_subfn_enables()
813 static int _gather_info(struct ipmi_intf * intf, struct ipmi_function_params * p, struct bmc_fn_sup… in _gather_info() argument
818 ret = _get_netfn_support(intf, p->channel, lun, netfn); in _gather_info()
821 if (p->lun >= 0 && p->lun != l) in _gather_info()
833 if (p->netfn >= 0) { in _gather_info()
834 if (!((p->lun < 0 || bmc->lun[p->lun].support) && in _gather_info()
835 (p->netfn < 0 || bmc->lun[p->lun].netfn[p->netfn>>1].support))) { in _gather_info()
836 lprintf(LOG_ERR, "LUN or LUN/NetFn pair %d,%d not supported", p->lun, p->netfn); in _gather_info()
839 ret = _get_command_support(intf, p, &(bmc->lun[p->lun].netfn[p->netfn>>1])); in _gather_info()
840 ret |= _get_command_configurable(intf, p, &(bmc->lun[p->lun].netfn[p->netfn>>1])); in _gather_info()
841 ret |= _get_command_enables(intf, p, &(bmc->lun[p->lun].netfn[p->netfn>>1])); in _gather_info()
842 if (!ret && p->command >= 0) { in _gather_info()
843 ret = _get_subfn_support(intf, p, in _gather_info()
844 &(bmc->lun[p->lun].netfn[p->netfn>>1].command[p->command])); in _gather_info()
845 ret |= _get_subfn_configurable(intf, p, in _gather_info()
846 &(bmc->lun[p->lun].netfn[p->netfn>>1].command[p->command])); in _gather_info()
847 ret |= _get_subfn_enables(intf, p, in _gather_info()
848 &(bmc->lun[p->lun].netfn[p->netfn>>1].command[p->command])); in _gather_info()
851 else if (p->lun >= 0) { in _gather_info()
852 l = p->lun; in _gather_info()
855 p->netfn = n*2; in _gather_info()
857 ret = _get_command_support(intf, p, &(bmc->lun[l].netfn[n])); in _gather_info()
858 ret |= _get_command_configurable(intf, p, &(bmc->lun[l].netfn[n])); in _gather_info()
859 ret |= _get_command_enables(intf, p, &(bmc->lun[l].netfn[n])); in _gather_info()
865 p->netfn = -1; in _gather_info()
868 p->lun = l; in _gather_info()
871 p->netfn = n*2; in _gather_info()
873 ret = _get_command_support(intf, p, &(bmc->lun[l].netfn[n])); in _gather_info()
874 ret |= _get_command_configurable(intf, p, &(bmc->lun[l].netfn[n])); in _gather_info()
875 ret |= _get_command_enables(intf, p, &(bmc->lun[l].netfn[n])); in _gather_info()
882 p->lun = -1; in _gather_info()
883 p->netfn = -1; in _gather_info()
902 struct ipmi_function_params p = {0xe, -1, -1, -1, -1}; in ipmi_firewall_info() local
906 if ((argc > 0 && strncmp(argv[0], "help", 4) == 0) || ipmi_firewall_parse_args(argc, argv, &p) < 0) in ipmi_firewall_info()
918 ret = _gather_info(intf, &p, bmc_fn_support); in ipmi_firewall_info()
920 if (p.command >= 0) { in ipmi_firewall_info()
922 if (!((p.lun < 0 || bmc_fn_support->lun[p.lun].support) && in ipmi_firewall_info()
923 (p.netfn < 0 || bmc_fn_support->lun[p.lun].netfn[p.netfn>>1].support) && in ipmi_firewall_info()
924 bmc_fn_support->lun[p.lun].netfn[p.netfn>>1].command[p.command].support)) in ipmi_firewall_info()
927 p.command, p.lun, p.netfn); in ipmi_firewall_info()
933 &bmc_fn_support->lun[p.lun].netfn[p.netfn>>1].command[p.command]; in ipmi_firewall_info()
938 p.lun, p.netfn, p.command, in ipmi_firewall_info()
950 else if (p.netfn >= 0) { in ipmi_firewall_info()
951 if (!((p.lun < 0 || bmc_fn_support->lun[p.lun].support) && in ipmi_firewall_info()
952 (bmc_fn_support->lun[p.lun].netfn[p.netfn>>1].support))) in ipmi_firewall_info()
955 p.lun, p.netfn); in ipmi_firewall_info()
960 n = p.netfn >> 1; in ipmi_firewall_info()
961 l = p.lun; in ipmi_firewall_info()
962 printf("Commands on LUN 0x%02x, NetFn 0x%02x\n", p.lun, p.netfn); in ipmi_firewall_info()
975 p.lun = l; in ipmi_firewall_info()
978 p.netfn = n*2; in ipmi_firewall_info()
980 printf("%02x,%02x support: ", p.lun, p.netfn); in ipmi_firewall_info()
983 printf("%02x,%02x configurable: ", p.lun, p.netfn); in ipmi_firewall_info()
986 printf("%02x,%02x enabled: ", p.lun, p.netfn); in ipmi_firewall_info()
993 p.lun = -1; in ipmi_firewall_info()
994 p.netfn = -1; in ipmi_firewall_info()
1015 struct ipmi_function_params p = {0xe, -1, -1, -1, -1}; in ipmi_firewall_enable_disable() local
1037 if (ipmi_firewall_parse_args(argc, argv, &p) < 0) in ipmi_firewall_enable_disable()
1046 ret = _gather_info(intf, &p, bmc_fn_support); in ipmi_firewall_enable_disable()
1053 l = p.lun; in ipmi_firewall_enable_disable()
1054 n = p.netfn>>1; in ipmi_firewall_enable_disable()
1055 c = p.command; in ipmi_firewall_enable_disable()
1056 if (p.subfn >= 0) { in ipmi_firewall_enable_disable()
1062 bit_set(enables, p.subfn, enable); in ipmi_firewall_enable_disable()
1063 ret = _set_subfn_enables(intf, &p, in ipmi_firewall_enable_disable()
1066 } else if (p.command >= 0) { in ipmi_firewall_enable_disable()
1070 ret = _set_subfn_enables(intf, &p, in ipmi_firewall_enable_disable()
1074 bit_set(enables, p.command, enable); in ipmi_firewall_enable_disable()
1075 ret |= _set_command_enables(intf, &p, in ipmi_firewall_enable_disable()
1076 &bmc_fn_support->lun[l].netfn[n], enables, p.force); in ipmi_firewall_enable_disable()
1077 } else if (p.netfn >= 0) { in ipmi_firewall_enable_disable()
1081 ret = _set_command_enables(intf, &p, in ipmi_firewall_enable_disable()
1082 &bmc_fn_support->lun[l].netfn[n], enables, p.force); in ipmi_firewall_enable_disable()
1106 struct ipmi_function_params p = {0xe, -1, -1, -1, -1}; in ipmi_firewall_reset() local
1120 if (ipmi_firewall_parse_args(argc, argv, &p) < 0) in ipmi_firewall_reset()
1129 ret = _gather_info(intf, &p, bmc_fn_support); in ipmi_firewall_reset()
1137 p.lun = l; in ipmi_firewall_reset()
1139 p.netfn = n; in ipmi_firewall_reset()
1141 p.command = c; in ipmi_firewall_reset()
1144 ret = _set_subfn_enables(intf, &p, in ipmi_firewall_reset()
1149 ret = _set_command_enables(intf, &p, in ipmi_firewall_reset()