Lines Matching full:pieces
340 * These functions are just to extract uCode section data from the pieces
343 static struct fw_sec *get_sec(struct iwl_firmware_pieces *pieces,
347 return &pieces->img[type].sec[sec];
350 static void alloc_sec_data(struct iwl_firmware_pieces *pieces,
354 struct fw_img_parsing *img = &pieces->img[type];
370 static void set_sec_data(struct iwl_firmware_pieces *pieces,
375 alloc_sec_data(pieces, type, sec);
377 pieces->img[type].sec[sec].data = data;
380 static void set_sec_size(struct iwl_firmware_pieces *pieces,
385 alloc_sec_data(pieces, type, sec);
387 pieces->img[type].sec[sec].size = size;
390 static size_t get_sec_size(struct iwl_firmware_pieces *pieces,
394 return pieces->img[type].sec[sec].size;
397 static void set_sec_offset(struct iwl_firmware_pieces *pieces,
402 alloc_sec_data(pieces, type, sec);
404 pieces->img[type].sec[sec].offset = offset;
410 static int iwl_store_ucode_sec(struct iwl_firmware_pieces *pieces,
419 if (WARN_ON(!pieces || !data || type >= IWL_UCODE_TYPE_MAX))
424 img = &pieces->img[type];
515 struct iwl_firmware_pieces *pieces)
533 set_sec_size(pieces, IWL_UCODE_REGULAR, IWL_UCODE_SECTION_INST,
535 set_sec_size(pieces, IWL_UCODE_REGULAR, IWL_UCODE_SECTION_DATA,
537 set_sec_size(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_INST,
539 set_sec_size(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_DATA,
552 set_sec_size(pieces, IWL_UCODE_REGULAR, IWL_UCODE_SECTION_INST,
554 set_sec_size(pieces, IWL_UCODE_REGULAR, IWL_UCODE_SECTION_DATA,
556 set_sec_size(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_INST,
558 set_sec_size(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_DATA,
581 get_sec_size(pieces, IWL_UCODE_REGULAR, IWL_UCODE_SECTION_INST) +
582 get_sec_size(pieces, IWL_UCODE_REGULAR, IWL_UCODE_SECTION_DATA) +
583 get_sec_size(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_INST) +
584 get_sec_size(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_DATA)) {
593 set_sec_data(pieces, IWL_UCODE_REGULAR, IWL_UCODE_SECTION_INST, src);
594 src += get_sec_size(pieces, IWL_UCODE_REGULAR, IWL_UCODE_SECTION_INST);
595 set_sec_offset(pieces, IWL_UCODE_REGULAR, IWL_UCODE_SECTION_INST,
597 set_sec_data(pieces, IWL_UCODE_REGULAR, IWL_UCODE_SECTION_DATA, src);
598 src += get_sec_size(pieces, IWL_UCODE_REGULAR, IWL_UCODE_SECTION_DATA);
599 set_sec_offset(pieces, IWL_UCODE_REGULAR, IWL_UCODE_SECTION_DATA,
601 set_sec_data(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_INST, src);
602 src += get_sec_size(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_INST);
603 set_sec_offset(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_INST,
605 set_sec_data(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_DATA, src);
606 src += get_sec_size(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_DATA);
607 set_sec_offset(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_DATA,
711 struct iwl_firmware_pieces *pieces,
780 set_sec_data(pieces, IWL_UCODE_REGULAR,
782 set_sec_size(pieces, IWL_UCODE_REGULAR,
784 set_sec_offset(pieces, IWL_UCODE_REGULAR,
789 set_sec_data(pieces, IWL_UCODE_REGULAR,
791 set_sec_size(pieces, IWL_UCODE_REGULAR,
793 set_sec_offset(pieces, IWL_UCODE_REGULAR,
798 set_sec_data(pieces, IWL_UCODE_INIT,
800 set_sec_size(pieces, IWL_UCODE_INIT,
802 set_sec_offset(pieces, IWL_UCODE_INIT,
807 set_sec_data(pieces, IWL_UCODE_INIT,
809 set_sec_size(pieces, IWL_UCODE_INIT,
811 set_sec_offset(pieces, IWL_UCODE_INIT,
858 pieces->init_evtlog_ptr =
864 pieces->init_evtlog_size =
870 pieces->init_errlog_ptr =
876 pieces->inst_evtlog_ptr =
882 pieces->inst_evtlog_size =
888 pieces->inst_errlog_ptr =
897 set_sec_data(pieces, IWL_UCODE_WOWLAN,
899 set_sec_size(pieces, IWL_UCODE_WOWLAN,
901 set_sec_offset(pieces, IWL_UCODE_WOWLAN,
906 set_sec_data(pieces, IWL_UCODE_WOWLAN,
908 set_sec_size(pieces, IWL_UCODE_WOWLAN,
910 set_sec_offset(pieces, IWL_UCODE_WOWLAN,
921 iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_REGULAR,
926 iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_INIT,
931 iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_WOWLAN,
953 iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_REGULAR,
958 iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_INIT,
963 iwl_store_ucode_sec(pieces, tlv_data, IWL_UCODE_WOWLAN,
1014 pieces->dbg_dest_ver = (const u8 *)tlv_data;
1015 if (*pieces->dbg_dest_ver == 1) {
1017 } else if (*pieces->dbg_dest_ver == 0) {
1022 *pieces->dbg_dest_ver);
1026 if (pieces->dbg_dest_tlv_init) {
1032 pieces->dbg_dest_tlv_init = true;
1035 pieces->dbg_dest_tlv_v1 = dest_v1;
1038 pieces->dbg_dest_tlv = dest;
1062 if (!pieces->dbg_dest_tlv_init) {
1076 if (pieces->dbg_conf_tlv[conf->id]) {
1089 pieces->dbg_conf_tlv[conf->id] = conf;
1090 pieces->dbg_conf_tlv_len[conf->id] = tlv_len;
1105 if (pieces->dbg_trigger_tlv[trigger_id]) {
1114 pieces->dbg_trigger_tlv[trigger_id] = trigger;
1115 pieces->dbg_trigger_tlv_len[trigger_id] = tlv_len;
1131 iwl_store_ucode_sec(pieces, tlv_data,
1179 size = sizeof(*pieces->dbg_mem_tlv) *
1180 (pieces->n_mem_tlv + 1);
1181 n = krealloc(pieces->dbg_mem_tlv, size, GFP_KERNEL);
1184 pieces->dbg_mem_tlv = n;
1185 pieces->dbg_mem_tlv[pieces->n_mem_tlv] = *dbg_mem;
1186 pieces->n_mem_tlv++;
1371 struct iwl_firmware_pieces *pieces,
1377 sec = kcalloc(pieces->img[type].sec_counter, sizeof(*sec), GFP_KERNEL);
1381 drv->fw.img[type].num_sec = pieces->img[type].sec_counter;
1383 for (i = 0; i < pieces->img[type].sec_counter; i++)
1384 if (iwl_alloc_fw_desc(drv, &sec[i], get_sec(pieces, type, i)))
1391 struct iwl_firmware_pieces *pieces,
1395 get_sec_size(pieces, IWL_UCODE_REGULAR,
1398 get_sec_size(pieces, IWL_UCODE_REGULAR,
1401 get_sec_size(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_INST));
1403 get_sec_size(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_DATA));
1406 if (get_sec_size(pieces, IWL_UCODE_REGULAR, IWL_UCODE_SECTION_INST) >
1409 get_sec_size(pieces, IWL_UCODE_REGULAR,
1414 if (get_sec_size(pieces, IWL_UCODE_REGULAR, IWL_UCODE_SECTION_DATA) >
1417 get_sec_size(pieces, IWL_UCODE_REGULAR,
1422 if (get_sec_size(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_INST) >
1425 get_sec_size(pieces, IWL_UCODE_INIT,
1430 if (get_sec_size(pieces, IWL_UCODE_INIT, IWL_UCODE_SECTION_DATA) >
1433 get_sec_size(pieces, IWL_UCODE_REGULAR,
1499 struct iwl_firmware_pieces *pieces;
1517 pieces = kzalloc(sizeof(*pieces), GFP_KERNEL);
1518 if (!pieces)
1537 err = iwl_parse_v1_v2_firmware(drv, ucode_raw, pieces);
1539 err = iwl_parse_tlv_firmware(drv, ucode_raw, pieces,
1567 if (fw->type == IWL_FW_DVM && validate_sec_sizes(drv, pieces,
1578 if (iwl_alloc_ucode(drv, pieces, i))
1581 if (pieces->dbg_dest_tlv_init) {
1591 if (*pieces->dbg_dest_ver == 0) {
1592 memcpy(drv->fw.dbg.dest_tlv, pieces->dbg_dest_tlv_v1,
1598 dest_tlv->version = pieces->dbg_dest_tlv->version;
1600 pieces->dbg_dest_tlv->monitor_mode;
1602 pieces->dbg_dest_tlv->size_power;
1604 pieces->dbg_dest_tlv->wrap_count;
1606 pieces->dbg_dest_tlv->write_ptr_reg;
1608 pieces->dbg_dest_tlv->base_shift;
1610 pieces->dbg_dest_tlv->reg_ops,
1622 dest_tlv->base_reg = pieces->dbg_dest_tlv->cfg_reg;
1624 pieces->dbg_dest_tlv->size_shift;
1629 if (pieces->dbg_conf_tlv[i]) {
1631 kmemdup(pieces->dbg_conf_tlv[i],
1632 pieces->dbg_conf_tlv_len[i],
1662 if (pieces->dbg_trigger_tlv[i]) {
1670 if (WARN_ON(pieces->dbg_trigger_tlv_len[i] <
1675 pieces->dbg_trigger_tlv_len[i];
1677 kmemdup(pieces->dbg_trigger_tlv[i],
1687 drv->fw.dbg.mem_tlv = pieces->dbg_mem_tlv;
1688 pieces->dbg_mem_tlv = NULL;
1689 drv->fw.dbg.n_mem_tlv = pieces->n_mem_tlv;
1696 fw->init_evtlog_ptr = pieces->init_evtlog_ptr;
1697 if (pieces->init_evtlog_size)
1698 fw->init_evtlog_size = (pieces->init_evtlog_size - 16)/12;
1702 fw->init_errlog_ptr = pieces->init_errlog_ptr;
1703 fw->inst_evtlog_ptr = pieces->inst_evtlog_ptr;
1704 if (pieces->inst_evtlog_size)
1705 fw->inst_evtlog_size = (pieces->inst_evtlog_size - 16)/12;
1709 fw->inst_errlog_ptr = pieces->inst_errlog_ptr;
1792 if (pieces) {
1793 for (i = 0; i < ARRAY_SIZE(pieces->img); i++)
1794 kfree(pieces->img[i].sec);
1795 kfree(pieces->dbg_mem_tlv);
1796 kfree(pieces);