aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-fw.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-fw.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-fw.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-fw.h b/drivers/net/wireless/iwlwifi/iwl-fw.h
index eaf1ff04adb9..20d44ea315ea 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fw.h
@@ -150,6 +150,10 @@ struct iwl_fw_cscheme_list {
150 * @mvm_fw: indicates this is MVM firmware 150 * @mvm_fw: indicates this is MVM firmware
151 * @cipher_scheme: optional external cipher scheme. 151 * @cipher_scheme: optional external cipher scheme.
152 * @human_readable: human readable version 152 * @human_readable: human readable version
153 * @dbg_dest_tlv: points to the destination TLV for debug
154 * @dbg_conf_tlv: array of pointers to configuration TLVs for debug
155 * @dbg_conf_tlv_len: lengths of the @dbg_conf_tlv entries
156 * @dbg_dest_reg_num: num of reg_ops in %dbg_dest_tlv
153 */ 157 */
154struct iwl_fw { 158struct iwl_fw {
155 u32 ucode_ver; 159 u32 ucode_ver;
@@ -174,6 +178,57 @@ struct iwl_fw {
174 178
175 struct ieee80211_cipher_scheme cs[IWL_UCODE_MAX_CS]; 179 struct ieee80211_cipher_scheme cs[IWL_UCODE_MAX_CS];
176 u8 human_readable[FW_VER_HUMAN_READABLE_SZ]; 180 u8 human_readable[FW_VER_HUMAN_READABLE_SZ];
181
182 struct iwl_fw_dbg_dest_tlv *dbg_dest_tlv;
183 struct iwl_fw_dbg_conf_tlv *dbg_conf_tlv[FW_DBG_MAX];
184 size_t dbg_conf_tlv_len[FW_DBG_MAX];
185
186 u8 dbg_dest_reg_num;
177}; 187};
178 188
189static inline const char *get_fw_dbg_mode_string(int mode)
190{
191 switch (mode) {
192 case SMEM_MODE:
193 return "SMEM";
194 case EXTERNAL_MODE:
195 return "EXTERNAL_DRAM";
196 case MARBH_MODE:
197 return "MARBH";
198 default:
199 return "UNKNOWN";
200 }
201}
202
203static inline const struct iwl_fw_dbg_trigger *
204iwl_fw_dbg_conf_get_trigger(const struct iwl_fw *fw, u8 id)
205{
206 const struct iwl_fw_dbg_conf_tlv *conf_tlv = fw->dbg_conf_tlv[id];
207 u8 *ptr;
208 int i;
209
210 if (!conf_tlv)
211 return NULL;
212
213 ptr = (void *)&conf_tlv->hcmd;
214 for (i = 0; i < conf_tlv->num_of_hcmds; i++) {
215 ptr += sizeof(conf_tlv->hcmd);
216 ptr += le16_to_cpu(conf_tlv->hcmd.len);
217 }
218
219 return (const struct iwl_fw_dbg_trigger *)ptr;
220}
221
222static inline bool
223iwl_fw_dbg_conf_enabled(const struct iwl_fw *fw, u8 id)
224{
225 const struct iwl_fw_dbg_trigger *trigger =
226 iwl_fw_dbg_conf_get_trigger(fw, id);
227
228 if (!trigger)
229 return false;
230
231 return trigger->enabled;
232}
233
179#endif /* __iwl_fw_h__ */ 234#endif /* __iwl_fw_h__ */