Have IPMI plugin detect whether something is an ITE or not

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14131 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2012-10-25 21:39:24 +00:00
parent 9bb1c459e3
commit f1b045c5cd

View File

@ -1682,7 +1682,8 @@ sub got_bmc_fw_info {
$fru->value($mprom);
$sessdata->{fru_hash}->{mprom} = $fru;
if ($isanimm) {
get_imm_property(property=>"/v2/bios/build_id",callback=>\&got_bios_buildid,sessdata=>$sessdata);
#get_imm_property(property=>"/v2/bios/build_id",callback=>\&got_bios_buildid,sessdata=>$sessdata);
check_for_ite(sessdata=>$sessdata);
} else {
initfru_with_mprom($sessdata);
}
@ -1755,6 +1756,32 @@ sub got_fpga_date {
}
initfru_with_mprom($sessdata);
}
sub check_for_ite {
my %args = @_;
my @getpropertycommand;
my $sessdata = $args{sessdata};
$sessdata->{property_callback} = \&got_ite_check; #$args{callback};
@getpropertycommand = unpack("C*","/v2/cmm/");
my $length = 0b10000000 | (scalar @getpropertycommand);#use length to store tlv
unshift @getpropertycommand,$length;
#command also needs the overall length
$length = (scalar @getpropertycommand);
unshift @getpropertycommand,0; #do not recurse, though it's not going to matter anyway since we are just checking for the existence of the category
unshift @getpropertycommand,$length&0xff;
unshift @getpropertycommand,($length>>8)&0xff;
unshift @getpropertycommand,2; #get all properties command,
$sessdata->{ipmisession}->subcmd(netfn=>0x3a,command=>0xc4,data=>\@getpropertycommand,callback=>\&got_imm_property,callback_args=>$sessdata);
}
sub got_ite_check {
my %res = @_;
my $sessdata = $res{sessdata};
if ($res{ccode} == 9) { #success, end of tree means an ITE, remember this
$sessdata->{isite}=1;
} else {
$sessdata->{isite}=0;
}
get_imm_property(property=>"/v2/bios/build_id",callback=>\&got_bios_buildid,sessdata=>$sessdata);
}
sub get_imm_property {
my %args = @_;
my @getpropertycommand;
@ -1769,7 +1796,6 @@ sub get_imm_property {
unshift @getpropertycommand,($length>>8)&0xff;
unshift @getpropertycommand,0; #the actual 'get proprety' command is 0.
$sessdata->{ipmisession}->subcmd(netfn=>0x3a,command=>0xc4,data=>\@getpropertycommand,callback=>\&got_imm_property,callback_args=>$sessdata);
}
sub got_imm_property {
if (check_rsp_errors(@_)) {
@ -1781,6 +1807,7 @@ sub got_imm_property {
my $propval = shift @data;
my %res;
$res{sessdata}=$sessdata;
$res{ccode}=$propval;
if ($propval == 0) { #success
shift @data; #discard payload size
shift @data; #discard payload size