From b4bda3e80f101a341b87f3bc228c0062cea2807c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 28 Feb 2020 16:03:44 -0500 Subject: [PATCH] Add support for non-zero LUN Systems are now more likely to do non-zero LUN --- xCAT-server/lib/perl/xCAT/IPMI.pm | 4 ++-- xCAT-server/lib/xcat/plugins/ipmi.pm | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/IPMI.pm b/xCAT-server/lib/perl/xCAT/IPMI.pm index 5284ccba15..759777e331 100644 --- a/xCAT-server/lib/perl/xCAT/IPMI.pm +++ b/xCAT-server/lib/perl/xCAT/IPMI.pm @@ -514,7 +514,7 @@ sub subcmd { $seqincrement--; #assure seq number doesn't go beyond 7 even if it means going taboo, one enhancement would be to pick the *least* taboo instead of just giving up } my $rsaddr = 0x20; #figrue 13-4, rssa by old code - my @rnl = ($rsaddr, $args{netfn} << 2); + my @rnl = ($rsaddr, ($args{netfn} << 2) | $args{lun}); my @rest = ($self->{rqaddr}, $self->{seqlun}, $args{command}, @{ $args{data} }); my @payload = (@rnl, $self->checksum(@rnl), @rest, $self->checksum(@rest)); $self->{ipmicallback} = $args{callback}; @@ -1017,7 +1017,7 @@ sub parse_ipmi_payload { #for now, just trash the headers, this has been validated to death anyway #except seqlun, that one is important - unless ($payload[4] == $self->{seqlun} and $payload[1] >> 2 == $self->{expectednetfn} and $payload[5] == $self->{expectedcmd}) { + unless (($payload[4] & 0xfc) == $self->{seqlun} and $payload[1] >> 2 == $self->{expectednetfn} and $payload[5] == $self->{expectedcmd}) { #both sequence number and arqaddr must match, because we are using rqaddr to extend the sequence number #print "Successfully didn't get confused by stale response ".$payload[4]." and ".($self->{seqlun}-4)."\n"; diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 51a7e06c8c..0553acdc77 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -6928,7 +6928,8 @@ sub readsensor { return; } my $sensor = $sessdata->{currsdr}->sensor_number; - $sessdata->{ipmisession}->subcmd(netfn => 0x4, command => 0x2d, data => [$sensor], callback => \&sensor_was_read, callback_args => $sessdata); + my $lun = $sessdata->{currsdr}->sensor_owner_lun; + $sessdata->{ipmisession}->subcmd(netfn => 0x4, command => 0x2d, lun => $lun, data => [$sensor], callback => \&sensor_was_read, callback_args => $sessdata); } sub sensor_was_read {