Lines Matching refs:eq

236 	struct ehea_eq *eq;  in ehea_create_eq()  local
238 eq = kzalloc(sizeof(*eq), GFP_KERNEL); in ehea_create_eq()
239 if (!eq) in ehea_create_eq()
242 eq->adapter = adapter; in ehea_create_eq()
243 eq->attr.type = type; in ehea_create_eq()
244 eq->attr.max_nr_of_eqes = max_nr_of_eqes; in ehea_create_eq()
245 eq->attr.eqe_gen = eqe_gen; in ehea_create_eq()
246 spin_lock_init(&eq->spinlock); in ehea_create_eq()
249 &eq->attr, &eq->fw_handle); in ehea_create_eq()
255 ret = hw_queue_ctor(&eq->hw_queue, eq->attr.nr_pages, in ehea_create_eq()
262 for (i = 0; i < eq->attr.nr_pages; i++) { in ehea_create_eq()
263 vpage = hw_qpageit_get_inc(&eq->hw_queue); in ehea_create_eq()
274 eq->fw_handle, rpage, 1); in ehea_create_eq()
276 if (i == (eq->attr.nr_pages - 1)) { in ehea_create_eq()
278 vpage = hw_qpageit_get_inc(&eq->hw_queue); in ehea_create_eq()
289 hw_qeit_reset(&eq->hw_queue); in ehea_create_eq()
290 return eq; in ehea_create_eq()
293 hw_queue_dtor(&eq->hw_queue); in ehea_create_eq()
296 ehea_h_free_resource(adapter->handle, eq->fw_handle, FORCE_FREE); in ehea_create_eq()
299 kfree(eq); in ehea_create_eq()
303 struct ehea_eqe *ehea_poll_eq(struct ehea_eq *eq) in ehea_poll_eq() argument
308 spin_lock_irqsave(&eq->spinlock, flags); in ehea_poll_eq()
309 eqe = hw_eqit_eq_get_inc_valid(&eq->hw_queue); in ehea_poll_eq()
310 spin_unlock_irqrestore(&eq->spinlock, flags); in ehea_poll_eq()
315 static u64 ehea_destroy_eq_res(struct ehea_eq *eq, u64 force) in ehea_destroy_eq_res() argument
320 spin_lock_irqsave(&eq->spinlock, flags); in ehea_destroy_eq_res()
322 hret = ehea_h_free_resource(eq->adapter->handle, eq->fw_handle, force); in ehea_destroy_eq_res()
323 spin_unlock_irqrestore(&eq->spinlock, flags); in ehea_destroy_eq_res()
328 hw_queue_dtor(&eq->hw_queue); in ehea_destroy_eq_res()
329 kfree(eq); in ehea_destroy_eq_res()
334 int ehea_destroy_eq(struct ehea_eq *eq) in ehea_destroy_eq() argument
337 if (!eq) in ehea_destroy_eq()
340 hcp_epas_dtor(&eq->epas); in ehea_destroy_eq()
342 hret = ehea_destroy_eq_res(eq, NORMAL_FREE); in ehea_destroy_eq()
344 ehea_error_data(eq->adapter, eq->fw_handle, &aer, &aerr); in ehea_destroy_eq()
345 hret = ehea_destroy_eq_res(eq, FORCE_FREE); in ehea_destroy_eq()