Lines Matching refs:hw

93  * @hw: pointer to the HW structure
107 enum i40e_status_code i40e_init_lan_hmc(struct i40e_hw *hw, u32 txq_num,
116 hw->hmc.signature = I40E_HMC_INFO_SIGNATURE;
117 hw->hmc.hmc_fn_id = hw->pf_id;
120 ret_code = i40e_allocate_virt_mem(hw, &hw->hmc.hmc_obj_virt_mem,
124 hw->hmc.hmc_obj = (struct i40e_hmc_obj_info *)
125 hw->hmc.hmc_obj_virt_mem.va;
128 full_obj = &hw->hmc.hmc_obj[I40E_HMC_LAN_FULL];
135 obj = &hw->hmc.hmc_obj[I40E_HMC_LAN_TX];
136 obj->max_cnt = rd32(hw, I40E_GLHMC_LANQMAX);
139 size_exp = rd32(hw, I40E_GLHMC_LANTXOBJSZ);
155 obj = &hw->hmc.hmc_obj[I40E_HMC_LAN_RX];
156 obj->max_cnt = rd32(hw, I40E_GLHMC_LANQMAX);
158 obj->base = hw->hmc.hmc_obj[I40E_HMC_LAN_TX].base +
159 (hw->hmc.hmc_obj[I40E_HMC_LAN_TX].cnt *
160 hw->hmc.hmc_obj[I40E_HMC_LAN_TX].size);
162 size_exp = rd32(hw, I40E_GLHMC_LANRXOBJSZ);
178 obj = &hw->hmc.hmc_obj[I40E_HMC_FCOE_CTX];
179 obj->max_cnt = rd32(hw, I40E_GLHMC_FCOEMAX);
181 obj->base = hw->hmc.hmc_obj[I40E_HMC_LAN_RX].base +
182 (hw->hmc.hmc_obj[I40E_HMC_LAN_RX].cnt *
183 hw->hmc.hmc_obj[I40E_HMC_LAN_RX].size);
185 size_exp = rd32(hw, I40E_GLHMC_FCOEDDPOBJSZ);
201 obj = &hw->hmc.hmc_obj[I40E_HMC_FCOE_FILT];
202 obj->max_cnt = rd32(hw, I40E_GLHMC_FCOEFMAX);
204 obj->base = hw->hmc.hmc_obj[I40E_HMC_FCOE_CTX].base +
205 (hw->hmc.hmc_obj[I40E_HMC_FCOE_CTX].cnt *
206 hw->hmc.hmc_obj[I40E_HMC_FCOE_CTX].size);
208 size_exp = rd32(hw, I40E_GLHMC_FCOEFOBJSZ);
223 hw->hmc.first_sd_index = 0;
224 hw->hmc.sd_table.ref_cnt = 0;
227 if (NULL == hw->hmc.sd_table.sd_entry) {
228 hw->hmc.sd_table.sd_cnt = (u32)
233 ret_code = i40e_allocate_virt_mem(hw, &hw->hmc.sd_table.addr,
235 hw->hmc.sd_table.sd_cnt));
238 hw->hmc.sd_table.sd_entry =
239 (struct i40e_hmc_sd_entry *)hw->hmc.sd_table.addr.va;
247 if (hw->hmc.hmc_obj_virt_mem.va)
248 i40e_free_virt_mem(hw, &hw->hmc.hmc_obj_virt_mem);
255 * @hw: pointer to the HW structure
267 static enum i40e_status_code i40e_remove_pd_page(struct i40e_hw *hw,
274 ret_code = i40e_remove_pd_page_new(hw, hmc_info, idx, TRUE);
281 * @hw: pointer to our HW structure
294 static enum i40e_status_code i40e_remove_sd_bp(struct i40e_hw *hw,
301 ret_code = i40e_remove_sd_bp_new(hw, hmc_info, idx, TRUE);
308 * @hw: pointer to the HW structure
314 enum i40e_status_code i40e_create_lan_hmc_object(struct i40e_hw *hw,
384 ret_code = i40e_add_sd_table_entry(hw, info->hmc_info, j,
401 ret_code = i40e_add_pd_table_entry(hw,
412 i40e_remove_pd_bp(hw, info->hmc_info,
422 I40E_SET_PF_SD_ENTRY(hw,
427 I40E_SET_PF_SD_ENTRY(hw, sd_entry->u.bp.addr.pa,
448 i40e_remove_pd_bp(hw, info->hmc_info, i);
449 i40e_remove_pd_page(hw, info->hmc_info, (j - 1));
452 i40e_remove_sd_bp(hw, info->hmc_info, (j - 1));
466 * @hw: pointer to the hw structure
473 enum i40e_status_code i40e_configure_lan_hmc(struct i40e_hw *hw,
477 u8 hmc_fn_id = hw->hmc.hmc_fn_id;
482 info.hmc_info = &hw->hmc;
485 info.direct_mode_sz = hw->hmc.hmc_obj[I40E_HMC_LAN_FULL].size;
494 ret_code = i40e_create_lan_hmc_object(hw, &info);
506 ret_code = i40e_create_lan_hmc_object(hw, &info);
521 obj = &hw->hmc.hmc_obj[I40E_HMC_LAN_TX];
522 wr32(hw, I40E_GLHMC_LANTXBASE(hmc_fn_id),
524 wr32(hw, I40E_GLHMC_LANTXCNT(hmc_fn_id), obj->cnt);
527 obj = &hw->hmc.hmc_obj[I40E_HMC_LAN_RX];
528 wr32(hw, I40E_GLHMC_LANRXBASE(hmc_fn_id),
530 wr32(hw, I40E_GLHMC_LANRXCNT(hmc_fn_id), obj->cnt);
533 obj = &hw->hmc.hmc_obj[I40E_HMC_FCOE_CTX];
534 wr32(hw, I40E_GLHMC_FCOEDDPBASE(hmc_fn_id),
536 wr32(hw, I40E_GLHMC_FCOEDDPCNT(hmc_fn_id), obj->cnt);
539 obj = &hw->hmc.hmc_obj[I40E_HMC_FCOE_FILT];
540 wr32(hw, I40E_GLHMC_FCOEFBASE(hmc_fn_id),
542 wr32(hw, I40E_GLHMC_FCOEFCNT(hmc_fn_id), obj->cnt);
550 * @hw: pointer to the HW structure
558 enum i40e_status_code i40e_delete_lan_hmc_object(struct i40e_hw *hw,
625 ret_code = i40e_remove_pd_bp(hw, info->hmc_info, j);
646 ret_code = i40e_remove_sd_bp(hw, info->hmc_info, i);
651 ret_code = i40e_remove_pd_page(hw, info->hmc_info, i);
665 * @hw: pointer to the hw structure
670 enum i40e_status_code i40e_shutdown_lan_hmc(struct i40e_hw *hw)
675 info.hmc_info = &hw->hmc;
681 ret_code = i40e_delete_lan_hmc_object(hw, &info);
684 i40e_free_virt_mem(hw, &hw->hmc.sd_table.addr);
685 hw->hmc.sd_table.sd_cnt = 0;
686 hw->hmc.sd_table.sd_entry = NULL;
689 i40e_free_virt_mem(hw, &hw->hmc.hmc_obj_virt_mem);
690 hw->hmc.hmc_obj = NULL;
1171 * @hw: the hardware struct
1175 static enum i40e_status_code i40e_clear_hmc_context(struct i40e_hw *hw,
1180 i40e_memset(context_bytes, 0, (u32)hw->hmc.hmc_obj[hmc_type].size,
1225 * @hw: pointer to the hw structure
1234 enum i40e_status_code i40e_hmc_get_object_va(struct i40e_hw *hw,
1240 struct i40e_hmc_info *hmc_info = &hw->hmc;
1296 * @hw: the hardware struct
1300 enum i40e_status_code i40e_get_lan_tx_queue_context(struct i40e_hw *hw,
1307 err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_TX, queue);
1317 * @hw: the hardware struct
1320 enum i40e_status_code i40e_clear_lan_tx_queue_context(struct i40e_hw *hw,
1326 err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_TX, queue);
1330 return i40e_clear_hmc_context(hw, context_bytes, I40E_HMC_LAN_TX);
1335 * @hw: the hardware struct
1339 enum i40e_status_code i40e_set_lan_tx_queue_context(struct i40e_hw *hw,
1346 err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_TX, queue);
1356 * @hw: the hardware struct
1360 enum i40e_status_code i40e_get_lan_rx_queue_context(struct i40e_hw *hw,
1367 err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_RX, queue);
1377 * @hw: the hardware struct
1380 enum i40e_status_code i40e_clear_lan_rx_queue_context(struct i40e_hw *hw,
1386 err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_RX, queue);
1390 return i40e_clear_hmc_context(hw, context_bytes, I40E_HMC_LAN_RX);
1395 * @hw: the hardware struct
1399 enum i40e_status_code i40e_set_lan_rx_queue_context(struct i40e_hw *hw,
1406 err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_RX, queue);