@@ -71,48 +71,25 @@ void iwl_mld_get_bios_tables(struct iwl_mld *mld)
71
71
static int iwl_mld_geo_sar_init (struct iwl_mld * mld )
72
72
{
73
73
u32 cmd_id = WIDE_ID (PHY_OPS_GROUP , PER_CHAIN_LIMIT_OFFSET_CMD );
74
- union iwl_geo_tx_power_profiles_cmd cmd ;
75
- u16 len ;
76
- u32 n_bands ;
77
- __le32 sk = cpu_to_le32 (0 );
78
- int ret ;
79
- u8 cmd_ver = iwl_fw_lookup_cmd_ver (mld -> fw , cmd_id ,
80
- IWL_FW_CMD_VER_UNKNOWN );
81
-
82
- BUILD_BUG_ON (offsetof(struct iwl_geo_tx_power_profiles_cmd_v4 , ops ) !=
83
- offsetof(struct iwl_geo_tx_power_profiles_cmd_v5 , ops ));
84
-
85
- cmd .v4 .ops = cpu_to_le32 (IWL_PER_CHAIN_OFFSET_SET_TABLES );
86
-
87
74
/* Only set to South Korea if the table revision is 1 */
88
- if (mld -> fwrt .geo_rev == 1 )
89
- sk = cpu_to_le32 (1 );
90
-
91
- if (cmd_ver == 5 ) {
92
- len = sizeof (cmd .v5 );
93
- n_bands = ARRAY_SIZE (cmd .v5 .table [0 ]);
94
- cmd .v5 .table_revision = sk ;
95
- } else if (cmd_ver == 4 ) {
96
- len = sizeof (cmd .v4 );
97
- n_bands = ARRAY_SIZE (cmd .v4 .table [0 ]);
98
- cmd .v4 .table_revision = sk ;
99
- } else {
100
- return - EOPNOTSUPP ;
101
- }
75
+ __le32 sk = cpu_to_le32 (mld -> fwrt .geo_rev == 1 ? 1 : 0 );
76
+ union iwl_geo_tx_power_profiles_cmd cmd = {
77
+ .v5 .ops = cpu_to_le32 (IWL_PER_CHAIN_OFFSET_SET_TABLES ),
78
+ .v5 .table_revision = sk ,
79
+ };
80
+ int ret ;
102
81
103
- BUILD_BUG_ON (offsetof(struct iwl_geo_tx_power_profiles_cmd_v4 , table ) !=
104
- offsetof(struct iwl_geo_tx_power_profiles_cmd_v5 , table ));
105
- /* the table is at the same position for all versions, so set use v4 */
106
- ret = iwl_sar_geo_fill_table (& mld -> fwrt , & cmd .v4 .table [0 ][0 ],
107
- n_bands , BIOS_GEO_MAX_PROFILE_NUM );
82
+ ret = iwl_sar_geo_fill_table (& mld -> fwrt , & cmd .v5 .table [0 ][0 ],
83
+ ARRAY_SIZE (cmd .v5 .table [0 ]),
84
+ BIOS_GEO_MAX_PROFILE_NUM );
108
85
109
86
/* It is a valid scenario to not support SAR, or miss wgds table,
110
87
* but in that case there is no need to send the command.
111
88
*/
112
89
if (ret )
113
90
return 0 ;
114
91
115
- return iwl_mld_send_cmd_pdu (mld , cmd_id , & cmd , len );
92
+ return iwl_mld_send_cmd_pdu (mld , cmd_id , & cmd , sizeof ( cmd . v5 ) );
116
93
}
117
94
118
95
int iwl_mld_config_sar_profile (struct iwl_mld * mld , int prof_a , int prof_b )
0 commit comments