Lines Matching refs:trans
23 struct iwl_trans *trans = (struct iwl_trans *)data; in iwl_pnvm_complete_fn() local
26 IWL_DEBUG_FW(trans, in iwl_pnvm_complete_fn()
33 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()
56 IWL_ERR(trans, "invalid TLV len: %zd/%u\n", in iwl_pnvm_handle_section()
67 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
75 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
81 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
93 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
97 if (mac_type == CSR_HW_REV_TYPE(trans->hw_rev) && in iwl_pnvm_handle_section()
98 rf_id == CSR_HW_RFID_TYPE(trans->hw_rf_id)) in iwl_pnvm_handle_section()
105 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
111 IWL_DEBUG_FW(trans, "Ignoring separator.\n"); in iwl_pnvm_handle_section()
115 IWL_DEBUG_FW(trans, "Adding data (size %d)\n", in iwl_pnvm_handle_section()
120 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
136 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
140 IWL_DEBUG_FW(trans, "Found TLV 0x%0x, len %d\n", in iwl_pnvm_handle_section()
151 IWL_DEBUG_FW(trans, in iwl_pnvm_handle_section()
153 CSR_HW_REV_TYPE(trans->hw_rev), in iwl_pnvm_handle_section()
154 CSR_HW_RFID_TYPE(trans->hw_rf_id)); in iwl_pnvm_handle_section()
160 IWL_DEBUG_FW(trans, "Empty PNVM, skipping.\n"); in iwl_pnvm_handle_section()
165 IWL_INFO(trans, "loaded PNVM version %08x\n", sha1); in iwl_pnvm_handle_section()
167 ret = iwl_trans_set_pnvm(trans, pnvm_data, size); in iwl_pnvm_handle_section()
173 static int iwl_pnvm_parse(struct iwl_trans *trans, const u8 *data, in iwl_pnvm_parse() argument
178 IWL_DEBUG_FW(trans, "Parsing PNVM file\n"); in iwl_pnvm_parse()
190 IWL_ERR(trans, "invalid TLV len: %zd/%u\n", in iwl_pnvm_parse()
199 IWL_DEBUG_FW(trans, in iwl_pnvm_parse()
202 IWL_DEBUG_FW(trans, "sku_id 0x%0x 0x%0x 0x%0x\n", in iwl_pnvm_parse()
210 if (trans->sku_id[0] == le32_to_cpu(sku_id->data[0]) && in iwl_pnvm_parse()
211 trans->sku_id[1] == le32_to_cpu(sku_id->data[1]) && in iwl_pnvm_parse()
212 trans->sku_id[2] == le32_to_cpu(sku_id->data[2])) { in iwl_pnvm_parse()
215 ret = iwl_pnvm_handle_section(trans, data, len); in iwl_pnvm_parse()
219 IWL_DEBUG_FW(trans, "SKU ID didn't match!\n"); in iwl_pnvm_parse()
230 static int iwl_pnvm_get_from_fs(struct iwl_trans *trans, u8 **data, size_t *len) in iwl_pnvm_get_from_fs() argument
237 iwl_pnvm_get_fs_name(trans, pnvm_name, sizeof(pnvm_name)); in iwl_pnvm_get_from_fs()
239 ret = firmware_request_nowarn(&pnvm, pnvm_name, trans->dev); in iwl_pnvm_get_from_fs()
241 IWL_DEBUG_FW(trans, "PNVM file %s not found %d\n", in iwl_pnvm_get_from_fs()
258 int iwl_pnvm_load(struct iwl_trans *trans, in iwl_pnvm_load() argument
270 if (!trans->sku_id[0] && !trans->sku_id[1] && !trans->sku_id[2]) in iwl_pnvm_load()
277 if (trans->pnvm_loaded) { in iwl_pnvm_load()
278 ret = iwl_trans_set_pnvm(trans, NULL, 0); in iwl_pnvm_load()
285 package = iwl_uefi_get_pnvm(trans, &len); in iwl_pnvm_load()
303 ret = iwl_pnvm_get_from_fs(trans, &data, &len); in iwl_pnvm_load()
310 trans->pnvm_loaded = true; in iwl_pnvm_load()
316 iwl_pnvm_parse(trans, data, len); in iwl_pnvm_load()
323 if (!trans->reduce_power_loaded) { in iwl_pnvm_load()
324 data = iwl_uefi_get_reduced_power(trans, &len); in iwl_pnvm_load()
331 trans->reduce_power_loaded = true; in iwl_pnvm_load()
337 ret = iwl_trans_set_reduce_power(trans, data, len); in iwl_pnvm_load()
339 IWL_DEBUG_FW(trans, in iwl_pnvm_load()
347 iwl_pnvm_complete_fn, trans); in iwl_pnvm_load()
350 iwl_write_umac_prph(trans, UREG_DOORBELL_TO_ISR6, in iwl_pnvm_load()