@@ -412,7 +412,7 @@ IWL_EXPORT_SYMBOL(iwl_acpi_get_eckv);
412
412
413
413
static int iwl_sar_set_profile (union acpi_object * table ,
414
414
struct iwl_sar_profile * profile ,
415
- bool enabled )
415
+ bool enabled , u8 num_chains , u8 num_sub_bands )
416
416
{
417
417
int i , j , idx = 0 ;
418
418
@@ -422,8 +422,8 @@ static int iwl_sar_set_profile(union acpi_object *table,
422
422
* The table from ACPI is flat, but we store it in a
423
423
* structured array.
424
424
*/
425
- for (i = 0 ; i < ACPI_SAR_NUM_CHAINS ; i ++ ) {
426
- for (j = 0 ; j < ACPI_SAR_NUM_SUB_BANDS ; j ++ ) {
425
+ for (i = 0 ; i < num_chains ; i ++ ) {
426
+ for (j = 0 ; j < num_sub_bands ; j ++ ) {
427
427
if (table [idx ].type != ACPI_TYPE_INTEGER ||
428
428
table [idx ].integer .value > U8_MAX )
429
429
return - EINVAL ;
@@ -539,7 +539,8 @@ int iwl_sar_get_wrds_table(struct iwl_fw_runtime *fwrt)
539
539
/* The profile from WRDS is officially profile 1, but goes
540
540
* into sar_profiles[0] (because we don't have a profile 0).
541
541
*/
542
- ret = iwl_sar_set_profile (table , & fwrt -> sar_profiles [0 ], enabled );
542
+ ret = iwl_sar_set_profile (table , & fwrt -> sar_profiles [0 ], enabled ,
543
+ ACPI_SAR_NUM_CHAINS , ACPI_SAR_NUM_SUB_BANDS );
543
544
out_free :
544
545
kfree (data );
545
546
return ret ;
@@ -598,7 +599,9 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt)
598
599
*/
599
600
ret = iwl_sar_set_profile (& wifi_pkg -> package .elements [pos ],
600
601
& fwrt -> sar_profiles [i + 1 ],
601
- enabled );
602
+ enabled ,
603
+ ACPI_SAR_NUM_CHAINS ,
604
+ ACPI_SAR_NUM_SUB_BANDS );
602
605
if (ret < 0 )
603
606
break ;
604
607
0 commit comments