Lines Matching refs:trans

25 	struct iwl_trans *trans = (struct iwl_trans *)data;  in iwl_pnvm_complete_fn()  local
28 IWL_DEBUG_FW(trans, in iwl_pnvm_complete_fn()
35 static int iwl_pnvm_handle_section(struct iwl_trans *trans, const u8 *data, in iwl_pnvm_handle_section() argument
44 IWL_DEBUG_FW(trans, "Handling PNVM section\n"); in iwl_pnvm_handle_section()
58 IWL_ERR(trans, "invalid TLV len: %zd/%u\n", in iwl_pnvm_handle_section()
68 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
76 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
83 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
95 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
99 if (mac_type == CSR_HW_REV_TYPE(trans->hw_rev) && in iwl_pnvm_handle_section()
100 rf_id == CSR_HW_RFID_TYPE(trans->hw_rf_id)) in iwl_pnvm_handle_section()
107 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
113 IWL_DEBUG_FW(trans, "Ignoring separator.\n"); in iwl_pnvm_handle_section()
118 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
123 IWL_DEBUG_FW(trans, "Adding data (size %d)\n", in iwl_pnvm_handle_section()
133 if (iwl_uefi_handle_tlv_mem_desc(trans, data, tlv_len, in iwl_pnvm_handle_section()
138 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
142 IWL_DEBUG_FW(trans, "Found TLV 0x%0x, len %d\n", in iwl_pnvm_handle_section()
153 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
155 CSR_HW_REV_TYPE(trans->hw_rev), in iwl_pnvm_handle_section()
156 CSR_HW_RFID_TYPE(trans->hw_rf_id)); in iwl_pnvm_handle_section()
161 IWL_DEBUG_FW(trans, "Empty PNVM, skipping.\n"); in iwl_pnvm_handle_section()
168 static int iwl_pnvm_parse(struct iwl_trans *trans, const u8 *data, in iwl_pnvm_parse() argument
174 IWL_DEBUG_FW(trans, "Parsing PNVM file\n"); in iwl_pnvm_parse()
187 IWL_ERR(trans, "invalid TLV len: %zd/%u\n", in iwl_pnvm_parse()
196 IWL_DEBUG_FW(trans, in iwl_pnvm_parse()
199 IWL_DEBUG_FW(trans, "sku_id 0x%0x 0x%0x 0x%0x\n", in iwl_pnvm_parse()
207 trans->reduced_cap_sku = false; in iwl_pnvm_parse()
208 rf_type = CSR_HW_RFID_TYPE(trans->hw_rf_id); in iwl_pnvm_parse()
209 if ((trans->sku_id[0] & IWL_PNVM_REDUCED_CAP_BIT) && in iwl_pnvm_parse()
211 trans->reduced_cap_sku = true; in iwl_pnvm_parse()
213 IWL_DEBUG_FW(trans, in iwl_pnvm_parse()
215 trans->reduced_cap_sku); in iwl_pnvm_parse()
217 if (trans->sku_id[0] == le32_to_cpu(sku_id->data[0]) && in iwl_pnvm_parse()
218 trans->sku_id[1] == le32_to_cpu(sku_id->data[1]) && in iwl_pnvm_parse()
219 trans->sku_id[2] == le32_to_cpu(sku_id->data[2])) { in iwl_pnvm_parse()
222 ret = iwl_pnvm_handle_section(trans, data, len, in iwl_pnvm_parse()
227 IWL_DEBUG_FW(trans, "SKU ID didn't match!\n"); in iwl_pnvm_parse()
238 static int iwl_pnvm_get_from_fs(struct iwl_trans *trans, u8 **data, size_t *len) in iwl_pnvm_get_from_fs() argument
245 iwl_pnvm_get_fs_name(trans, pnvm_name, sizeof(pnvm_name)); in iwl_pnvm_get_from_fs()
247 ret = firmware_request_nowarn(&pnvm, pnvm_name, trans->dev); in iwl_pnvm_get_from_fs()
249 IWL_DEBUG_FW(trans, "PNVM file %s not found %d\n", in iwl_pnvm_get_from_fs()
297 static void iwl_pnvm_load_pnvm_to_trans(struct iwl_trans *trans, in iwl_pnvm_load_pnvm_to_trans() argument
306 if (trans->fail_to_parse_pnvm_image) in iwl_pnvm_load_pnvm_to_trans()
309 if (trans->pnvm_loaded) in iwl_pnvm_load_pnvm_to_trans()
312 data = iwl_get_pnvm_image(trans, &length); in iwl_pnvm_load_pnvm_to_trans()
314 trans->fail_to_parse_pnvm_image = true; in iwl_pnvm_load_pnvm_to_trans()
322 ret = iwl_pnvm_parse(trans, data, length, pnvm_data); in iwl_pnvm_load_pnvm_to_trans()
324 trans->fail_to_parse_pnvm_image = true; in iwl_pnvm_load_pnvm_to_trans()
328 ret = iwl_trans_load_pnvm(trans, pnvm_data, capa); in iwl_pnvm_load_pnvm_to_trans()
331 IWL_INFO(trans, "loaded PNVM version %08x\n", pnvm_data->version); in iwl_pnvm_load_pnvm_to_trans()
334 iwl_trans_set_pnvm(trans, capa); in iwl_pnvm_load_pnvm_to_trans()
341 iwl_pnvm_load_reduce_power_to_trans(struct iwl_trans *trans, in iwl_pnvm_load_reduce_power_to_trans() argument
349 if (trans->failed_to_load_reduce_power_image) in iwl_pnvm_load_reduce_power_to_trans()
352 if (trans->reduce_power_loaded) in iwl_pnvm_load_reduce_power_to_trans()
355 data = iwl_uefi_get_reduced_power(trans, &length); in iwl_pnvm_load_reduce_power_to_trans()
357 trans->failed_to_load_reduce_power_image = true; in iwl_pnvm_load_reduce_power_to_trans()
365 ret = iwl_uefi_reduce_power_parse(trans, data, length, pnvm_data); in iwl_pnvm_load_reduce_power_to_trans()
367 trans->failed_to_load_reduce_power_image = true; in iwl_pnvm_load_reduce_power_to_trans()
371 ret = iwl_trans_load_reduce_power(trans, pnvm_data, capa); in iwl_pnvm_load_reduce_power_to_trans()
373 IWL_DEBUG_FW(trans, in iwl_pnvm_load_reduce_power_to_trans()
376 trans->failed_to_load_reduce_power_image = true; in iwl_pnvm_load_reduce_power_to_trans()
381 iwl_trans_set_reduce_power(trans, capa); in iwl_pnvm_load_reduce_power_to_trans()
387 int iwl_pnvm_load(struct iwl_trans *trans, in iwl_pnvm_load() argument
396 if (!trans->sku_id[0] && !trans->sku_id[1] && !trans->sku_id[2]) in iwl_pnvm_load()
399 iwl_pnvm_load_pnvm_to_trans(trans, capa); in iwl_pnvm_load()
400 iwl_pnvm_load_reduce_power_to_trans(trans, capa); in iwl_pnvm_load()
404 iwl_pnvm_complete_fn, trans); in iwl_pnvm_load()
407 iwl_write_umac_prph(trans, UREG_DOORBELL_TO_ISR6, in iwl_pnvm_load()