Skip to content

Commit aa2b177

Browse files
committed
iwlwifi: fix calibration parser
The firmware TLV for calibration data isn't really a u64, but two u32 values. Define a struct for that and change the parser. Signed-off-by: Johannes Berg <[email protected]>
1 parent 4a4ee10 commit aa2b177

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

drivers/net/wireless/iwlwifi/iwl-drv.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ struct fw_sec_parsing {
268268
*/
269269
struct iwl_tlv_calib_data {
270270
__le32 ucode_type;
271-
__le64 calib;
271+
struct iwl_tlv_calib_ctrl calib;
272272
} __packed;
273273

274274
struct iwl_firmware_pieces {
@@ -358,7 +358,11 @@ static int iwl_set_default_calib(struct iwl_drv *drv, const u8 *data)
358358
ucode_type);
359359
return -EINVAL;
360360
}
361-
drv->fw.default_calib[ucode_type] = le64_to_cpu(def_calib->calib);
361+
drv->fw.default_calib[ucode_type].flow_trigger =
362+
def_calib->calib.flow_trigger;
363+
drv->fw.default_calib[ucode_type].event_trigger =
364+
def_calib->calib.event_trigger;
365+
362366
return 0;
363367
}
364368

drivers/net/wireless/iwlwifi/iwl-fw.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,19 @@ struct fw_img {
139139
#define IWL_UCODE_API(ver) (((ver) & 0x0000FF00) >> 8)
140140
#define IWL_UCODE_SERIAL(ver) ((ver) & 0x000000FF)
141141

142+
/*
143+
* Calibration control struct.
144+
* Sent as part of the phy configuration command.
145+
* @flow_trigger: bitmap for which calibrations to perform according to
146+
* flow triggers.
147+
* @event_trigger: bitmap for which calibrations to perform according to
148+
* event triggers.
149+
*/
150+
struct iwl_tlv_calib_ctrl {
151+
__le32 flow_trigger;
152+
__le32 event_trigger;
153+
} __packed;
154+
142155
/**
143156
* struct iwl_fw - variables associated with the firmware
144157
*
@@ -168,7 +181,7 @@ struct iwl_fw {
168181
u32 init_evtlog_ptr, init_evtlog_size, init_errlog_ptr;
169182
u32 inst_evtlog_ptr, inst_evtlog_size, inst_errlog_ptr;
170183

171-
u64 default_calib[IWL_UCODE_TYPE_MAX];
184+
struct iwl_tlv_calib_ctrl default_calib[IWL_UCODE_TYPE_MAX];
172185
u32 phy_config;
173186

174187
bool mvm_fw;

0 commit comments

Comments
 (0)