tools: pack_v2: limit the wifi fws based on profiles

This patch adds support in the pack_v2 script to limit
the wifi firmwares which packed into the single images
based on the profiles.

Add corresponding profile entry under each RDP
config in config.xml to restrict wifi fw images
packed into the single image.

Eg:
<profiles>256</profiles>
<profiles>512</profiles>
<profiles>512,256</profiles>

Note: No need add default profile in profiles tag.

Change-Id: I06667ec7ba31a2bbcb742fbd5319f0e30be193fc
Signed-off-by: Ram Kumar D <quic_ramd@quicinc.com>
This commit is contained in:
Ram Kumar D 2024-03-20 10:43:51 +05:30
parent 4568deeb3c
commit ea1cdf6874

View file

@ -863,6 +863,13 @@ class Pack(object):
wifi_fw_list = []
no_fw_mach_ids = []
for segment in entries:
if (memory_size != "default"):
profiles = segment.find('.//profiles')
if (profiles == None):
continue
if memory_size not in profiles.text:
continue
wififw_type = segment.find('.//wififw_name')
if wififw_type == None:
machid = int(segment.find(".//machid").text, 0)
@ -1063,8 +1070,9 @@ class Pack(object):
wifi_fw_type = ""
if filename != "":
wifi_fw_list.append(filename)
filename = ""
if filename not in wifi_fw_list:
wifi_fw_list.append(filename)
filename = ""
continue
if section != None and filename != "" and section.get('filename_mem' + memory_size) != None:
@ -1184,7 +1192,7 @@ class Pack(object):
if (2 == len(possible_fw_vers)):
temp_name = filename
temp_name = temp_name.replace(possible_fw_vers[0][0][0], a)
temp_name = temp_name.replace(possible_fw_vers[0][1][0], b)
temp_name = temp_name.replace(possible_fw_vers[1][0][0], b)
if os.path.exists(os.path.join(self.images_dname, temp_name)):
if wifi_fws_combs.get(temp_name) == None:
@ -1195,8 +1203,8 @@ class Pack(object):
if (3 == len(possible_fw_vers)):
temp_name = filename
temp_name = temp_name.replace(possible_fw_vers[0][0][0], a)
temp_name = temp_name.replace(possible_fw_vers[0][1][0], b)
temp_name = temp_name.replace(possible_fw_vers[0][2][0], c)
temp_name = temp_name.replace(possible_fw_vers[1][0][0], b)
temp_name = temp_name.replace(possible_fw_vers[2][0][0], c)
if os.path.exists(os.path.join(self.images_dname, temp_name)):
if wifi_fws_combs.get(temp_name) == None:
@ -1207,9 +1215,9 @@ class Pack(object):
if (4 == len(possible_fw_vers)):
temp_name = filename
temp_name = temp_name.replace(possible_fw_vers[0][0][0], a)
temp_name = temp_name.replace(possible_fw_vers[0][1][0], b)
temp_name = temp_name.replace(possible_fw_vers[0][2][0], c)
temp_name = temp_name.replace(possible_fw_vers[0][3][0], d)
temp_name = temp_name.replace(possible_fw_vers[1][0][0], b)
temp_name = temp_name.replace(possible_fw_vers[2][0][0], c)
temp_name = temp_name.replace(possible_fw_vers[3][0][0], d)
if os.path.exists(os.path.join(self.images_dname, temp_name)):
if wifi_fws_combs.get(temp_name) == None: