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