Fix SMMDR send directory info call

Call to send directory method fails to give data if it sends input
below 32 bytes, which as per spec should be allowed considering
N*16 bytes. Hence changing the condition.
Also, it wasn't working for more than 1 directory , so made changes
accordingly.

Tested:
Checked via dbus method-call and IPMI OEM commands, it works fine.

busctl call xyz.openbmc_project.Smbios.MDR_V2 /xyz/openbmc_project/Smbios/MDR_V2
xyz.openbmc_project.Smbios.MDR_V2 SendDirectoryInformation yyyyay
2 0 2 0 32 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 66
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 76
b true

busctl call xyz.openbmc_project.Smbios.MDR_V2 /xyz/openbmc_project/Smbios/MDR_V2
xyz.openbmc_project.Smbios.MDR_V2 GetDirectoryInformation y 0
ay 36 2 2 2 0 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 66
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 76

SmmdrSendDirectoryInfo(38h) executes successfully with correct input
and fails with request data length invalid in case of incorrect input.

ipmitool raw 0x3E 0x38 0x1 0x1 0x1 0x0 0x1 0x0 0x28 0x29 0x2a 0x2b 0x2c
0x2d 0x2e 0x2f 0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x42
 01         // SUCCESS

ipmitool raw 0x3E 0x38 0x1 0x1 0x1 0x0 0x1 0x0 0x28 0x29 0x2a 0x2b 0x2c
0x2d 0x2e 0x2f 0x30 0x31 0x32
Unable to send RAW command (channel=0x0 netfn=0x3e lun=0x0 cmd=0x38
rsp=0xc7): Request data length invalid

Signed-off-by: Mansi Joshi <mansi.joshi@linux.intel.com>
Change-Id: Ia07df1f9ad502308181a791f6afc2554f6d8a6fc
1 file changed