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
225 static int iwl_request_firmware(struct iwl_drv *drv, bool first) in iwl_request_firmware() argument
227 const struct iwl_cfg *cfg = drv->trans->cfg; in iwl_request_firmware()
231 if (drv->trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_9000 && in iwl_request_firmware()
232 (drv->trans->hw_rev_step != SILICON_B_STEP && in iwl_request_firmware()
233 drv->trans->hw_rev_step != SILICON_C_STEP)) { in iwl_request_firmware()
234 IWL_ERR(drv, in iwl_request_firmware()
236 drv->trans->hw_rev); in iwl_request_firmware()
240 fw_name_pre = iwl_drv_get_fwname_pre(drv->trans, _fw_name_pre); in iwl_request_firmware()
243 drv->fw_index = cfg->ucode_api_max; in iwl_request_firmware()
245 drv->fw_index--; in iwl_request_firmware()
247 if (drv->fw_index < cfg->ucode_api_min) { in iwl_request_firmware()
248 IWL_ERR(drv, "no suitable firmware found!\n"); in iwl_request_firmware()
251 IWL_ERR(drv, "%s-%d is required\n", fw_name_pre, in iwl_request_firmware()
254 IWL_ERR(drv, "minimum version required: %s-%d\n", in iwl_request_firmware()
256 IWL_ERR(drv, "maximum version supported: %s-%d\n", in iwl_request_firmware()
260 IWL_ERR(drv, in iwl_request_firmware()
265 snprintf(drv->firmware_name, sizeof(drv->firmware_name), "%s-%d.ucode", in iwl_request_firmware()
266 fw_name_pre, drv->fw_index); in iwl_request_firmware()
268 IWL_DEBUG_FW_INFO(drv, "attempting to load firmware '%s'\n", in iwl_request_firmware()
269 drv->firmware_name); in iwl_request_firmware()
271 return request_firmware_nowait(THIS_MODULE, 1, drv->firmware_name, in iwl_request_firmware()
272 drv->trans->dev, in iwl_request_firmware()
273 GFP_KERNEL, drv, iwl_req_fw_callback); in iwl_request_firmware()
425 static int iwl_set_default_calib(struct iwl_drv *drv, const u8 *data) in iwl_set_default_calib() argument
431 IWL_ERR(drv, "Wrong ucode_type %u for default calibration.\n", in iwl_set_default_calib()
435 drv->fw.default_calib[ucode_type].flow_trigger = in iwl_set_default_calib()
437 drv->fw.default_calib[ucode_type].event_trigger = in iwl_set_default_calib()
443 static void iwl_set_ucode_api_flags(struct iwl_drv *drv, const u8 *data, in iwl_set_ucode_api_flags() argument
452 IWL_WARN(drv, in iwl_set_ucode_api_flags()
464 static void iwl_set_ucode_capabilities(struct iwl_drv *drv, const u8 *data, in iwl_set_ucode_capabilities() argument
473 IWL_WARN(drv, in iwl_set_ucode_capabilities()
485 static const char *iwl_reduced_fw_name(struct iwl_drv *drv) in iwl_reduced_fw_name() argument
487 const char *name = drv->firmware_name; in iwl_reduced_fw_name()
495 static int iwl_parse_v1_v2_firmware(struct iwl_drv *drv, in iwl_parse_v1_v2_firmware() argument
504 drv->fw.ucode_ver = le32_to_cpu(ucode->ver); in iwl_parse_v1_v2_firmware()
505 api_ver = IWL_UCODE_API(drv->fw.ucode_ver); in iwl_parse_v1_v2_firmware()
511 IWL_ERR(drv, "File size too small!\n"); in iwl_parse_v1_v2_firmware()
530 IWL_ERR(drv, "File size too small!\n"); in iwl_parse_v1_v2_firmware()
551 snprintf(drv->fw.fw_version, in iwl_parse_v1_v2_firmware()
552 sizeof(drv->fw.fw_version), in iwl_parse_v1_v2_firmware()
554 IWL_UCODE_MAJOR(drv->fw.ucode_ver), in iwl_parse_v1_v2_firmware()
555 IWL_UCODE_MINOR(drv->fw.ucode_ver), in iwl_parse_v1_v2_firmware()
556 IWL_UCODE_API(drv->fw.ucode_ver), in iwl_parse_v1_v2_firmware()
557 IWL_UCODE_SERIAL(drv->fw.ucode_ver), in iwl_parse_v1_v2_firmware()
558 buildstr, iwl_reduced_fw_name(drv)); in iwl_parse_v1_v2_firmware()
568 IWL_ERR(drv, in iwl_parse_v1_v2_firmware()
594 static void iwl_drv_set_dump_exclude(struct iwl_drv *drv, in iwl_drv_set_dump_exclude() argument
605 excl = &drv->fw.dump_excl[0]; in iwl_drv_set_dump_exclude()
609 excl = &drv->fw.dump_excl_wowlan[0]; in iwl_drv_set_dump_exclude()
610 } else if (fw_has_capa(&drv->fw.ucode_capa, in iwl_drv_set_dump_exclude()
613 excl = &drv->fw.dump_excl[0]; in iwl_drv_set_dump_exclude()
616 excl = &drv->fw.dump_excl_wowlan[0]; in iwl_drv_set_dump_exclude()
623 IWL_DEBUG_FW_INFO(drv, "found too many excludes in fw file\n"); in iwl_drv_set_dump_exclude()
631 static void iwl_parse_dbg_tlv_assert_tables(struct iwl_drv *drv, in iwl_parse_dbg_tlv_assert_tables() argument
652 drv->trans->dbg.umac_error_event_table = addr; in iwl_parse_dbg_tlv_assert_tables()
653 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_dbg_tlv_assert_tables()
657 drv->trans->dbg.lmac_error_event_table[0] = addr; in iwl_parse_dbg_tlv_assert_tables()
658 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_dbg_tlv_assert_tables()
662 drv->trans->dbg.lmac_error_event_table[1] = addr; in iwl_parse_dbg_tlv_assert_tables()
663 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_dbg_tlv_assert_tables()
667 drv->trans->dbg.tcm_error_event_table[0] = addr; in iwl_parse_dbg_tlv_assert_tables()
668 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_dbg_tlv_assert_tables()
672 drv->trans->dbg.tcm_error_event_table[1] = addr; in iwl_parse_dbg_tlv_assert_tables()
673 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_dbg_tlv_assert_tables()
677 drv->trans->dbg.rcm_error_event_table[0] = addr; in iwl_parse_dbg_tlv_assert_tables()
678 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_dbg_tlv_assert_tables()
682 drv->trans->dbg.rcm_error_event_table[1] = addr; in iwl_parse_dbg_tlv_assert_tables()
683 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_dbg_tlv_assert_tables()
691 static int iwl_parse_tlv_firmware(struct iwl_drv *drv, in iwl_parse_tlv_firmware() argument
711 IWL_ERR(drv, "uCode has invalid length: %zd\n", len); in iwl_parse_tlv_firmware()
716 IWL_ERR(drv, "invalid uCode magic: 0X%x\n", in iwl_parse_tlv_firmware()
721 drv->fw.ucode_ver = le32_to_cpu(ucode->ver); in iwl_parse_tlv_firmware()
722 memcpy(drv->fw.human_readable, ucode->human_readable, in iwl_parse_tlv_firmware()
723 sizeof(drv->fw.human_readable)); in iwl_parse_tlv_firmware()
731 snprintf(drv->fw.fw_version, in iwl_parse_tlv_firmware()
732 sizeof(drv->fw.fw_version), in iwl_parse_tlv_firmware()
734 IWL_UCODE_MAJOR(drv->fw.ucode_ver), in iwl_parse_tlv_firmware()
735 IWL_UCODE_MINOR(drv->fw.ucode_ver), in iwl_parse_tlv_firmware()
736 IWL_UCODE_API(drv->fw.ucode_ver), in iwl_parse_tlv_firmware()
737 IWL_UCODE_SERIAL(drv->fw.ucode_ver), in iwl_parse_tlv_firmware()
738 buildstr, iwl_reduced_fw_name(drv)); in iwl_parse_tlv_firmware()
753 IWL_ERR(drv, "invalid TLV len: %zd/%u\n", in iwl_parse_tlv_firmware()
798 IWL_ERR(drv, "Found unexpected BOOT ucode\n"); in iwl_parse_tlv_firmware()
830 iwl_set_ucode_api_flags(drv, tlv_data, capa); in iwl_parse_tlv_firmware()
835 iwl_set_ucode_capabilities(drv, tlv_data, capa); in iwl_parse_tlv_firmware()
876 drv->fw.enhance_sensitivity_table = true; in iwl_parse_tlv_firmware()
905 drv->fw.type = IWL_FW_MVM; in iwl_parse_tlv_firmware()
910 drv->fw.type = IWL_FW_MVM; in iwl_parse_tlv_firmware()
915 drv->fw.type = IWL_FW_MVM; in iwl_parse_tlv_firmware()
920 if (iwl_set_default_calib(drv, tlv_data)) in iwl_parse_tlv_firmware()
926 drv->fw.phy_config = le32_to_cpup((const __le32 *)tlv_data); in iwl_parse_tlv_firmware()
927 drv->fw.valid_tx_ant = (drv->fw.phy_config & in iwl_parse_tlv_firmware()
930 drv->fw.valid_rx_ant = (drv->fw.phy_config & in iwl_parse_tlv_firmware()
937 drv->fw.type = IWL_FW_MVM; in iwl_parse_tlv_firmware()
942 drv->fw.type = IWL_FW_MVM; in iwl_parse_tlv_firmware()
947 drv->fw.type = IWL_FW_MVM; in iwl_parse_tlv_firmware()
956 drv->fw.img[IWL_UCODE_REGULAR].is_dual_cpus = in iwl_parse_tlv_firmware()
958 drv->fw.img[IWL_UCODE_INIT].is_dual_cpus = in iwl_parse_tlv_firmware()
960 drv->fw.img[IWL_UCODE_WOWLAN].is_dual_cpus = in iwl_parse_tlv_firmware()
963 IWL_ERR(drv, "Driver support up to 2 CPUs\n"); in iwl_parse_tlv_firmware()
985 snprintf(drv->fw.fw_version, in iwl_parse_tlv_firmware()
986 sizeof(drv->fw.fw_version), in iwl_parse_tlv_firmware()
988 local_comp, iwl_reduced_fw_name(drv)); in iwl_parse_tlv_firmware()
1002 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1009 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1024 IWL_INFO(drv, "Found debug destination: %s\n", in iwl_parse_tlv_firmware()
1027 drv->fw.dbg.n_dest_reg = (dest_v1) ? in iwl_parse_tlv_firmware()
1035 drv->fw.dbg.n_dest_reg /= in iwl_parse_tlv_firmware()
1036 sizeof(drv->fw.dbg.dest_tlv->reg_ops[0]); in iwl_parse_tlv_firmware()
1045 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1051 if (conf->id >= ARRAY_SIZE(drv->fw.dbg.conf_tlv)) { in iwl_parse_tlv_firmware()
1052 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1059 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1068 IWL_INFO(drv, "Found debug configuration: %d\n", in iwl_parse_tlv_firmware()
1080 if (trigger_id >= ARRAY_SIZE(drv->fw.dbg.trigger_tlv)) { in iwl_parse_tlv_firmware()
1081 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1088 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1094 IWL_INFO(drv, "Found debug trigger: %u\n", trigger->id); in iwl_parse_tlv_firmware()
1102 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1107 drv->fw.dbg.dump_mask = in iwl_parse_tlv_firmware()
1122 IWL_DEBUG_FW(drv, in iwl_parse_tlv_firmware()
1127 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1134 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1140 drv->fw.img[IWL_UCODE_REGULAR].paging_mem_size = in iwl_parse_tlv_firmware()
1143 drv->fw.img[usniffer_img].paging_mem_size = in iwl_parse_tlv_firmware()
1158 IWL_DEBUG_INFO(drv, "Found debug memory segment: %u\n", in iwl_parse_tlv_firmware()
1172 drv->fw.iml_len = tlv_len; in iwl_parse_tlv_firmware()
1173 drv->fw.iml = kmemdup(tlv_data, tlv_len, GFP_KERNEL); in iwl_parse_tlv_firmware()
1174 if (!drv->fw.iml) in iwl_parse_tlv_firmware()
1200 IWL_INFO(drv, "TLV_FW_FSEQ_VERSION: %s\n", in iwl_parse_tlv_firmware()
1209 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1229 if (drv->trans->trans_cfg->device_family < in iwl_parse_tlv_firmware()
1232 drv->trans->dbg.umac_error_event_table = in iwl_parse_tlv_firmware()
1235 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_tlv_firmware()
1245 if (drv->trans->trans_cfg->device_family < in iwl_parse_tlv_firmware()
1248 drv->trans->dbg.lmac_error_event_table[0] = in iwl_parse_tlv_firmware()
1251 drv->trans->dbg.error_event_table_tlv_status |= in iwl_parse_tlv_firmware()
1256 iwl_parse_dbg_tlv_assert_tables(drv, tlv); in iwl_parse_tlv_firmware()
1264 iwl_dbg_tlv_alloc(drv->trans, tlv, false); in iwl_parse_tlv_firmware()
1268 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1284 if (drv->fw.phy_integration_ver) { in iwl_parse_tlv_firmware()
1285 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1290 drv->fw.phy_integration_ver = in iwl_parse_tlv_firmware()
1292 if (!drv->fw.phy_integration_ver) in iwl_parse_tlv_firmware()
1294 drv->fw.phy_integration_ver_len = tlv_len; in iwl_parse_tlv_firmware()
1298 iwl_drv_set_dump_exclude(drv, tlv_type, in iwl_parse_tlv_firmware()
1304 drv->trans->dbg.pc_data = in iwl_parse_tlv_firmware()
1306 if (!drv->trans->dbg.pc_data) in iwl_parse_tlv_firmware()
1308 drv->trans->dbg.num_pc = in iwl_parse_tlv_firmware()
1312 IWL_DEBUG_INFO(drv, "unknown TLV: %d\n", tlv_type); in iwl_parse_tlv_firmware()
1319 IWL_ERR(drv, in iwl_parse_tlv_firmware()
1325 IWL_ERR(drv, "invalid TLV after parsing: %zd\n", len); in iwl_parse_tlv_firmware()
1326 iwl_print_hex_dump(drv, IWL_DL_FW, data, len); in iwl_parse_tlv_firmware()
1333 IWL_ERR(drv, "TLV %d has invalid size: %u\n", tlv_type, tlv_len); in iwl_parse_tlv_firmware()
1335 iwl_print_hex_dump(drv, IWL_DL_FW, tlv_data, tlv_len); in iwl_parse_tlv_firmware()
1340 static int iwl_alloc_ucode(struct iwl_drv *drv, in iwl_alloc_ucode() argument
1350 drv->fw.img[type].sec = sec; in iwl_alloc_ucode()
1351 drv->fw.img[type].num_sec = pieces->img[type].sec_counter; in iwl_alloc_ucode()
1354 if (iwl_alloc_fw_desc(drv, &sec[i], get_sec(pieces, type, i))) in iwl_alloc_ucode()
1360 static int validate_sec_sizes(struct iwl_drv *drv, in validate_sec_sizes() argument
1364 IWL_DEBUG_INFO(drv, "f/w package hdr runtime inst size = %zd\n", in validate_sec_sizes()
1367 IWL_DEBUG_INFO(drv, "f/w package hdr runtime data size = %zd\n", in validate_sec_sizes()
1370 IWL_DEBUG_INFO(drv, "f/w package hdr init inst size = %zd\n", in validate_sec_sizes()
1372 IWL_DEBUG_INFO(drv, "f/w package hdr init data size = %zd\n", in validate_sec_sizes()
1378 IWL_ERR(drv, "uCode instr len %zd too large to fit in\n", in validate_sec_sizes()
1386 IWL_ERR(drv, "uCode data len %zd too large to fit in\n", in validate_sec_sizes()
1394 IWL_ERR(drv, "uCode init instr len %zd too large to fit in\n", in validate_sec_sizes()
1402 IWL_ERR(drv, "uCode init data len %zd too large to fit in\n", in validate_sec_sizes()
1411 _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 if (test_bit(STATUS_TRANS_DEAD, &drv->trans->status)) in _iwl_op_mode_start()
1438 IWL_ERR(drv, "retry init count %d\n", retry); in _iwl_op_mode_start()
1441 debugfs_remove_recursive(drv->dbgfs_op_mode); in _iwl_op_mode_start()
1442 drv->dbgfs_op_mode = NULL; in _iwl_op_mode_start()
1449 static void _iwl_op_mode_stop(struct iwl_drv *drv) in _iwl_op_mode_stop() argument
1455 if (drv->op_mode) { in _iwl_op_mode_stop()
1456 iwl_op_mode_stop(drv->op_mode); in _iwl_op_mode_stop()
1457 drv->op_mode = NULL; in _iwl_op_mode_stop()
1460 debugfs_remove_recursive(drv->dbgfs_op_mode); in _iwl_op_mode_stop()
1461 drv->dbgfs_op_mode = NULL; in _iwl_op_mode_stop()
1474 struct iwl_drv *drv = context; in iwl_req_fw_callback() local
1475 struct iwl_fw *fw = &drv->fw; in iwl_req_fw_callback()
1480 const unsigned int api_max = drv->trans->cfg->ucode_api_max; in iwl_req_fw_callback()
1481 const unsigned int api_min = drv->trans->cfg->ucode_api_min; in iwl_req_fw_callback()
1504 IWL_DEBUG_FW_INFO(drv, "Loaded firmware file '%s' (%zd bytes).\n", in iwl_req_fw_callback()
1505 drv->firmware_name, ucode_raw->size); in iwl_req_fw_callback()
1509 IWL_ERR(drv, "File size way too small!\n"); in iwl_req_fw_callback()
1517 err = iwl_parse_v1_v2_firmware(drv, ucode_raw, pieces); in iwl_req_fw_callback()
1519 err = iwl_parse_tlv_firmware(drv, ucode_raw, pieces, in iwl_req_fw_callback()
1525 if (fw_has_api(&drv->fw.ucode_capa, IWL_UCODE_TLV_API_NEW_VERSION)) in iwl_req_fw_callback()
1526 api_ver = drv->fw.ucode_ver; in iwl_req_fw_callback()
1528 api_ver = IWL_UCODE_API(drv->fw.ucode_ver); in iwl_req_fw_callback()
1536 IWL_ERR(drv, in iwl_req_fw_callback()
1547 if (fw->type == IWL_FW_DVM && validate_sec_sizes(drv, pieces, in iwl_req_fw_callback()
1548 drv->trans->cfg)) in iwl_req_fw_callback()
1558 if (iwl_alloc_ucode(drv, pieces, i)) in iwl_req_fw_callback()
1562 size_t dbg_dest_size = sizeof(*drv->fw.dbg.dest_tlv) + in iwl_req_fw_callback()
1563 sizeof(drv->fw.dbg.dest_tlv->reg_ops[0]) * in iwl_req_fw_callback()
1564 drv->fw.dbg.n_dest_reg; in iwl_req_fw_callback()
1566 drv->fw.dbg.dest_tlv = kmalloc(dbg_dest_size, GFP_KERNEL); in iwl_req_fw_callback()
1568 if (!drv->fw.dbg.dest_tlv) in iwl_req_fw_callback()
1572 memcpy(drv->fw.dbg.dest_tlv, pieces->dbg_dest_tlv_v1, in iwl_req_fw_callback()
1576 drv->fw.dbg.dest_tlv; in iwl_req_fw_callback()
1591 sizeof(drv->fw.dbg.dest_tlv->reg_ops[0]) * in iwl_req_fw_callback()
1592 drv->fw.dbg.n_dest_reg); in iwl_req_fw_callback()
1608 for (i = 0; i < ARRAY_SIZE(drv->fw.dbg.conf_tlv); i++) { in iwl_req_fw_callback()
1610 drv->fw.dbg.conf_tlv[i] = in iwl_req_fw_callback()
1614 if (!drv->fw.dbg.conf_tlv[i]) in iwl_req_fw_callback()
1641 for (i = 0; i < ARRAY_SIZE(drv->fw.dbg.trigger_tlv); i++) { in iwl_req_fw_callback()
1654 drv->fw.dbg.trigger_tlv_len[i] = in iwl_req_fw_callback()
1656 drv->fw.dbg.trigger_tlv[i] = in iwl_req_fw_callback()
1658 drv->fw.dbg.trigger_tlv_len[i], in iwl_req_fw_callback()
1660 if (!drv->fw.dbg.trigger_tlv[i]) in iwl_req_fw_callback()
1667 drv->fw.dbg.mem_tlv = pieces->dbg_mem_tlv; in iwl_req_fw_callback()
1669 drv->fw.dbg.n_mem_tlv = pieces->n_mem_tlv; in iwl_req_fw_callback()
1681 drv->trans->trans_cfg->base_params->max_event_log_size; in iwl_req_fw_callback()
1688 drv->trans->trans_cfg->base_params->max_event_log_size; in iwl_req_fw_callback()
1703 iwl_dbg_tlv_load_bin(drv->trans->dev, drv->trans); in iwl_req_fw_callback()
1718 IWL_INFO(drv, "loaded firmware version %s op_mode %s\n", in iwl_req_fw_callback()
1719 drv->fw.fw_version, op->name); in iwl_req_fw_callback()
1722 list_add_tail(&drv->list, &op->drv); in iwl_req_fw_callback()
1725 drv->op_mode = _iwl_op_mode_start(drv, op); in iwl_req_fw_callback()
1727 if (!drv->op_mode) { in iwl_req_fw_callback()
1736 complete(&drv->request_firmware_complete); in iwl_req_fw_callback()
1744 if (iwl_request_firmware(drv, false)) in iwl_req_fw_callback()
1751 complete(&drv->request_firmware_complete); in iwl_req_fw_callback()
1752 device_release_driver(drv->trans->dev); in iwl_req_fw_callback()
1753 /* drv has just been freed by the release */ in iwl_req_fw_callback()
1757 iwl_dealloc_ucode(drv); in iwl_req_fw_callback()
1769 struct iwl_drv *drv; in iwl_drv_start() local
1772 drv = kzalloc(sizeof(*drv), GFP_KERNEL); in iwl_drv_start()
1773 if (!drv) { in iwl_drv_start()
1778 drv->trans = trans; in iwl_drv_start()
1779 drv->dev = trans->dev; in iwl_drv_start()
1781 init_completion(&drv->request_firmware_complete); in iwl_drv_start()
1782 INIT_LIST_HEAD(&drv->list); in iwl_drv_start()
1786 drv->dbgfs_drv = debugfs_create_dir(dev_name(trans->dev), in iwl_drv_start()
1790 drv->trans->dbgfs_dir = debugfs_create_dir("trans", drv->dbgfs_drv); in iwl_drv_start()
1793 drv->trans->dbg.domains_bitmap = IWL_TRANS_FW_DBG_DOMAIN(drv->trans); in iwl_drv_start()
1798 drv->trans->dbg.domains_bitmap &= 0xffff; in iwl_drv_start()
1806 drv->trans->dbg.domains_bitmap = in iwl_drv_start()
1811 ret = iwl_request_firmware(drv, true); in iwl_drv_start()
1817 return drv; in iwl_drv_start()
1821 debugfs_remove_recursive(drv->dbgfs_drv); in iwl_drv_start()
1823 iwl_dbg_tlv_free(drv->trans); in iwl_drv_start()
1824 kfree(drv); in iwl_drv_start()
1829 void iwl_drv_stop(struct iwl_drv *drv) in iwl_drv_stop() argument
1831 wait_for_completion(&drv->request_firmware_complete); in iwl_drv_stop()
1835 _iwl_op_mode_stop(drv); in iwl_drv_stop()
1837 iwl_dealloc_ucode(drv); in iwl_drv_stop()
1844 if (!list_empty(&drv->list)) in iwl_drv_stop()
1845 list_del(&drv->list); in iwl_drv_stop()
1849 iwl_trans_debugfs_cleanup(drv->trans); in iwl_drv_stop()
1851 debugfs_remove_recursive(drv->dbgfs_drv); in iwl_drv_stop()
1854 iwl_dbg_tlv_free(drv->trans); in iwl_drv_stop()
1856 kfree(drv); in iwl_drv_stop()
1873 struct iwl_drv *drv; in iwl_opmode_register() local
1883 list_for_each_entry(drv, &op->drv, list) in iwl_opmode_register()
1884 drv->op_mode = _iwl_op_mode_start(drv, op); in iwl_opmode_register()
1897 struct iwl_drv *drv; in iwl_opmode_deregister() local
1906 list_for_each_entry(drv, &iwlwifi_opmode_table[i].drv, list) in iwl_opmode_deregister()
1907 _iwl_op_mode_stop(drv); in iwl_opmode_deregister()
1921 INIT_LIST_HEAD(&iwlwifi_opmode_table[i].drv); in iwl_drv_init()