Lines Matching refs:fwevt
178 static void mpi3mr_fwevt_get(struct mpi3mr_fwevt *fwevt) in mpi3mr_fwevt_get() argument
180 kref_get(&fwevt->ref_count); in mpi3mr_fwevt_get()
189 static void mpi3mr_fwevt_put(struct mpi3mr_fwevt *fwevt) in mpi3mr_fwevt_put() argument
191 kref_put(&fwevt->ref_count, mpi3mr_fwevt_free); in mpi3mr_fwevt_put()
205 struct mpi3mr_fwevt *fwevt; in mpi3mr_alloc_fwevt() local
207 fwevt = kzalloc(sizeof(*fwevt) + len, GFP_ATOMIC); in mpi3mr_alloc_fwevt()
208 if (!fwevt) in mpi3mr_alloc_fwevt()
211 kref_init(&fwevt->ref_count); in mpi3mr_alloc_fwevt()
212 return fwevt; in mpi3mr_alloc_fwevt()
225 struct mpi3mr_fwevt *fwevt) in mpi3mr_fwevt_add_to_list() argument
234 mpi3mr_fwevt_get(fwevt); in mpi3mr_fwevt_add_to_list()
235 INIT_LIST_HEAD(&fwevt->list); in mpi3mr_fwevt_add_to_list()
236 list_add_tail(&fwevt->list, &mrioc->fwevt_list); in mpi3mr_fwevt_add_to_list()
237 INIT_WORK(&fwevt->work, mpi3mr_fwevt_worker); in mpi3mr_fwevt_add_to_list()
239 mpi3mr_fwevt_get(fwevt); in mpi3mr_fwevt_add_to_list()
240 queue_work(mrioc->fwevt_worker_thread, &fwevt->work); in mpi3mr_fwevt_add_to_list()
258 struct mpi3mr_fwevt *fwevt; in mpi3mr_hdb_trigger_data_event() local
261 fwevt = mpi3mr_alloc_fwevt(sz); in mpi3mr_hdb_trigger_data_event()
262 if (!fwevt) { in mpi3mr_hdb_trigger_data_event()
267 fwevt->mrioc = mrioc; in mpi3mr_hdb_trigger_data_event()
268 fwevt->event_id = MPI3MR_DRIVER_EVENT_PROCESS_TRIGGER; in mpi3mr_hdb_trigger_data_event()
269 fwevt->send_ack = 0; in mpi3mr_hdb_trigger_data_event()
270 fwevt->process_evt = 1; in mpi3mr_hdb_trigger_data_event()
271 fwevt->evt_ctx = 0; in mpi3mr_hdb_trigger_data_event()
272 fwevt->event_data_size = sz; in mpi3mr_hdb_trigger_data_event()
273 memcpy(fwevt->event_data, event_data, sz); in mpi3mr_hdb_trigger_data_event()
275 mpi3mr_fwevt_add_to_list(mrioc, fwevt); in mpi3mr_hdb_trigger_data_event()
288 struct mpi3mr_fwevt *fwevt) in mpi3mr_fwevt_del_from_list() argument
293 if (!list_empty(&fwevt->list)) { in mpi3mr_fwevt_del_from_list()
294 list_del_init(&fwevt->list); in mpi3mr_fwevt_del_from_list()
299 mpi3mr_fwevt_put(fwevt); in mpi3mr_fwevt_del_from_list()
316 struct mpi3mr_fwevt *fwevt = NULL; in mpi3mr_dequeue_fwevt() local
320 fwevt = list_first_entry(&mrioc->fwevt_list, in mpi3mr_dequeue_fwevt()
322 list_del_init(&fwevt->list); in mpi3mr_dequeue_fwevt()
327 mpi3mr_fwevt_put(fwevt); in mpi3mr_dequeue_fwevt()
331 return fwevt; in mpi3mr_dequeue_fwevt()
340 static void mpi3mr_cancel_work(struct mpi3mr_fwevt *fwevt) in mpi3mr_cancel_work() argument
349 if (cancel_work_sync(&fwevt->work)) { in mpi3mr_cancel_work()
354 mpi3mr_fwevt_put(fwevt); in mpi3mr_cancel_work()
359 mpi3mr_fwevt_put(fwevt); in mpi3mr_cancel_work()
374 struct mpi3mr_fwevt *fwevt = NULL; in mpi3mr_cleanup_fwevt_list() local
380 while ((fwevt = mpi3mr_dequeue_fwevt(mrioc))) in mpi3mr_cleanup_fwevt_list()
381 mpi3mr_cancel_work(fwevt); in mpi3mr_cleanup_fwevt_list()
384 fwevt = mrioc->current_event; in mpi3mr_cleanup_fwevt_list()
393 if (current_work() == &fwevt->work || fwevt->pending_at_sml) { in mpi3mr_cleanup_fwevt_list()
394 fwevt->discard = 1; in mpi3mr_cleanup_fwevt_list()
398 mpi3mr_cancel_work(fwevt); in mpi3mr_cleanup_fwevt_list()
416 struct mpi3mr_fwevt *fwevt; in mpi3mr_queue_qd_reduction_event() local
427 fwevt = mpi3mr_alloc_fwevt(sz); in mpi3mr_queue_qd_reduction_event()
428 if (!fwevt) { in mpi3mr_queue_qd_reduction_event()
432 *(struct mpi3mr_throttle_group_info **)fwevt->event_data = tg; in mpi3mr_queue_qd_reduction_event()
433 fwevt->mrioc = mrioc; in mpi3mr_queue_qd_reduction_event()
434 fwevt->event_id = MPI3MR_DRIVER_EVENT_TG_QD_REDUCTION; in mpi3mr_queue_qd_reduction_event()
435 fwevt->send_ack = 0; in mpi3mr_queue_qd_reduction_event()
436 fwevt->process_evt = 1; in mpi3mr_queue_qd_reduction_event()
437 fwevt->evt_ctx = 0; in mpi3mr_queue_qd_reduction_event()
438 fwevt->event_data_size = sz; in mpi3mr_queue_qd_reduction_event()
443 mpi3mr_fwevt_add_to_list(mrioc, fwevt); in mpi3mr_queue_qd_reduction_event()
1338 struct mpi3mr_fwevt *fwevt) in mpi3mr_devstatuschg_evt_bh() argument
1344 (struct mpi3_event_data_device_status_change *)fwevt->event_data; in mpi3mr_devstatuschg_evt_bh()
1574 struct mpi3mr_fwevt *fwevt) in mpi3mr_encldev_add_chg_evt_bh() argument
1581 encl_pg0 = (struct mpi3_enclosure_page0 *) fwevt->event_data; in mpi3mr_encldev_add_chg_evt_bh()
1582 added = (fwevt->event_id == MPI3_EVENT_ENCL_DEVICE_ADDED) ? 1 : 0; in mpi3mr_encldev_add_chg_evt_bh()
1705 struct mpi3mr_fwevt *fwevt) in mpi3mr_sastopochg_evt_bh() argument
1708 (struct mpi3_event_data_sas_topology_change_list *)fwevt->event_data; in mpi3mr_sastopochg_evt_bh()
1738 if (fwevt->discard) in mpi3mr_sastopochg_evt_bh()
1884 struct mpi3mr_fwevt *fwevt) in mpi3mr_pcietopochg_evt_bh() argument
1887 (struct mpi3_event_data_pcie_topology_change_list *)fwevt->event_data; in mpi3mr_pcietopochg_evt_bh()
1896 if (fwevt->discard) in mpi3mr_pcietopochg_evt_bh()
1934 struct mpi3mr_fwevt *fwevt) in mpi3mr_logdata_evt_bh() argument
1936 mpi3mr_app_save_logdata(mrioc, fwevt->event_data, in mpi3mr_logdata_evt_bh()
1937 fwevt->event_data_size); in mpi3mr_logdata_evt_bh()
2005 struct mpi3mr_fwevt *fwevt) in mpi3mr_fwevt_bh() argument
2012 mpi3mr_fwevt_del_from_list(mrioc, fwevt); in mpi3mr_fwevt_bh()
2013 mrioc->current_event = fwevt; in mpi3mr_fwevt_bh()
2021 fwevt->event_id); in mpi3mr_fwevt_bh()
2025 if (!fwevt->process_evt) in mpi3mr_fwevt_bh()
2028 switch (fwevt->event_id) { in mpi3mr_fwevt_bh()
2031 dev_pg0 = (struct mpi3_device_page0 *)fwevt->event_data; in mpi3mr_fwevt_bh()
2052 dev_pg0 = (struct mpi3_device_page0 *)fwevt->event_data; in mpi3mr_fwevt_bh()
2060 mpi3mr_devstatuschg_evt_bh(mrioc, fwevt); in mpi3mr_fwevt_bh()
2066 mpi3mr_encldev_add_chg_evt_bh(mrioc, fwevt); in mpi3mr_fwevt_bh()
2072 mpi3mr_sastopochg_evt_bh(mrioc, fwevt); in mpi3mr_fwevt_bh()
2077 mpi3mr_pcietopochg_evt_bh(mrioc, fwevt); in mpi3mr_fwevt_bh()
2082 mpi3mr_logdata_evt_bh(mrioc, fwevt); in mpi3mr_fwevt_bh()
2089 tg = *(struct mpi3mr_throttle_group_info **)fwevt->event_data; in mpi3mr_fwevt_bh()
2128 (struct trigger_event_data *)fwevt->event_data); in mpi3mr_fwevt_bh()
2136 if (fwevt->send_ack) in mpi3mr_fwevt_bh()
2137 mpi3mr_process_event_ack(mrioc, fwevt->event_id, in mpi3mr_fwevt_bh()
2138 fwevt->evt_ctx); in mpi3mr_fwevt_bh()
2141 mpi3mr_fwevt_put(fwevt); in mpi3mr_fwevt_bh()
2155 struct mpi3mr_fwevt *fwevt = container_of(work, struct mpi3mr_fwevt, in mpi3mr_fwevt_worker() local
2157 mpi3mr_fwevt_bh(fwevt->mrioc, fwevt); in mpi3mr_fwevt_worker()
2162 mpi3mr_fwevt_put(fwevt); in mpi3mr_fwevt_worker()
2925 struct mpi3mr_fwevt *fwevt = NULL; in mpi3mr_add_event_wait_for_device_refresh() local
2927 fwevt = mpi3mr_alloc_fwevt(0); in mpi3mr_add_event_wait_for_device_refresh()
2928 if (!fwevt) { in mpi3mr_add_event_wait_for_device_refresh()
2934 fwevt->mrioc = mrioc; in mpi3mr_add_event_wait_for_device_refresh()
2935 fwevt->event_id = MPI3_EVENT_WAIT_FOR_DEVICES_TO_REFRESH; in mpi3mr_add_event_wait_for_device_refresh()
2936 fwevt->send_ack = 0; in mpi3mr_add_event_wait_for_device_refresh()
2937 fwevt->process_evt = 1; in mpi3mr_add_event_wait_for_device_refresh()
2938 fwevt->evt_ctx = 0; in mpi3mr_add_event_wait_for_device_refresh()
2939 fwevt->event_data_size = 0; in mpi3mr_add_event_wait_for_device_refresh()
2940 mpi3mr_fwevt_add_to_list(mrioc, fwevt); in mpi3mr_add_event_wait_for_device_refresh()
2958 struct mpi3mr_fwevt *fwevt = NULL; in mpi3mr_os_handle_events() local
3043 fwevt = mpi3mr_alloc_fwevt(sz); in mpi3mr_os_handle_events()
3044 if (!fwevt) { in mpi3mr_os_handle_events()
3050 memcpy(fwevt->event_data, event_reply->event_data, sz); in mpi3mr_os_handle_events()
3051 fwevt->mrioc = mrioc; in mpi3mr_os_handle_events()
3052 fwevt->event_id = evt_type; in mpi3mr_os_handle_events()
3053 fwevt->send_ack = ack_req; in mpi3mr_os_handle_events()
3054 fwevt->process_evt = process_evt_bh; in mpi3mr_os_handle_events()
3055 fwevt->evt_ctx = le32_to_cpu(event_reply->event_context); in mpi3mr_os_handle_events()
3056 mpi3mr_fwevt_add_to_list(mrioc, fwevt); in mpi3mr_os_handle_events()