Lines Matching full:drv
13 #include "iwl-drv.h"
41 * struct iwl_drv - drv common data
42 * @list: list of drv structures using this opmode
79 /* Protects the table contents, i.e. the ops pointer & drv list */
84 struct list_head drv; /* list of devices using this op_mode */ member
102 static void iwl_free_fw_desc(struct iwl_drv *drv, struct fw_desc *desc) in iwl_free_fw_desc() argument
109 static void iwl_free_fw_img(struct iwl_drv *drv, struct fw_img *img) in iwl_free_fw_img() argument
113 iwl_free_fw_desc(drv, &img->sec[i]); in iwl_free_fw_img()
117 static void iwl_dealloc_ucode(struct iwl_drv *drv) in iwl_dealloc_ucode() argument
121 kfree(drv->fw.dbg.dest_tlv); in iwl_dealloc_ucode()
122 for (i = 0; i < ARRAY_SIZE(drv->fw.dbg.conf_tlv); i++) in iwl_dealloc_ucode()
123 kfree(drv->fw.dbg.conf_tlv[i]); in iwl_dealloc_ucode()
124 for (i = 0; i < ARRAY_SIZE(drv->fw.dbg.trigger_tlv); i++) in iwl_dealloc_ucode()
125 kfree(drv->fw.dbg.trigger_tlv[i]); in iwl_dealloc_ucode()
126 kfree(drv->fw.dbg.mem_tlv); in iwl_dealloc_ucode()
127 kfree(drv->fw.iml); in iwl_dealloc_ucode()
128 kfree(drv->fw.ucode_capa.cmd_versions); in iwl_dealloc_ucode()
129 kfree(drv->fw.phy_integration_ver); in iwl_dealloc_ucode()
130 kfree(drv->trans->dbg.pc_data); in iwl_dealloc_ucode()
131 drv->trans->dbg.pc_data = NULL; in iwl_dealloc_ucode()
134 iwl_free_fw_img(drv, drv->fw.img + i); in iwl_dealloc_ucode()
137 memset(&drv->fw, 0, sizeof(drv->fw)); in iwl_dealloc_ucode()
140 static int iwl_alloc_fw_desc(struct iwl_drv *drv, struct fw_desc *desc, in iwl_alloc_fw_desc() argument
222 static int iwl_request_firmware(struct iwl_drv *drv, bool first) in iwl_request_firmware() argument
224 const struct iwl_cfg *cfg = drv->trans->cfg; in iwl_request_firmware()
228 if (drv->trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_9000 && in iwl_request_firmware()
229 (drv->trans->hw_rev_step != SILICON_B_STEP && in iwl_request_firmware()
230 drv->trans->hw_rev_step != SILICON_C_STEP)) { in iwl_request_firmware()
231 IWL_ERR(drv, in iwl_request_firmware()
233 drv->trans->hw_rev); in iwl_request_firmware()
237 fw_name_pre = iwl_drv_get_fwname_pre(drv->trans, _fw_name_pre); in iwl_request_firmware()
240 drv->fw_index = cfg->ucode_api_max; in iwl_request_firmware()
242 drv->fw_index--; in iwl_request_firmware()
244 if (drv->fw_index < cfg->ucode_api_min) { in iwl_request_firmware()
245 IWL_ERR(drv, "no suitable firmware found!\n"); in iwl_request_firmware()
248 IWL_ERR(drv, "%s-%d is required\n", fw_name_pre, in iwl_request_firmware()
251 IWL_ERR(drv, "minimum version required: %s-%d\n", in iwl_request_firmware()
253 IWL_ERR(drv, "maximum version supported: %s-%d\n", in iwl_request_firmware()
257 IWL_ERR(drv, in iwl_request_firmware()
262 snprintf(drv->firmware_name, sizeof(drv->firmware_name), "%s-%d.ucode", in iwl_request_firmware()
263 fw_name_pre, drv->fw_index); in iwl_request_firmware()
265 IWL_DEBUG_FW_INFO(drv, "attempting to load firmware '%s'\n", in iwl_request_firmware()
266 drv->firmware_name); in iwl_request_firmware()
268 return request_firmware_nowait(THIS_MODULE, 1, drv->firmware_name, in iwl_request_firmware()
269 drv->trans->dev, in iwl_request_firmware()
270 GFP_KERNEL, drv, iwl_req_fw_callback); in iwl_request_firmware()
422 static int iwl_set_default_calib(struct iwl_drv *drv, const u8 *data) in iwl_set_default_calib() argument
428 IWL_ERR(drv, "Wrong ucode_type %u for default calibration.\n", in iwl_set_default_calib()
432 drv->fw.default_calib[ucode_type].flow_trigger = in iwl_set_default_calib()
434 drv->fw.default_calib[ucode_type].event_trigger = in iwl_set_default_calib()
440 static void iwl_set_ucode_api_flags(struct iwl_drv *drv, const u8 *data, in iwl_set_ucode_api_flags() argument
449 IWL_WARN(drv, in iwl_set_ucode_api_flags()
461 static void iwl_set_ucode_capabilities(struct iwl_drv *drv, const u8 *data, in iwl_set_ucode_capabilities() argument
470 IWL_WARN(drv, in iwl_set_ucode_capabilities()
482 static const char *iwl_reduced_fw_name(struct iwl_drv *drv) in iwl_reduced_fw_name() argument
484 const char *name = drv->firmware_name; in iwl_reduced_fw_name()
492 static int iwl_parse_v1_v2_firmware(struct iwl_drv *drv, in iwl_parse_v1_v2_firmware() argument
501 drv->fw.ucode_ver = le32_to_cpu(ucode->ver); in iwl_parse_v1_v2_firmware()
502 api_ver = IWL_UCODE_API(drv->fw.ucode_ver); in iwl_parse_v1_v2_firmware()
508 IWL_ERR(drv, "File size too small!\n"); in iwl_parse_v1_v2_firmware()
527 IWL_ERR(drv, "File size too small!\n"); in iwl_parse_v1_v2_firmware()
548 snprintf(drv->fw.fw_version, in iwl_parse_v1_v2_firmware()
549 sizeof(drv->fw.fw_version), in iwl_parse_v1_v2_firmware()
551 IWL_UCODE_MAJOR(drv->fw.ucode_ver), in iwl_parse_v1_v2_firmware()
552 IWL_UCODE_MINOR(drv->fw.ucode_ver), in iwl_parse_v1_v2_firmware()
553 IWL_UCODE_API(drv->fw.ucode_ver), in iwl_parse_v1_v2_firmware()
554 IWL_UCODE_SERIAL(drv->fw.ucode_ver), in iwl_parse_v1_v2_firmware()
555 buildstr, iwl_reduced_fw_name(drv)); in iwl_parse_v1_v2_firmware()
565 IWL_ERR(drv, in iwl_parse_v1_v2_firmware()
591 static void iwl_drv_set_dump_exclude(struct iwl_drv *drv, in iwl_drv_set_dump_exclude() argument
602 excl = &drv->fw.dump_excl[0]; in iwl_drv_set_dump_exclude()
606 excl = &drv->fw.dump_excl_wowlan[0]; in iwl_drv_set_dump_exclude()
607 } else if (fw_has_capa(&drv->fw.ucode_capa, in iwl_drv_set_dump_exclude()
610 excl = &drv->fw.dump_excl[0]; in iwl_drv_set_dump_exclude()
613 excl = &drv->fw.dump_excl_wowlan[0]; in iwl_drv_set_dump_exclude()
620 IWL_DEBUG_FW_INFO(drv, "found too many excludes in fw file\n"); in iwl_drv_set_dump_exclude()
628 static void iwl_parse_dbg_tlv_assert_tables(struct iwl_drv *drv, in iwl_parse_dbg_tlv_assert_tables() argument
649 drv->trans->dbg.umac_error_event_table = addr; in iwl_parse_dbg_tlv_assert_tables()
650 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_dbg_tlv_assert_tables()
654 drv->trans->dbg.lmac_error_event_table[0] = addr; in iwl_parse_dbg_tlv_assert_tables()
655 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_dbg_tlv_assert_tables()
659 drv->trans->dbg.lmac_error_event_table[1] = addr; in iwl_parse_dbg_tlv_assert_tables()
660 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_dbg_tlv_assert_tables()
664 drv->trans->dbg.tcm_error_event_table[0] = addr; in iwl_parse_dbg_tlv_assert_tables()
665 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_dbg_tlv_assert_tables()
669 drv->trans->dbg.tcm_error_event_table[1] = addr; in iwl_parse_dbg_tlv_assert_tables()
670 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_dbg_tlv_assert_tables()
674 drv->trans->dbg.rcm_error_event_table[0] = addr; in iwl_parse_dbg_tlv_assert_tables()
675 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_dbg_tlv_assert_tables()
679 drv->trans->dbg.rcm_error_event_table[1] = addr; in iwl_parse_dbg_tlv_assert_tables()
680 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_dbg_tlv_assert_tables()
688 static int iwl_parse_tlv_firmware(struct iwl_drv *drv, in iwl_parse_tlv_firmware() argument
708 IWL_ERR(drv, "uCode has invalid length: %zd\n", len); in iwl_parse_tlv_firmware()
713 IWL_ERR(drv, "invalid uCode magic: 0X%x\n", in iwl_parse_tlv_firmware()
718 drv->fw.ucode_ver = le32_to_cpu(ucode->ver); in iwl_parse_tlv_firmware()
719 memcpy(drv->fw.human_readable, ucode->human_readable, in iwl_parse_tlv_firmware()
720 sizeof(drv->fw.human_readable)); in iwl_parse_tlv_firmware()
728 snprintf(drv->fw.fw_version, in iwl_parse_tlv_firmware()
729 sizeof(drv->fw.fw_version), in iwl_parse_tlv_firmware()
731 IWL_UCODE_MAJOR(drv->fw.ucode_ver), in iwl_parse_tlv_firmware()
732 IWL_UCODE_MINOR(drv->fw.ucode_ver), in iwl_parse_tlv_firmware()
733 IWL_UCODE_API(drv->fw.ucode_ver), in iwl_parse_tlv_firmware()
734 IWL_UCODE_SERIAL(drv->fw.ucode_ver), in iwl_parse_tlv_firmware()
735 buildstr, iwl_reduced_fw_name(drv)); in iwl_parse_tlv_firmware()
750 IWL_ERR(drv, "invalid TLV len: %zd/%u\n", in iwl_parse_tlv_firmware()
795 IWL_ERR(drv, "Found unexpected BOOT ucode\n"); in iwl_parse_tlv_firmware()
827 iwl_set_ucode_api_flags(drv, tlv_data, capa); in iwl_parse_tlv_firmware()
832 iwl_set_ucode_capabilities(drv, tlv_data, capa); in iwl_parse_tlv_firmware()
873 drv->fw.enhance_sensitivity_table = true; in iwl_parse_tlv_firmware()
902 drv->fw.type = IWL_FW_MVM; in iwl_parse_tlv_firmware()
907 drv->fw.type = IWL_FW_MVM; in iwl_parse_tlv_firmware()
912 drv->fw.type = IWL_FW_MVM; in iwl_parse_tlv_firmware()
917 if (iwl_set_default_calib(drv, tlv_data)) in iwl_parse_tlv_firmware()
923 drv->fw.phy_config = le32_to_cpup((const __le32 *)tlv_data); in iwl_parse_tlv_firmware()
924 drv->fw.valid_tx_ant = (drv->fw.phy_config & in iwl_parse_tlv_firmware()
927 drv->fw.valid_rx_ant = (drv->fw.phy_config & in iwl_parse_tlv_firmware()
934 drv->fw.type = IWL_FW_MVM; in iwl_parse_tlv_firmware()
939 drv->fw.type = IWL_FW_MVM; in iwl_parse_tlv_firmware()
944 drv->fw.type = IWL_FW_MVM; in iwl_parse_tlv_firmware()
953 drv->fw.img[IWL_UCODE_REGULAR].is_dual_cpus = in iwl_parse_tlv_firmware()
955 drv->fw.img[IWL_UCODE_INIT].is_dual_cpus = in iwl_parse_tlv_firmware()
957 drv->fw.img[IWL_UCODE_WOWLAN].is_dual_cpus = in iwl_parse_tlv_firmware()
960 IWL_ERR(drv, "Driver support up to 2 CPUs\n"); in iwl_parse_tlv_firmware()
983 snprintf(drv->fw.fw_version, in iwl_parse_tlv_firmware()
984 sizeof(drv->fw.fw_version), in iwl_parse_tlv_firmware()
986 local_comp, iwl_reduced_fw_name(drv)); in iwl_parse_tlv_firmware()
988 snprintf(drv->fw.fw_version, in iwl_parse_tlv_firmware()
989 sizeof(drv->fw.fw_version), in iwl_parse_tlv_firmware()
991 local_comp, iwl_reduced_fw_name(drv)); in iwl_parse_tlv_firmware()
1005 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1012 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1027 IWL_INFO(drv, "Found debug destination: %s\n", in iwl_parse_tlv_firmware()
1030 drv->fw.dbg.n_dest_reg = (dest_v1) ? in iwl_parse_tlv_firmware()
1038 drv->fw.dbg.n_dest_reg /= in iwl_parse_tlv_firmware()
1039 sizeof(drv->fw.dbg.dest_tlv->reg_ops[0]); in iwl_parse_tlv_firmware()
1048 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1054 if (conf->id >= ARRAY_SIZE(drv->fw.dbg.conf_tlv)) { in iwl_parse_tlv_firmware()
1055 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1062 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1071 IWL_INFO(drv, "Found debug configuration: %d\n", in iwl_parse_tlv_firmware()
1083 if (trigger_id >= ARRAY_SIZE(drv->fw.dbg.trigger_tlv)) { in iwl_parse_tlv_firmware()
1084 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1091 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1097 IWL_INFO(drv, "Found debug trigger: %u\n", trigger->id); in iwl_parse_tlv_firmware()
1105 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1110 drv->fw.dbg.dump_mask = in iwl_parse_tlv_firmware()
1125 IWL_DEBUG_FW(drv, in iwl_parse_tlv_firmware()
1130 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1137 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1143 drv->fw.img[IWL_UCODE_REGULAR].paging_mem_size = in iwl_parse_tlv_firmware()
1146 drv->fw.img[usniffer_img].paging_mem_size = in iwl_parse_tlv_firmware()
1161 IWL_DEBUG_INFO(drv, "Found debug memory segment: %u\n", in iwl_parse_tlv_firmware()
1175 drv->fw.iml_len = tlv_len; in iwl_parse_tlv_firmware()
1176 drv->fw.iml = kmemdup(tlv_data, tlv_len, GFP_KERNEL); in iwl_parse_tlv_firmware()
1177 if (!drv->fw.iml) in iwl_parse_tlv_firmware()
1203 IWL_INFO(drv, "TLV_FW_FSEQ_VERSION: %.32s\n", in iwl_parse_tlv_firmware()
1212 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1232 if (drv->trans->trans_cfg->device_family < in iwl_parse_tlv_firmware()
1235 drv->trans->dbg.umac_error_event_table = in iwl_parse_tlv_firmware()
1238 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_tlv_firmware()
1248 if (drv->trans->trans_cfg->device_family < in iwl_parse_tlv_firmware()
1251 drv->trans->dbg.lmac_error_event_table[0] = in iwl_parse_tlv_firmware()
1254 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_tlv_firmware()
1259 iwl_parse_dbg_tlv_assert_tables(drv, tlv); in iwl_parse_tlv_firmware()
1267 iwl_dbg_tlv_alloc(drv->trans, tlv, false); in iwl_parse_tlv_firmware()
1271 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1287 if (drv->fw.phy_integration_ver) { in iwl_parse_tlv_firmware()
1288 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1293 drv->fw.phy_integration_ver = in iwl_parse_tlv_firmware()
1295 if (!drv->fw.phy_integration_ver) in iwl_parse_tlv_firmware()
1297 drv->fw.phy_integration_ver_len = tlv_len; in iwl_parse_tlv_firmware()
1301 iwl_drv_set_dump_exclude(drv, tlv_type, in iwl_parse_tlv_firmware()
1307 drv->trans->dbg.pc_data = in iwl_parse_tlv_firmware()
1309 if (!drv->trans->dbg.pc_data) in iwl_parse_tlv_firmware()
1311 drv->trans->dbg.num_pc = in iwl_parse_tlv_firmware()
1315 IWL_DEBUG_INFO(drv, "unknown TLV: %d\n", tlv_type); in iwl_parse_tlv_firmware()
1322 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1328 IWL_ERR(drv, "invalid TLV after parsing: %zd\n", len); in iwl_parse_tlv_firmware()
1329 iwl_print_hex_dump(drv, IWL_DL_FW, data, len); in iwl_parse_tlv_firmware()
1336 IWL_ERR(drv, "TLV %d has invalid size: %u\n", tlv_type, tlv_len); in iwl_parse_tlv_firmware()
1338 iwl_print_hex_dump(drv, IWL_DL_FW, tlv_data, tlv_len); in iwl_parse_tlv_firmware()
1343 static int iwl_alloc_ucode(struct iwl_drv *drv, in iwl_alloc_ucode() argument
1353 drv->fw.img[type].sec = sec; in iwl_alloc_ucode()
1354 drv->fw.img[type].num_sec = pieces->img[type].sec_counter; in iwl_alloc_ucode()
1357 if (iwl_alloc_fw_desc(drv, &sec[i], get_sec(pieces, type, i))) in iwl_alloc_ucode()
1363 static int validate_sec_sizes(struct iwl_drv *drv, in validate_sec_sizes() argument
1367 IWL_DEBUG_INFO(drv, "f/w package hdr runtime inst size = %zd\n", in validate_sec_sizes()
1370 IWL_DEBUG_INFO(drv, "f/w package hdr runtime data size = %zd\n", in validate_sec_sizes()
1373 IWL_DEBUG_INFO(drv, "f/w package hdr init inst size = %zd\n", in validate_sec_sizes()
1375 IWL_DEBUG_INFO(drv, "f/w package hdr init data size = %zd\n", in validate_sec_sizes()
1381 IWL_ERR(drv, "uCode instr len %zd too large to fit in\n", in validate_sec_sizes()
1389 IWL_ERR(drv, "uCode data len %zd too large to fit in\n", in validate_sec_sizes()
1397 IWL_ERR(drv, "uCode init instr len %zd too large to fit in\n", in validate_sec_sizes()
1405 IWL_ERR(drv, "uCode init data len %zd too large to fit in\n", in validate_sec_sizes()
1414 _iwl_op_mode_start(struct iwl_drv *drv, struct iwlwifi_opmode_table *op) in _iwl_op_mode_start() argument
1424 drv->dbgfs_op_mode = debugfs_create_dir(op->name, in _iwl_op_mode_start()
1425 drv->dbgfs_drv); in _iwl_op_mode_start()
1426 dbgfs_dir = drv->dbgfs_op_mode; in _iwl_op_mode_start()
1429 op_mode = ops->start(drv->trans, drv->trans->cfg, in _iwl_op_mode_start()
1430 &drv->fw, dbgfs_dir); in _iwl_op_mode_start()
1435 IWL_ERR(drv, "retry init count %d\n", retry); in _iwl_op_mode_start()
1438 debugfs_remove_recursive(drv->dbgfs_op_mode); in _iwl_op_mode_start()
1439 drv->dbgfs_op_mode = NULL; in _iwl_op_mode_start()
1446 static void _iwl_op_mode_stop(struct iwl_drv *drv) in _iwl_op_mode_stop() argument
1449 if (drv->op_mode) { in _iwl_op_mode_stop()
1450 iwl_op_mode_stop(drv->op_mode); in _iwl_op_mode_stop()
1451 drv->op_mode = NULL; in _iwl_op_mode_stop()
1454 debugfs_remove_recursive(drv->dbgfs_op_mode); in _iwl_op_mode_stop()
1455 drv->dbgfs_op_mode = NULL; in _iwl_op_mode_stop()
1468 struct iwl_drv *drv = context; in iwl_req_fw_callback() local
1469 struct iwl_fw *fw = &drv->fw; in iwl_req_fw_callback()
1474 const unsigned int api_max = drv->trans->cfg->ucode_api_max; in iwl_req_fw_callback()
1475 const unsigned int api_min = drv->trans->cfg->ucode_api_min; in iwl_req_fw_callback()
1499 IWL_DEBUG_FW_INFO(drv, "Loaded firmware file '%s' (%zd bytes).\n", in iwl_req_fw_callback()
1500 drv->firmware_name, ucode_raw->size); in iwl_req_fw_callback()
1504 IWL_ERR(drv, "File size way too small!\n"); in iwl_req_fw_callback()
1512 err = iwl_parse_v1_v2_firmware(drv, ucode_raw, pieces); in iwl_req_fw_callback()
1514 err = iwl_parse_tlv_firmware(drv, ucode_raw, pieces, in iwl_req_fw_callback()
1520 if (fw_has_api(&drv->fw.ucode_capa, IWL_UCODE_TLV_API_NEW_VERSION)) in iwl_req_fw_callback()
1521 api_ver = drv->fw.ucode_ver; in iwl_req_fw_callback()
1523 api_ver = IWL_UCODE_API(drv->fw.ucode_ver); in iwl_req_fw_callback()
1531 IWL_ERR(drv, in iwl_req_fw_callback()
1542 if (fw->type == IWL_FW_DVM && validate_sec_sizes(drv, pieces, in iwl_req_fw_callback()
1543 drv->trans->cfg)) in iwl_req_fw_callback()
1553 if (iwl_alloc_ucode(drv, pieces, i)) in iwl_req_fw_callback()
1557 size_t dbg_dest_size = sizeof(*drv->fw.dbg.dest_tlv) + in iwl_req_fw_callback()
1558 sizeof(drv->fw.dbg.dest_tlv->reg_ops[0]) * in iwl_req_fw_callback()
1559 drv->fw.dbg.n_dest_reg; in iwl_req_fw_callback()
1561 drv->fw.dbg.dest_tlv = kmalloc(dbg_dest_size, GFP_KERNEL); in iwl_req_fw_callback()
1563 if (!drv->fw.dbg.dest_tlv) in iwl_req_fw_callback()
1567 memcpy(drv->fw.dbg.dest_tlv, pieces->dbg_dest_tlv_v1, in iwl_req_fw_callback()
1571 drv->fw.dbg.dest_tlv; in iwl_req_fw_callback()
1586 sizeof(drv->fw.dbg.dest_tlv->reg_ops[0]) * in iwl_req_fw_callback()
1587 drv->fw.dbg.n_dest_reg); in iwl_req_fw_callback()
1603 for (i = 0; i < ARRAY_SIZE(drv->fw.dbg.conf_tlv); i++) { in iwl_req_fw_callback()
1605 drv->fw.dbg.conf_tlv[i] = in iwl_req_fw_callback()
1609 if (!drv->fw.dbg.conf_tlv[i]) in iwl_req_fw_callback()
1636 for (i = 0; i < ARRAY_SIZE(drv->fw.dbg.trigger_tlv); i++) { in iwl_req_fw_callback()
1649 drv->fw.dbg.trigger_tlv_len[i] = in iwl_req_fw_callback()
1651 drv->fw.dbg.trigger_tlv[i] = in iwl_req_fw_callback()
1653 drv->fw.dbg.trigger_tlv_len[i], in iwl_req_fw_callback()
1655 if (!drv->fw.dbg.trigger_tlv[i]) in iwl_req_fw_callback()
1662 drv->fw.dbg.mem_tlv = pieces->dbg_mem_tlv; in iwl_req_fw_callback()
1664 drv->fw.dbg.n_mem_tlv = pieces->n_mem_tlv; in iwl_req_fw_callback()
1676 drv->trans->trans_cfg->base_params->max_event_log_size; in iwl_req_fw_callback()
1683 drv->trans->trans_cfg->base_params->max_event_log_size; in iwl_req_fw_callback()
1698 iwl_dbg_tlv_load_bin(drv->trans->dev, drv->trans); in iwl_req_fw_callback()
1713 IWL_INFO(drv, "loaded firmware version %s op_mode %s\n", in iwl_req_fw_callback()
1714 drv->fw.fw_version, op->name); in iwl_req_fw_callback()
1717 list_add_tail(&drv->list, &op->drv); in iwl_req_fw_callback()
1720 drv->op_mode = _iwl_op_mode_start(drv, op); in iwl_req_fw_callback()
1722 if (!drv->op_mode) { in iwl_req_fw_callback()
1736 complete(&drv->request_firmware_complete); in iwl_req_fw_callback()
1751 if (iwl_request_firmware(drv, false)) in iwl_req_fw_callback()
1758 complete(&drv->request_firmware_complete); in iwl_req_fw_callback()
1759 device_release_driver(drv->trans->dev); in iwl_req_fw_callback()
1760 /* drv has just been freed by the release */ in iwl_req_fw_callback()
1764 iwl_dealloc_ucode(drv); in iwl_req_fw_callback()
1776 struct iwl_drv *drv; in iwl_drv_start() local
1779 drv = kzalloc(sizeof(*drv), GFP_KERNEL); in iwl_drv_start()
1780 if (!drv) { in iwl_drv_start()
1785 drv->trans = trans; in iwl_drv_start()
1786 drv->dev = trans->dev; in iwl_drv_start()
1788 init_completion(&drv->request_firmware_complete); in iwl_drv_start()
1789 INIT_LIST_HEAD(&drv->list); in iwl_drv_start()
1793 drv->dbgfs_drv = debugfs_create_dir(dev_name(trans->dev), in iwl_drv_start()
1797 drv->trans->dbgfs_dir = debugfs_create_dir("trans", drv->dbgfs_drv); in iwl_drv_start()
1800 drv->trans->dbg.domains_bitmap = IWL_TRANS_FW_DBG_DOMAIN(drv->trans); in iwl_drv_start()
1805 drv->trans->dbg.domains_bitmap &= 0xffff; in iwl_drv_start()
1813 drv->trans->dbg.domains_bitmap = in iwl_drv_start()
1818 ret = iwl_request_firmware(drv, true); in iwl_drv_start()
1824 return drv; in iwl_drv_start()
1828 debugfs_remove_recursive(drv->dbgfs_drv); in iwl_drv_start()
1830 iwl_dbg_tlv_free(drv->trans); in iwl_drv_start()
1831 kfree(drv); in iwl_drv_start()
1836 void iwl_drv_stop(struct iwl_drv *drv) in iwl_drv_stop() argument
1838 wait_for_completion(&drv->request_firmware_complete); in iwl_drv_stop()
1840 _iwl_op_mode_stop(drv); in iwl_drv_stop()
1842 iwl_dealloc_ucode(drv); in iwl_drv_stop()
1850 if (!list_empty(&drv->list)) in iwl_drv_stop()
1851 list_del(&drv->list); in iwl_drv_stop()
1855 drv->trans->ops->debugfs_cleanup(drv->trans); in iwl_drv_stop()
1857 debugfs_remove_recursive(drv->dbgfs_drv); in iwl_drv_stop()
1860 iwl_dbg_tlv_free(drv->trans); in iwl_drv_stop()
1862 kfree(drv); in iwl_drv_stop()
1879 struct iwl_drv *drv; in iwl_opmode_register() local
1889 list_for_each_entry(drv, &op->drv, list) in iwl_opmode_register()
1890 drv->op_mode = _iwl_op_mode_start(drv, op); in iwl_opmode_register()
1903 struct iwl_drv *drv; in iwl_opmode_deregister() local
1912 list_for_each_entry(drv, &iwlwifi_opmode_table[i].drv, list) in iwl_opmode_deregister()
1913 _iwl_op_mode_stop(drv); in iwl_opmode_deregister()
1927 INIT_LIST_HEAD(&iwlwifi_opmode_table[i].drv); in iwl_drv_init()