Lines Matching refs:hmc_info

58 static inline void i40iw_find_sd_index_limit(struct i40iw_hmc_info *hmc_info,  in i40iw_find_sd_index_limit()  argument
67 fpm_addr = hmc_info->hmc_obj[(type)].base + in i40iw_find_sd_index_limit()
68 hmc_info->hmc_obj[type].size * idx; in i40iw_find_sd_index_limit()
69 fpm_limit = fpm_addr + hmc_info->hmc_obj[type].size * cnt; in i40iw_find_sd_index_limit()
88 static inline void i40iw_find_pd_index_limit(struct i40iw_hmc_info *hmc_info, in i40iw_find_pd_index_limit() argument
97 fpm_adr = hmc_info->hmc_obj[type].base + in i40iw_find_pd_index_limit()
98 hmc_info->hmc_obj[type].size * idx; in i40iw_find_pd_index_limit()
99 fpm_limit = fpm_adr + (hmc_info)->hmc_obj[(type)].size * (cnt); in i40iw_find_pd_index_limit()
176 struct i40iw_hmc_info *hmc_info, in i40iw_hmc_sd_grp() argument
188 sdinfo.hmc_fn_id = hmc_info->hmc_fn_id; in i40iw_hmc_sd_grp()
190 sd_entry = &hmc_info->sd_table.sd_entry[i]; in i40iw_hmc_sd_grp()
251 struct i40iw_hmc_info *hmc_info = NULL; in i40iw_vf_hmcinfo_from_fpm() local
257 hmc_info = &dev->vf_dev[idx]->hmc_info; in i40iw_vf_hmcinfo_from_fpm()
261 return hmc_info; in i40iw_vf_hmcinfo_from_fpm()
272 if (info->start_idx >= info->hmc_info->hmc_obj[info->rsrc_type].cnt) in i40iw_hmc_finish_add_sd_reg()
276 info->hmc_info->hmc_obj[info->rsrc_type].cnt) in i40iw_hmc_finish_add_sd_reg()
282 return i40iw_hmc_sd_grp(dev, info->hmc_info, in i40iw_hmc_finish_add_sd_reg()
283 info->hmc_info->sd_indexes[0], in i40iw_hmc_finish_add_sd_reg()
306 if (info->start_idx >= info->hmc_info->hmc_obj[info->rsrc_type].cnt) in i40iw_sc_create_hmc_obj()
310 info->hmc_info->hmc_obj[info->rsrc_type].cnt) { in i40iw_sc_create_hmc_obj()
314 info->hmc_info->hmc_obj[info->rsrc_type].cnt); in i40iw_sc_create_hmc_obj()
321 i40iw_find_sd_index_limit(info->hmc_info, info->rsrc_type, in i40iw_sc_create_hmc_obj()
324 if (sd_idx >= info->hmc_info->sd_table.sd_cnt || in i40iw_sc_create_hmc_obj()
325 sd_lmt > info->hmc_info->sd_table.sd_cnt) { in i40iw_sc_create_hmc_obj()
328 i40iw_find_pd_index_limit(info->hmc_info, info->rsrc_type, in i40iw_sc_create_hmc_obj()
332 ret_code = i40iw_add_sd_table_entry(dev->hw, info->hmc_info, in i40iw_sc_create_hmc_obj()
338 sd_entry = &info->hmc_info->sd_table.sd_entry[j]; in i40iw_sc_create_hmc_obj()
341 ((dev->hmc_info == info->hmc_info) && in i40iw_sc_create_hmc_obj()
348 ret_code = i40iw_add_pd_table_entry(dev->hw, info->hmc_info, in i40iw_sc_create_hmc_obj()
357 i40iw_remove_pd_bp(dev->hw, info->hmc_info, (i - 1), in i40iw_sc_create_hmc_obj()
366 info->hmc_info->sd_indexes[info->add_sd_cnt] = (u16)j; in i40iw_sc_create_hmc_obj()
374 sd_entry = &info->hmc_info->sd_table.sd_entry[j - 1]; in i40iw_sc_create_hmc_obj()
381 i40iw_prep_remove_pd_page(info->hmc_info, i); in i40iw_sc_create_hmc_obj()
384 i40iw_prep_remove_pd_page(info->hmc_info, (j - 1)); in i40iw_sc_create_hmc_obj()
412 ret_code = i40iw_hmc_sd_grp(dev, info->hmc_info, in i40iw_finish_del_sd_reg()
413 info->hmc_info->sd_indexes[0], in i40iw_finish_del_sd_reg()
420 sd_idx = info->hmc_info->sd_indexes[i]; in i40iw_finish_del_sd_reg()
421 sd_entry = &info->hmc_info->sd_table.sd_entry[sd_idx]; in i40iw_finish_del_sd_reg()
457 if (info->start_idx >= info->hmc_info->hmc_obj[info->rsrc_type].cnt) { in i40iw_sc_del_hmc_obj()
461 info->hmc_info->hmc_obj[info->rsrc_type].cnt); in i40iw_sc_del_hmc_obj()
466 info->hmc_info->hmc_obj[info->rsrc_type].cnt) { in i40iw_sc_del_hmc_obj()
471 info->hmc_info->hmc_obj[info->rsrc_type].cnt); in i40iw_sc_del_hmc_obj()
481 i40iw_find_pd_index_limit(info->hmc_info, info->rsrc_type, in i40iw_sc_del_hmc_obj()
487 if (info->hmc_info->sd_table.sd_entry[sd_idx].entry_type != in i40iw_sc_del_hmc_obj()
492 pd_table = &info->hmc_info->sd_table.sd_entry[sd_idx].u.pd_table; in i40iw_sc_del_hmc_obj()
494 ret_code = i40iw_remove_pd_bp(dev->hw, info->hmc_info, j, in i40iw_sc_del_hmc_obj()
503 i40iw_find_sd_index_limit(info->hmc_info, info->rsrc_type, in i40iw_sc_del_hmc_obj()
505 if (sd_idx >= info->hmc_info->sd_table.sd_cnt || in i40iw_sc_del_hmc_obj()
506 sd_lmt > info->hmc_info->sd_table.sd_cnt) { in i40iw_sc_del_hmc_obj()
512 if (!info->hmc_info->sd_table.sd_entry[i].valid) in i40iw_sc_del_hmc_obj()
514 switch (info->hmc_info->sd_table.sd_entry[i].entry_type) { in i40iw_sc_del_hmc_obj()
516 ret_code = i40iw_prep_remove_sd_bp(info->hmc_info, i); in i40iw_sc_del_hmc_obj()
518 info->hmc_info->sd_indexes[info->del_sd_cnt] = (u16)i; in i40iw_sc_del_hmc_obj()
523 ret_code = i40iw_prep_remove_pd_page(info->hmc_info, i); in i40iw_sc_del_hmc_obj()
525 info->hmc_info->sd_indexes[info->del_sd_cnt] = (u16)i; in i40iw_sc_del_hmc_obj()
545 struct i40iw_hmc_info *hmc_info, in i40iw_add_sd_table_entry() argument
556 sd_entry = &hmc_info->sd_table.sd_entry[sd_index]; in i40iw_add_sd_table_entry()
584 hmc_info->sd_table.sd_entry[sd_index].entry_type = type; in i40iw_add_sd_table_entry()
586 I40IW_INC_SD_REFCNT(&hmc_info->sd_table); in i40iw_add_sd_table_entry()
616 struct i40iw_hmc_info *hmc_info, in i40iw_add_pd_table_entry() argument
629 if (pd_index / I40IW_HMC_PD_CNT_IN_SD >= hmc_info->sd_table.sd_cnt) in i40iw_add_pd_table_entry()
633 if (hmc_info->sd_table.sd_entry[sd_idx].entry_type != I40IW_SD_TYPE_PAGED) in i40iw_add_pd_table_entry()
637 pd_table = &hmc_info->sd_table.sd_entry[sd_idx].u.pd_table; in i40iw_add_pd_table_entry()
665 if (hmc_info->hmc_fn_id < I40IW_FIRST_VF_FPM_ID) in i40iw_add_pd_table_entry()
667 else if (hw->hmc.hmc_fn_id != hmc_info->hmc_fn_id) in i40iw_add_pd_table_entry()
669 hmc_info->hmc_fn_id); in i40iw_add_pd_table_entry()
693 struct i40iw_hmc_info *hmc_info, in i40iw_remove_pd_bp() argument
706 if (sd_idx >= hmc_info->sd_table.sd_cnt) in i40iw_remove_pd_bp()
709 sd_entry = &hmc_info->sd_table.sd_entry[sd_idx]; in i40iw_remove_pd_bp()
713 pd_table = &hmc_info->sd_table.sd_entry[sd_idx].u.pd_table; in i40iw_remove_pd_bp()
728 hmc_info->hmc_fn_id); in i40iw_remove_pd_bp()
747 enum i40iw_status_code i40iw_prep_remove_sd_bp(struct i40iw_hmc_info *hmc_info, u32 idx) in i40iw_prep_remove_sd_bp() argument
751 sd_entry = &hmc_info->sd_table.sd_entry[idx]; in i40iw_prep_remove_sd_bp()
756 I40IW_DEC_SD_REFCNT(&hmc_info->sd_table); in i40iw_prep_remove_sd_bp()
767 enum i40iw_status_code i40iw_prep_remove_pd_page(struct i40iw_hmc_info *hmc_info, in i40iw_prep_remove_pd_page() argument
772 sd_entry = &hmc_info->sd_table.sd_entry[idx]; in i40iw_prep_remove_pd_page()
778 I40IW_DEC_SD_REFCNT(&hmc_info->sd_table); in i40iw_prep_remove_pd_page()
795 struct i40iw_hmc_info *hmc_info; in i40iw_pf_init_vfhmc() local
811 hmc_info = i40iw_vf_hmcinfo_from_fpm(dev, vf_hmc_fn_id); in i40iw_pf_init_vfhmc()
815 hmc_info->hmc_obj[i].cnt = in i40iw_pf_init_vfhmc()
818 hmc_info->hmc_obj[i].cnt = hmc_info->hmc_obj[i].max_cnt; in i40iw_pf_init_vfhmc()