mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
sb_firmware: Fixed firmware version check
Added firmware version check to handle the following cases: - when the data table version is the same and fw version is newer or - when the fw version is the same and data table version is newer. BUG=chrome-os-partner:36310 BRANCH=none TEST=Verified on Glimmer. crosh> battery_firmware check crosh> battery_firmware update Change-Id: If3d28f6ae7a89fc7c41fd60214ab3616f1abfe5a Signed-off-by: Sheng-Liang Song <ssl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/270387 Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
764c3fa790
commit
6cd67659db
@@ -193,10 +193,12 @@ static int check_battery_firmware_image_version(
|
||||
struct sb_fw_header *hdr,
|
||||
struct sb_fw_update_info *p)
|
||||
{
|
||||
return (((hdr->fw_version == 0xFFFF)
|
||||
|| (hdr->fw_version > p->fw_version)) &&
|
||||
((hdr->data_table_version == 0xFFFF)
|
||||
|| (hdr->data_table_version > p->data_version)));
|
||||
/*
|
||||
* If the battery firmware has a newer fw version
|
||||
* or a newer data table version, then it is ok to update.
|
||||
*/
|
||||
return (hdr->fw_version > p->fw_version)
|
||||
|| (hdr->data_table_version > p->data_version);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user