Lines Matching refs:fwevt

171 static void mpi3mr_fwevt_get(struct mpi3mr_fwevt *fwevt)  in mpi3mr_fwevt_get()  argument
173 kref_get(&fwevt->ref_count); in mpi3mr_fwevt_get()
182 static void mpi3mr_fwevt_put(struct mpi3mr_fwevt *fwevt) in mpi3mr_fwevt_put() argument
184 kref_put(&fwevt->ref_count, mpi3mr_fwevt_free); in mpi3mr_fwevt_put()
198 struct mpi3mr_fwevt *fwevt; in mpi3mr_alloc_fwevt() local
200 fwevt = kzalloc(sizeof(*fwevt) + len, GFP_ATOMIC); in mpi3mr_alloc_fwevt()
201 if (!fwevt) in mpi3mr_alloc_fwevt()
204 kref_init(&fwevt->ref_count); in mpi3mr_alloc_fwevt()
205 return fwevt; in mpi3mr_alloc_fwevt()
218 struct mpi3mr_fwevt *fwevt) in mpi3mr_fwevt_add_to_list() argument
227 mpi3mr_fwevt_get(fwevt); in mpi3mr_fwevt_add_to_list()
228 INIT_LIST_HEAD(&fwevt->list); in mpi3mr_fwevt_add_to_list()
229 list_add_tail(&fwevt->list, &mrioc->fwevt_list); in mpi3mr_fwevt_add_to_list()
230 INIT_WORK(&fwevt->work, mpi3mr_fwevt_worker); in mpi3mr_fwevt_add_to_list()
232 mpi3mr_fwevt_get(fwevt); in mpi3mr_fwevt_add_to_list()
233 queue_work(mrioc->fwevt_worker_thread, &fwevt->work); in mpi3mr_fwevt_add_to_list()
247 struct mpi3mr_fwevt *fwevt) in mpi3mr_fwevt_del_from_list() argument
252 if (!list_empty(&fwevt->list)) { in mpi3mr_fwevt_del_from_list()
253 list_del_init(&fwevt->list); in mpi3mr_fwevt_del_from_list()
258 mpi3mr_fwevt_put(fwevt); in mpi3mr_fwevt_del_from_list()
275 struct mpi3mr_fwevt *fwevt = NULL; in mpi3mr_dequeue_fwevt() local
279 fwevt = list_first_entry(&mrioc->fwevt_list, in mpi3mr_dequeue_fwevt()
281 list_del_init(&fwevt->list); in mpi3mr_dequeue_fwevt()
286 mpi3mr_fwevt_put(fwevt); in mpi3mr_dequeue_fwevt()
290 return fwevt; in mpi3mr_dequeue_fwevt()
299 static void mpi3mr_cancel_work(struct mpi3mr_fwevt *fwevt) in mpi3mr_cancel_work() argument
308 if (cancel_work_sync(&fwevt->work)) { in mpi3mr_cancel_work()
313 mpi3mr_fwevt_put(fwevt); in mpi3mr_cancel_work()
318 mpi3mr_fwevt_put(fwevt); in mpi3mr_cancel_work()
333 struct mpi3mr_fwevt *fwevt = NULL; in mpi3mr_cleanup_fwevt_list() local
339 while ((fwevt = mpi3mr_dequeue_fwevt(mrioc))) in mpi3mr_cleanup_fwevt_list()
340 mpi3mr_cancel_work(fwevt); in mpi3mr_cleanup_fwevt_list()
343 fwevt = mrioc->current_event; in mpi3mr_cleanup_fwevt_list()
352 if (current_work() == &fwevt->work || fwevt->pending_at_sml) { in mpi3mr_cleanup_fwevt_list()
353 fwevt->discard = 1; in mpi3mr_cleanup_fwevt_list()
357 mpi3mr_cancel_work(fwevt); in mpi3mr_cleanup_fwevt_list()
375 struct mpi3mr_fwevt *fwevt; in mpi3mr_queue_qd_reduction_event() local
386 fwevt = mpi3mr_alloc_fwevt(sz); in mpi3mr_queue_qd_reduction_event()
387 if (!fwevt) { in mpi3mr_queue_qd_reduction_event()
391 *(struct mpi3mr_throttle_group_info **)fwevt->event_data = tg; in mpi3mr_queue_qd_reduction_event()
392 fwevt->mrioc = mrioc; in mpi3mr_queue_qd_reduction_event()
393 fwevt->event_id = MPI3MR_DRIVER_EVENT_TG_QD_REDUCTION; in mpi3mr_queue_qd_reduction_event()
394 fwevt->send_ack = 0; in mpi3mr_queue_qd_reduction_event()
395 fwevt->process_evt = 1; in mpi3mr_queue_qd_reduction_event()
396 fwevt->evt_ctx = 0; in mpi3mr_queue_qd_reduction_event()
397 fwevt->event_data_size = sz; in mpi3mr_queue_qd_reduction_event()
402 mpi3mr_fwevt_add_to_list(mrioc, fwevt); in mpi3mr_queue_qd_reduction_event()
1247 struct mpi3mr_fwevt *fwevt) in mpi3mr_devstatuschg_evt_bh() argument
1253 (struct mpi3_event_data_device_status_change *)fwevt->event_data; in mpi3mr_devstatuschg_evt_bh()
1427 struct mpi3mr_fwevt *fwevt) in mpi3mr_encldev_add_chg_evt_bh() argument
1434 encl_pg0 = (struct mpi3_enclosure_page0 *) fwevt->event_data; in mpi3mr_encldev_add_chg_evt_bh()
1435 added = (fwevt->event_id == MPI3_EVENT_ENCL_DEVICE_ADDED) ? 1 : 0; in mpi3mr_encldev_add_chg_evt_bh()
1558 struct mpi3mr_fwevt *fwevt) in mpi3mr_sastopochg_evt_bh() argument
1561 (struct mpi3_event_data_sas_topology_change_list *)fwevt->event_data; in mpi3mr_sastopochg_evt_bh()
1591 if (fwevt->discard) in mpi3mr_sastopochg_evt_bh()
1737 struct mpi3mr_fwevt *fwevt) in mpi3mr_pcietopochg_evt_bh() argument
1740 (struct mpi3_event_data_pcie_topology_change_list *)fwevt->event_data; in mpi3mr_pcietopochg_evt_bh()
1749 if (fwevt->discard) in mpi3mr_pcietopochg_evt_bh()
1787 struct mpi3mr_fwevt *fwevt) in mpi3mr_logdata_evt_bh() argument
1789 mpi3mr_app_save_logdata(mrioc, fwevt->event_data, in mpi3mr_logdata_evt_bh()
1790 fwevt->event_data_size); in mpi3mr_logdata_evt_bh()
1858 struct mpi3mr_fwevt *fwevt) in mpi3mr_fwevt_bh() argument
1864 mpi3mr_fwevt_del_from_list(mrioc, fwevt); in mpi3mr_fwevt_bh()
1865 mrioc->current_event = fwevt; in mpi3mr_fwevt_bh()
1873 fwevt->event_id); in mpi3mr_fwevt_bh()
1877 if (!fwevt->process_evt) in mpi3mr_fwevt_bh()
1880 switch (fwevt->event_id) { in mpi3mr_fwevt_bh()
1883 dev_pg0 = (struct mpi3_device_page0 *)fwevt->event_data; in mpi3mr_fwevt_bh()
1904 dev_pg0 = (struct mpi3_device_page0 *)fwevt->event_data; in mpi3mr_fwevt_bh()
1912 mpi3mr_devstatuschg_evt_bh(mrioc, fwevt); in mpi3mr_fwevt_bh()
1918 mpi3mr_encldev_add_chg_evt_bh(mrioc, fwevt); in mpi3mr_fwevt_bh()
1924 mpi3mr_sastopochg_evt_bh(mrioc, fwevt); in mpi3mr_fwevt_bh()
1929 mpi3mr_pcietopochg_evt_bh(mrioc, fwevt); in mpi3mr_fwevt_bh()
1934 mpi3mr_logdata_evt_bh(mrioc, fwevt); in mpi3mr_fwevt_bh()
1941 tg = *(struct mpi3mr_throttle_group_info **)fwevt->event_data; in mpi3mr_fwevt_bh()
1972 if (fwevt->send_ack) in mpi3mr_fwevt_bh()
1973 mpi3mr_process_event_ack(mrioc, fwevt->event_id, in mpi3mr_fwevt_bh()
1974 fwevt->evt_ctx); in mpi3mr_fwevt_bh()
1977 mpi3mr_fwevt_put(fwevt); in mpi3mr_fwevt_bh()
1991 struct mpi3mr_fwevt *fwevt = container_of(work, struct mpi3mr_fwevt, in mpi3mr_fwevt_worker() local
1993 mpi3mr_fwevt_bh(fwevt->mrioc, fwevt); in mpi3mr_fwevt_worker()
1998 mpi3mr_fwevt_put(fwevt); in mpi3mr_fwevt_worker()
2747 struct mpi3mr_fwevt *fwevt = NULL; in mpi3mr_add_event_wait_for_device_refresh() local
2749 fwevt = mpi3mr_alloc_fwevt(0); in mpi3mr_add_event_wait_for_device_refresh()
2750 if (!fwevt) { in mpi3mr_add_event_wait_for_device_refresh()
2756 fwevt->mrioc = mrioc; in mpi3mr_add_event_wait_for_device_refresh()
2757 fwevt->event_id = MPI3_EVENT_WAIT_FOR_DEVICES_TO_REFRESH; in mpi3mr_add_event_wait_for_device_refresh()
2758 fwevt->send_ack = 0; in mpi3mr_add_event_wait_for_device_refresh()
2759 fwevt->process_evt = 1; in mpi3mr_add_event_wait_for_device_refresh()
2760 fwevt->evt_ctx = 0; in mpi3mr_add_event_wait_for_device_refresh()
2761 fwevt->event_data_size = 0; in mpi3mr_add_event_wait_for_device_refresh()
2762 mpi3mr_fwevt_add_to_list(mrioc, fwevt); in mpi3mr_add_event_wait_for_device_refresh()
2780 struct mpi3mr_fwevt *fwevt = NULL; in mpi3mr_os_handle_events() local
2859 fwevt = mpi3mr_alloc_fwevt(sz); in mpi3mr_os_handle_events()
2860 if (!fwevt) { in mpi3mr_os_handle_events()
2866 memcpy(fwevt->event_data, event_reply->event_data, sz); in mpi3mr_os_handle_events()
2867 fwevt->mrioc = mrioc; in mpi3mr_os_handle_events()
2868 fwevt->event_id = evt_type; in mpi3mr_os_handle_events()
2869 fwevt->send_ack = ack_req; in mpi3mr_os_handle_events()
2870 fwevt->process_evt = process_evt_bh; in mpi3mr_os_handle_events()
2871 fwevt->evt_ctx = le32_to_cpu(event_reply->event_context); in mpi3mr_os_handle_events()
2872 mpi3mr_fwevt_add_to_list(mrioc, fwevt); in mpi3mr_os_handle_events()